THIS PAGE IS A WORK IN PROGRESS!
This document is relevant to: Duet 3 MB6HC and EXP3HC, Duet 3 Toolboard 1LC, Duet 3 Mini 5+, Duet 2 WiFi / Ethernet, Duet 2 Maestro
Firmware versions: RepRapFirmware 3.1.1 and later, may apply to earlier versions
The Duet range of boards feature Trinamic stepper drivers, which have a number of features that, once tuned, can result in improved performance and/or reduced noise.
Board | Driver chip and Datasheet link | Microstep Interpolation | stealthChop | spreadCycle | stallGuard | coolStep |
---|---|---|---|---|---|---|
Duet 3 MB6HC Duet 3 EB3HC | TMC2160 or TMC5160 | Y | Y (SC2) | Y | Y (SG2) | Y |
Duet 3 Toolboard | TMC2209 | Y | Y (SC2) | Y | Y (SG4) | Y |
Duet 3 Mini 5+ | TMC2209 | Y | Y (SC2) | Y | Y (SG4) | Y |
Duet 2 WiFi and Ethernet | TMC2660 | 16x only | N | Y | Y (SG2) | Y |
Duet 2 Maestro | TMC2224 | Y | Y (SC2) | Y | N | N |
Please note that currently (RRF 3.2), stall detection on Duet 3 tool boards (Duet 3 TOOL1LC) and expansion boards (Duet 3 EB3HC) are not yet reported and cannot be used for homing. See Duet 3 with CAN expansion firmware configuration limitations.
Using the I1
parameter in M350 will enable microstep interpolation. This smooths movement between microsteps, and is noticeably quieter. There is no loss in performance or extra processor burden.
stealthChop is a quiet mode of operation for stepper motors at standstill and at low velocities. It is based on a voltage mode PWM. With stealthChop2, the driver automatically adapts to the application for best performance, but can also be set manually using M569.
stealthChop is not supported on TMC2660 drivers in Duet 2 WiFi / Ethernet.
While stealthChop is a voltage mode PWM controlled chopper, spreadCycle is a cycle-by-cycle current control. It can react extremely fast to changes in motor velocity or motor load. spreadCycle will give better performance in medium to high velocity range for motors and applications which tend to resonance.
stallGuard provides a measurement of the load on the motor. It can be used for stall detection as well as other uses at loads below those which stall the motor, such as CoolStep load-adaptive current reduction.
See Stall detection and sensorless homing
stallGuard is not supported on TMC2224 drivers in Duet 2 Maestro.
coolStep allows energy savings by automatically adapting the motor current to the load. Requires stallGuard to be tuned first, as it relies on measuring the motor load.
coolStep is not supported on TMC2224 drivers in Duet 2 Maestro.
Parameter | Description | Gcode |
---|---|---|
toff | General enable for the motor driver, the actual value does not influence stealthChop. | |
thigh | ||
tcoolthrs | ||
tblank | ||
hstart | Hysteresis start value | |
hend | Hysteresis end (low) value | |
hdec | Hysteresis decrement interval | |
pos | ||
tpwmthrs | Sets the upper velocity for stealthChop voltage PWM mode. | M569 V[nnn] |
M569 is used to set stepper driver settings. The following parameters are used to enable tuning of the Trinamic drivers:
Duet 3 MB6HC output from M569 P0
Drive 0 runs forwards, active low enable, step timing fast, mode spreadCycle, ccr 0x08053, toff 3, tblank 1, hstart/hend/hdec 5/0/0, pos 0, tpwmthrs 2000 (4.7 mm/sec), thigh 200 (46.9 mm/sec)
Duet 2 WiFi output from M569 P0
Drive 0 runs forwards, active low enable, step timing fast, mode spreadCycle, ccr 0x101b4, toff 4, tblank 2, hstart/hend/hdec 3/3/0, pos 0
Duet 2 Maestro output from M569 P0
Drive 0 runs in reverse, active low enable, step timing fast, mode stealthChop, ccr 0x00053, toff 3, tblank 0, hstart/hend/hdec 5/0/0, pos 72, tpwmthrs 2000 (4.3 mm/sec)
TMC2224, TMC5160 and TMC2209 have stealthChop. It's a little more complicated to configure on the TMC5160 because this chip also has coolStep. Also, stall detection doesn't work in stealthChop mode, so you have to switch to spreadCycle while doing stall detect homing.
TMC2209 is a little different because it doesn't have coolStep and because stall detection only works in stealthChop mode.
In both cases there are some limitations:
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.
We suggest the use of one of the following configurations:
If you have interpolation enabled, you may find that your motors are very quiet already. To be able to hear the difference that enabling stealthChop, try reducing microstepping to x8 and disable interpolation.
These are the conditions you need for the drivers to run in stealthChop mode:
So to use stealthChop, set tpwmthrs, thigh and tcoolthrs all to the same value, for example:
M569 P0 D3 H50 v50
M915 P0 T50
You can send M569 P0 to see what belt speed the H and V parameters correspond to. What you are satisfied that you have the threshold high enough, execute the tuning procedure. If necessary, you can execute a very short move (just 1 microstep is enough) to power up the motors at the start.
In principle you could use different values of thigh and tcoolthrs so that at speeds too high for stealthChop you still use coolStep, however i'm not sure that there are any speeds at which coolStep provides any advantages over stealthChop.
If you are using stall-detect homing, then in the homing file you must increase the M915 T parameter to a value that corresponds to a speed below the speed of your homing move. [I have not yet checked whether you also need to switch to spreadCycle mode explicitly]. After homing, reduce the M915 T parameter again, then execute the tuning procedure.
See Stall Detection and Sensorless Homing.
coolStep is configured using the T parameter of M915. This sets the coolStep control register, with a 16-bit unsigned integer. See the stepper driver documentation for sensible values. As coolStep needs to use the motor loads to dynamically adjust the motor current, stallGuard needs to be set up and tuned first. See Stall Detection and Sensorless Homing.
Forum thread https://forum.duet3d.com/topic/16297/help-needed-with-duet-3-6hc-tmc5160-stealthchop-config