User's Manual

PMAC User Manual
Computational Features 143
COMPUTATIONAL FEATURES
Advanced Computational Features
PMAC has advanced computational features that permit off-loading of many operations from a host, or
even stand-alone operation in ways that were not previously possible. Many arithmetic, logical, and
transcendental operations can be performed on variables and constants in user programs on board the
card.
Computational Priorities
As a multi-tasking, real-time computer, PMAC has an elaborate prioritization scheme to ensure that vital
tasks get accomplished when needed, and that all tasks are executed reasonably quickly. The scheme was
designed to hide its complexity as much as possible, but also to give some flexibility in optimizing the
controller for his particular needs. The tasks at the different priority levels are:
Single Character I/O: Bringing in a single character from, or sending out a single character to, the
serial port or host port (PC or STD) is the highest priority in PMAC. This task takes only 200 nsec
per character, but having it at this high priority ensures that PMAC cannot be outrun by the host on a
character-by-character basis. This task is never a significant portion of the PMAC total calculation
time. This task does not include processing a full command; that happens at a lower priority (see
below).
Commutation Update: The commutation (phasing) update is the second highest priority on PMAC.
For each motor commutated by PMAC, this task takes 3 µsec per update cycle (2 µsec for the 30
MHz card). The frequency of this task is determined by the master clock frequency, and jumpers
E98, E29-E33. The default update frequency is 9 kHz (110 µsec cycle). At the default, the
commutation of each motor takes approximately 3% of the PMAC computational power.
Servo Update: The servo update — computing the new commanded position, reading the new actual
position, and computing a command output based on the difference between the two — is the third
highest priority on PMAC. For each activated motor on PMAC, this task takes 30 µsec per update
cycle (20 µsec for the 30 MHz card) plus about 30 µsec for general servo tasks such as the encoder
conversion table. The frequency of this task is determined by the master clock frequency, and
jumpers E98, E29-E33, E3-E6. The default update frequency is 2.26 kHz (442 µsec cycle). At the
default, the servo update of each motor takes approximately 7% of the PMAC computational power.
See Closing the Servo Loop section in this manual for details on optimizing this update rate.
Real-Time Interrupt Tasks: The real-time interrupt (RTI) tasks are the fifth highest priority on
PMAC. They occur immediate after the servo update tasks at a rate controlled by parameter I8 (every
I8+1 servo update cycles). There are two significant tasks occurring at this priority level: PLC 0 and
motion program move planning.
PLC Program 0: PLC 0 is a special PLC program that operates at a higher priority than the other
PLC programs. It is meant to be used for only a few tasks (usually a single task) that must be done at
a higher frequency than the other PLC tasks. The PLC 0 will execute every real-time interrupt as
long as the tasks from the previous RTI have been completed. PLC 0 is potentially the most
dangerous task on PMAC as far as disturbing the scheduling of tasks is concerned. If it is too long, it
will starve the background tasks for time. The first thing to notice is that communications and
background PLC tasks will become sluggish. In the worst case, the watchdog timer will trip, shutting
down the card, because the housekeeping task in background did not have the time to keep it updated.