Datasheet

TMC5130A DATASHEET (Rev. 1.11 / 2015-OCT-08) 79
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.
14.5 External STEP/DIR Driver
The TMC5130A allows using the internal ramp generator to control an external STEP/DIR driver like the
TRINAMIC TMC262, TMC2660 or TMC389 for powerful stepper applications. In this configuration, the
internal driver will normally not be used, but it may be used in addition to the external driver, e.g.
when two motors shall move synchronously. The SWN_DIAG0 and SWP_DIAG1 outputs are enabled
for STEP and DIR output by setting GCONF flags diag0_step and diag1_dir. Additional internal driver
features like dcStep and automatic motor current control are not available in this mode, because there
is no feedback from the external driver to the TMC5130A. In order to provide a robust and simple
interface, the STEP output uses the edge triggered mode, i.e. it toggles with each (micro)step taken.
Enable the dedge function on the external driver.
The feature also can be used to provide a step-synchronous signal to external logic.