User's Manual

PMAC User Manual
80 Setting Up a Motor
Table Range
The compensation is defined directly for a range of source motor positions starting at zero counts (the
most recent home or power-up/reset position) and going in the positive direction. The size of this range is
declared as the last argument of the DEFINE COMP command. This argument has units of counts of the
source motor. The spacing between entries is the total range divided by the number of entries (which is
the first argument of the DEFINE COMP command). The first entry in the table defines the correction at
one spacing from the zero position of the source motor, the second entry at two spacings, and so on.
Rollover
Outside of this range, the uncorrected position is rolled over to within this range — essentially a modulo
(remainder) operation — before the compensation is done. This permits compensation of rotary axes over
several revolutions, and simple compensation for encoder eccentricity. Of course, if the table is made big
enough to cover the entire source motor travel, the rollover feature will never be used.
If the motor has a travel range to the negative side of zero, and compensation is desired here, these entries
should be made as if they were past the positive end of the motor range. For instance, if the motor travel
were +/- 50,000 counts and a table entry was to be made every 500 counts (so 200 entries total), the table
would be set up with a DEFINE COMP 200,100000 command.
The first 100 entries would cover the 500 to +50,000 count range, and the last 100 entries would cover the
-50,000 to 0 count range. (Usually the table is referenced so there is a zero correction at the source motor
zero position, so the last entry in the table should be 0.) Essentially, the -50,000 to 0 range would be
mapped into the +50,000 to +100,000 range.
Example:
If the following table were entered:
#1
DEFINE COMP 8,4000 ; Table of 8 entries over 4000 cts belonging to motor 1;
; Uses motor 1 for source & target because no other
; motor specified
-160 ; Correction at 4000/8 (500) cts is -160/16 = -10 cts
80 ; Correction at 1000 counts is 5 counts
120 ; Correction at 1500 counts is 7.5 counts
96 ; Correction at 2000 counts is 6 counts
20 ; Correction at 2500 counts is 1.25 counts
-56 ; Correction at 3000 counts is -4.5 counts
-12 ; Correction at 3500 counts is -0.75 cts
0 ; Correction at 4000 (and 0) cts is zero
and the axis definition were #1->1000X, a commanded move to X1.3 would give an uncorrected motor
position of 1300 counts. The applied correction would be linearly interpolated from the table:
()
counts5.65
500
10001300
*55.7Correction +=+
=
At X8.4, PMAC would calculate an uncorrected motor position of 8400 counts; roll this over to within
the table range: 8400 mod 4000 = 400 counts; and the correction from the table would be:
()
counts80
500
0400
*010Correction =+
=
Enabling and Disabling
All leadscrew compensation tables are enabled when I51 is set to 1. When I51 is set to 0, all are disabled.