TMC5161 DATASHEET (Rev. 1.01 / 2018-NOV-20)
39
6.3.2.1 SW_MODE – Reference Switch & stallGuard2 Event Configuration Register
0X34: SW_MODE – REFERENCE SWITCH AND STALLGUARD2 EVENT CONFIGURATION REGISTER
Bit Name
Comment
11 en_softstop
0: Hard stop
1: Soft stop
The soft stop mode always uses the deceleration ramp settings DMAX, V1,
D1, VSTOP and TZEROWAIT for stopping the motor. A stop occurs when
the velocity sign matches the reference switch position (REFL for negative
velocities, REFR for positive velocities) and the respective switch stop
function is enabled.
A hard stop also uses TZEROWAIT before the motor becomes released.
Attention: Do not use soft stop in combination with stallGuard2. Use soft
stop for stealthChop operation at high velocity. In this case, hard stop
must be avoided, as it could result in severe overcurrent.
10 sg_stop
1: Enable stop by stallGuard2 (also available in dcStep mode). Disable to
release motor after stop event. Program TCOOLTHRS for velocity threshold.
Hint: Do not enable during motor spin-up, wait until the motor velocity
exceeds a certain value, where stallGuard2 delivers a stable result. This
velocity threshold should be programmed using TCOOLTHRS.
1: Latch encoder position to ENC_LATCH upon reference switch event.
1: Activates latching of the position to XLATCH upon an inactive going
edge on the right reference switch input REFR. The active level is defined
by pol_stop_r.
9
8
en_latch_encoder
latch_r_inactive
7
latch_r_active
1: Activates latching of the position to XLATCH upon an active going edge
on the right reference switch input REFR.
Hint: Activate latch_r_active to detect any spurious stop event by reading
status_latch_r.
6
5
latch_l_inactive
latch_l_active
1: Activates latching of the position to XLATCH upon an inactive going
edge on the left reference switch input REFL. The active level is defined
by pol_stop_l.
1: Activates latching of the position to XLATCH upon an active going edge
on the left reference switch input REFL.
Hint: Activate latch_l_active to detect any spurious stop event by reading
status_latch_l.
4
3
swap_lr
pol_stop_r
1: Swap the left and the right reference switch input REFL and REFR
Sets the active polarity of the right reference switch input
0=non-inverted, high active: a high level on REFR stops the motor
1=inverted, low active: a low level on REFR stops the motor
Sets the active polarity of the left reference switch input
0=non-inverted, high active: a high level on REFL stops the motor
1=inverted, low active: a low level on REFL stops the motor
1: Enables automatic motor stop during active right reference switch input
2
1
0
pol_stop_l
stop_r_enable
stop_l_enable
Hint: The motor restarts in case the stop switch becomes released.
1: Enables automatic motor stop during active left reference switch input
Hint: The motor restarts in case the stop switch becomes released.
www.trinamic.com