User's Manual

PMAC User Manual
Setting Up a Motor 75
Setting the Trigger State
The process bits — bits 16 to 23 of the first Y-word in the conversion table entry — of a single triggered
time-base entry will take on three values during the normal course of use. This is done with an 8-bit M-
variable. First, with the slave axes dwelling at their starting position, these process bits should be set to
$90 in the sequence of motion program calculations for the first move. This forces the time-base value to
zero, putting the coordinate system in feed-hold mode.
Next, another program, usually a PLC program, changes the bits from $90 to $B0. This arms the time-
base, so that it is waiting for the position-capture trigger on the source encoder, as defined by
Encoder/Flag I-variable 2 for that encoder. When the capture occurs, the time base starts up, with the
captured-position register used as the initial value for the time-base difference equations. When this
happens, PMAC automatically changes the process bits from $B0 to $A0. For untriggered use of this
format, set the process bits to $A0.
Example
For example, if adding a triggered time-base entry working from Encoder 8 to the end of the standard
conversion table, with a real-time input frequency of 64 cts/msec. These entries would reside in registers
$072A(1834) and $072B (1835). Initially we would write to Y:$072A a value of $A0C01C (running
time-base from Encoder 8 registers), and to Y:$072B a value of $800 (131,072 / 64 = 2048 = $800). We
define an M-variable to the process bits with the command M199->Y:$072A,16,8.
With the slave axes dwelling at the start-up position, freeze the time base with the motion program
command M199=$90. If Ix93 is not already pointing to X register $072B, do this at this time. The
motion program commands immediately following this calculate the move, but with a zero time-base
value, the move execution is stuck at the starting point. Meanwhile, a PLC program is looking for M199
to be equal to $90, at which time it changes it to $B0, arming for the trigger. Since a PLC program
cannot interrupt motion program calculations for a move, this will not be done until after the calculations
are completed. This change can be done with three program lines in a PLC program:
IF (M199=$90)
M199=$B0
ENDIF
Once the trigger is armed by the PLC program, when the capture trigger occurs, PMAC starts the time
base and changes the process bits to $A0 automatically.
Exponential-Filter Entries
It is possible to use the conversion table to create an exponential filter on a word of input data. This is
particularly useful for position following (electronic gearing), especially when the slave is geared up from
the master; i.e., the slave moves more than one count for each count of the master, where it can
significantly smooth the motion of the following axis.
The equation of the exponential filter executed every servo cycle n is:
Out(n) = Out(n-1) + (K/2
23
)*[In(n)-Out(n-1)]
If [Out(n) - Out(n-1)] > Max_change, Out(n) = Out(n-1) + Max_change
If [Out(n) - Out(n-1)] < -Max_change, Out(n) = Out(n-1) - Max_change
In, Out, and K are all signed 24-bit numbers (range -8,388,608 to 8,388,607). The difference [In(n)-
Out(n-1)] is truncated to 24 bits to handle rollover properly.
The time constant of the filter, in servo cycles, is 2
23
/K. The lower the value of K, the longer the time
constant. No shifting action is performed. Any operations such as 1/T interpolation should have been
done on the data already, so typically the source register for this filter is the result register of the previous
operation.