TMC5031 DATASHEET (Rev. 1.11 / 2016-APR-28)
46
9.5 Reference Switches
Prior to normal operation of the drive an absolute reference position must be set. The reference
position can be found using a mechanical stop which can be detected by stall detection, or by a
reference switch.
In case of a linear drive, the mechanical motion range must not be left. This can be ensured also for
abnormal situations by enabling the stop switch functions for the left and the right reference switch.
Therefore, the ramp generator responds to a number of stop events as configured in the SW_MODE
register. There are two ways to stop the motor:
-
it can be stopped abruptly, when a switch is hit. This is useful in an emergency case and for
stallGuard based homing.
-
Or the motor can be softly decelerated to zero using deceleration settings (DMAX, V1, D1).
Hint
Latching of the ramp position XACTUAL to the holding register XLATCH upon a switch event gives a
precise snapshot of the position of the reference switch.
+VCC_IO
+VCC_IO
10k
10k
REF_L
REF_R
Motor
22k
1nF
Negative
direction
Traveler
Positive
direction
Optional RC filter
(example)
Figure 9.4 Using reference switches (example)
Normally open or normally closed switches can be used by programming the switch polarity or
selecting the pull-up or pull-down resistor configuration. A normally closed switch is failsafe with
respect to an interrupt of the switch connection. Switches which can be used are:
-
-
-
mechanical switches,
photo interrupters, or
hall sensors.
Be careful to select reference switch resistors matching your switch requirements!
In case of long cables additional RC filtering might be required near the TMC5031 reference inputs.
Adding an RC filter will also reduce the danger of destroying the logic level inputs by wiring faults,
but it will add a certain delay which should be considered with respect to the application.
IMPLEMENTING A HOMING PROCEDURE
1. Make sure, that the home switch is not pressed, e.g. by moving away from the switch.
2. Activate position latching upon the desired switch event and activate motor (soft) stop upon
active switch. stallGuard based homing requires using a hard stop (en_softstop=0).
3. Start a motion ramp into the direction of the switch. (Move to a more negative position for a left
switch, to a more positive position for a right switch). You may timeout this motion by using a
position ramping command.
4. As soon as the switch is hit, the position becomes latched and the motor is stopped. Wait until
the motor is in standstill again by polling the actual velocity VACTUAL or checking vzero or the
standstill flag. Please be aware that reading RAMP_STAT may clear flags (e.g. sg_stop) and thus
the motor may restart after expiration of TZEROWAIT. In case the stop condition might be reset
www.trinamic.com