TMC5130A DATASHEET (Rev. 1.14 / 2017-MAY-15)
79
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.
HOMING WITH A THIRD SWITCH
Some applications use an additional home switch, which operates independently of the mechanical
limit switches. The encoder functionality of the TMC5130 provides an additional source for position
latching. It allows using the N channel input to snapshot XACTUAL with a rising or falling edge event,
or both. This function also provides an interrupt output.
1. Activate the latching function (ENCMODE: Set ignoreAB, clr_cont, neg_edge or pos_edge and
latch_x_act). The latching function can then trigger the interrupt output (check by reading n_event
in ENC_STATUS when interrupt is signaled at DIAG0).
2. Move to the direction, where the N channel switch should be. In case the motor hits a stop
switch (REFL or REFR) before the home switch is detected, reverse the motion direction.
3. Read out XLATCH once the switch has been triggered. It gives the position of the switch event.
4. After detection of the switch event, stop the motor, and subtract XLATCH from the actual position.
(A detailed description of the required steps is in the homing procedure above.)
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.
www.trinamic.com