Download pmac users

Transcript
PMAC User Manual
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.
8-16
Setting Up PMAC Commutation