38
TMC223 DATASHEET (V. 1.05 / March 7, 2011)
6.9 Positioning Task Example
The TMC223 has to perform a positioning task, where the actual position of the stepper motor is
unknown. The desired target position is 3000 µsteps away from position 0. See figure below.
Stop
Actual
Target
Position
Position
=
= 3000
unknown
?
?
X [µsteps]
?
Position 0
Figure 22: Positioning Example: Initial situation
The following sequence of commands has to be sent to the slave in order to complete the scenario
described above (assumed after power on):
GetFullStatus1
The command is used to read the current status of the TMC223. Electrical or environmental problems
will be reported, furthermore the circuit leaves the shutdown state and is ready for action. See 6.8.1
GetFullStatus1 on page 31.
GetFullStatus2
The circuit will enter a deadlock state if the actual position corresponds to the first target position of the
RunInit command. This command is used to read the actual position. The master must take care that
both positions are containing different values. For deadlock conditions see 5.1.11 Reference Search /
Position initialization on page 15.
SetMotorParam
In order to drive the stepper motor with a desired motion parameters like torque, velocity, aso. the
SetMotorParam command must issued. See 6.8.9 SetMotorParam on page 35.
RunInit
Hence the actual position is unknown, a position initialization has to be performed. The first motion
must drive the stepper motor into the stop for sure. The second motion is a very short motion to bring
the motor out of the stop. The actual position is then set to zero automatically after the second motion
is finished. See 6.8.8 RunInit on page 34.
After reference search the situation is as depicted in the figure below. Actual position of the stepper
motor corresponds to zero, the target position is 3000 µsteps away from the actual position.
Stop
Actual
Position
= 0
Target
Position
= 3000
X [µsteps]
Figure 23: Positioning Example: Situation after reference search
Now the positioning command SetPosition can be issued in order to drive the stepper motor to the
desired position.
Copyright © 2007-2011 TRINAMIC Motion Control GmbH & Co. KG