Datasheet

TMC5041 DATASHEET (Rev. 1.13 / 2017-MAY-16) 58
www.trinamic.com
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
by the read and clear (R+C) function, be sure to execute step 5 within the time range set by
TZEROWAIT.
5. Switch the ramp generator to hold mode and calculate the difference between the latched
position and the actual position. For stallGuard based homing or when using hard stop, XACTUAL
stops exactly at the home position, so there is no difference (0).
6. Write the calculated difference into the actual position register. Now, homing is finished. A move
to position 0 will bring back the motor exactly to the switching point. In case stallGuard was
used for homing, a read access to RAMP_STAT clears the stallGuard stop event event_stop_sg and
releases the motor from the stop condition.