C-Axis for lathe (construction in progress)

All things related to the Centroid Acorn CNC Controller

Moderator: cnckeith

suntravel
Posts: 1979
Joined: Thu Sep 23, 2021 3:49 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 6433DB0446C1-08115074
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: Germany

Re: C-Axis for lathe

Post by suntravel »

Spartan117 wrote: Mon Jul 04, 2022 3:44 pm If you are not careful, the lathe will tip over from all the attachments :D

I wish i could give you some tips for your PLC-problems... But hey, even the centroid-pros here seem to be stumped for that kind of problems, so how should i be able to help you :D It's a pity, that PLC-thing could be such a powerful tool with a little bit of support for certain questions.
Even with C-Axis, it will not have more weight than with the original AC-motor ;)

The PLC is very powerfull, it is possible to hire professional support, but well I better learn how to go fishing, than to buy a fish :mrgreen:

Uwe
Spartan117
Posts: 101
Joined: Mon Apr 11, 2022 3:37 pm
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: C-Axis for lathe

Post by Spartan117 »

suntravel wrote: Mon Jul 04, 2022 4:01 pm ...but well I better learn how to go fishing, than to buy a fish :mrgreen:
Me too! But my fishing-teacher is speaking swahili, not german... :lol:
Scary
Posts: 89
Joined: Fri Aug 20, 2021 2:12 am
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: None
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: C-Axis for lathe

Post by Scary »

That looks an awesome setup. I have been looking at similar but I was stuck on the plc side of things. I feel like I might have to borrow some of your code 🤔. I also like the electric clutch idea, beats the air clutch I made because I don’t need to turn the compressor on
suntravel
Posts: 1979
Joined: Thu Sep 23, 2021 3:49 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 6433DB0446C1-08115074
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: Germany

Re: C-Axis for lathe

Post by suntravel »

Scary wrote: Tue Jul 05, 2022 7:13 am That looks an awesome setup. I have been looking at similar but I was stuck on the plc side of things. I feel like I might have to borrow some of your code 🤔. I also like the electric clutch idea, beats the air clutch I made because I don’t need to turn the compressor on
Pls, wait till I have this running, then the PLC code and macros will be debugged, and I post the final version.

Uwe
cnckeith
Posts: 7334
Joined: Wed Mar 03, 2010 4:23 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: Yes
CNC Control System Serial Number: none
DC3IOB: Yes
CNC11: Yes
CPU10 or CPU7: Yes
Contact:

Re: C-Axis for lathe

Post by cnckeith »

suntravel wrote: Sun Jul 03, 2022 7:55 am Now I figured out how to set C home to the zero index pulse from spindle encoder.
G91 is not part of CNC12 lathe, so I used the current position for incremental moves.

Would be better to have the C axis continuous moving to the zero index, but could not figure out how to do this.

Maybe I must find a way to trigger an input with the encoder zero index?
Than I could use M105 /C P#
Any ideas how to do this?

But for now it works to home C allways to the same position.

Code: Select all

;------------------------------------------------------------------------------
; Filename: mfunc57.mac 
; M57 macro
; Description: Set C-Axis Home to Zero Index from Spindle Encoder
; Notes: C-Axis must be turned on
; M200 only for testing, remove later
; #5043 current position C 
; #23405 index pulse from spindle encoder
;------------------------------------------------------------------------------

IF #50010                        ;Prevent lookahead from parsing past here
IF #4201 || #4202 THEN GOTO 1000 ;Skip macro if graphing or searching

G98
N100
#104=#5043+0.1
G0 C[#104] 
N200
IF #23405==1 THEN GOTO 300 ELSE GOTO 100
N300
#105=#23405
M200"Spindle Pos=%f"#105
#102=#5043
M26 /C
#101=#5043
M200"C set from%f to 0 CPos=%f"#102#101


Uwe
search Zri homing for related posts.. and see page 24 https://www.centroidcnc.com/centroid_di ... amming.pdf
Need support? READ THIS POST first. http://centroidcncforum.com/viewtopic.php?f=60&t=1043
All Acorn Documentation is located here: viewtopic.php?f=60&t=3397
Answers to common questions: viewforum.php?f=63
and here viewforum.php?f=61
Gear we use but don't sell. https://www.centroidcnc.com/centroid_di ... _gear.html
Allin1Chris
Posts: 135
Joined: Wed Jul 31, 2019 12:53 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: Yes
CNC Control System Serial Number: none
DC3IOB: Yes
CNC12: Yes
CNC11: Yes
CPU10 or CPU7: Yes

Re: C-Axis for lathe (construction in progress)

Post by Allin1Chris »

suntravel wrote: Tue Jun 28, 2022 1:56 pm I started to build a C-axis for my lathe.
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 :mrgreen:

So till now the way I build some safety for this is quite simple ( I am not the best PLC programmer :D )

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                             
M53 will turn C axis OFF

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 
On the VCP is use M55 to switch ON and OFF

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 
And some edit in the PLC to inhibit spindle ON if C-axis is on

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)
Not the most elegant solution, but it works :mrgreen:

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
Parameter 93 has a special Option for C-Axis (Add a 16, This will automatically hide and show the C-Axis on the DRO with M50/M51). Attached is how i would setup the C-Axis Macros for M50/M51. Because there is a conflict with M50, i moved the existing Part 0 All Axes to M45, i also have this attached. Will have to change VCP button to reflect change in M-Code though.

As for PLC, the acorn does require some additional code in PLC to prevent spindle from turning on. Here is what i did,

Code: Select all

M51_SV                        IS SV_M94_M95_51 ;(C-Axis Enable)

; JOGBOARD SPINDLE CONTROL (Add M51_SV to SpinStop_M)
IF (SpinStopKey || KbSpinStop_M || SkinSpinStop_M || MpgSpinOff_M) ||
	(SpinAutoModeLED && !(M3 || M4)) ||
	(SV_PC_RIGID_TAP_SPINDLE_OFF && SpinAutoModeLED) ||
	ProbeSpindleInhibit_M || SV_STOP || ErrorFlag_M || LimitTripped_M ||
	 M51_SV
   THEN (SpinStop_M)
   
;Under MainStage, Add Logic to turn on Output for Clutch
;CAxisEnable
IF M51_SV THEN (CAxisEnable) ;Will need to Assign "CAxisEnable" to an Output for this to compile.

;--M-Codes (Add M51_SV to be reset when exiting Job or MDI)
;    Reset these M-codes if not in CNC Program Running mode
IF !(SV_PROGRAM_RUNNING || SV_MDI_MODE) || SV_STOP
  THEN RST M3,
       RST M4,
	   RST M6,		   
           RST M8,
           RST M7,
           RST M10M,
	   RST M10L,
	   RST M11L,
	   RST M18,
	   RST M3P,
	   RST M35,
	   RST M51_SV

Attachments
mfunc45.mac
(2.37 KiB) Downloaded 33 times
mfunc51.mac
(1.23 KiB) Downloaded 32 times
mfunc50.mac
(1007 Bytes) Downloaded 30 times
When requesting support READ THIS POST first. http://centroidcncforum.com/viewtopic.php?f=60&t=1043

Please ALWAYS post a FRESH report. To make a report: https://www.youtube.com/watch?v=Ecvg0VJp1oQ.

(We pride ourselves on providing timely solid technical support but, without good information we may not be able to help and/or reply until such information is posted.)

Centroid PLC Tutorial Videos
suntravel
Posts: 1979
Joined: Thu Sep 23, 2021 3:49 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 6433DB0446C1-08115074
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: Germany

Re: C-Axis for lathe (construction in progress)

Post by suntravel »

Allin1Chris wrote: Tue Jul 05, 2022 10:55 am .......


Parameter 93 has a special Option for C-Axis (Add a 16, This will automatically hide and show the C-Axis on the DRO with M50/M51). Attached is how i would setup the C-Axis Macros for M50/M51. Because there is a conflict with M50, i moved the existing Part 0 All Axes to M45, i also have this attached. Will have to change VCP button to reflect change in M-Code though.

As for PLC, the acorn does require some additional code in PLC to prevent spindle from turning on. Here is what i did,

Code: Select all

M51_SV                        IS SV_M94_M95_51 ;(C-Axis Enable)

; JOGBOARD SPINDLE CONTROL (Add M51_SV to SpinStop_M)
IF (SpinStopKey || KbSpinStop_M || SkinSpinStop_M || MpgSpinOff_M) ||
	(SpinAutoModeLED && !(M3 || M4)) ||
	(SV_PC_RIGID_TAP_SPINDLE_OFF && SpinAutoModeLED) ||
	ProbeSpindleInhibit_M || SV_STOP || ErrorFlag_M || LimitTripped_M ||
	 M51_SV
   THEN (SpinStop_M)
   
;Under MainStage, Add Logic to turn on Output for Clutch
;CAxisEnable
IF M51_SV THEN (CAxisEnable) ;Will need to Assign "CAxisEnable" to an Output for this to compile.

;--M-Codes (Add M51_SV to be reset when exiting Job or MDI)
;    Reset these M-codes if not in CNC Program Running mode
IF !(SV_PROGRAM_RUNNING || SV_MDI_MODE) || SV_STOP
  THEN RST M3,
       RST M4,
	   RST M6,		   
           RST M8,
           RST M7,
           RST M10M,
	   RST M10L,
	   RST M11L,
	   RST M18,
	   RST M3P,
	   RST M35,
	   RST M51_SV

Thank you Chris, this helps me to understand better how this PLC works...

Uwe
suntravel
Posts: 1979
Joined: Thu Sep 23, 2021 3:49 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 6433DB0446C1-08115074
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: Germany

Re: C-Axis for lathe (construction in progress)

Post by suntravel »

I made some calculations about the setup of the driver and overall gear ratio for the C-Axis.
My Driver supports no Steps per rev like 3600 or 7200, so the overall gear ratio must be 4.5 / 9 / 45 or 90
This makes sure the CNC can calculate full steps for the positions in degree up to 0.1° resolution

Keep this in mind if you build your own.

You can use the spreadsheet to find a useful combination.

Uwe
Attachments
DriveCalc.xls
(13.5 KiB) Downloaded 21 times
DriveCalc.jpg
suntravel
Posts: 1979
Joined: Thu Sep 23, 2021 3:49 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 6433DB0446C1-08115074
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: Germany

Re: C-Axis for lathe (construction in progress)

Post by suntravel »

Had milled the parts to mount the C-Axis drive today, the machine are building themselves, with a bit of human input :D

Uwe
Attachments
20220710_161508.jpg
20220710_161441.jpg
20220710_161437.jpg
20220710_160741.jpg
20220710_160731.jpg
20220710_160648.jpg
20220710_160635.jpg
20220710_160625.jpg
20220710_155802.jpg
suntravel
Posts: 1979
Joined: Thu Sep 23, 2021 3:49 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 6433DB0446C1-08115074
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: Germany

Re: C-Axis for lathe (construction in progress)

Post by suntravel »

Now it works for first testing, but still waiting for the clutch....



Got this running today, but I will make some more complex things with it like shown here :mrgreen:

Uwe
Post Reply