How to: Adding Start/End Code to Fusion 360

Ok I couldnt find a simple example online of how to add start/end gcode to my fusion 360 projects, but today I figured it out. So I decided to do this little tutorial to hopefully make it easier for others.

This is for the LowRider/MPCNC Flyfisher Postprocessor.

My goal was simply to turn on a cooling fan that I just installed. I could have wired it to be on all the time without any code, but wanted it to come on only when cutting.

First, open the post processor config file called “MPCNC.cps” in a text editor
Next scroll to line 110
Add the name of your start and end gcode files in between the quotes.

Then, in a text editor, create two files with the names you chose (I used “StartCode.gcode” and “EndCode.gcode”)
Add any commands and comments you want into the files , for me it was M106 and M107 (Fan on, fan off)

These files must be saved to the folder named “NC”, which is where the gcode output is placed after posting.
For me this was: C:\Users\RONALD\AppData\Local\Fusion 360 CAM\nc

The “AppData” file is hidden by default, so If you cant find “AppData” in windows explorer, type %AppData% into the search bar and hit enter.

Now in Fusion360, click PostProcess for the part you want to cut. In the properties menu, you should see “Extern: Start File” and “StartCode.gcode”

Thats it.
The only problem I’ve had with this so far is that the “StartCode” and “Endcode” files must be in the same output folder that you are saving your new post code to.
You must save the new code to the “NC” folder
OR
if you want to save directly to your USB drive or SD card from F360, you must keep a copy of “StartCode” and “Endcode” on those drives. Otherwise you will get an error.

Hope this saves someone some time.

1 Like

Nice writeup. Thanks.

if you want to save directly to your USB drive or SD card from F360, you must keep a copy of “StartCode” and “Endcode” on those drives. Otherwise you will get an error.

I too ran into this problem. I wanted to keep my start code on my main computer in one place, but the post processor does not respect absolute paths to a file. I have to keep copies in two places (since I save to two different places), and have to edit both copies each time I want to make changes.

The other minor issue is that there must be a newline after the last line of g-code in the EndCode file or the last line will not be processed (by Marlin I assume). I would be nice if the post processor appended a newline to the end of the file to avoid this issue, but this is a nit.

Not sure what you mean, my EndCode file only has one line: “M107” and it worked fine.
What do you mean by “newline”? like just anything, a comment? a semicolon?

If you author your EndCode file with just an M107, and do not hit the carriage return at the end of the line, then this one line will not be processed. I don’t know if this is a post processor issue, or if this is a Marlin issue. It may be the post processor is not reading in that last line, or it may be that Marlin expects a newline character after each g-code command line.