Hello Guest it is June 14, 2025, 05:41:28 PM

Author Topic: ATC Build With Macros - Use it if you like  (Read 11469 times)

0 Members and 1 Guest are viewing this topic.

ATC Build With Macros - Use it if you like
« on: January 10, 2025, 03:33:47 AM »
Hi everyone - I thought to share this - Since I believe it is impressive.    I tried to upload the photos, but cant seem to. 

I build my own Auto Tool Changer with a n pneumatic tool rack.  10 Tools.  The biggest challenge was the dust shoe.  I decided to make a spot where I can park the dust shoe.  You will see it on the photos. 

The dust shoe top section (Attached to spindle), Bottom section (Brushes) and the parking spot holder where all 3d printed - If you want this models let me know - I will Glady make them available.

The CNC is a basic Chinese version that I bought and upgraded.  Im running a Pokeys 57 CNC.     I bought a ATC Spindle on AliExpress.  I do agree this might not be the best on but because of budget and production time I'm willing to upgrade this is the future.    The cost of the Spindle is only a small part of the whole solution.  The programming time, tool rack.  Pneumatics all add up and I had to spend my budget wisely.

M6 - Tool Change Macro
m110 - Toggle Draw Bar On Spindle (Output 2 - Set to relay2 Pokeys)
M120 - Toggle Tool Rack (Output 3 - Set to relay1 Pokeys)
M1005 - Fixed probe on bed to measure tool length and update Tool Table
M1010 - Normal Z probe to measure material Height.

The M6 macro is where all the magic happens.

I used the sample scripts to access to ToolRack database as created in the scripting Tutorial.  Just a bit adjusted.  I added a field for what tool is loaded.  Look at the .csv in the modules folder. 
Slot, Tool Num, X,Y,Z

I also make use of Mach4 Tool Database for length offsets. 

This way I can load tool 23 as an example into slot 1 if I want to. Not limited to only 10 tools.   Just update the CSV with your changes.  I'm busy writing an editor for the CSV into the Screen. Not yet completed. 

Keep in mind all ATC G00 and G01 happen in G53 (Machine).
First step is to park the Dust shoe.

Whenever M6 is called the Macro checks if a slot is allocated for the Current Loaded tool.  If Not, it goes into a Manual Tool Drop Mode otherwise it will proceed to store the tool in the tool rack. 
If no tool is currently loaded, the macro moves on to Loading Section.

On Loading, Same rule applies - If the requested tool is not configured in the tool rack, the macro goes into a Manual Loading Mode.      If the tool rack is configured and loaded with the correct tool t he macro will go ahead and load the tool.

Pick Up the Dust Shoe.

If the select tool length is set to 999 in the tool database, the M6 will call m1005 to re-measure the tool length and update tool database.  Useful for tool breaks or something.  All Manual Tool Loads will be re measure. 

Once done, the tool length offset is applied.  And G00 back to where the M6 was called. 

If M6 T0 (Unload tool) was called, M6 will clear tool offsets and park the Spindle at the dust shoe after the loaded tool was stored.  It Will not move back to original position.   This works for me as my bed is accessible and no tool loaded.  Got practice at the end of each job.

Future plans are to input my VFD and Water signals into the pokeys for safety.   Spindle should never start without water.  And Drawbar should never release when VFD are running.

Please keep in mind this is very custom, but I do believe it is easy to configure for your own use.  I tried to add a lot of comments to explain the M6. 

I hope someone finds this useful or errors/suggestion. Send me a pm and I will forward you my email.


« Last Edit: January 10, 2025, 03:40:46 AM by massynrt »

Offline smurph

*
  • *
  •  1,574 1,574
  • "That there... that's an RV."
Re: ATC Build With Macros - Use it if you like
« Reply #1 on: January 14, 2025, 05:13:33 PM »
Holy smokes!  This is impressive.  Thanks for sharing.

Steve
Re: ATC Build With Macros - Use it if you like
« Reply #2 on: January 14, 2025, 11:56:45 PM »
Thank you -

I've already updated this.

I've redesigned the screen to show a table of the tools loaded and an indicator to show what slot/tool is loaded.  I dont like tabs on the screen.  I want all the detail I need on 1 page.   

The ATC rack can also be configured from the screen now.  No need to go dive into the CSV anymore - Only when XYZ of the tool rack might ever change - But tool # can be updated from the screen.    Improved the database/CSV function.

I think I should make a google drive folder and put all the STL Models, images, videos and code there.   That might be useful to some in the future.


Re: ATC Build With Macros - Use it if you like
« Reply #3 on: January 15, 2025, 06:48:13 AM »

Offline Bill_O

*
  •  598 598
Re: ATC Build With Macros - Use it if you like
« Reply #4 on: January 15, 2025, 04:05:47 PM »
Very nice.
I will need to really look this over and see what I can improve on mine.

thanks for sharing.
Bill
Re: ATC Build With Macros - Use it if you like
« Reply #5 on: January 16, 2025, 12:26:11 AM »
And please feel free to give me feedback on what I can improve too.  I would love this to be a help for everyone building their own.     Some info I might need to add-

1.  My implementation for tool length offset is based on the fact that I dont use a master tool - I'm sure it will still work - I rather think of my Spindle's bottom as the master tool - All my tool lengths are calculated from that point.  The total length incl the tool holder from the spindle.   As long as the correct tool offset is applied when you probe or home the Z home, everything is perfect.   

2.  I use a X Box controller -  My Z probe is used with a macro that I've assigned on a bottom on the Xbox Controller.  That is why I removed it from the screen.   I want to be at the machine when I probe, not at the PC.   
Re: ATC Build With Macros - Use it if you like
« Reply #6 on: January 22, 2025, 11:35:55 AM »
Oh do I wish we would have found each other about 8 months ago!

I have been working on a VERY similar set of modules, macros, scripts and whatnot to integrate a carousel style toolchanger.  It would have been great to compare notes.

I'm in the final integration/debugging phase now so it is probably too late for me to use much of your efforts.  I haven't done anything with the tool table/database however.  I saved that for last.

One consideration with respect to the tool table:  I have been making great use of the Gwizard software and plan to make the tool library the "master".  Then I could just use some scripting to sync the tool tables between them.  Let me know if this makes sense.  I too was planning the Mach4 tool table to be a subset of the master table and able to be reconfigured. (load tool#18 into carousel slot 3 for example).  I'll probably adapt your work for this.

My plan was the following: 

My tool carousel is also 10 slots.  Slot/tool 0 is "No Tool" (empty spindle).  This is so that I can remove the tool from the spindle without an additional function.  I have designated slot 11 for my renishaw probe (it has a cord to plug in so it needs to be loaded like a manual tool).  Slots 12-20(?) are "manual tools".  These will probably be loose mills/drills that are not living in a dedicated tool holder but existing in the tool table to keep track of speeds/feeds/etc...  This way I can call them in the CAM software.  Tools beyond 20 or so will exist only in the "master" tool table and would need to be entered on a case-by-case basis (maybe manually?)

I have a few specific questions about implementation:

I plan to use a number of different CAM/post processors until I find the one that works best for me.  Currently I use Aspire/Carve3d but as I migrate to using 5 axis, I will need to go to SolidCam or MasterCam.  Which of the tool table entries are necessary for the post processor to know?  I know that for 5 axis work, the exact tool length is important for calculating the inverse kinematics.

Is there a standard(ish) format for tool tables that has at least been adopted by a few software packages? I'm hoping that there is a "least common denominator" csv file format that I can find that will work with all of these packages.  Gwizard also can output a binary .dat file for Mach3 but it looks like more of a pain to work with.

Thanks!
Re: ATC Build With Macros - Use it if you like
« Reply #7 on: January 22, 2025, 12:22:55 PM »
I'm going to give this a shot - Im not as much as an expert as I would like to believe. 

I think it is important to really understand how you want your system to work - There are a few different systems at play - I'm going to explain my implementation, and hopefully I can answer your questions.

Firstly, you need to define ToolIDs to your tools.    I suspect this is your master db you are referring too.     The post processor only knows the tool number.  The PP does not manage tool length or diameter offsets.

I cant imagine for 5 axis work it would make a difference, since the tool length offset will be applied by the controller.      I've never dont 5 axis work - But I'm sure there would be a Work offset procedure and then length offsets will be applied. 

 What you have to do, either in your PP or in my case in the M6 macro is, you have to apply the tool length offset from the MACH4 tool database.     G43 H[tool number].     I'm sure you would be able to make use of your own database but then you will have to manually set the offsets -  If you make use of MACH4 build in tool database, you immediately get access with on API call to apply to offset.     It is also very easy to update the DB via probes etc.     I would highly recommend you go that route.   

The way I implemented it, was not to open the tool table every time.  Once it is set up, you can forget about it basically - Only when I break a bit or want the bit length to be measured again, I open the tool table, change the length to 999 and my M6 macro will measure it again.   I can always add extra check boxes or something for this - This was just an easy way to achieve the outcome.

Tool changes require two steps -
1- Physically loading the tool.
2 - Loading the offsets via G43

I have 10 slots also.    I dont think of Tool 0 as empty spindle.    M6 Macro is scripted in a way to unload, and if selected tool is 0, dont load next tool - Clear the offsets. 

Im sure engineering companies that use large bits that resharpen them will also make use of diameter offsets.   I dont care for them since I only cut Signs and Cabinets.   

The only other real consideration is what you consider as Home Z 0.  Some people call this the master tool.   This can get a bit confusing.   For me this is the bottom of the spindle, without any tool loaded.    So basically - If I probe my z height with tool 1 loaded in the spindle and Tool Length 1 Offset applied.  HomeZ is then 0.  If I unload the tool and clear the length offset, the bottom of the spindle will actually be the Z0 point without the offset applied.    Thus you can probe with any tool, change any tool and the offsets will make sure the Z height is correct. 

I have 2 cvs database files for my tool rack.
1.  One to assign the X,Y,Z position to the tool rack slots.
2.  Second To load specific tools into specific slots.     This can be random.    I can load tool 94 into slot 5 if I want to. 

Thus - Dont limit yourself to 1-10 as ATC,  and 12-20 as manual - It can be anything you like - Anyway you would like to setup your Master Tool DB.   

Tool ID's need to to be the same across all CAMs.  In my case I use 2 CAM software apps.  Vectric V Carve and Mossaik Cabinet.   Both have their own build in tool databases.  These databases are responsible for the speeds and feeds for each Tool ID, for each material, for each process etc etc.   

You just need to make sure that the tool numbers align between Vectric, Mossaik, MACH4 tool table.     For me, this is once off setting thus I did not feel the need to program scripts for this.  Will only be done once.  The only changes left is when I change a tool in the rack, to update the loaded tool CSV.

I've added some extra code to M6 to go into manual mode when a toolID is not available in the rack. 

Then your 2nd questions - From what I've gather - There are NO standards.     Every company building an ATC mill or something does it they why they want.   Some of the Gcode are standardized but that is about it.  I'm sure large companies like Tormach have standards between their machines - But that is above my pay grade.. 

Hope this helps.

« Last Edit: January 22, 2025, 12:27:43 PM by massynrt »
Re: ATC Build With Macros - Use it if you like
« Reply #8 on: January 22, 2025, 12:38:33 PM »
Haha that’s great.  Way easier than i thought. 

Ok. I keep the tool master tool database flexible (have all tools there, arbitrary numbering). I would have to assign the tool slot number to the tool in vectric/pp? then?  Because otherwise there would need to be a lookup table or something in mach that would know that ‘tool 23’ is loaded into slot 4 or whatever.  Or is that exactly what you added for your implementation.
Re: ATC Build With Macros - Use it if you like
« Reply #9 on: January 22, 2025, 12:40:17 PM »
Because the PP needs to know what tool number to include in the M6 call each time…