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>
This commit is contained in:
Kevin O'Connor 2018-04-20 12:50:04 -04:00
parent 832c0bc017
commit 48e9fa04e7
1 changed files with 3 additions and 3 deletions

View File

@ -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()