Acorn ATC Overview....Updated 2-26-24

Moderator: cnckeith

diycncscott

Acorn ATC Overview....Updated 2-26-24

Post by diycncscott »

<cnckeith update 2-26-24>

The CNC12 v5.08 for Acorn and AcornSix Wizard now supports many common type Tool Changers for Lathes, Mills and Routers.

Even if your particular tool changer is not directly supported the Wizard generated PLC and Macros can be user edited to fine tune the ATC logic for proper operation. Introduction and Overview document. https://www.centroidcnc.com/centroid_di ... _guide.pdf

wizard atc.png

_______________________________________________________________________________________

Everything below is archival.. please use cnc12 v.5.08+ and use the Wizard to setup your ATC
https://www.centroidcnc.com/centroid_di ... loads.html


The following is an overview of using an ATC with Acorn with beta samples of PLC programs that you can use as is or modify to your needs.

Improved v4.6+ ATC program set with instructions download link is located in the "All Acorn Documentation" Thread.

https://centroidcncforum.com/viewtopic.php?f=60&t=3397

cnckeith adds: updated 8-28-20

All ATC plc program and macros have been updated to be compatible with CNC12 v4.5
CNC12 v4.5 is required to use these programs.


ACORN CNC ATC PLC/Macro programs download link for use with CNC12 v4.5
https://www.centroidcnc.com/centroid_di ... ograms.zip
use as is OR edit to your needs.
atc_acorn_plc.PNG
atc_acorn_plc.PNG (7.34 KiB) Viewed 14936 times
Introduction to Centroid Macro Programming.
https://www.centroidcnc.com/centroid_di ... amming.pdf


Marty's Step by Step Lathe turret setup video














Complete documentation on PLC programming can be found in the
"CNC11 PLC Programming Manual":
http://www.centroidcnc.com/downloads/CN ... Manual.pdf

When programming PLC's the "PLC Detective" is an AWESOME Tool. Press ctrl-e
from the main screen in your Acorn to start it. It allows you to view
real-time status of I/O in the PLC program as well as capture timing sequences.
PLC Detective Quickstart Manual:
http://www.centroidcnc.com/downloads/ce ... kstart.pdf

cnckeith adds..6-24-19 YouTube Video series on PLC programming for newbie's is here..


NOTE: Not all I/O described here needs
to necessarily be defined. Instead of waiting for an input to close, such as
RackIsUp, ToolUnclamped, CarouselIsIn etc.. a simple dwell could be used to
give the action time to take place. Ideally, you would have an input to
confirm an action has taken place but there is not always enough I/O to go
around or there is no sensor for a particular action. M function numbers used
are generally flexible - if you chose to program M80 to unclamp your tool you
certainly could.

Performing a tool change for any ATC, regardless of type, consists of the following sequence.

1. Control should be configured for ATC. For both mill and lathe, Parameter 6 is set to a 1 and Parameter 161 should be set
to the max tool # positions. Parameter 160 denotes an "enhanced ATC" on mill. "enhanced ATC" should be set = 1 (non-random). Random ("Arm Type") tool changers are beyond the scope of this document. See the PLC programming manual for more information.

2. G code line calls for a tool change ie.. T6M6 in mill, or T0606 for lathe.

3. The control parses the tool change request, retrieves the requested tool position, does a look up to find the position/bin number for the requested tool number and stores the bin number/position in system variable #4120.

NOTE: For some tool change configurations, the tool number is the same as the bin number/position. Just keep in mind multiple tool numbers can use the same bin number/position and that #4120 and the value sent by M107 is the bin number/position number NOT the tool number. If parameter 160 = 0, #4120 and the value sent by M107 will = tool number.

4. The control call the tool change macro - mfunc6.mac (M6) for mill and cnctch.mac for lathe.

5. Both mill and lathe tool change macros are typically structured as follows:

a) Header comments that note the name of the file, date created, programmer name, purpose. etc.. It is also a good idea to list any I/O and m functions being used in the comments.

b) Code that prevents look-ahead from prematurely evaluating or assigning values to variables. This is typically just an if statement that evaluates and I/O bit. Evaluation of I/O bits forces parsing to halt until the control is actually executing the line of code evaluating the I/O bit. Note: The THEN is not required following the IF statement if no action other than to halt parsing is required.
IF #50001 ;Prevent lookahead


c) Code that prevents the macro from being run if graphing or searching
;If graphing or searching, skip to end of macro.
IF #4202 || #4201 THEN GOTO #### ;where #### = a block N#### inserted
;at end of macro such as N1000

d) Code to compare the current tool with the requested tool. If they are the same, skip to the end of macro. Note: If parameter 160 is set to a 1 or 2, the CNC12 software will skip the macro entirely if the tool in the spindle = requested tool. This is logic is included in the tool change macro here is to show that it is part of the sequence and, depending on the tool changer type (such a rackmount), may be required. #150 is a persistent user variable (keeps it's value between power ups)

IF #4120 == #150 THEN GOTO ####

e) Code to turn off spindle and coolant. Note, only 1 m code allowed per line
M5
M9

f) Code to pre position machine for tool change.
; You can either hard code a machine position here or use a return point which you have previously defined.
G30 P1

g) For Mill, Code to request orient spindle or Rack Up for rackmount - requires mfunc19.mac macro and PLC logic. May not be needed on some tool changers.
M19



h) Confirm spindle is oriented or RackIsUp - Waits until INP7 is closed.
M101 /7

i) Code to request tool change - not needed for most rackmounts.
M94 /6

j) For Mill only, code to wait for turret to move to position to put back the existing tool. This code would exist in the PLC for Carousel type tool changers For rackmount, it would typically be a move to a machine position which is a clearance position for the tool being put away.
M101 /70013 ;Wait for PLC to indicate tool turret
;is in position to put back current
;tool. ReadyForPutBack(MEM13 set). ;

k) For Mill only.
Umbrella type - code to move tool turret to position to put existing tool back in pocket. M80 requires mfunc80.mac macro and PLC logic. Rackmount - G code move to machine position to put existing tool back in pocket.
M80 ;Request to move tool turret to spindle
M101 /50002 ;Wait for ToolTurretIsIn(INP2) to close
G4 P1 ;Give tool turret 1 second to settle
M101 /50002 ;Check ToolTurretIsIn(INP2) again

l) Mill - Code to unclamp tool -requires mfunc15.mac macro and PLC logic.
Lathe - Code to unlock turret -requires mfunc15.mac macro and PLC logic.
M15

m) Mill- Wait for ToolUnclamped - INP6 closed
Lathe- Wait for turret unclamped
M101 /6

m) Mill - Move to clearance
G53 Z0

n) Mill - code to move turret to position to get new tool. This code would exist in the PLC for Carousel type tool changers.
For rackmount, it would typically be a move to a machine position to get new tool.
Lathe- code to move turret to position to get new tool. This code would exist in the PLC.

o) Mill only. Code to move Z to clamp/unclamp position
G28 G91 Z-???

p) Mill - Code to clamp tool -requires mfunc16.mac macro and PLC logic.
Lathe - Code to lock turret -requires mfunc16.mac macro and PLC logic.
M16

q) For Mill only.
Umbrella type - code to move tool turret away from spindle. M81 requires mfunc81.mac macro and PLC logic.
Rackmount - G code move to machine position to to clear rack.

r) For Mill only - rackmount only. Code to move RackDown -requires mfunc20.mac macro and PLC logic.
M20

s) Code to confirm is tool change ready to complete.
For Mill, wait for an input that indicates tool turret is retracted from spindle.
Rackmount, wait for an input that RackIsDown
For lathe, wait for an input that indicates turret is locked
M101 /??

t) For lathe and non-rackmount mill, wait for plc to indicate tool change is complete.
M101 /???

u) Update variable to store tool in spindle
#150 = #4120

v) Tool change is complete. turn off tool change request. End of macro
M95 /6
N####
diycncscott

Re: Acorn ATC Overview

Post by diycncscott »

Chaz wrote: Sat Feb 17, 2018 6:00 pm Can anyone using a rotary tool turret share their cnctch.mac file please? Any help with this or the PLC bits will be much appreciated, struggling to get to grips with this.

Thanks.
Chaz - please see this topic for my reply viewtopic.php?f=60&t=1544&p=9586#p9586
Threedj16
Posts: 224
Joined: Thu Feb 22, 2018 1:21 am
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: C8FD19F23AFF-0213180659
DC3IOB: No
CNC11: No
CPU10 or CPU7: No
Location: Augusta, Ga

Re: Acorn ATC Overview

Post by Threedj16 »

First question. In the Dec 13, 2017 Acorn_Lathe_PLC.src file (the latest, best I can tell since I've installed this software within the last 30 days) this is what is on lines 36-39. But when I pull up the parameter pages in CNC12, the pages skip fro 399 to 900. So I'm trying to figure out whether I am missing some parameter pages?
;SV_MACHINE_PARAMETER_830 = ATC Type, 0 = none. 1 = incremental, 2 = incremental w/sync,
; 4 = absolute 3bit, 8 = absolute 4bit, 16 = switched reverse
; 32 = self reversing
;
Next question:
diycncscott wrote: Thu Feb 22, 2018 10:15 am No need for stepper motor if your turret already has sensors. Control interaction and PLC for an incremental type turret would look something like the following:

Program asks for T0101

Control calls cnctch.mac to do tool change

Tool number sent down from cnctch.mac with M107 command

PLC determines if it is already at correct location. If not, rotate turret

;Rotate turret
IF M6 && (RequestedTurretPosition_W != CurrentTurretPosition_W) THEN SET RotateToolTurret

;Update turret position every time the ToolCounterInput fires
;Use 1 shot so tool counter only increments once when input is turned on
IF ToolCounterInput THEN ToolCounter(PD)
IF RotateToolTurret && ToolCounter(PD) THEN CurrentTurretPosition_W = CurrentTurretPosition_W+1

;Handle rollover - set parameter 161 to max # tool positions in turret. If 6 positions, then set to 1 after passing 6
IF CurrentTurretPosition_W > SV_MACHINE_PARAMETER_161 THEN CurrentTurretPosition_W = 1

;Report position to software
IF True THEN SV_PLC_CAROUSEL_POSITION = CurrentTurretPosition_W

;Note control stores the last known location of tool turret on shutdown so you can use SV_ATC_CAROUSEL_POSITION to initialize the turret
;position on power up. No need for home switch if the turret doesn't move while powered off


Turret positioning and live position reporting handled with 1 output and 1 input...
You may need a second output to reverse turret to lock depending on your turret.
M6 wasn't defined in the M functions section, I added it in (not sure if what I did was correct, just used a commented out spot between M8 and M7. ToolCounterPD was also not defined in the one shot section. So I added it in after PD38 since there was an opening until PD41. Not sure if any of this is correct. But it wouldn't compile before and did after I added.

Lastly, this is this bit of code for the ATCIncrementalStage section of the same acorn_lathe_plc.src file stated at the top:
AtcIncrementalStage
;------------------------------------------------------------------------------
;For incremental ATC's, ToolTurretPosBit1 is the tool counter and toggles each time the
;turret rotates to a tool position. If ToolTurretPosBit1 toggles while ReverseToolTurret is
;not on, then CurrentTurretPosition_W = CurrentTurretPosition_W + 1. If ToolTurretPosBit1
;toggles while ReverseToolTurret is on, then CurrentTurretPosition_W = CurrentTurretPosition_W -1.
;IF ToolTurretPosBit1 && RotateToolTurret && !ReverseToolTurret
;THEN CurrentTurretPosition_W = CurrentTurretPosition_W + 1

;IF ToolTurretPosBit1 && RotateToolTurret && !ReverseToolTurret
;THEN CurrentTurretPosition_W = CurrentTurretPosition_W - 1
Isn't the net result of this 0 since both statements have nots? This was the stage originally, I've added some of your suggestions above trying to test.

Below is my current report where you can see the changes I made. Any of my earlier reports from my worklight help request post won't have the updates I made, so you can see the items missing (viewtopic.php?f=60&t=1742) . Unfortunately the worklight still isn't working for the Aux7 button based on the code you''ll gave me. I've tried changing it several times, but just can't find a working example to mimic it anywhere.

I'll try and setup a tech support call in the morning so maybe we can get this ironed out. I'm really liking CNC12 and learning how it works (maybe soon I'll turn some chips...LOL). Sorry for all the questions here, but trying to learn this code and then finding what appears to be conflicts is making this hard.
report_C8FD19F23AFF-0213180659_2018-04-19_22-43-03.zip
(182.61 KiB) Downloaded 353 times

I posted here so you would see it, but you can just move to my original turret thread if you prefer - viewtopic.php?f=60&t=1710&start=20

Thanks,
Jasen
diycncscott

Re: Acorn ATC Overview

Post by diycncscott »

Jason,
None of the code you are posting is supported yet. That's why it's located in deactivated stages, the one shots and macros are not defined and it is not present in the Wizard.
That said, is your turret uni or bi-directional? Does it a turret clamp output? Does it reverse to clamp? Does it require a separate output to reverse or does it self reverse when the rotate output is turned off? How many positions are on your turret? I assume you have a single, incremental sensor?
Threedj16
Posts: 224
Joined: Thu Feb 22, 2018 1:21 am
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: C8FD19F23AFF-0213180659
DC3IOB: No
CNC11: No
CPU10 or CPU7: No
Location: Augusta, Ga

Re: Acorn ATC Overview

Post by Threedj16 »

diycncscott wrote: Sat Apr 21, 2018 12:26 pm Jason,
None of the code you are posting is supported yet. That's why it's located in deactivated stages, the one shots and macros are not defined and it is not present in the Wizard.
That said, is your turret uni or bi-directional? Does it a turret clamp output? Does it reverse to clamp? Does it require a separate output to reverse or does it self reverse when the rotate output is turned off? How many positions are on your turret? I assume you have a single, incremental sensor?
It's a simple incremental (6 tool positions) with an input for each tool position (input 6 defined as ToolTurretPosBit1) and one input for tool 1 or home (input 5 defined as ToolTurrentPosSynBit). The turret motor is always in reverse when the system is powered up, holding the turret position against a pawl. So when a tool change is called, output 2 (defined as RotateToolTurret) should activate, which is setup to move the turret forward off the pawl. The snag I see is when the turret is reversed into the pawl, ToolTurretPosBit1 turns off. So when activating RotateToolTurret to move to the required position, it will activate ToolTurretPosBit1 once for the current tool, then again for each tool position it passes until it gets to the requested position.

So I would call that a uni directional (since activating it will only move it one direction, deactivating it auto-reverses into pawl). No turret clamp output. Just the two inputs and one output I described above.

Thanks,
Jasen

Current report with one shots, inputs, outputs and M codes defined for turret code.
report_C8FD19F23AFF-0213180659_2018-04-21_12-54-32.zip
(216.15 KiB) Downloaded 345 times
Threedj16
Posts: 224
Joined: Thu Feb 22, 2018 1:21 am
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: C8FD19F23AFF-0213180659
DC3IOB: No
CNC11: No
CPU10 or CPU7: No
Location: Augusta, Ga

Re: Acorn ATC Overview

Post by Threedj16 »

Here's my ATC thread for all the details and where I am at with the source (and latest report). viewtopic.php?f=60&t=1710&p=11514#p11514
cnckeith
Posts: 7165
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: Acorn ATC Overview

Post by cnckeith »

We are working on adding ATC auto configuration support into the Acorn Wizard. In the meantime we have created plc code and schematic that supports typical 4 bit grey code Lathe Turret. Please find the precompiled ready to run files here...

http://www.centroidcnc.com/centroid_diy ... turret.zip

instructions and schematic are included in the zip file above.
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
Mstcnc
Posts: 3
Joined: Sat Aug 25, 2018 3:56 am
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: Acorn ATC Overview

Post by Mstcnc »

cnckeith wrote: Wed Sep 05, 2018 11:26 am We are working on adding ATC auto configuration support into the Acorn Wizard. In the meantime we have created plc code and schematic that supports typical 4 bit grey code Lathe Turret. Please find the precompiled ready to run files here...

http://www.centroidcnc.com/centroid_diy ... turret.zip

instructions and schematic are included in the zip file above.
In the instructions:
"Configuration of Turret Gray Logic
Edit “turret-tool-settings.txt” to set the R values for each position of the turret according to the turret input
combinations that are closed at a particular tool/turret position."

There is no “turret-tool-settings.txt” file in the zip file.
Should there be?

Everything else seems to be ok.

Regards Mika
cnckeith
Posts: 7165
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: Acorn ATC Overview

Post by cnckeith »

Mika,
hello. sorry my bad.. fixed..please re download..same link has updated zip file. K
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
Mstcnc
Posts: 3
Joined: Sat Aug 25, 2018 3:56 am
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC11: No
CPU10 or CPU7: No

Re: Acorn ATC Overview

Post by Mstcnc »

Hi,
I am realy taken how easy ATC was set up! It just works!
Only some minor tweaking to get timing right.

Testing rigid tapping is next...

One question I have.
With centroid supplied files I did loose VCP (virtual control panel)
Tried set parameter 219 non zero, but no go.
If I try set it ON with wizard I loose ATC.

I want to learn more about PLC programs, so which files have VCP settings?

Kind regards Mika

report_985DADECD6FC-0530180939_2018-09-14_20-23-38.zip
(246.14 KiB) Downloaded 332 times
Locked