From 346e3901f6076987bdb8a6ec391f00f07e5c45e2 Mon Sep 17 00:00:00 2001 From: BIGTREETECH <38851044+bigtreetech@users.noreply.github.com> Date: Tue, 28 Mar 2023 09:18:06 +0800 Subject: [PATCH] tmc: Enable sg_angle_offset for smooth switching from Stealthchop to Spreadcycle (#6123) Signed-off-by: Alan.Ma from BigTreeTech --- docs/Config_Reference.md | 1 + klippy/extras/tmc2240.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/docs/Config_Reference.md b/docs/Config_Reference.md index 4e648847..a3c1e314 100644 --- a/docs/Config_Reference.md +++ b/docs/Config_Reference.md @@ -3410,6 +3410,7 @@ run_current: #driver_SEDN: 0 #driver_SEIMIN: 0 #driver_SFILT: 0 +#driver_SG4_ANGLE_OFFSET: 1 # Set the given register during the configuration of the TMC2240 # chip. This may be used to set custom motor parameters. The # defaults for each parameter are next to the parameter name in the diff --git a/klippy/extras/tmc2240.py b/klippy/extras/tmc2240.py index 1bc4c1ca..45482509 100644 --- a/klippy/extras/tmc2240.py +++ b/klippy/extras/tmc2240.py @@ -394,6 +394,8 @@ class TMC2240: set_config_field(config, "pwm_lim", 12) # TPOWERDOWN set_config_field(config, "tpowerdown", 10) + # SG4_THRS + set_config_field(config, "sg4_angle_offset", 1) def load_config_prefix(config): return TMC2240(config)