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 ...
Re: New Build - 'Audit' CNC - Lathe Attachment
Posted: Sat Aug 16, 2025 8:41 am
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.
;------------------------------------------------------------------------------
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
;---------------------------------------------------------------------------------
;---------------------------------------------------------------------------------
; 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
Re: New Build - 'Audit' CNC - Lathe Attachment
Posted: Sat Aug 16, 2025 9:10 am
by Chaz
A quick vid shows the code doing what it needs to do but the Tool number doesnt update.
Re: New Build - 'Audit' CNC - Lathe Attachment
Posted: Sun Aug 17, 2025 8:32 am
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
Re: New Build - 'Audit' CNC - Lathe Attachment
Posted: Wed Aug 20, 2025 2:32 am
by Chaz
Any thoughts on this please anyone?
Thanks
Re: New Build - 'Audit' CNC - Lathe Attachment
Posted: Wed Aug 20, 2025 9:57 am
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?
Re: New Build - 'Audit' CNC - Lathe Attachment
Posted: Wed Aug 20, 2025 12:43 pm
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.
Re: New Build - 'Audit' CNC - Lathe Attachment
Posted: Fri Aug 22, 2025 10:28 am
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?
Re: New Build - 'Audit' CNC - Lathe Attachment
Posted: Fri Aug 22, 2025 10:47 am
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?