Since my lathe is with gearbox and some lash in the gears, I decided to go with an extra drive belted directly on the spindle an be engaged with a clutch.
Setting up C axis in the Wizard is the easy part, but then you can jog the C-Axis while the spindle is running, or turn on the spindle while the clutch is engaged. Would make some funny smoke
So till now the way I build some safety for this is quite simple ( I am not the best PLC programmer )
If P#93=1 C Axis will be displayed on the DRO as rotary axis
If P#93=512 C Axis will not be displayed on the DRO
If P#218 is set to 3 you can only jog X and Z with the WMPG
If P#218 is set to 7 you can jog C, X and Z with the WMPG (C as 4th axis)
I use OUTPUT8 to switch the clutch with M68 / M88
M52 will turn C-axis ON
Code: Select all
;------------------------------------------------------------------------------
; Filename: mfunc52.mac - Turn C-Axis on
; M52 macro
; Description: User Customizable Macro
; Notes: C-axis must be configured in the Wizard
; Requires: custom PLC StandardSpindleStage
; ;Inhibit Spindle when P#93=1 C-axis On - UWE
; IF !SpindleEnableOut_M || SV_MACHINE_PARAMETER_93 == 1 THEN (DoSpindleStop)
;------------------------------------------------------------------------------
IF #50010 ;Prevent lookahead from parsing past here
IF #4201 || #4202 THEN GOTO 1000 ;Skip macro if graphing or searching
M5
G4 P1
#103=1
#104=7
G10 P1093 R[#103]
G10 P1218 R[#104]
; Output8 for Clutch ON
M68
N100
Code: Select all
;------------------------------------------------------------------------------
; Filename: mfunc52.mac - Turn C-Axis off
; M53 macro
; Description: User Customizable Macro
; Notes: C-axis must be configured in the Wizard
; Requires:
;------------------------------------------------------------------------------
IF #50010 ;Prevent lookahead from parsing past here
IF #4201 || #4202 THEN GOTO 1000 ;Skip macro if graphing or searching
#101=512
#102=2
G10 P1093 R[#101]
G10 P1218 R[#102]
; Output8 for Clutch OFF
M88
N100
Code: Select all
;------------------------------------------------------------------------------
; Filename: mfunc55.mac - To run from VCP AUX 10 key, set p197 = 5511
; M55 macro
; Description: Turns C-Axis ON/OFF
; Notes:
; Requires: Machine home must be set prior to use.
;------------------------------------------------------------------------------
IF #50010 ;Prevent lookahead from parsing past here
IF #4201 || #4202 THEN GOTO 1000 ;Skip macro if graphing or searching
N100 ;Insert your code between N100 and N1000
#105=#9093
IF #105==512 THEN M52 ELSE M53
N1000
Code: Select all
;==============================================================================
StandardSpindleStage
;==============================================================================
IF (SpindleEnableOut_M || SpinStart_M ) && !SpinStop_M && ChuckOpenCloseComplete_M
THEN SET SpindleEnableOut_M
; inhibit spindle with C-axis ON - UWE
IF !((SpindleEnableOut_M || SpinStart_M ) && !SpinStop_M) THEN RST SpindleEnableOut_M
IF SpindleEnableOut_M && !M37 && SV_MACHINE_PARAMETER_93 == 512 && !(OUTPUT8) THEN (VFDEnable_O)
IF SpindleEnableOut_M && !M37 && !SpindleDirectionOut_M && SpindleBrakeTimer THEN (SpinFWD)
IF SpindleEnableOut_M && !M37 && SpindleDirectionOut_M && SpindleBrakeTimer THEN (SpinREV), (VFDDirection_O)
IF !SpindleEnableOut_M || SV_MACHINE_PARAMETER_93 == 1 THEN (DoSpindleStop)
Now I must find a clutch that will do the job and figure out if I can use the spindle encoder for setting C Home....
Uwe