Skip to content

Commit 76ba4be

Browse files
committed
toolhead: cornering without limited acceleration
Credits to @richfelker
1 parent dc87709 commit 76ba4be

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

klippy/toolhead.py

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ def __init__(self, toolhead, start_pos, end_pos, speed):
1717
self.start_pos = tuple(start_pos)
1818
self.end_pos = tuple(end_pos)
1919
self.accel = toolhead.max_accel
20-
self.junction_deviation = toolhead.junction_deviation
20+
self.equilateral_corner_v2 = toolhead.equilateral_corner_v2
2121
self.timing_callbacks = []
2222
velocity = min(speed, toolhead.max_velocity)
2323
self.is_kinematic_move = True
@@ -82,8 +82,8 @@ def calc_junction(self, prev_move):
8282
* prev_move.accel)
8383
# Apply limits
8484
self.max_start_v2 = min(
85-
R_jd * self.junction_deviation * self.accel,
86-
R_jd * prev_move.junction_deviation * prev_move.accel,
85+
R_jd * self.equilateral_corner_v2,
86+
R_jd * prev_move.equilateral_corner_v2,
8787
move_centripetal_v2, prev_move_centripetal_v2,
8888
extruder_v2, self.max_cruise_v2, prev_move.max_cruise_v2,
8989
prev_move.max_start_v2 + prev_move.delta_v2)
@@ -218,7 +218,7 @@ def __init__(self, config):
218218
self.max_accel_to_decel = self.requested_accel_to_decel
219219
self.square_corner_velocity = config.getfloat(
220220
'square_corner_velocity', 5., minval=0.)
221-
self.junction_deviation = 0.
221+
self.equilateral_corner_v2 = 0.
222222
self._calc_junction_deviation()
223223
# Print time tracking
224224
self.buffer_time_low = config.getfloat(
@@ -547,7 +547,7 @@ def get_max_velocity(self):
547547
return self.max_velocity, self.max_accel
548548
def _calc_junction_deviation(self):
549549
scv2 = self.square_corner_velocity**2
550-
self.junction_deviation = scv2 * (math.sqrt(2.) - 1.) / self.max_accel
550+
self.equilateral_corner_v2 = scv2 * (math.sqrt(2.) - 1.)
551551
self.max_accel_to_decel = min(self.requested_accel_to_decel,
552552
self.max_accel)
553553
def cmd_G4(self, gcmd):

0 commit comments

Comments
 (0)