ATC macro help

All things related to the Centroid Acorn CNC Controller

Moderator: cnckeith

bmilam
Posts: 152
Joined: Sun Sep 16, 2018 7:51 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: No

ATC macro help

Post by bmilam »

I'm a Newbie at macros so hope that you understand. I have a simple linear tool rack with pockets that the tools sit in, no fingers. I have made a rack and got all of my machine coordinates for each hole (10 total). Tonight I started an attempt at editing the macro. My spindle is very basic. The only function in it is to release/ grab the tool using the same function. It doesn't recognize one function from the other and has no other air controls to blast the cone or tools with. I think that I have the macro partially completed correctly. I want to move the tool to the bin, lower to the tool rack height and release the tool. Then I want it to move to the next bin and on the way down, activate the spindle to grab the tool and hold that until it is at the correct height then release grabbing the tool. Hopefully that makes sense.

Do I combine line 79 and 80 into one line and add a time delay or how would I go about accomplishing this? If left like I am reading the macro, once it got to the height it would try to push the tool holder down, deforming the rack and I don't think that would be good over time. If I try to find a height that it grabs the tool without pushing it into the rack, it isn't consistent on grabbing the tool.

I tried to attach as a downloadable file but for some reason my notebook++ stopped letting me save it as the correct type of file.

One other question, I see where to place the tool rack height but how does it know the height of the tool change? Just retracts until it trips the limit switch?
Here it is.

; File: mfunc6.mac
; Desc: Tool change macro for no finger rack mount ATC
;
; Inputs:
; ToolIsUnclamped IS INP2
;
;
; Outputs:
;
; ToolUnclamp IS OUT8
;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;

O9101
;Enter the XY coordinate of Tool #1
G53 X6.3231Y96.9599
M99

O9102
;Enter the XY coordinate of Tool #2
G53 X11.1710Y96.9599
M99

O9103
;Enter the XY coordinate of Tool #3
G53 X16.019Y96.9599
M99

O9104
;Enter the XY coordinate of Tool #4
G53 X20.8670Y96.9599
M99

O9105
;Enter the XY coordinate of Tool #5
G53 X25.7148Y96.9599
M99

O9106
;Enter the XY coordinate of Tool #6
G53 X30.563Y96.9599
M99

O9107
;Enter the XY coordinate of Tool #7
G53 X35.4107Y96.9599
M99

O9108
;Enter the XY coordinate of Tool #8
G53 X40.2787Y96.9599
M99

O9109
;Enter the XY coordinate of Tool #9
G53 X45.1265Y96.9599
M99

O9110
;Enter the XY coordinate of Tool #10
G53 X49.9675Y96.9599
M99

; Variable Definitions:
;#150 = Tool currently in the spindle
#100 = -7.7132 ; Z height of tool rack

;skip if graphing or searching or if at the same tool
IF [[#4120] == [#150]] || #4202 || #4201 THEN GOTO 500

IF (#150 == 0) THEN #150 = 1 ; Initialize tool
G28 ; Move to tool change height
M3 S0 ; Turn the spindle on
M98 P[#150 + 9100] ; Go to tool location for the tool that's in the spindle
G53 G1 Z[#100] F10 ; Move Z down to the tool rack
M15 ; Unclamp the tool

G28 ; Move Z up to tool change height
M98 P[#4120 + 9100] ; Go to the desired tool location
G53 G1 Z[#100] F10 ; Move Z down to the tool rack
M16 ; Clamp the tool
G28 ; Move Z up to tool change height
IF #50001 ; Prevent lookahead from parsing past here
#150 = #4120

N500


David Buchhauser
Posts: 26
Joined: Mon Sep 16, 2019 10:47 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: C122564
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: Tucson, Arizona
Contact:

Re: ATC macro help

Post by David Buchhauser »

Here is your file in .mac format.
David
mfunc6.mac
(1.63 KiB) Downloaded 190 times


bmilam
Posts: 152
Joined: Sun Sep 16, 2018 7:51 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: No

Re: ATC macro help

Post by bmilam »

Thanks going to have to get notepad++ going again


bmilam
Posts: 152
Joined: Sun Sep 16, 2018 7:51 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: No

Re: ATC macro help

Post by bmilam »

Talked with David and I think that I was over thinking the operation of the macro. I think I understand how it works now and I need to go back and put the tool clamp input and output back in.


martyscncgarage
Community Expert
Posts: 9955
Joined: Tue Mar 28, 2017 12:01 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: No
CNC Control System Serial Number: none
DC3IOB: No
CNC12: Yes
CNC11: Yes
CPU10 or CPU7: Yes
Location: Mesa, AZ

Re: ATC macro help

Post by martyscncgarage »

bmilam wrote: Sun Jan 12, 2020 12:31 am Talked with David and I think that I was over thinking the operation of the macro. I think I understand how it works now and I need to go back and put the tool clamp input and output back in.
Let us know how you make out...
Marty
Reminder, for support please follow this post: viewtopic.php?f=20&t=383
We can't "SEE" what you see...
Mesa, AZ


bmilam
Posts: 152
Joined: Sun Sep 16, 2018 7:51 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: No

Re: ATC macro help

Post by bmilam »

Thanks Marty will do.


bmilam
Posts: 152
Joined: Sun Sep 16, 2018 7:51 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: No

Re: ATC macro help

Post by bmilam »

I've worked with this all afternoon and just can't seem to get it to work. I've changed so many outputs and things trying that I won't even get into which ones and how. When I go into the diagnostics screen, I go to the output assigned output and when I trigger it once it puts a line under the dot, a second time gives a green light and the unclamp button is activated on the machine. I try to load a simple gcode file using multiple tools. The gantry travels all the way to the home position at the front of the machine then uses tool #1 that is in the spindle. Then it goes to the tool rack and lowers to put tool #1 in it's bin. Moves to the next location and lowers to pick up the tool and the program stops. The screen says "Waiting for memory #232 (M101)". It never activates the button at any point to release or grab a tool.

Here's a video of it running. I'm very much a noob at this so any help would be appreciated.


mfunc6.mac
(1.63 KiB) Downloaded 132 times



David Buchhauser
Posts: 26
Joined: Mon Sep 16, 2019 10:47 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: C122564
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No
Location: Tucson, Arizona
Contact:

Re: ATC macro help

Post by David Buchhauser »

I'll be very interested to find out what is going on here as well. I'm planning to do the same thing, only with forks instead of the "no forks" approach that Bobby is using.
Thanks,
David


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: ATC macro help

Post by cbb1962 »

Code: Select all

G28 ; Move to tool change height
G28 is the Tool Change Position. X, Y, and Z not just move to the tool change height.

I commented out G28 and replaced each instance with:

Code: Select all

G53 Z0 
That will stop it from going to the front of the machine each time.

When I was getting my M6 macro working I would go to the MDI and enter an M15/M16 to test for clamp/unclamp.

My M15 and M16 are different than yours

Code: Select all

;------------------------------------------------------------------------------
; Filename: mfunc15.mac
; Description: Tool unclamp macro
; Notes:
; Requires: 
;
; Inputs:
; ToolIsUnclamped IS INP2
;
; Outputs:
; ToolUnclamp IS OUT8
;------------------------------------------------------------------------------

IF #50010                        ;Prevent lookahead from parsing past here
IF #4201 || #4202 THEN GOTO 1000 ;Skip macro if graphing or searching

N100                             ;Insert your code between N100 and N1000  

M94 /15                          ;Turn on ToolUnclamp request
IF (#9402 != 0) THEN GOTO 200
G4 P0.5                           ;Wait 0.50seconds
GOTO 1000

N200
M101 /70012                      ;Wait until tool is unclamped

N1000                            ;End of Macro

Code: Select all

;------------------------------------------------------------------------------
; Filename: mfunc16.mac
; Description: Tool clamp macro
; Notes:
; Requires: 
;
; Outputs:
; ToolUnclamp IS OUT8
;------------------------------------------------------------------------------

IF #50010                        ;Prevent lookahead from parsing past here
IF #4201 || #4202 THEN GOTO 1000 ;Skip macro if graphing or searching

N100                             ;Insert your code between N100 and N1000  

M95 /15                          ;Turn on ToolUnclamp request

N1000                            ;End of Macro
Maybe this will help
Clint in NW Arkansas

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


cncsnw
Community Expert
Posts: 4595
Joined: Wed Mar 24, 2010 5:48 pm

Re: ATC macro help

Post by cncsnw »

The M15 and M16 macros from bmilam's report do not match the PLC program or the M6 macro.

Perhaps Keith or Chris could comment.


Post Reply