Download PMAC2 User`s Manual

Transcript
3A0-602413-363
START POSITION
EQUn
AUTO-INCREMENT
STARTING
COMPARE B
REGISTER
STARTING
COMPARE A
REGISTER
Figure 11-2. Setup For Multiple Pulses
Example
Starting from the above example, desiring the compare output on between 1000
and 1010 counts, but adding an auto-increment value of 2000 counts, with a
starting position of about 100 counts, program code to start the sequence could
be:
M110=2000
M108=1000
M109=1010-M110
M112=0
M111=1
;
;
;
;
;
Auto-increment of 2000 encoder counts
First front edge at 1000 counts
First back edge at 1010 counts
Prepare initial value of 0
Enable direct write (resets immediately to zero)
Converting from Motor and Axis
Coordinates
The compare registers are scaled in encoder counts, referenced to the power-up
position. Typically, the user wants to work in either motor coordinates, still in
counts and referenced to the home position, or in axis coordinates, in
engineering units (mm, inches, degrees) and referenced to a user-set origin.
Two values are needed to convert motor position to encoder position for
compare calculations. First is the home capture offset, the encoder position
captured at the home trigger, a value PMAC stores for future use. The second is
the home offset variable Ix26, which contains the difference between the trigger
position and the home position. The relationship is:
EncoderPosition = MotorPosition + HomeCaptureOffset + HomeOffset
PMAC2 User’s Manual – 15 March 1997
12-5