User's Manual

PMAC User Manual
Basic Motor Moves 135
I326=0 ; No home offset
I912=3 ; Capture on rising flag and rising index
I913=0 ; Use HMFL3 as flag
CMD"#3HM" ; Do actual homing move
WHILE (M345=1) ; Waits for Home Search to start
ENDWHILE
WHILE (M333=0) ; Waits for Home motion to complete
ENDWHILE
DIS PLC12 ; Disables PLC once Home is found
CLOSE ; End of program
Storing the Home Position
PMAC stores the encoder position that was captured during the latest homing search move for the motor
automatically. This value is kept in the Motor Encoder Position Offset Register [Y:$0815 (Motor 1),
Y:$08D5 (Motor 2), etc.], which is set to zero on power-up/reset for motors without absolute power-on
position. If Ix10>0 to specify an absolute power-on position read from a resolver so no homing is
necessary, this register holds the negative of the power-on resolver position. In either case, it contains the
difference between the encoder-counter zero position (power-on position) and the motor zero (home)
position, scaled in counts.
Note:
Prior to V1.14 firmware, this value could be obtained by using the PLC program
HOMOFFST.PMC. Starting in V1.14, PMAC stores this value automatically.
Uses
There are two main uses for this register. First, it provides a reference for using the encoder position-
capture and position-compare registers. These registers are referenced to the encoder zero position, which
is the power-up position, not the home (motor zero) position. This register holds the difference between
the two positions. This value should be subtracted from encoder position (usually from position capture)
to get motor position, or added to motor position to get encoder position (usually for position compare).
Example:
To move an axis until a trigger is found, then convert the captured encoder position to a motor position,
use the following M-variable definitions:
M103->X:$C003,24,S ; Encoder 1 position-capture register
M117->X:$C000,17 ; Encoder 1 position-capture flag
M125->Y:$0815,24,S ; Motor 1 encoder position offset register
Now use a motion program segment like the following:
INC ; Incremental moves
TM10 TA10 ; Move segment time 10 msec
WHILE (M117=0) ; While no trigger to capture position
X20 ; Command next move segment
ENDWHILE
P103=M103-M125 ; Read captured position; subtract offset to
; get motor position at trigger
The second use for this register is to determine whether the encoder counter has lost any counts. This can
be done by performing a second homing search move after an operation, and comparing the contents of
the register after the second homing search move to the contents after the first homing search move.