Here is a video of an example. This was originally done in Grbl_ESP32, but the machine was updated to FluidNC.
Warning This is a new feature. The developers can only do limited testing on this because we don't have access to much ATC equipment. You should evaluate any ATC features you want to use with safe, "air jobs" to determine if the features are functional and safe on your machine.
ATCs are a very advanced feature and not recommended by newbies. Most of the developers cannot afford ATC machines to help test and develop this feature. Please become a sponsor of the project if you need help and support. Please be respectful of our time.
There are a lot of safety issues with ATCs. If your machine opens the ATC while spinning, it is likely to throw that tool across the room with a razor sharp bit. That could kill you. It will also likely do serious damage to your spindle. Be careful and never trust your machine or the firmware. You are the sole person responsible for your safety.
To get the current tool number you can send $G or D#5400
There are 4 types of ATCs that can be supported by FluidNC
If you do not use macros or an ATC class, you can still use tool numbers to change spindles. The tool numbers are only used to determine the spindle number. This is the original system since the beginning of FluidNC. See the spindle page.
Each spindle in the config file can have an m6_macro:
. This can be gcode or you can specify a file to run with $SD/Run=myfile.gcode. You can use parameters and expressions in the gcode. This gives you access to the tool number, probe values and other information.
pwm:
pwm_hz: 5000
...
atc:
m6_macro: G55 G0X0Y0
You can create advanced ATC classes. Spindles can use these classes via the atc:
config item. This allows any spindle to use any of the existing classes.
atc_manual:
safe_z_mpos_mm: -1.000000
probe_seek_rate_mm_per_min: 800.000000
probe_feed_rate_mm_per_min: 80.000000
change_mpos_mm: 80.000 0.000 -1.000
ets_mpos_mm: 5.000 -9.000 -40.000
ets_rapid_z_mpos_mm: -25.000000
pwm:
pwm_hz: 5000
...
atc: atc_manual
M6_macro:
If you have an ATC that requires special interaction between the spindle and ATC, you can write a custom spindle class. All information about the tool change goes through the spindle, so you can act upon it at that level if you like.
my_spindle:
pwm: 5000
...
atc:
M6_macro:
my_config_item1:
my_config_item2:
An m6_macro:
can be used with any spindle type. It will run if it is defined and the spindle does not have an ATC config item. Read more about macros here.
You must set the current tool number with M61Q<number>
in your macro. This allows you to decide if the tool change was successful. In most cases you will want to set an alarm and exit the macro if there is a problem. Use $Send/Alarm=3
(Abort during cycle)