Problem with proper setting of StealthChop-to-SpreadCycle mode
-
Hi,
I have VCast IDEX with Duet 6HC and two 1LCs. Firmware is 3.4beta 5.
I am trying to configure StealthChop with switch to SpreadCycle at certain speed. So far it works, BUT with some issue I cannot understand.
When I enable SpreadCycle only. Then everything works ok. Prints are fine and motors sing their own songs on low speeds.
When I enable StealthChop up to 46.9mm/s (example) then when switch to SpreadCycle (above 46.9mm/s) happens there is an awful metal-like noise ("clack") on start of a movement/change direction. Prints are fine, but that sound defeats the purpose. It happens to all XUYZ as I run SpreadCycle on extruder motors.
Please bear in mind that on X (and most probably U) MGN carriage is very loose so contributes to awful noise while moving carriage around 60-75mm/s. Low quality unfortunately. To be replaced soon.
SpreadCycle only
https://youtu.be/0HDCOK81GIsStealthChop with switch to SpreadCycle
https://youtu.be/jnZPjZBxbwsMacro routine does series of moves on each axis speeding up to 100mm/s and shortens movement distance to 2mm gradually. When StealthChop is enabled its nice and quiet, then SpreadCycle takes over and noise appears. Exactly same routine does not emit that sound when running in SpreadCycle only mode.
I've added driver tuning to my homing sequence and checked with dc42 corexy test script that it is actually tuning. Also tried various advices from forum. No luck so far...
Played with various THIGH, TPWMTHRS and TCOOLTHRS and I was either having StealthChop not enabling at all or that clacking sound. Tried with and without PA and Input Shaping enabled. I've managed get that clack sound a bit down but nothing close to how it is non-existing in SpreadCycle only mode.
Basically I could leave StealthChop on for all moves but during test prints I had layer shifts on Y (heavy bed) when executing travel moves around 100mm/s. So I would loose some speed.
STRANGEST (At least for me) part is that that noise is not present when only SpreadCycle is enabled.
Sooo... Any idea what I am doing wrong would be highly appreciated.
Motors config
M584 X0.0 U0.1 Y0.2 Z0.3:0.4 E20.0:21.0 ; set drive mapping var scSpeed_XU_TPWMTHRS = 200 var scSpeed_XU_THIGH = 200 var sdSpeed_XU = 200 var scSpeed_Y_TPWMTHRS = 200 var scSpeed_Y_THIGH = 200 var sdSpeed_Y_TCOOLTHRS = 200 var scSpeed_Z_TPWMTHRS = 50 var scSpeed_Z_THIGH = 50 var sdSpeed_Z_TCOOLTHRS = 50 M569 P0.0 S0 D3 V{var.scSpeed_XU_TPWMTHRS} H{var.scSpeed_XU_THIGH} ; physical drive 0.0 goes backwards X M915 P0.0 T{var.sdSpeed_XU} M569 P0.1 S0 D3 V{var.scSpeed_XU_TPWMTHRS} H{var.scSpeed_XU_THIGH} ; physical drive 0.1 goes backwards U M915 P0.1 T{var.sdSpeed_XU} M569 P0.2 S0 D3 V{var.scSpeed_Y_TPWMTHRS} H{var.scSpeed_Y_THIGH} ; physical drive 0.2 goes backwards Y M915 P0.2 T{var.sdSpeed_Y_TCOOLTHRS} M569 P0.3 S1 D3 V{var.scSpeed_Z_TPWMTHRS} H{var.scSpeed_Y_THIGH} ; physical drive 0.3 goes forwards ZLeft M915 P0.3 T{var.sdSpeed_Z_TCOOLTHRS} M569 P0.4 S1 D3 V{var.scSpeed_Z_TPWMTHRS} H{var.scSpeed_Z_THIGH} ; physical drive 0.4 goes forwards ZRight M915 P0.4 T{var.sdSpeed_Z_TCOOLTHRS} M569 P20.0 S1 D2 ; physical drive 20.0 goes forwards M569 P21.0 S1 D2 ; physical drive 21.0 goes forwards M915 P0.0:0.1:0.2:0.3:0.4:0.5 T1 ; disable coolstep M915 P20.0:21.0 T1 ; disable coolstep
Drivers reports
Drive 0 runs in reverse, active low enable, timing fast, mode stealthChop, ccr 0x08053, toff 3, tblank 1, thigh 200 (46.9 mm/sec), tpwmthrs 200 (46.9 mm/sec), pwmScaleSum 24, pwmScaleAuto 2, pwmOfsAuto 32, pwmGradAuto 3, pos 824 Driver 0.0: stall threshold 1, filter off, steps/sec 200 (40.0 mm/sec), coolstep threshold 1 (9376.9 mm/sec), action on stall: none Drive 1 runs in reverse, active low enable, timing fast, mode stealthChop, ccr 0x08053, toff 3, tblank 1, thigh 200 (46.9 mm/sec), tpwmthrs 200 (46.9 mm/sec), pwmScaleSum 22, pwmScaleAuto 0, pwmOfsAuto 32, pwmGradAuto 1, pos 168 Driver 0.1: stall threshold 1, filter off, steps/sec 200 (40.0 mm/sec), coolstep threshold 1 (9380.6 mm/sec), action on stall: none Drive 2 runs in reverse, active low enable, timing fast, mode stealthChop, ccr 0x08053, toff 3, tblank 1, thigh 200 (46.8 mm/sec), tpwmthrs 200 (46.8 mm/sec), pwmScaleSum 19, pwmScaleAuto 0, pwmOfsAuto 29, pwmGradAuto 14, pos 24 Driver 0.2: stall threshold 1, filter off, steps/sec 200 (39.9 mm/sec), coolstep threshold 1 (9356.3 mm/sec), action on stall: none Drive 3 runs forwards, active low enable, timing fast, mode stealthChop, ccr 0x08053, toff 3, tblank 1, thigh 50 (37.8 mm/sec), tpwmthrs 50 (37.8 mm/sec), pwmScaleSum 23, pwmScaleAuto 0, pwmOfsAuto 34, pwmGradAuto 23, pos 648 Driver 0.3: stall threshold 1, filter off, steps/sec 200 (8.1 mm/sec), coolstep threshold 1 (1890.0 mm/sec), action on stall: none Drive 4 runs forwards, active low enable, timing fast, mode stealthChop, ccr 0x08053, toff 3, tblank 1, thigh 50 (37.8 mm/sec), tpwmthrs 50 (37.8 mm/sec), pwmScaleSum 24, pwmScaleAuto 0, pwmOfsAuto 35, pwmGradAuto 20, pos 648 Driver 0.4: stall threshold 1, filter off, steps/sec 200 (8.1 mm/sec), coolstep threshold 1 (1890.0 mm/sec), action on stall: none
Speeds
M566 X700 U700 Y600 Z60:60 E300:300 ; set maximum instantaneous speed changes (mm/min) M203 X6000 U6000 Y6000 Z1800:1800 E3600:3600 ; set maximum speeds (mm/min) M201 X800 U800 Y900 Z100:100 E600:600 ; set accelerations (mm/s^2) M204 P800 T1600
Currents and steps
M906 X2125 U2125 Y2000 Z1600:1600 E350:350 I50 M84 X0 U3 Y1 S30 M350 X16 U16 Y16 Z16:16 E16:16 I1 M92 X79.9840 U79.9520 Y80.1603 Z396.8254 E699.3007:699.3007
-
I can confirm similar behavior (6HC with 1LC in SBC mode on latest 3.4 beta5 firmware) on another RatRig printer - V-Core3 (CoreXY). Running left and right motors in StealthChop-to-SpreadCycle mode causes same "clacking" sound as shown by OP.
-
@wichur this is a known issue with stealthChop. From the TMC2160A datasheet:
A jerk occurs when switching at higher velocities, because the back-EMF of the motor (which rises with the velocity) causes a phase shift of up to 90° between motor voltage and motor current. So when switching at higher velocities between voltage PWM and current PWM mode, this jerk will occur with increased intensity. A high jerk may even produce a temporary overcurrent condition (depending on the motor coil resistance). At low velocities (e.g. 1 to a few 10 RPM), it can be completely neglected for most motors. Therefore, consider the switching jerk when choosing TPWMTHRS. Set TPWMTHRS zero if you want to work with StealthChop only.
The TMC5160, TMC2208 and TMC2209 have similar paragraphs. So I suggest using one of the following strategies:
-
Configure the driver to switch from stealthChop to spreadCycle at a low speed. This is the default for the Duet 3 Mini. You will benefit from reduced standstill noise compared to always running in spreadCycle mode.
-
Always run in stealthChop mode, and configure your maximum speed in M203 to be low enough that stealthChop always works reliably. You will have to accept that prints will take longer.
The Prusa Mk3 has two printing modes: "fast" and "quiet". I suspect that those two modes use these two strategies respectively.
-
-
@dc42 Thanks for a rapid answer.
So it was my lack of understanding.
On Prusa/Bear that I duetized (Duet 3 mini 5+) it worked quickly just using 2nd strategy. Just configured StealthChop only mode and it worked without layer shifts up to 100mm/s - which I never excedeed. Probably worked due to different steppers, masses etc.
I'll do a step back then. First trying to tune speed/acc/jerk as currently I have mix of values provided by manufacturers (RR and Orbiter) and what produced good prints. Then retry setting StealthChop by adjusting jerk and drivers to find proper speed to switch to SpreadCycle.
My fallback will be to stay in one mode only.
One thing makes me wonder. Why I execute few moves consecutively with speed enabling SpreadCycle then sound stays. Not only when I move slow->fast->slow->fast.
Cheers!
-
@wichur remember that for reliable stealthChop operation, you need to execute the correct tuning move in your homing file. See https://duet3d.dozuki.com/Wiki/Tuning_Stepper_Motor_Drivers. You can use M17 to enable a driver and then G4 to pause before moving it.
-
@dc42 Yes. I already did that. But maybe version with M17 is more reliable?
I ran your corexy test to confirm is it actually changing something and it is (https://forum.duet3d.com/topic/16297/help-needed-with-duet-3-6hc-tmc5160-stealthchop-config/75?_=1634594365615)
echo "Running homex.g" G91 ; Relative positioning G1 H2 Z0.02 F3000 G4 P250 G1 Z5 F1000 H2 ; Lift Z relative to current position G1 H2 X0.02 F3000 G4 P250 G1 X-999 F6000 H1 ; Move X-axis to the endstop and stop (first pass) G1 X5 F6000 H2 ; Go back a few mm G1 X-999 F360 H1 ; Move X-axis to the endstop once more (second pass) G1 Z-5 F1000 H2 ; Return Z to previous height G90 ; Absolute positioning
-
@wichur your current code enables the X motor before homing but not the Y motor. This is because G1 H2 moves are individual motor commands. So you needed to use G1 H2 X0.02 Y0.02. But M17 X Y is even better as long as you are running RRF 3.3 or later.
-
@dc42 That is only homex.g file. After that I run homeu.g, homey.g and finally homez.g calling one after another using M98 P from homeall.g
To have it working properly I cannot tune them separately, but have to do it in one move? Correct?
-
@wichur best to enable each motor before you first move it. On a CoreXY machine, both X and Y motors are involved in homing X, so best enable both and pause before the X homing move. Same for Y. However, apart from the first homing move, your scheme will probably work.
-
@dc42 I experimented some more and came up with testing routine. Trying to set StealthChop to SpreadCycle at low speed. No luck... Or maybe at 10mm/s is all I can get?
Accel/jerk are halved in comparison to normal operation.
Each testing sequence consists of:
- Configuration
- Homing with tuning
- Three sets of moves of Y and U separately
- Each set has different speed - 10, 50 and 100mm/s
It runs five tests with different configuration each:
- StealthChop to SpreadCycle with switch at 10.4 mm/s
- StealthChop to SpreadCycle with switch at 52.1 mm/s
- StealthChop to SpreadCycle with switch at 93.8 mm/s
- Pure SpreadCycle
- Pure StealthChop
I've recorded a routine with first 3 sequences. Every time movement is above switch speed then "clack" happens. Its visibly less noticeable at low setting, but is still there. As it's increased then it gets much worse.
If you could look if I did homing/tuning correctly, please.
I'll proceed to experimenting with different speeds. Previously when I picked different values for M569 and M915 I've got some improvement - clacking was getting less and less visible.
Thanks for your time and input.
Video (last two removed for brevity):
https://youtu.be/yojaNXBJG9sMacros:
stealthChop.home.g; Homing and tuning M18 X U Y Z ; Disable motors M17 X U Y Z ; Enable motors G4 P100 ; Wait G91 ; Relative positioning G1 Z5 F1000 H2 ; Lift Z relative to current position G1 X-999 U999 Y-999 F3000 H1 ; Move and Tune G1 X5 U-5 Y5 F6000 H2 ; Go back a few mm G1 X-999 U999 Y-999 F360 H1 ; Move again G1 Z-5 F1000 H2 ; Return Z to previous height G90 ; BLTouch preperation M280 P0 S160 ; Precautionary alarm release M280 P0 S90 ; Ensure the pin is raised ; Home Z using the Z-Probe G91 ; Relative positioning G1 Z10 F1000 H2 ; Lift Z relative to current position G90 ; Absolute positioning G1 X-130 Y-115 F6000 ; Move T0 to probing point, including probe offset G30 ; Probe the bed and set Z to the probe offset G1 Z10 F1000 ; Raise Z off the bed
stealthChop.test.g
; Initial settings var distance = 30 ;mm var speed_high = 100 ;mm/s var speed_high_min = 60 * var.speed_high; var speed_med = 50 ;mm/s var speed_med_min = 60 * var.speed_med; var speed_low = 10 ;mm/s var speed_low_min = 60 * var.speed_low; G1 X-999 U0 Y0 F3000 ; Prepare for test G4 P1000 ; Test Low Speed while iterations < 3 G1 U{var.distance/4} F{var.speed_low_min} G1 U{-(var.distance/4)} F{var.speed_low_min} while iterations < 3 G1 Y{var.distance/4} F{var.speed_low_min} G1 Y{-(var.distance/4)} F{var.speed_low_min} ; Test Medium Speed while iterations < 3 G1 U{var.distance/2} F{var.speed_med_min} G1 U{-(var.distance/2)} F{var.speed_med_min} while iterations < 3 G1 Y{var.distance/2} F{var.speed_med_min} G1 Y{-(var.distance/2)} F{var.speed_med_min} ; Test High Speed while iterations < 3 G1 U{var.distance} F{var.speed_high_min} G1 U{-(var.distance)} F{var.speed_high_min} while iterations < 3 G1 Y{var.distance} F{var.speed_high_min} G1 Y{-(var.distance)} F{var.speed_high_min}
stealthChop.spreadCycle.test.g
; RR VCast IDEX (Cartesian) ; Duet 3 6HC TMC5160 ; Testing U and Y ; XUY using 2.5A/3.1V LDO-42STH47-2504AC ; https://www.ratrig.com/nema-17-stepper-motor.html ; 1. Load StealthChop to SpreadCycle settings ; 2. Tune drivers ; 3. Run test for StealthChop to SpreadCycle ; 4. Run test for StealthChop only ; 5. Run test for SpreadCycle only G4 S5 ; Time to start recording :) ; Accel/Jerk are halved in comparison to normal operation M906 X2125 U2125 Y2125 Z1600:1600 E350:350 I50 ; set currents M566 X350 U350 Y350 Z60:60 E300:300 ; set maximum instantaneous speed changes (mm/min) M203 X6000 U6000 Y6000 Z1800:1800 E3600:3600 ; set maximum speeds (mm/min) M201 X400 U400 Y450 Z100:100 E600:600 ; set accelerations (mm/s^2) M204 P400 T400 ;------------------------------------ ;---- StealthChop to SpreadCycle ---- ;------------------------------------ echo "Enable StealthChop to SpreadCycle settings (Switch Speed - 10.4 mm/s)" ; Reset Coolstep M915 P0.0:0.1:0.2:0.3:0.4:0.5 T1 ; disable coolstep M915 P20.0:21.0 T1 ; disable coolstep ; Set U M569 P0.1 S0 D3 V900 H900 M915 P0.1 T900 ; Set Y M569 P0.2 S0 D3 V900 H900 M915 P0.2 T900 ; Homing and tuning M98 p"/macros/stealthChop.home.g" M98 p"/macros/stealthChop.test.g" echo "Enable StealthChop to SpreadCycle settings (Switch speed - 52.1 mm/s)" ; Reset Coolstep M915 P0.0:0.1:0.2:0.3:0.4:0.5 T1 ; disable coolstep M915 P20.0:21.0 T1 ; disable coolstep ; Set U M569 P0.1 S0 D3 V180 H180 M915 P0.1 T180 ; Set Y M569 P0.2 S0 D3 V180 H180 M915 P0.2 T180 ; Homing and tuning M98 p"/macros/stealthChop.home.g" M98 p"/macros/stealthChop.test.g" echo "Enable StealthChop to SpreadCycle settings (Switch speed - 93.8 mm/s)" ; Reset Coolstep M915 P0.0:0.1:0.2:0.3:0.4:0.5 T1 ; disable coolstep M915 P20.0:21.0 T1 ; disable coolstep ; Set U M569 P0.1 S0 D3 V100 H100 M915 P0.1 T100 ; Set Y M569 P0.2 S0 D3 V100 H100 M915 P0.2 T100 ; Homing and tuning M98 p"/macros/stealthChop.home.g" M98 p"/macros/stealthChop.test.g" ;------------------------------------ ;---- SpreadCycle only ---- ;------------------------------------ echo "Enable SpreadCycle settings" ; Reset Coolstep M915 P0.0:0.1:0.2:0.3:0.4:0.5 T1 ; disable coolstep M915 P20.0:21.0 T1 ; disable coolstep ; Set U (Factory values) M569 P0.1 S0 D2 H200 M915 P0.1 T2000 ; Set Y M569 P0.2 S0 D2 H200 M915 P0.2 T2000 ; Homing and tuning M98 p"/macros/stealthChop.home.g" M98 p"/macros/stealthChop.test.g" ;------------------------------------ ;---- StealthChop only ---- ;------------------------------------ echo "Enable StealthChop settings" ; Reset Coolstep M915 P0.0:0.1:0.2:0.3:0.4:0.5 T1 ; disable coolstep M915 P20.0:21.0 T1 ; disable coolstep ; Set U (Above 100mm/s) M569 P0.1 S0 D3 V50 H50 M915 P0.1 T50 ; Set Y M569 P0.2 S0 D3 V50 H50 M915 P0.2 T50 ; Homing and tuning M98 p"/macros/stealthChop.home.g" M98 p"/macros/stealthChop.test.g"
-