User's Manual

PMAC User Manual
Setting Up PMAC Commutation 91
In the stepper-motor phasing search, PMAC first forces current to put the motor at the +/-60
o
point in the
phasing cycle and waits for the settling time. Then it forces current to put the motor at the 0
o
point in the
phasing cycle and again waits for the settling time. It checks to see that there has been at least 1/16 cycle
(22.5
o
) movement between the two steps. If there has been, it forces the phase position register to 0,
clears the phasing-search-error motor status bit, and closes the servo loop. If it has detected less
movement than this, it sets the phasing-search-error bit, and disables (kills) the servo loop.
If the stepper motor phasing search is done outside the power-on/reset cycle, the phasing search algorithm
will also fail if an amplifier fault or overtravel limit condition is detected. PMAC will set the phasing-
search-error bit and disable the servo loop. If done inside the power-on/reset cycle, PMAC cannot
automatically detect these errors; the search will likely fail due to lack of movement.
Custom Phasing Search Methods
It may be necessary or desirable to write a custom phasing-search algorithm. Usually these are executed
as PMAC PLC programs, but often they can be tried and debugged using on-line commands. The on-line
commands are useful particularly if the phasing search is done only in development to establish a
reference for an absolute sensor.
Most custom algorithms are variations on the stepper-motor phasing search method. They use the phase-
current offset values Ix29 and Ix79 with an O0 command to force current into particular phases so the
motor will lock at a certain physical position in its phasing cycle. The following table shows the positions
in the phasing cycle created by different combinations of Ix29 and Ix79 for 3-phase motors. Usually the
magnitude of the non-zero values are 2000 to 3000:
Ix29
=0 <0 <0 =0 >0 >0
Ix79
>0 >0 =0 <0 <0 =0
Pos(Ix72=85)
0
o
e 60
o
e 120
o
e +180
o
e -120
o
e -60
o
e
Pos(Ix72=171)
+180
o
e -120
o
e -60
o
e 0
o
e 60
o
e 120
o
e
For example, the following set of on-line commands typed into the terminal window of the PMAC
Executive program could be used to force a motor to the zero position in its phasing cycle, set the phase
position register as zero, and enable the motor.
#1O0 ; Enable the motor with open-loop zero magnitude
I129=0 ; No offset on Phase A
I179=3000 ; Positive offset on Phase B to force to 0 deg
; (Ix72=85)
M171=0 ; Write zero into phase position register
I179=0 ; No offset on Phase B
J/ ; Close servo loop
The time between typing the commands would provide sufficient delay for settling into position.
The following PLC program is a good starting point for variants on the stepper-motor phasing search
method. Extensions to this program could be to phase two gantry motors simultaneously or to “step” out
of a position limit. This example uses Ix73 and Ix74 as they would be used in the automatic stepper-
motor phasing search method.
;****************** Set-up and Definitions ********************
CLOSE ; Make sure all buffers are closed
M70->X:$0700,0,24,S ; 24-bit automatic timer register
M271->X:$007D,0,24,S ; Motor 2 phase position register
;****************** Program to do phasing search **************