User's Manual

Turbo PMAC User Manual
Setting Up Turbo PMAC-Based Commutation and/or Current Loop 125
Most custom algorithms are variations on the stepper-motor phasing search method. They use the phase-
current offset values Ixx29 and Ixx79 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 Ixx29 and Ixx79 for 3-phase motors. Usually
the magnitudes of the non-zero values are 2000 to 3000:
Ixx29 =0 <0 <0 =0 >0 >0
Ixx79 >0 >0 =0 <0 <0 =0
(A). Phase Pos. 0
o
e -60
o
e -120
o
e +180
o
e 120
o
e 60
o
e
(B). Phase Pos. +180
o
e 120
o
e 60
o
e 0
o
e -60
o
e -120
o
e
Case (A) shows the resulting positions for all direct PWM systems and for sine-wave output systems with
Ixx72<1024.
Case (B) shows the resulting phase positions for sine-wave output systems with Ixx72>1024.
For example, the following set of on-line commands typed into the terminal window of the 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
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 Ixx73 and Ixx74 as they would be used in the automatic stepper-
motor phasing search method.
;****************** Set-up and Definitions ********************
CLOSE ; Make sure all buffers are closed
M248->X:$000140,8,1 ; Motor 2 phasing error fault bit
M271->X:$000134,0,24,S ; Motor 2 phase position register
;****************** Program to do phasing search **************
OPEN PLC 1 CLEAR
CMD"#2O0" ; Force zero-magnitude open-loop
M248=1 ; Tentatively set phasing error bit
P229=I229 ; Save real Phase A bias
P279=I279 ; Save real Phase B bias
I229=-I273 ; Force negative bias into A
I279=I273 ; Force positive bias into A
I5111=I274*256 ; Starting value for countdown timer
WHILE (I5111>0) ; Wait for prescribed time
ENDWHILE
P271=M271 ; Store phase position at this point
I229=P229 ; Restore real bias to A for 0 deg
I5111=I274*256 ; Starting value for countdown timer
WHILE (I5111>0) ; Wait for prescribed time
ENDWHILE
P271=P271-M271 ; Get difference between two positions
IF (I282>0 OR I272<1024) ; Direct PWM or check analog phase
M271=0 ; Set phase position to zero
ELSE ; Analog system with Ixx72>1024
M271=I271/2 ; Set phase position to 180 deg