User`s manual

1.0 - Introduction to PMAC
Page - 10
1.6.7 - Observations:
- PMAC has an on-board "watchdog timer" circuit whose job it is to detect a number of conditions that could result in
dangerous misfunction. At the default settings, if the RTI frequency were to drop below about 50 Hz or the background
cycle is not performed at least every 512 RTI cycles, the timer would trip.
The purpose of this two-part control of the timer is to make sure all aspects of the PMAC software are being executed,
both in foreground (interrupt-driven) and background. If anything keeps either type of routine from executing, the
watchdog will fail quickly.
- PLC0 or PLCC0 are meant to be used for only a very 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 you will
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.
- Although it is very rare for a motion program to cause a watchdog failure, this does happen on occasion. If you have an
"empty" (no-motion) loop, the motion program acts much like a PLC 0 during this period. These empty loops, which
are usually used to wait for a certain condition, provide very fast response to the change in condition, but their fast
repetition occupies a lot of CPU time, and can starve the background tasks for time. Particularly if several coordinate
systems are executing empty loops at the same time, you can run into serious background time limitations, which can
be severe enough to trip the watchdog timer.
If there are a huge number of lines of intensive calculations (e.g. 100) before any move or dwell is encountered, there
can be such a long time before background calculations are resumed (more than 512 RTI cycles) it is possible to trip
the watchdog timer. If this problem occurs, the calculations should be split apart with short DWELL commands to
give other tasks time to execute.
- It is possible to use compiled PLCC programs for faster execution. The faster execution of the compiled PLCs comes
from two factors: first, from the elimination of interpretation time, and second, from the capability of the compiled PLC
programs to execute integer arithmetic.
The space dedicated to store up to 32 compiled PLC programs, however, is limited to 15K (15,360) 24-bit words of
PMAC memory; or 14K (14,336) words if there is a user-written servo as well.
- In between each scan of each individual background interpreted PLC program, PMAC will execute one scan of all
active background compiled PLCs. This means that the background compiled PLCs execute at a higher scan rate than
the background interpreted PLCs. For example, if there are seven active background interpreted PLCs, each
background compiled PLC will execute seven scans for each scan of a background interpreted PLC.
- Most of the housekeeping functions are safety checks such as following error limits and overtravel limits. Since
compiled PLCCs are executed at the same rate as the housekeeping functions, code to complement or replace these
functions could be placed in a compiled PLCC. If, for example, an extra input flag is desired for position capturing
purposes either the end-of-travel limit inputs or the amplifier fault input could be used. The automatic check of the
input flag could be disabled by an appropriate setting of the corresponding Ix25 variable and replaced by a PLCC code
that will check a general purpose input where the amplifier fault or end-of-travel limit would be connected instead.
- On power-up\reset PLC programs are executed sequentially from 1 to 31. This makes PLC1, the first code executed,
the ideal place to perform initialization commands like other PLCs disabling, motors phasing and motion programs
start. After its execution PLC1 could disable itself with the command DIS PLC1, running only once on power-up\reset.
- Bits of the first word returned from the global status bits request command, ???:
Bit 22 Real-Time Interrupt Re-entry: This bit is 1 if a real-time interrupt task has taken long enough so that it
was still executing when the next real-time interrupt came (I8+1 servo cycles later). It stays at 1 until the card is reset,
or until this bit is manually changed to 0. If motion program calculations cause this it is not a serious problem. If PLC
0 causes this (no motion programs running) it could be serious.
Bit 20 Servo Error: This bit is 1 if PMAC could not properly complete its servo routines. This is a serious error
condition. It is 0 if the servo operations have been completing properly.