New Build - 'Audit' CNC - Lathe Attachment

All things related to the Centroid Acorn CNC Controller

Moderator: cnckeith

Chaz
Posts: 826
Joined: Thu Feb 08, 2018 7:57 am
Acorn CNC Controller: No
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: New Build - 'Audit' CNC - Lathe Attachment

Post by Chaz »

I've managed to get the Tool Turret motor replaced with a 400W Servo as I have no way to easily drive the 110V 3 Phase AC motor on the existing setup. I am back to trying to code the ATC Macro. I tried the Wizard created Axis driven type, which should work, its only a Rachet and Pawl type setup but its not.

So I prefer to just code it myself. I can use similar code to what I used on the Emco 320 however I'd prefer something simpler.

We discovered that I cant do G91 incremental moves on a lathe and therefore Uwe suggested U V W etc for X Y Z, however I cant find anything that tells me how I can move an A Axis incrementally on a lathe.

Chat GPT offers this as a workaround which Ill try ...

"#100 = #5021 (current A axis position system variable)
G90
G1 A[#100 + 15.0] F100 (move 15° relative to current position)"

Of course #100 is used elsewhere for messaging but its more the point of the code ...


Chaz
Posts: 826
Joined: Thu Feb 08, 2018 7:57 am
Acorn CNC Controller: No
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: New Build - 'Audit' CNC - Lathe Attachment

Post by Chaz »

So, really struggling getting the maths right and found a bit of a hacky way to do it which seems to work in terms of the movement.

Unwind turret
Move to position
Wind the turret back in

Problem is that its not updating the Tool once its done. Is there anything in my code stopping this? So it will do a change, from Tool 1 to Tool 8, movement is spot on, but then it just says T0108. It's taken the offset but hasnt applied the Tool Number which means that all subsequent tool changes are therefore wrong.

Thanks


;------------------------------------------------------------------------------
; Description: Tool Change Macro - AuditCNC
; Notes:
; Requires: CNC12 V5.30
; Revision Date: 16 August 2025

;------------------------------------------------------------------------------
; Parameters:
; Variables from PLC:
; #96052 = CurrentTurretPosition_W
; #9830 = #96028 = ATCType_W
;
; System Variables Used:
; #4120 = requested tool
; #20601-#20604 = Counts per unit for axes1-4
; #5021-#5024 is the current machine position for axes 1(#5021) through 4(#5024)
;
; Parameters:
; #9161 = Number turret positions (Parameter 161)
;
; User Variables:
; #100 = Display Message Timer
; #101 = Calculated Current Turret Position.
; #102 = Calculated Requested Turret Position.

#100 = 0 ;Ensure M225 Messages appear for indefinite time

#111 = 10000 ;Feedrate for A Axis
#112 = 0.2 ; Delay Timer
#113 = 55 ;Unwind Distance
#114 = -55 ;Wind Distance

;------------------------------------------------------------------------------
IF #50001 ;Prevent lookahead from parsing past here
IF #4201 || #4202 THEN GOTO 1000 ;Skip macro if graphing or searching
IF #4120 == #96052 THEN GOTO 1000 ;Skip macro if at requested tool position

;---------------------------------------------------------------------------------
; Rachet and Pawl Tool Turret Code
;---------------------------------------------------------------------------------
;---------------------------------------------------------------------------------
; Calculate Number of Moves
;---------------------------------------------------------------------------------

IF #4120 > #4203 THEN #117 = 45*(#4120 - #4203) ELSE #117 = 45*(8+(#4120 - #4203))

;---------------------------------------------------------------------------------
; Unwind from Location First
;---------------------------------------------------------------------------------

G1 A[#113] F#111
G4 P#112
M26/A
G4 P#112

;---------------------------------------------------------------------------------
; Move Forward Calculated Distance
;---------------------------------------------------------------------------------

G1 A[#117] F#111
G4 P#112
M26/A
G4 P#112

;---------------------------------------------------------------------------------
; Wind Turret In
;---------------------------------------------------------------------------------

G1 A[#114] F#111
G4 P#112
M26/A
G4 P#112

GOTO 1000

N1000

IF #50001 ;Prevent lookahead from parsing past here
G4 P0.5 ;Wait 0.5 seconds
M95 /7 ;Turn off request to change tool


Chaz
Posts: 826
Joined: Thu Feb 08, 2018 7:57 am
Acorn CNC Controller: No
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: New Build - 'Audit' CNC - Lathe Attachment

Post by Chaz »

A quick vid shows the code doing what it needs to do but the Tool number doesnt update.



Chaz
Posts: 826
Joined: Thu Feb 08, 2018 7:57 am
Acorn CNC Controller: No
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: New Build - 'Audit' CNC - Lathe Attachment

Post by Chaz »

Ive got it working by putting this code in, snipped from another thread. I'd like to understand why this is needed. It was working before and I have other lathe tool change macros without this that work. What's different?

G10 P1976 R[#4120] ;Set parameter 976 to tool number

Thanks


Chaz
Posts: 826
Joined: Thu Feb 08, 2018 7:57 am
Acorn CNC Controller: No
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: New Build - 'Audit' CNC - Lathe Attachment

Post by Chaz »

Any thoughts on this please anyone?

Thanks


Allin1Chris
PLC Expert
Posts: 244
Joined: Wed Jul 31, 2019 12:53 pm
Acorn CNC Controller: Yes
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: Yes
Hickory CNC Controller: No
Oak CNC controller: Yes
CNC Control System Serial Number: none
DC3IOB: Yes
CNC12: Yes
CNC11: Yes
CPU10 or CPU7: Yes

Re: New Build - 'Audit' CNC - Lathe Attachment

Post by Allin1Chris »

By Setting P976 you are setting the value for SV_PLC_CAROUSEL_POSITION in the PLC for the current tool on the turret, which is needed for CNC12 to display the current Tool. Were your previous Turret's also axis driven or was their motion handled by the PLC?
When requesting support READ THIS POST first. viewtopic.php?t=1043

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

(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


Chaz
Posts: 826
Joined: Thu Feb 08, 2018 7:57 am
Acorn CNC Controller: No
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: New Build - 'Audit' CNC - Lathe Attachment

Post by Chaz »

Thanks for the response.

On my Emco 320, its custom code, a bit like this and I dont need the same command and it works.

I did for a short time run the 'built in' code on my Denford Orac but never checked if it had that line.

I'm home tomorrow so I can share my report for the Emco320 and/or share the Macro. Its hacky, but it works but it doesnt have this updating of P976 in it at all.

Ive done around 10 retrofits now, various machines, some mill, some lathe. Ive never seen the line being used before.


Chaz
Posts: 826
Joined: Thu Feb 08, 2018 7:57 am
Acorn CNC Controller: No
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: New Build - 'Audit' CNC - Lathe Attachment

Post by Chaz »

Has anyone seen anything like this before?



Ive tried different spindle speeds, doesnt matter. Effectively I get 3.5V max at full speed - measured with a multimeter. I then simply pull the connector out, push it back in, it goes to 10V and max speed.

Ive even seen this just stopping the spindle and restarting it, max speed. Most of the time, it however stops at 3.5V.

I dont think its noise, its consistently (capped) but oddly goes to max when I reconnect or sometimes stop / restart it.

You can also see in the vid, as I decrease the speed you can hear it slowing proportionally, then basically just falling off a cliff and going back to the lower voltage and going back up a few steps, it remains capped at the slower speed.

Any ideas?


suntravel
Community Expert
Posts: 3763
Joined: Thu Sep 23, 2021 3:49 pm
Acorn CNC Controller: Yes
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory 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: New Build - 'Audit' CNC - Lathe Attachment

Post by suntravel »

post a report pls.

Do the spindle bench test measuring the voltage with nothing attached to the output.

Is there a spindle encoder and is the spindle really 7000 rpm?

Uwe


Chaz
Posts: 826
Joined: Thu Feb 08, 2018 7:57 am
Acorn CNC Controller: No
Plasma CNC Controller: No
AcornSix CNC Controller: No
Allin1DC CNC Controller: No
Hickory CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: New Build - 'Audit' CNC - Lathe Attachment

Post by Chaz »

Latest Report Attached in case it might help.
Attachments
report_880CE0342ECD-0529259564_2025-08-22_16-07-03.zip
(1.15 MiB) Downloaded 1 time


Post Reply