Rack ATC Macro Help

All things related to the Centroid Acorn CNC Controller

Moderator: cnckeith

hebs
Posts: 64
Joined: Wed Sep 18, 2019 4:46 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: A81087B53034-0710192235
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: Rack ATC Macro Help

Post by hebs »

Chris has used parameter 700 (a free user parameter) to store the current tool bin location so that the macro and main program can share its value (bin location of current tool). This is so that the code written for the carousel ATC can enable us to do what we want with a rack ATC - it keeps the existing program and macro in sync. The line he wrote to be put in the main.src file (don’t forget to compile it!) makes this possible.

The M18 macro file exists for ATC initialisation only. When you use it for the first time or need to reset after an error during tool change then the M18 macro resets parameter 700 to 1, telling the program that the tool in the spindle is tool 1 and to put it back in bin 1. Once you have done that then you can setup your tool library as you wish.


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: Rack ATC Macro Help

Post by cbb1962 »

hebs, I was wondering if it makes sense to move your error checking to another macro and call that macro from the M6?
Clint in NW Arkansas

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


hebs
Posts: 64
Joined: Wed Sep 18, 2019 4:46 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: A81087B53034-0710192235
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: Rack ATC Macro Help

Post by hebs »

When parameter 160 is set to 1, it triggers the enhanced ATC functionality including all the good bits we need to allow us to edit bin locations, unfortunately it also does all the error handling before the M6 macro, leaving very few error scenarios for any macro to handle afterwards. I don’t think that it will be possible to edit bins ‘on-the-fly’ - if there is an error with the library it just highlights this pre-macro and then stops the process without starting the macro.

I think I remember reading something about another parameter that allows you to do something different on an M6 call..... I’ll have a look.

edit...

Ok, I think that it may be possible using a M17 command and macro. I could edit my post processor to give a M17 command prior to a tool change (triggering a M17 macro that contains all the useful library checks prior to calling M6). The centroid manual also shows that if parameter 162 is set to 1 then intercon will also call M17 pre tool change. I need to check if pressing the F7 key for ATC tool change will also trigger M17... if so then great, this should work perfect.


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

Re: Rack ATC Macro Help

Post by cncsnw »

No, the F7/ATC key will not call M17 (or any other code specified with P162).

The purpose of P162 and M17 is to save some time, when a cut has just been completed (tool is still down at clearance, spindle and coolant are still running), and a tool change is coming up. If you go straight into M6, CNC12 will move the head up to the tool-change level (G28 Z) before it runs any of the codes in the M6 macro. Executing an M code (e.g. M17) while still down there gives you a chance to turn off the coolant and start the spindle-orient process.

Since the F7/ATC key is generally used in setup operations and not in production, there is no reason to look up and run whatever M function might be specified in P162.


Allin1Chris
PLC Expert
Posts: 237
Joined: Wed Jul 31, 2019 12:53 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: Yes
CNC Control System Serial Number: none
DC3IOB: Yes
CNC12: Yes
CNC11: Yes
CPU10 or CPU7: Yes

Re: Rack ATC Macro Help

Post by Allin1Chris »

hebs wrote: Sat Jan 18, 2020 9:47 am Is it possible for me to catch this pre mfunc6.mac? or is the code relating to parameter 160=1 (containing library check etc..) built in to the main program?
This is handled in the software, depending on parameter settings the software handles it differently.
cbb1962 wrote: Sat Jan 18, 2020 1:17 pm
If I understand this correctly this line G10 P700 R1 will Set parameter 700 to a value of 1. Why Parameter 700? shouldn't it be parameter 17000?
As Hebs explained, parameter 700 is required, as the tool that is put back is assigned its bin by the variable SV_PLC_CAROUSEL_POSITION in the PLC before or as the m6 is being ran. Otherwise the bin will remain 0 in the tool library for that tool.
When requesting support READ THIS POST first. http://centroidcncforum.com/viewtopic.php?f=60&t=1043

Please ALWAYS post a FRESH report. To make a report: https://www.youtube.com/watch?v=Ecvg0VJp1oQ.

(We pride ourselves on providing timely solid technical support but, without good information we may not be able to help and/or reply until such information is posted.)

Centroid PLC Tutorial Videos


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: Rack ATC Macro Help

Post by cbb1962 »

Allin1Chris,

Thanks for the reply. I have modified and compiled the PLC changes and I have a finger version of your M6 working! :mrgreen:

I was wondering if you had looked at the error checking that hebs has in his macro? The ability to manage the bin locations and keep them in sync with the real world is very appealing. With that said should, the hundreds of lines of code for error checking make if difficult to follow the macro. Does it make sense to create a macro that just does tool library error checking/maintenance and call that from within the M6?

Chris, since you deal with macros every day, how would you approach what hebs is trying to accomplish?
Clint in NW Arkansas

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


Allin1Chris
PLC Expert
Posts: 237
Joined: Wed Jul 31, 2019 12:53 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: Yes
Oak CNC controller: Yes
CNC Control System Serial Number: none
DC3IOB: Yes
CNC12: Yes
CNC11: Yes
CPU10 or CPU7: Yes

Re: Rack ATC Macro Help

Post by Allin1Chris »

cbb1962 wrote: Mon Jan 20, 2020 12:22 pm I was wondering if you had looked at the error checking that hebs has in his macro? The ability to manage the bin locations and keep them in sync with the real world is very appealing. With that said should, the hundreds of lines of code for error checking make if difficult to follow the macro. Does it make sense to create a macro that just does tool library error checking/maintenance and call that from within the M6?

Chris, since you deal with macros every day, how would you approach what hebs is trying to accomplish?
For a non-random system, the bins for each tool should not change (i.e. Tool 1 should always go to the same bin). This changes for random tool changers for example like a swingarm where it will swap two tools, so tool that was in the spindle is now in the bin of the requested tool, so in this case the tool is always changing bins. The software when the PLC and macro are written properly will keep track where each tool is.

I think a macro that would highlight potential issues with their library could be useful, especially to those who may be new to CNC or just not familiar with ATC systems. As for an approach, i think hebs approach is good even though it may be as he described "hacky". The only thing i would do is change it to use the actual bin variables 17000 series instead of the diameter numbers 13000 series. The approach i took in my ATC macro available in this thread was to simply disallowed the macro to continue with a tool change if the putback bin was equal to the bin of the requested tool, preventing a crash.

As with most things, there is always room for improvement with the macros.
When requesting support READ THIS POST first. http://centroidcncforum.com/viewtopic.php?f=60&t=1043

Please ALWAYS post a FRESH report. To make a report: https://www.youtube.com/watch?v=Ecvg0VJp1oQ.

(We pride ourselves on providing timely solid technical support but, without good information we may not be able to help and/or reply until such information is posted.)

Centroid PLC Tutorial Videos


hebs
Posts: 64
Joined: Wed Sep 18, 2019 4:46 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: A81087B53034-0710192235
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: Rack ATC Macro Help

Post by hebs »

I am working on a library checking macro now. I have learned a great deal from Chris’s macros (thanks Chris!) and can write this correctly now (or less inefficiently than the last one).

It may be misusing the M17 macro, but this is what I intent to use to capture a check before the centroid software runs its own check outside of any macro.


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: Rack ATC Macro Help

Post by cbb1962 »

Any luck hebs?
Clint in NW Arkansas

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


hebs
Posts: 64
Joined: Wed Sep 18, 2019 4:46 pm
Acorn CNC Controller: Yes
Allin1DC CNC Controller: No
Oak CNC controller: No
CNC Control System Serial Number: A81087B53034-0710192235
DC3IOB: No
CNC12: Yes
CNC11: No
CPU10 or CPU7: No

Re: Rack ATC Macro Help

Post by hebs »

Not yet, sorry. Have been tied up with work. I will hopefully get time this weekend.


Post Reply