trentster wrote: Hey Luke, I also use Fusion360 and would appreciate you sharing your current sub routines. Thanks mate.
Hi
I have been meaning to write this up ever since I got it all working. Hopefully this will be useful to some of you. It works for me and could probably be improved. I have produced lots of accurate parts on my mini CNC using this setup.
I have attached my LinuxCNC config files for reference.
Changes required
1. Created tool-change.ngc and saved in /macros/ folder on CNC - I've attached mine for reference
2. Downloaded LinuxCNC Post Processor from -
cam.autodesk.com/posts/
3. Saved Post Processor into - /luke/Autodesk/Fusion 360 CAM/Posts/ - you will need to locate your Fusion360 folder. I'm using a mac
4. Removed retract to G53 Z0 from post processor by deleting these lines (appeared twice)
else {
writeBlock(gAbsIncModal.format(90), gFormat.format(53), gMotionModal.format(0), "Z" + xyzFormat.format(0)); // retract
}
5. Edit your cnc.hal to include the manual tool change stuff. Refer to my mf70.hal for reference.
6. Edit your cnc.ini to include the M6 remap under this heading [RS274NGC] - refer to mine for reference. I also commented out
tool_change_at_G30
CNC config you will need to do
Note. Z zero for my CNC is at the top of travel i.e. tool furthest away from table. All of my tools have a negative length value and all z references in the config files are negative value as a result.
1. You will need to update the X & Y co-ordinates of the touch of sensor in the tool-change.ngc config file
2. You will need to update the height of the touch of sensor in the tool-change.ngc config file - I opened up the pin viewer for the probe pin, 13 in my case (I will update this section with more detail once I've gone through it again on my cnc) and jogged down to the sensor until the pin updated to True. This Z position was added to tool-chang.ngc under <_Ztravel> heading
3. You might need to update the min & max tool length values in the tool-change.ngc file
Fusion360 steps
1. Produce G code for each tool within your part. I try and group tool ops by the tool to avoid lots of tool changes. This isn't always possible.
2. Select the post processor stored on your computer rather than the cloud version - Fusion will remember this next time and use automatically.
3. I tend to add a comment into the g code before I save it with part coordinates and any tool order reminders.
4. I name my gcode in this format - sample_part_PT1.ngc, sample_part_PT2.ngc etc... - this makes it obvious when you come to run the g code on your cnc.
Bonus - getting your g code over to your mill
1. I have setup mega.nz on my Fusion360 Mac and my CNC located in my garage. I have a "watched" folder on both systems so each time I generate a g code file in Fusion I save it to a folder called "CNC". This automatically syncs to my LinuxCNC machine so no need for USB sticks.
2. You could use Dropbox to achieve the same however, mega.nz gives you 50GB free and its encrypted end-to-end so no fear of your files being leaked.
LinuxCNC setup routine
1. Launch LinuxCNC and Home all Axis
2. Open G code to run
3. Manually run Tn M6 (n being the tool number for that program) from MDI - auto tool touch off runs and sets Z offset by updating tool table.
4. Jog to material and touch off in all Axis using tool. - I use paper method to touch off in Z
5. Run program
6. Program initiates tool change by issuing Tn M6 command. A message will pop up on screen saying "tool already in spindle. no change required"
7. Program runs.
Notes.
1. T0 M6 will reset selected tool back to nothing. Auto tool routine will only retract Z back to zero and will not run the touch-off routine.
2. T1 M6 in my case will select tool 1 and will not run the touch-off routine. This is due to tool 1 being a touch probe for me and I don't need to measure it.
3. If you have an accurate touch probe you can avoid doing the paper method touch off described above by doing a T1 M6 (1 being your probe number) first, touch-off your part in all axes and then just allow the tool-change routine to be called by gcode each time and measure the tool length. - my touch probe isn't highly repeatable so I prefer to touch off in z each time for each tool change.
I hope this helps. Feel free to ask any questions.