Acorn ATC for Router

All things related to the Centroid Acorn CNC Controller

Moderator: cnckeith

Post Reply
Ronnie_CNC
Posts: 2
Joined: Fri Nov 10, 2017 7:39 pm
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: Yes

Acorn ATC for Router

Post by Ronnie_CNC »

Hello Im trying to implement a ATC for a router I already have a mfunc6.mac macro that i modified basically I think it need only a output for the Spindle unclamp/clamp with M15/M16 well Im no realy shure :roll: and Parameter 6 to 1. Well have a few cuestions.

1) I need to change the Parameter 161 to 8 ?

Here is the macro.

;-------------------------------------------------------------------------------
; Tool Change Macro (M6) Linear Rack ATC for Router 8 tools
; Date: 9-11-2017
; Requires: that user set #150 to the tool number that is currently in the spindle.
; If no tool is in the spindle, the macro will command the
; machine to move directly to the new tool location while
; at the Z axis tool change clearance position.
;
;---------------------------NOTES--------------------------------
; The user must set the value for #105 below to the incremental
; distance between pots on the X axis and set #103 to the Y axis
; position for tool changes and #104 to the X axis position of the
; first tool pot. The macro then determines the positions for the
; put back tool and the new tool as follows:

; Putback location for variable axis = [[[[#150]-1]*7.530] + 33.865]
; ((("tool in spindle" -1) * (Incremental distance between pots))
; + "variable axis (X) tool change position for tool 1")

; Requested tool location for variable axis = [[[[#4120]-1]*7.530] + 33.865
; ((("requested tool number" -1) * (Incremental distance between pots))
; + "variable axis (X) tool change position for tool 1")

; Skip tool change macro if in search or graphing mode
If #4201 || #4202 THEN GOTO 600

;---------------------Begin Tool change--------------------------
; Initialize variables
N50
;M0
If !#50001 then
M107 ; Send tool number
G4 P.25
If #4120 == #150 THEN GOTO 600 ; Skip if tool already in spindle
If #151 == 1 THEN GOTO 450 ; Previous unsuccessful - FAULT
#151 = 1 ; Set tool change flag
;M103 /10 ; Start action timer. If tool change
; > 10 seconds to complete - issue fault

M107 ; Send tool number

#100 = [#4003] ; Store positioning mode -G90 or G91
G90 ; Set to absolute
#101 = -14.275 ; Set Z axis tool change position
#102 = -2.125 ; Set Z axis tool change clearance position
#103 = -0.4 ; Set fixed axis (Y) tool change position for was 62.95 when y homed to front
; tool 1
#104 = 33.865 ; Set variable axis (X) tool change position
; for tool 1
#105 = 7.530 ; Incremental distance between pots
#106 = 8 ; Number of tool bins in rack
#107 = 0 ; Message timer 0 = force cycle start
#108 = 1.00 ; Pull Back Increment in Y

; Check for valid tool and putback number

If #4120 < 0 THEN GOTO 400 ; Go to fault if tool number invalid
If #4120 > [#106] THEN GOTO 400 ; Go to fault if tool number invalid
If #150 > [#106] THEN GOTO 400 ; Go to fault if putback location invalid
If #150 < 0 THEN GOTO 400 ; Go to fault if putback location invalid
If !#50011 THEN ; Force update to variables before proceeding

N100 ;Turn off spindle/coolant, move Z to clearance extend rack
;M0
If !#50001 then
M5 ; Turn off spindle

G53 Z#102 ; Rapid Z axis tool change clearance position


N200 ;Putback previous tool
;M0
If !#50001 then
If [#150] == 0 Then GOTO 300 ; Skip putback if no tool in spindle
G53 X[[[[#150]-1]*#105]+#104]Y[#103-#108] ; Rapid to putback X,Y clearance pos.
G53 Z#101 ; Rapid to Z axis tool change pos
G53 X[[[[#150]-1]*#105]+#104]Y#103 ; Rapid to putback X,Y pos.
M15 ; Unclamp Tool
G91 Z.1 ; Move Z up slightly to allow tool to release
G90 ; Set back to absolute
G4 P1
If !#50001 then
G53 Z#102 ; Rapid Z axis tool change clearance position

N300 ;Get new tool
;M0
If #4120 == 0 Then GOTO 500
If !#50001 then
M15 ; Turn On Unclamp
G53 X[[[[#4120]-1]*#105]+#104]Y#103 ; Rapid to requested X,Y tool pos
G53 Z#101 ; Rapid to Z axis tool change pos
M16 ; Turn off unclamp output
G4 P1

If !#50001 then ; Wait for tool to clamp (input 24 to open)
G53 X[[[[#4120]-1]*#105]+#104]Y[#103-#108] ; Rapid to putback X,Y clearance pos.
If 1 == 1 Then GOTO 500 ; Tool change complete, skip fault

N400 ; #150 not intialized or tool number out of range fault
;M0
If !#50001 then
If #150 > #106 Then M225 #107 "FAULT: Putback location(%.0f) invalid" #150
If #150 < 0 Then M225 #107 "FAULT: Putback location(%.0f) invalid" #150
If #4120 > #106 Then M225 #107 "FAULT: Invalid tool location(%.0f) invalid" #4120
If #4120 < 0 Then M225 #107 "FAULT: Invalid tool location(%.0f) invalid" #4120
If 1 == 1 Then GOTO 400

N450 ;Previous tool change did not complete successfully
;M0
If !#50001 then
If 1==1 Then M224 #150 "FAULT: Previous Tool Change Unsuccessful\nPlease enter the putback location for the\ntool which is currently in the spindle:\n(Enter 0 if no tool present)"
#151 = 0
If 1 == 1 Then GOTO 50 ;Restart tool change

N500 ; Tool change succesfull, End macro
;M0
G53 Z#102

If !#50001 then
#150 = #4120 ;Set #150 = tool in spindle
#151 = 0 ;Clear tool change flag
G[#100] ;Restore positioning mode
;M104 ;Cancel program action timer

N600 ; Done
G43 H#4120 ;Set correct tool height offset


----------------------------------------------------------------------------------------------
----------------------------------------------------------------------------------------------

2) The other question is. The macro call the M107 but what is really happened? :( where is send the tool number? do i need to use the bcd on a ATC rack Router? necessary?

Best Regards.
diycncscott

Re: Acorn ATC for Router

Post by diycncscott »

Hello.

For a rack mount style tool changer, nearly all logic is done in the Mfunc6.mac so really the only parameter that needs to be set is parameter 6 to a 1 to let the control know it's an ATC.

When a tool change is requested in your program, CNC12 will call mfunc6.mac

Assuming 8 tools with #101-#108 assigned to X rack positions for tools 1-8 and #111-#1118 assigned to Y rack positions for tools 1-8
Machine moves in Y axis between tool on ran rack and X tool position -10 is a valid clearance position
#109 = Z axis tool clamp/unclamp height
#110 = ZZ axis clearance height. (height to move at between tools.)
N1000 is the last line in your mfunc6.mac and #150 was assigned to the last tool number

Your mfunc6.mac will:

1. Assign XY values to tool positions values and Z clamp/clearance positions - All positions should be in machine position

(statically entered while setting up machine
#101 = 25.4500 ;X axis rack position for Tool #1*
#111 = 100.4562 ;Y axis rack position for Tool #1
#

etc.. etc.. for tools 2-8
#109 = -4.1234 ;Z axis clamp/unclamp position
#110 = 0 ;Z axis clearance position

2. Skip the tool change entirely if:
a) The control is either just graphing or searching. -> IF #50010 ;Prevent lookahead from parsing past here
IF #4201 || #4202 THEN GOTO 1000 ;Skip macro if graphing or searching
b) Read the requested tool number and skip IF #150 == #4120 THEN GOTO 1000 ;Skip macro if req tool = current.
if requested tool is already in spindle .

2. Return current tool to it's pocket
a) Z to home G53 Z0
b) Raise rack??? M#? (# M function number for rack up)
c) Wait until rack is up??? M101/5000# (INP# for rack up)
d) Move XY to X clearance for current tool G53 x[100 + [#150-10]] y[110 + [#150]]
e) Move to Z axis clamp/unclamp position: G53 z[#109]
f) Move XY to put away current tool G53 x[100 + [#150]] y[110 + [#150]]

3. Unclamp tool
a) M# (# M function number for UnclampTool)
b) Wait until tool is unclamped??? M101/5000# (INP# for ToolIsUnclamped or M100/ wait for ToolIsClamped to open )

4. Move to Z clearance
a) G53 Z[#110]

5. Move to XY Position for requested tool
a) G53 x[100 + [#4120]] y[110 + [#4120]]

6. Move to clamp position
a) G53 Z[#109]

7. Clamp Tool
a)M# (# M function number for ClampTool)
b) Wait until tool is clamped??? M101/5000# (INP# for ToolIsClamped or M100/ wait for ToolIsUnclamped to open )

8. Assign #150 to tool in spindle
a) #150 = #4120*

9. Move to X clearance position
a) G53 x[[#150] -10]

10 .Macro complete.

*When assigning values to variables, I always insert a IF #50001 line before and after the assignment to prevent look-ahead in the control from assigning values before the program has actually progressed to that point.

A good way of troubleshooting and proofing macros is to load the macro as a job (F2 load). Insert a tool number at the beginning of the top of the mfunc6.mac and then run single block mode to step through the macro.
Ronnie_CNC
Posts: 2
Joined: Fri Nov 10, 2017 7:39 pm
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: Yes

Re: Acorn ATC for Router

Post by Ronnie_CNC »

Scott Thanks for your input!

By the way the Router specs are:

Cantilever heavy duty router diy
3 1.8kw Ac DMM Servo
12.5hp atc colombo spindle no need for spindle orientation
60" travel on the X, 23" Y and 13" Z
C5 20mm pitch Ball Screw on 3 axis
1500 IPM RAPID POSITIONING

So 1-3 input on the Acorn are used for XYZ Home/Limit
8 to the Estop
5 for Driver OK
6-7 Probe
But only have one input left 4 for M100/M101/5000# confirmations. Then i´ll need to sacrify the probe input or wiring all the Home/Limit to an input? and for the Raise rack M#? (# M function number for rack up) it will be fixed or i will try to implement a external working sensor proximity type to rise the rack o take off the cover when the spindle is close by pneumatic cylinder don´t know if it´s secure. At the moment don't have any pics but i'll post
diycncscott

Re: Acorn ATC for Router

Post by diycncscott »

With the defeat limit capability in the Virtual Control Panel, you could easily daisy chain the limits and home switches into a single input without sacrificing anything.

If you really wanted the probe, you could configure the probe detect input to monitor an Estop, DriveOk or Limit/Home input as well (though you would have to set the parameter manually).

The above will free up 4 inputs for other uses.
cbb1962
Posts: 349
Joined: Wed Jan 03, 2018 10:04 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: 38D2695C8301-0122180576
DC3IOB: No
CNC11: No
CPU10 or CPU7: No
Location: NW Arkansas

Re: Acorn ATC for Router

Post by cbb1962 »

Ronnie_CNC wrote: Fri Nov 10, 2017 11:15 pm Hello Im trying to implement a ATC for a router I already have a mfunc6.mac macro that i modified basically I think it need only a output for the Spindle unclamp/clamp with M15/M16 well Im no realy shure :roll: and Parameter 6 to 1. Well have a few cuestions.
Ronnie,

Were you able to get it working? Can you post the completed macro and the parameters you had to set?

Clint
Clint in NW Arkansas

The more I learn, the more I realize I don't know...
Post Reply