Datasheet
TMC5041 DATASHEET (Rev. 1.13 / 2017-MAY-16) 56
www.trinamic.com
REALIZE JOYSTICK CONTROL
1. Use positioning mode in order to control the motion direction and to set the motion limit(s).
2. Modify VMAX at any time in the range VSTART to your maximum value. With VSTART=0, you can
also stop motion by setting VMAX=0. The motion controller will use A1 and AMAX as determined
by V1 to adapt velocity for ramping up and ramping down.
3. In case you do not modify the acceleration settings, you do not need to rewrite XTARGET, just
modify VMAX.
4. DMAX, D1 and VSTOP only become used when the ramp controller slows down due to reaching
the target position, or when the target position has been modified to point to the other direction.
10.3 Interrupt Handling
The motion controllers provide the capability to issue an interrupt to the microcontroller, e.g. in order
to react on a position reached event. In case more than one interrupt source is possible, it is
necessary to carefully check for the actual event, without risking losing an event.
INTERRUPT HANDLING FOR 2 AXIS (EXAMPLE FOR TARGET_REACHED):
1. Read RAMP_STAT1 to clear the interrupt flags. This will turn off the interrupt source.
2. Check XACTUAL1 for reaching of the target position (and any other conditions you want to check
for ramp 1).
3. Do the same for RAMP_STAT2 and XACTUAL2.
This way, you are sure that you will not miss any target_reached condition, because you first clear the
flags, and afterwards read out the condition.
10.4 Velocity Thresholds
The ramp generator provides a number of velocity thresholds coupled to the actual velocity VACTUAL.
The different ranges allow programming the motor to the optimum step mode, coil current and
acceleration settings. For the range labeled “microstepping” in Figure 10.3, either stealthChop or
spreadCycle can be used, if enabled.
high velocity fullstep
microstep + coolStep
microstep + coolStep
microstepping
microstepping
motor stand still
motor going to standby
motor in standby
motor in standby
v
t
VSTOP
VSTART
0
V1
VMAX
AMAX
DMAX
D
1
A
1
VACTUAL
VCOOLTHRS
VHIGH
current
TZEROWAIT
RMS current
I_HOLD
I_RUN
dI * IHOLDDELAY
coolStep current reduction
Figure 10.3 Ramp generator velocity dependent motor control