Fusion 360 & post processor

Thanks for the post file. What are the differences between this one and the earlier one? Just the took change pause? For my 3D printer I did a Marlin firmware change to pause, beep and lift out the of way for a filament change.

Steve

I tried to eliminate all commands that Marlin firmware doesn’t support.

https://www.diffchecker.com/oauw5fnh

Thanks! So the changes basically eliminate some unsupported gcode generation with “;” insertions in some functions and “//”'s out other functions all together. You also bring Z up 15mm on a tool change.

One thing I did not figure out is what happens at the very end. Does it not return to the origin? When I used the original “post” file the tool seemed to lift, then dropped to the model surface again then returned to the origin while dragging across the model surface. I thought that this was just a problem with my Fusion CAM settings. I still may misunderstand the meaning of some the different height settings in CAM. Is there any way get to simulate the entire tool path from and to the origin? Even with full tool path selected it just starts and ends at the milling operations.

Sorry I have been too busy/lazy to run the diff above :slight_smile: I will eventually get around to running the new version to see what happens.

If you look at the very bottom of the post file there is a section called function onClose() {

You can put anything you want into this section and will get generated at the end.

To go back to zero just add these two lines.

writeBlock(gMotionModal.format(1), “Z15”); //added to return tool to 15 height at the end ;Please don’t drag my bit across the work surface, lol
writeBlock(gMotionModal.format(1), “X0”, “Y0”); //return to zero

So the onClose function becomes:

function onClose() {
setCoolant(COOLANT_OFF);

writeBlock(gMotionModal.format(1), “Z15”);
writeBlock(gMotionModal.format(1), “X0”, “Y0”);
zOutput.reset();

onCommand(COMMAND_STOP_SPINDLE);
writeBlock(mFormat.format(84) + “; Turn steppers off”);
//writeln("%");
}

MPCNC_Fusion360_ReturnToHome.zip (4.12 KB)

To answer your question about the simulation. Fusion 360 simulates the cut path, not the final gcode generation.
If you want to simulate the gcode you would need to load the gcode into a CNC simulator.

I haven’t found a good simulator that is free yet; however, you can do a 30 trial here = http://www.tkcnc.com/

Worked ok for me.

I just downloaded and registered Fusion 360. I’m very excited to start learning a real cad/cam program.

I have a couple of questions:

About the tool change - how do you re-zero the z axis after changing the tool, or is that what that ReturnToHome code does?

Also, how do I use all these bits of code in this thread?

Thanks!

Karl

Generally I don’t try to shove every tool path into 1 gcode file.
I break up the post process by bit size.

In Fusion CAM side, just select the tool paths with the same size bit and for the post file select the MPCNC_Fusion360.cps

To rezero you can move the z down until the new bit barley touches the surface and issue a G92 Z0 manual command in Repetier-Host.

If you look at the sample gcode I posted, at the very top there is a G92 X0 Y0 Z0 - that sets the xyz axis to zero where the bit is currently at.

Can have a quick bullet point list of how to export from fusion?
I have been able to access the post process but there are options for 50 or so cnc machines. Not quite sure what to do now…

@WorkderDrone
Just got back to looking at the post and noticed that the zip MPCNC_Fusion360_ReturnToHome.zip with file MPCNC_Fusion360_V2.cps has some odd characters in the third and second to the last writeblock():
writeBlock(gMotionModal.format(1), “Z15”);
writeBlock(gMotionModal.format(1), “X0”, “Y0”);
I just deleted them and added your suggested return to home but with a 5mm Z offset. I also changed what I think is the initial home Z offset to 5mm.

The attached file contains the edited post.
Thanks
Steve C

MPCNC_Fusion360_V2_RTH.zip (4.11 KB)

Fusion 360 does not have an Marlin/MPCNC post processor file in it’s default configuration so you will need to download the one initiated by WorkerDrone and tell Fusion 360 to use it. Try my slightly modified version attached here.

OK - here is my attempt at some bullets for you:

  • Download and unzip the attached MPCNC_Fusion360_V2_RTH.zip to a convenient folder.
  • In Fusion 360:
    • Generate tool paths and simulate
    • Select tool path or paths
    • Select Post Process
    • In Configuration Folder section select Setup and browse to your convenient folder
    • In Post Configuration section select Open Config and select MPCNC_Fusion360_V2_RTH.cps
    • Select an output file location and name
    • Select Post
      Please let me know if anything is unclear or wrong.

MPCNC_Fusion360_V2_RTH1.zip (4.11 KB)

Awesome, thanks for editing the file and helping with instructions.

@WorkerDrone,

I made (hacked actually) a few changes to the post to help with tool changes. First, I wanted to keep the steppers driven during the change to reduce the chance of moving the the axis out of sync with the origin. The pause, M25 (or M1) does keep the steppers active during tool. The problem is that Marlin has a default timeout of 60 seconds after which the steppers are disabled. I did not want to modify the configuration.h file just for this and found that M84 Sseconds can be used to temporarily change the default timeout. An argument of S0 will disable the timeout all together. Also, on my current MPCNC build, I made the Z standoffs too short and I don’t have a lot of headroom for retracting enough to get the bit out for thicker stock. I usually have my origin at the lower left corner of the stock, so on a tool change I moved XY to a location beyond that to give me room the get the bit out.

I use an LCD’s SD card reader for input and have not used a USB host driver like Repetier Host in ages so my changes will probably not work over USB. I’m sure some minor change will make it compatible with a host.

My changes are something like:
- Removed odd characters - M25 (or M1) keeps steppers active during tool change, Problem is that the steppers are disabled after a 60s timeout, So "M84 S1800" was added to preamble to change the timeout to 30 minutes. - On tool change: Retract Z15, X-30, Y-30, Display "Change to Tool T#" to LCD Pause SD - To resume after tool change select "resume Printing" from menu

Steve C

MPCNC_Fusion360_V3_SDcard.zip (4.49 KB)

Thanks so much! I will check it out today and get back to you.

It works! thanks for the help. The only thing is now I have to figure out how to use fusion. It seems its impossible just to pocket a simple object.

@Simon,

Did you see the tutorials I posted above?

Here is the first of five videos “How to learn Fusion 360 CAM – Basic – Chapter 1” https://www.youtube.com/watch?v=6FzbZNhey2w&list=PL40d7srwyc_OmRH4UQ_E-6UB-GbhPdjc8&index=2 He does a nice job of going over the basics.

Fusion 360 is a feature filled, professional CAD suite but it has a very steep learning curve. I did a lot of guessing and trial and error to get through the CAM workflow. For example in a sequence of 2D Facing, 3D Adaptive Clearing and 3D Parallel, I am still not sure how I was able to select the correct geometry so that one operation would not redo milling of areas that the previous operation already took care of. I kind of randomly found selections that worked.

Let me know what you have tried and maybe I can help.
Steve C

It feels surprisingly unnatural. When I first realized I could use an autodesk product for cam I was trhilled because I am really good with autocad and inventor. Unfortunately its basically a whole different animal. In time I will figure it out. Fortunately like autocad and many other softwares there is a plethora of tutorials.

Amazing work on getting a working Marlin/MPCNC post processor file. I envy your knowledge of coding. I have only just started learning C+ with the Arduino IDE, it’s slow going without any prior experience, but very rewarding and fun. I got into it to build toys/robots for my son.

I am really impressed with Fusion 360, and have used it quite a bit over the last couple of months to design and print upgrades for my 3d printer. Prior to finding Fusion 360 I was using FreeCAD, but found it quite obtuse, with a very steep learning curve. I achieved more in my first hr using Fusion 3d, than I did in a week with FreeCAD (that was after spending hours watching tutorials lol). IMO it is by far the most easy and user friendly CAD I have found.

I very much look forward to exploring the CAM capabilities of Fusion 360 once my MPCNC is complete. In the mean time I will be following this thread closely.

@Simon,
With your Autocad experience it seems like I could learn a lot from you not the other way around.

Here is a slight update to the Fusion 360 Post file. V5 just adds an initial Z raise of +10 so that it does not drag across the stock surface and so that it clears any hold down clamps that might be in the way. (Of course I have never ever milled though one of my printed holddown clamps :slight_smile: )

I realized that this post inserts “G92 X0 Y0 Z0” at the beginning. This is nice because it sets the current tool location as the origin 0,0,0. Previously, before I knew about G92, I was cycling the power of my Arduino to reset the origin. In Fusion 360 CAM just select the milling origin at a convenient point on the stock box like the lower left corner surface top. Use the LCD or host or manually jog the tool tip to that location and start the job. It will automatically set that as the origin.

I did my first milling with a tool change midway and this post which maintains stepper lock worked great. I started with an 1/8" end mill for surfacing and roughing, then changed to an 1/8" ball mill for finishing. I have enclosed a screenshot of the Fusion 360 CAM screen and a mid milling photo of the test. It is a completely arbitrary object with some facing and a hand drawn squiggle with a cylinder cutout. It was milled on a length of 2x3" scrap. One helpful hint is to use a small block of wood with a slot cut in the side as a spacer to make sure all the milling bits are inserted to the same length. I included a photo of it below.

If others are using this post file please comment.
Thanks,
Steve C

MPCNC_Fusion360_V5_SDcard.zip (4.62 KB)

wow that really looks amazing! What router or machine are you using?