Analog Integrated Circuit Device Data
Freescale Semiconductor
27
33976
FUNCTIONAL DEVICE OPERATION
LOGIC COMMANDS AND REGISTERS
The motor is stepped by providing index commands at
intervals. The time between steps defines the motor velocity,
and the changing time defines the motor acceleration.
The state machine uses a table to define the allowed time
and also the maximum velocity. A useful side effect of the
table is that it also allows the direct determination of the
position at which the velocity should reduce to stop the motor
at the desired position.
The motor equations of motion are generated as follows.
(The units of position are steps, and velocity and acceleration
are in steps/second and steps/second2.)
From an initial position of 0 with an initial velocity (
u)
, the
motor position (
s)
at a time (
t)
is:
For unit steps, the time between steps is:
This defines the time increment between steps when the
motor is initially travelling at a velocity u. In the ROM, this time
is quantized to multiples of the system clock by rounding
upwards, ensuring acceleration never exceeds the allowed
value. The actual velocity and acceleration is calculated from
the time step actually used.
Using|
v
2
=
u
2
+ 2
as
and
v
=
u
+
at
and solving for
v
in terms of
u
,
s,
and
t
gives:
v
=
2
/
t
-
u
The correct value of
t
to use in this equation is the
quantized value obtained above.
From these equations a set of recursive equations can be
generated to give the allowed time step between motor
indexes when the motor is accelerating from a stop to its
maximum velocity.
Starting from a position
p
of 0 and a velocity
v
of 0, these
equations define the time interval between steps at each
position. To drive the motor at maximum performance, index
commands are given to the motor at these intervals. A table
is generated giving the time step
t
at an index position
n
.
where
indicates rounding up.
P
n
=
n
Note
P
n
=
n
.
This means on the
n
th step the motor has
indexed by
n
positions and has been accelerating steadily at
the maximum allowed rate. This is critical because it also
indicates the minimum distance the motor must travel while
decelerating to a stop. For example, the
stopping distance
is
also equal to the current value of
n
.
The algorithm to drive the motor is similar to:
1. While the motor is stopped, wait until a command is
received.
2. Send index pulses to the motor at an ever-increasing
rate, according to the time steps in
Table 30
until:
a. The maximum velocity is reached, at which point
the time intervals stop decreasing, or
b. The distance remaining to travel is less than the
current index in the table. At this point, the stopping
distance is equal to the remaining distance, and to
ensure it will stop at the required position, the motor
must begin decelerating.
An example of the velocity table for a particular motor is
provided in
Table 30
. This motor’s maximum speed is
4800 microsteps/s (at 12 microsteps/degrees), and its
maximum acceleration is 54000 microsteps/s
2
. The table is
quantized to a 1.0 MHz clock.
14
210
-0.5
-0.867
-1
15
225
-0.707
-0.707
-0.966
16
240
-0.866
-0.5
-0.866
17
255
-0.966
-0.259
-0.707
18
270
-1
0
-0.500
19
285
-0.966
0.259
-0.259
20
300
-0.866
0.5
0
21
315
-0.707
0.707
0.259
22
330
-0.5
0.866
0.500
23
345
-0.259
0.966
0.707
* Denotes normalized values.
Table 29. Coil Step Value
2
2
1
at
ut
s
+
=
a
a
u
u
t
2
2
+
+
=
0
0
0
0
=
=
v
p
1
2
=
n
n
n
v
t
v