Acorn ATC Overview

All things related to the Centroid Acorn CNC Controller

Moderator: cnckeith

Post Reply
diycncscott
Posts: 660
Joined: Thu Mar 04, 2010 4:03 pm

Acorn ATC Overview

Post by diycncscott » Thu Jan 04, 2018 3:16 pm

The following is an overview of using an ATC with Acorn. I'll post the entire
content here as I go. When complete, I will attach a pdf of the information
contained in this post for downloading. 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.

The pdf will be available here: (not yet available)

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


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####

Chaz
Posts: 10
Joined: Thu Feb 08, 2018 7:57 am
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: No
MPU11 & GPIO4D -w/ 3rd Party Drives: No
DC3IOB: No
CNC11: No
CPU10 or CPU7: No
System Serial Number: none

Re: Acorn ATC Overview

Post by Chaz » 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
Posts: 10
Joined: Thu Feb 08, 2018 7:57 am
Acorn CNC Controller: No
Allin1DC CNC Controller: No
Oak CNC controller: No
MPU11 & GPIO4D -w/ 3rd Party Drives: No
DC3IOB: No
CNC11: No
CPU10 or CPU7: No
System Serial Number: none

Re: Acorn ATC Overview

Post by Chaz » Sun Feb 18, 2018 4:36 pm

For reference, this is what I am trying to do. Nothing too spectacular. For reference, this is a stepper motor on the A Axis. I cannot trigger it via a relay or similar. So I guess I cannot trigger an output like below (found in another thread)?

TurretMotor IS OUT2 ;&*;


https://www.youtube.com/watch?v=-cCDulVashA

Here is the Mach 3 M6 code to make this happen. Can anyone please help me translate this into Centroid capable language please?

Thanks

If IsLoading() Then
' Do Nothing, program loading
Else

' Dim Variables

Dim Num_Tools As Integer
Dim CW_Steps_Per_Tool As Integer
Dim CCW_Steps As Integer
Dim HoldingDRO As Integer
Dim Requested_Tool As Integer
Dim Current_Tool As Integer
Dim CW_Feed As Integer
Dim CCW_Feed As Integer

Dim moves As Integer
Dim total_move As Integer


' set up some vars

Num_Tools = 8
CW_Move_Per_Tool = 360/Num_Tools
CCW_Move = 10
HoldingDRO = 1050
Requested_Tool = GetSelectedTool()
Current_Tool = GetUserDRO(HoldingDRO)
CW_Feed = 1500
CCW_Feed = 1000
Current_Feed = GetOEMDRO(818)


' start tool change

Message ("Requested Tool No=" & Requested_Tool)

If Requested_Tool > Num_Tools Then
Message "Requested Tool No. too high, program stopped."
Code "M30"
End
End If

If Requested_Tool < 1 Then
'Message "Requested Tool No. too low, program stopped."
Code "M30"
End
End If

If Requested_Tool = Current_Tool Then
' do nothing
Else
' lets do some changing
If Requested_Tool > Current_Tool Then moves = Requested_Tool -Current_Tool
If Requested_Tool < Current_Tool Then moves = Num_Tools - Current_Tool +Requested_Tool

total_move = (moves * CW_Move_Per_Tool)+(CCW_Move/2)

Code "G91 G94" 'incremental & Feed per minute
Code "G0 A" & total_move '& "F" & CW_Feed
Code "G0 A" & "-" & CCW_Move '& "F" & CCW_Feed
While IsMoving()
Wend

SetCurrentTool Requested_Tool
SetUserDRO HoldingDRO, Requested_Tool
Code "G90" ' back to absolute movement
Code "F" & Current_Feed
End If
End If

Post Reply

Who is online

Users browsing this forum: No registered users and 2 guests