tmc: Use configfile note_valid=False when inspecting stepper step_distance
Signed-off-by: Kevin O'Connor <kevin@koconnor.net>
This commit is contained in:
parent
14fd40e3f9
commit
0923450286
|
@ -287,7 +287,7 @@ def TMCStealthchopHelper(config, mcu_tmc, tmc_freq):
|
||||||
if velocity:
|
if velocity:
|
||||||
stepper_name = " ".join(config.get_name().split()[1:])
|
stepper_name = " ".join(config.get_name().split()[1:])
|
||||||
stepper_config = config.getsection(stepper_name)
|
stepper_config = config.getsection(stepper_name)
|
||||||
step_dist = stepper_config.getfloat('step_distance')
|
step_dist = stepper_config.getfloat('step_distance', note_valid=False)
|
||||||
step_dist_256 = step_dist / (1 << fields.get_field("MRES"))
|
step_dist_256 = step_dist / (1 << fields.get_field("MRES"))
|
||||||
threshold = int(tmc_freq * step_dist_256 / velocity + .5)
|
threshold = int(tmc_freq * step_dist_256 / velocity + .5)
|
||||||
fields.set_field("TPWMTHRS", max(0, min(0xfffff, threshold)))
|
fields.set_field("TPWMTHRS", max(0, min(0xfffff, threshold)))
|
||||||
|
|
Loading…
Reference in New Issue