tmc: Enable `multistep_filt` for drivers that support it

`multistep_filt` was not configured at all on tmc2240 and tmc5160. As such, it would default to the value of 0 when the GCONF field was sent to the driver. However, that field has a default value of 1 in the driver, so klipper was overriding the defaults by accident.
This field improves the stability of velocity based thresholds (it's effectively TSTEP filtering) and it also improves the current regulation stability in stealthchop2 (according to the datasheet).
This field was already set to 1 correctly in the tmc2208/tmc2209 driver code.

Signed-off-by: Alex Voinea <voinea.dragos.alexandru@gmail.com>
This commit is contained in:
Alex Voinea 2023-03-15 12:20:33 +01:00 committed by KevinOConnor
parent 117c1d42ac
commit dd39091388
2 changed files with 2 additions and 0 deletions

View File

@ -353,6 +353,7 @@ class TMC2240:
self.get_phase_offset = cmdhelper.get_phase_offset
self.get_status = cmdhelper.get_status
# Setup basic register values
self.fields.set_field("multistep_filt", True)
tmc.TMCWaveTableHelper(config, self.mcu_tmc)
self.fields.set_config_field(config, "offset_sin90", 0)
tmc.TMCStealthchopHelper(config, self.mcu_tmc, TMC_FREQUENCY)

View File

@ -326,6 +326,7 @@ class TMC5160:
self.get_phase_offset = cmdhelper.get_phase_offset
self.get_status = cmdhelper.get_status
# Setup basic register values
self.fields.set_field("multistep_filt", True)
tmc.TMCWaveTableHelper(config, self.mcu_tmc)
tmc.TMCStealthchopHelper(config, self.mcu_tmc, TMC_FREQUENCY)
set_config_field = self.fields.set_config_field