AN2364 Freescale Semiconductor / Motorola, AN2364 Datasheet - Page 2

no-image

AN2364

Manufacturer Part Number
AN2364
Description
Using the Table Stepper Motor TPU Function (TSM) with the MPC500 Family
Manufacturer
Freescale Semiconductor / Motorola
Datasheet
Freescale Semiconductor, Inc.
Local Table Mode
it issues an interrupt request to the CPU - if the appropriate interrupt enable bit is set, then a CPU interrupt
will result, allowing optional interrupt driven control.
The algorithm employed in the TPU re-evaluates the requested destination on every step, this means that
the CPU can change the desired position at any time during a movement and the TPU will adjust its strategy
to get to the new desired position as quickly as possible. e.g. if a motor is currently moving clockwise from
position A to position B at a given slew rate when the CPU writes a new desired position C, which is
counterclockwise from the current position, the TPU will immediately decelerate the motor, reverse
direction, accelerate, slew and decelerate in the counterclockwise direction to reach position C.
The TSM generates the actual step patterns to drive the motor via synchronized output matches on two or
four channels. The step patterns generated are defined by the user. The TSM function operates on a master
channel and either one or three slave channels. Except during initialization, all TPU service activity and
CPU communication occurs on the master channel only. This keeps TPU loading to a minimum and hence
maximizes performance. The master channel is chosen by the user and the slave(s) are then defined one or
three channels immediately after the master in numeric order. For example, in two channel mode, if channel
5 was chosen as the master, channel 6 is the slave. In four channel mode, if channel 13 is chosen as the
master, then channels 14, 15 and 0 are the slaves. The choice of two or four channel mode is made via a
control bit on the master channel.
The TSM function uses the same user defined step period profile during acceleration and deceleration. The
user specifies this profile via a table in parameter RAM. A 15-bit start period defines the period of the first
and last steps in any move i.e. the start/stop rate (pull in rate) of the motor. The acceleration profile is
programmed into a table of 8 bit constants that are used sequentially to fractionally multiply the start period
during acceleration to obtain the ‘nth’ step period.
The user also specifies a slew period which defines the exact maximum running speed of the motor. When
accelerating, the TPU uses a new value from the acceleration table for each step until the calculated step
period (table parameter * start period / 256) is smaller than the slew period. When this point is reached, the
TPU switches to the slew period. The TPU also uses the slew period if it reaches the end of the acceleration
table. The slew period parameter allows the terminal speed of the motor to be controlled independently of
the acceleration table length and content.
There are two acceleration table configurations available with the TSM function. These are referred to as
local table configuration and split table configuration. Each configuration has different merits and provides
different maximum table lengths. The actual table size is programmable by the user. Limits for the various
modes are explained below. Figure 2 illustrates these points.
2.1
Local Table Mode
In local table configuration, the acceleration parameters are obtained from a table starting in the lower byte
of the first parameter of the first slave channel (the channel immediately after the master in numeric order).
Any channel can be a master in local table configuration.
The maximum table size is 48 bytes. This is determined by the amount of contiguous parameter RAM
available, starting with parameter 0 of the first slave channel. The maximum number of step rates is equal
to the table size plus 2 (start/stop and slew).
Note that the length of table is independent of whether two or four channel mode is selected e.g. if channel
14 is the master in a two channel configuration, the PRAM of channel 0 can still be used to increase the table
size to 28 bytes (although channel 0 could not then run another TPU function). Channels 14 and 15 will be
the two motor driving channels.
2
Using the Table Stepper Motor TPU Function
MOTOROLA
For More Information On This Product,
Go to: www.freescale.com

Related parts for AN2364