User's Manual

PMAC User Manual
78 Setting Up a Motor
To use something other than the conversion table editor screen in the PMAC Executive program, view the
current set-up of the conversion table with a single Read-Hex (RH) command. For instance, if the table
were set up as in the example immediately above, the command RHY:$720,24 (report in hex 24 Y-
words starting at $720) would yield the following response:
00C000 00C004 00C008 00C00C 10C006 10C007 10C00E 10C00F
30FFD0 00FFFF 000100 30FFD1 00FFFF 000100 20C020 07FFFF
20C024 07FFFF 000000 000000 000000 000000 000000 000000
To use something other than the conversion table editor screen in the PMAC Executive program, change
the entries in the table with one or more Write (W) commands. For example, to change the third and
fourth entries above to straight conversion of the same registers, command WY:$722, $C0C008,
$C0C00C. While the set-up values may be specified in decimal, it is easier to specify them in
hexadecimal (except possibly for scale factors).
The set-up of the Encoder Conversion Table can be stored in EAROM with the SAVE command. The
most recently saved set-up is copied from EAROM into RAM (active memory) on power-up or reset, so
SAVE changes to the table to keep them.
Further Position Processing
Once the position feedback signals have been processed by the Encoder Conversion Table (which
happens at the beginning of each servo cycle), the data is ready for use by the servo loop.
Software Position Extension
For each activated motor, PMAC takes the position information in the 24-bit register pointed to by Ix03
and extends it in software to a 48-bit register that holds the actual motor position. In the process of
extension, it multiplies the value by the Ix08 position scale factor. Since the register in the conversion
table is in units of 1/32 of a count, the actual motor position register is in units of 1/(Ix08*32) of a count.
These extended motor position registers are set to zero on power-up/reset (unless there is an absolute
position sensor), and again at the end of a homing search move. The encoder position registers are only
set to zero on power-up/reset. Therefore, after a motor is homed, there is an offset between motor zero
position and encoder zero position.
Only worry about this offset if using the encoder registers directly (e.g., position capture and compare) or
to relate these values to motor position. Find and store the offset, which is the value in the position
capture register when the home trigger is found.
Program HOMOFFST.PMC in the Examples section shows how to do this. They may also have to
handle rollover of the encoder registers if they will be traveling more than +/-8 million counts. The
modulo (%) operator is useful for this. For more details, refer to the Synchronizing PMAC to External
Events section of this manual.