Reference Guide

PMAC Quick Reference Guide
Programming PMAC 37
Functions and operators can be used either in Motion Programs, PLCs, or as online commands. For
example, the following commands can be typed in a terminal window:
P1=SIN (45) P1 ; Reports the sine value of a 45° angle
I130=I130/2 ; Lower the proportional gain of Motor #1 by half
I125=I125|$20000 ; Disable the end-of-travel limits of Motor #1
Comparators
A comparator evaluates the relationship between two values (constants or expressions). It is used to
determine the truth of a condition in a motion or PLC program. The valid comparators for PMAC are:
= (equal to)
!= (not equal to)
> (greater than)
!> (not greater than; less than or equal to)
< (less than)
!< (not less than; greater than or equal to)
~ (approximately equal to -- within one)
!~ (not approximately equal to -- at least one apart)
Note that <= and >= are not valid PMAC comparators. The comparators !> and !<, respectively, should
be used in their place.
User-Written Phase and User-Written Servo Algorithms
For the sophisticated user with unusual and/or difficult commutation needs, PMAC provides the hooks for
custom user-written commutation (phasing) or servo algorithms. These routines must be written in
Motorola 56000 assembly language code, usually on a PC or compatible and cross assembled for the 56000.
Memory Map
PMAC’s processor is the Motorola 56001 DSP. The 56001 has dual data buses, each 24-bits wide, so that
both operands in a calculation may be brought in simultaneously. Each bus has access to a 16-bit address
space (0000hex to FFFFhex), which provides 65,536 24-bit words. One bus and address space is called
X, and the other is called Y. Therefore, when specifying a single-word memory location, one must use X:
or Y: with the 16-bit address. PMAC’s input and output is mapped into the same address space with the
memory.
PMAC uses double-word memory for both extended fixed-point values and for floating-point values
(single words are always fixed point). The fixed-point double word locations are specified by a D:
(double), and the floating-point double word locations are specified by an L: (long). This matches the
syntax of M-Variable declarations for these registers.
PMAC addresses may be specified with either decimal or hexadecimal values; the hex values must be
preceded by a $ to be interpreted as hex. For example, Y:$FFC0 is the hexadecimal specification, and
Y:65472 is the decimal specification of the same word address.
M-Variables are defined by providing the word address, the offset, the width, and the format (irrelevant
for bits). Several M-Variables were defined at the factory to match to inputs and outputs. For instance,
M11 thru M18 were assigned to Machine Inputs 1 thru 8 (MI1-MI8), and M1 to M8 were assigned to
Machine Outputs 1 thru 8 (MO1-MO8).
The PMAC architecture is very open, allowing the user to examine and use many internal registers.
Usually this is done through the use of M-Variables, which point to locations in the memory-I/O space of
the PMAC processor. Once defined to point to the proper location, an M-Variable can be treated as any
other variable for reading and writing.