diff options
author | Kevin O'Connor <kevin@koconnor.net> | 2018-04-20 12:50:04 -0400 |
---|---|---|
committer | Kevin O'Connor <kevin@koconnor.net> | 2018-04-20 12:50:04 -0400 |
commit | 48e9fa04e78e4c57fbd558281170d16ab357377f (patch) | |
tree | b96beb1c52584d3bcff555a8d6724c0a72832efd | |
parent | 832c0bc0170e78f702677a0faca3ed355341ff97 (diff) | |
download | kutter-48e9fa04e78e4c57fbd558281170d16ab357377f.tar.gz kutter-48e9fa04e78e4c57fbd558281170d16ab357377f.tar.xz kutter-48e9fa04e78e4c57fbd558281170d16ab357377f.zip |
toolhead: Allow max_accel_to_decel to be greater than max_accel in config
If max_accel_to_decel is greater than max_accel in the config, then
just internally limit max_accel_to_decel to max_accel. This makes it
easier to completely disable the max_accel_to_decel feature (as it can
just be set to a high value in the config).
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
-rw-r--r-- | klippy/toolhead.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/klippy/toolhead.py b/klippy/toolhead.py index bf6ff76a..aa0f73f1 100644 --- a/klippy/toolhead.py +++ b/klippy/toolhead.py @@ -193,9 +193,9 @@ class ToolHead: self.mcu = self.all_mcus[0] self.max_velocity = config.getfloat('max_velocity', above=0.) self.max_accel = config.getfloat('max_accel', above=0.) - self.max_accel_to_decel = config.getfloat( - 'max_accel_to_decel', self.max_accel * 0.5 - , above=0., maxval=self.max_accel) + max_accel_to_decel = config.getfloat('max_accel_to_decel', + self.max_accel * 0.5, above=0.) + self.max_accel_to_decel = min(max_accel_to_decel, self.max_accel) self.junction_deviation = config.getfloat( 'junction_deviation', 0.02, minval=0.) self.move_queue = MoveQueue() |