User's Manual

PMAC User Manual
Setting Up PMAC Commutation 101
Using the Motor
Once the motor is set up, use it just as any other PMAC motor. In fact, because it is working off internal
feedback, this motor can be programmed and tested without any physical motor attached!
User-Written Commutation Algorithm
For the sophisticated user with unusual and/or difficult commutation needs, PMAC provides the hooks for
custom user-written commutation (phasing) algorithms. These routines are written in Motorola 56000
assembly language code, usually on a PC or compatible, and cross assembled for the 56000. Delta Tau
provides the information about where to pick up the needed information, where to leave the output
commands, and where to store the algorithm itself. The writing and download procedure is as for the
user-written servo algorithm.
Note:
This is not a task for the inexperienced user. To attempt this, the user should be
well acquainted with both motor theory and assembly language coding.
The user-written commutation algorithm is enabled by setting Ix59 to 2 or 3 for Motor x (Ix59 = 3 also
enables the user-written servo). PMAC will only select between the standard commutation algorithm and
the user-written commutation algorithm at power-on/reset, so in order to change which algorithm is used,
Ix59 must be changed, the value must be stored to non-volatile memory with the SAVE command, and the
card must be reset.
Memory Space, Software Interface, and Program Restrictions
The program space allocated for a user-written commutation is:
Program code starting address P:$BB00
Maximum continuous program length is 256 24-bit words (P:$BB00 to P:$BBFF). With jump
instructions, other program memory reserved for user use (P:$8000-P:$BAFF) can be accessed.
Compiled PLC code, if present, starts at P:$8000; user-written servo, if present, starts at $B800.
Memory in this range not used for these purposes may be used for user-written commutation.
The data spaces easily available for variables used in the user-written servo are:
Zero-value-initialized registers L:$0770 to L:$077F
Uninitialized user registers L:$07F0 to L:$07FF. These registers retain the last values written to them
before power-down/reset in battery-backed PMACs; then power up with the last values saved to flash
memory in flash-backed PMACs.
Registers reserved with the DEFINE UBUFFER command; from L:$9FFF, with decreasing address
values to the declared length of the buffer.
The user-written commutation algorithm must directly access memory and memory-mapped I/O registers.
Unlike the user-written servo, no special data is placed into or removed from internal DSP registers.
Common registers to be used in user-written commutation are:
Servo filter result: X:$0045, X:$0081, etc.
Encoder phase position register:X:$C001, X:$C005, etc.
The following restrictions must be observed in the user-written commutation algorithm:
The code must start with ORG P:$BB00
No assumptions can be made as to the state of any internal DSP registers on entry.
No stack use is allowed.
If any R, M, or N registers are used, they must be restored before exiting.
The B-accumulator register must be cleared on exit (required for PMAC1 only).
The code must finish with an RTS instruction.