Inserting Gcode into Fusion 360's Post Processor

Hello experts!
Now that I can toggle my router on with “M106 P2 S1” I’d like to automate things and put that into my Gcode files. Does anyone know how I can have the post processor add the M106/M107 lines into my Gcode?
I’m using the Flyfisher604 post processor from here:

Thanks in advance!

I have to put my router on by hand, so no experience here, but a quick google says you need to edit the post processor to add the Gcode.
Try on google: “ fusion cam add gcode at start” to get ideas how to do so.

For Fusion 360 and the referenced postprocessor, you must put your code in text files, then you reference those files in this section of the postprocessor:

image

Start and Stop commands much each have their own file. You can author these files in any text editor including Notepad. There is one catch (at least when I set my files up). These files must be in the same folder/directory where you save your g-code files. These fields will not take paths. I have two places where I save files…a subdirectory on my desktop computer, and directly on the SD card I use to run CNC jobs. I have to have a pair of files in each place, and I have to remember to edit all four files when I want changes.

Repetier-Host has its own Start GCode and End GCode sections, so if you are using Repetier-Host to send files to your control board, I would recommend adding the commands there rather than Fusion 360. I use a SD card, so I must use the external files.

Tip: You must have a newline at the end of the last line in any Marlin g-code file. If you don’t, the last line will not be processed.

I’m surprised the “S1” in your “M106 P2 S1” works. I would recommend changing it to “S255”. The S parameter is a PWM value in the range of 0 to 255.

Edit: You might want to test if the Extern files now accept a path. This postprocessor has been substantially rewritten since I set up my Fusion 360 process.

1 Like

Robert-
Thanks for the reply! This works well, although it did take a bit to get it working properly. When an external file is used, it doesn’t add the default commands, so I had to look at a gcode file created prior to the adding my custom files to see what all should be there. Believe it or not, the first test post file failed because I had an extra new line at the end of the file. So it looks like the code has been changed since you used it. I’m so glad you mentioned that issue!!! I never would have found that without your tip.

I’ll have to measure what my fan output voltage is with my “S1” attribute and see if it fluctuates. I wish I had an oscilloscope to inspect the waveform. That is rather curious.

Thank you again for the assistance!

Robert, I thought I’d follow up on our conversation about the start/end files and outline my process in case anyone else was curious. I did create start and end gcode files and entered them into the Group 7 settings. It took a couple of iterations to do what I needed it to do, but it’s working quite well now. I put the files on Github if anyone needs them:

Thanks again for the help!

1 Like