Back to the Gcode Dictionary
M569.1: Stepper driver closed loop configuration
Set the configuration parameters of a closed loop driver. See the M569 D parameter for switching a driver to closed loop after it has been configured.
Supported for drivers attached to:
- Pnn Motor driver number
- Tn Encoder type: 0=none, 1=linear quadrature encoder on axis, 2=quadrature encoder on motor shaft, 3=Duet closed loop magnetic sensor (based on the AS5047D)*
- Cn.n Encoder counts per full step (when using a quadrature encoder on motor shaft) [count per mm will become available as support for linear encoders is implemented]
- En.n:m.m Error thresholds. Closed loop errors greater than m will be treated as a stall. Closed loop errors greater than n will be treated as a pre-stall. The action that is taken on a stall/pre-stall can be configured using M915. Note: Although this is supported on the 1HCL closed loop boards, it is not yet supported in the main RepRap Firmware.
- Rn.n Proportional constant
- In.n Integral constant
- Dn.n Derivative constant
- Hn.n Minimum holding current as a percentage of the configured motor current when operating in closed loop mode
See 'Tuning the Duet 3 Expansion 1HCL' for further details on setting the proportional/integral/derivative constants.
Encoder counts per step (Cn.n) can be found from the datasheet of the encoder being used. If the value is stated as counts per revolution (CPR), divide by the steps per revolution of the stepper motor to get the count per step. For example, a 1000 CPR encoder attached to a 200 step/rev motor will have a count per step of 1000 ÷ 200 = 5.