User's Manual

PMAC User Manual
226 Synchronizing PMAC to External Events
Instructions for the Triggered Time-Base
Using the triggered time-base feature involves proper setup of I-variable values, M-variable definitions,
and conversion table entries (these can be done ahead of time), writing motion programs, and writing PLC
programs. Each of these is covered in this section, first with a general explanation, then with a specific
example.
Step 1: Signal Decode Setup
The signal decoding of the master signal is the same as for standard time-base: the quadrature or pulse
and direction signal must be decoded so that the counter counts up. This is set with Encoder I-variable 0
(I900, I905, etc.).
Step 2: Interpolation and Time-Base Setup
The triggered time-base conversion in the encoder conversion table handles both the 1/T count
interpolation and the time-base calculation from the interpolated value. In the initial setup, a triggered
time-base entry is created in the conversion table, usually in the running (not frozen or waiting for trigger)
state. The time base scale factor is also entered here; it is calculated in exactly the same way as for the
standard time base.
Step 3: Writing the Motion Program
In writing the motion program that is to use triggered time base, all of the axes must be brought to a stop
at the point where they will wait for the trigger. If this is not at the beginning of the motion, the section
should be preceded immediately by a DWELL command.
At the start of the calculations for the moves that are to be started on the trigger, the time base should be
frozen to prevent the move from starting. Use an M-variable that has been assigned to the process bits for
the triggered time base entry in the conversion table. If the previous moves were done working from a
different time-base source, the time-base address for the coordinate system (Ix93) should be changed to
the triggered time-base entry.
These commands in the motion program are followed immediately by the calculations and commands for
the first move(s) that are to be started on the trigger. With the time-base frozen, PMAC will perform all
of the calculations, but not start actual execution of these moves. Variable I11 (calculation delay) should
be set to 0, so PMAC will be ready to start the move as soon as the time base starts.
Step 4: Arming the Trigger
The motion program that calculates the moves cannot arm the trigger itself without having a chance that
the trigger could occur before the calculations are done. If this were to happen, the program would be
behind the desired synchronization. Therefore, for reliable operation, the trigger should be armed by a
task that cannot execute until all of the move calculations are done, usually a PLC program. Arming the
trigger requires just one simple conditional branch in a PLC program; it just looks to see if the time base
is frozen, and if it is, the PLC program arms the trigger. Since the PLC program cannot interrupt the
motion program, this is guaranteed to happen after the motion program has finished the calculations for
the move.
Step 5: Starting on the Trigger
Once the trigger has been armed, PMAC waits for the position-capture trigger to occur on the master
encoder. Encoder/Flag I-variables 2 and 3 determine which edge(s) of which signal(s) cause the trigger.
When PMAC sees that the trigger has occurred, it starts the time base, using the captured master position
as the starting point for the time base.
Triggered Time-Base Example
Motor #1 is the A-axis in Coordinate System 1. It is a rotary axis with a 2500 line-per-revolution encoder
on the motor, and its load is geared down from the motor at a 3-to-1 ratio. It is to be slaved to a master
encoder connected to PMAC on Encoder 4.