User manual

Geo Brick Drive User Manual
Motor Setup 193
Absolute Power-On Phasing Example PLCs (Yaskawa):
With the motor phase position offset established, the phase position register can now be modified on
power-up to compensate for the calculated offset. This allows the user to issue jog commands or close the
loop and run a motion program on power-up or reset.
Channel 1 driving a 16-bit Yaskawa absolute encoder
#define Mtr1PhasePos M171 ; Suggested M-Variables
Mtr1PhasePos->X:$B4,24,S
#define Mtr1PhaseErr M148 ; Suggested M-Variables
Mtr1PhaseErr->Y:$C0,8
#define Mtr1CommSize I171 ;
#define Mtr1CommCycles I170 ;
#define Mtr1CommRatio P170 ; Motor 1 commutation cycle size (Ixx71/Ixx70 counts)
Mtr1CommRatio=Mtr1CommSize/Mtr1CommCycles
Open plc 1 clear
Mtr1PhasePos = ((Mtr1STD4_15 % Mtr1CommRatio) - PhaseOffset_16Bit) * 32 * Mtr1CommCycles
Mtr1PhaseErr = 0
Disable plc 1
Close
Channel 1 driving a 17-bit Yaskawa absolute encoder
#define Mtr1PhasePos M171 ; Suggested M-Variables
Mtr1PhasePos->X:$B4,24,S
#define Mtr1PhaseErr M148 ; Suggested M-Variables
Mtr1PhaseErr->Y:$C0,8
#define Mtr1CommSize I171
#define Mtr1CommCycles I170
#define Mtr1CommRatio P170 ; Motor 1 commutation cycle size (Ixx71/Ixx70 counts)
Mtr1CommRatio=Mtr1CommSize/Mtr1CommCycles
Open plc 1 clear
Mtr1PhasePos = ((Int((Mtr1STD0_23&$1FFFF0)/$F) % Mtr1CommRatio) - PhaseOffset_17Bit) * 32 *
Mtr1CommCycles
Mtr1PhaseErr = 0
Disable plc 1
Close
Channel 1 driving a 20-bit Yaskawa absolute encoder
#define Mtr1PhasePos M171 ; Suggested M-Variables
Mtr1PhasePos->X:$B4,24,S
#define Mtr1PhaseErr M148 ; Suggested M-Variables
Mtr1PhaseErr->Y:$C0,8
#define Mtr1CommSize I171
#define Mtr1CommCycles I170
#define Mtr1CommRatio P170 ; Motor 1 commutation cycle size (Ixx71/Ixx70 counts)
Mtr1CommRatio=Mtr1CommSize/Mtr1CommCycles
#define TwoToThe20th 1048576
Open plc 1 clear
If (Mtr1STD4_23 !< PhaseOffset_20Bit)
Mtr1PhasePos = (Mtr1STD4_23 - PhaseOffset_20Bit) * 32
Else
Mtr1PhasePos = (TwoToThe20th - PhaseOffset_20Bit + Mtr1STD4_23) * 32
EndIf
Mtr1PhaseErr = 0;
Disable plc 1
Close
Note
It is highly recommended to try the sequence in this PLC manually at
first (using the terminal window). In some cases, the Motor Phase
Position Offset has to be added instead of subtracted depending on the
direction of the encoder mounting/decoding. Turbo PMAC has no
control on the direction of serial encoder data