Autodesk Fusion 360 CAM Post-processor for ShapeOKO

I recently started playing around with Autodesk’s Fusion 360 3D modeling and CAM software.  I managed to fumble my way through making some quick designs and setting up a simple cam job to make a tool holder.  Designing the part was quick and so was setting up the CAM operation.  However when exporting the G-Code through the grbl post-processor I discovered the G-code was using G28 (return to home) which isn’t supported in a stock ShapeOKO 2.  Limit switches would need to be installed for this to work and for it to be turned on in grbl.  The default startup G-Code using the grbl post processor looks like this:

%
(1)
(T4  D=6.35 CR=0 - ZMIN=-19.525 - flat end mill)
G90 G94
G17
G21
G28 G91 Z0
G90

This in itself is fine but the first thing that happens is the tool is started right at the surface of the work instead of moving it up a safe distance.  The G28 would normally take care of this if you have limit switches and it is enabled in grbl.  However this is not the case.  Instead of the G28 G91 Z0 we want to move the tool to a safe Z-height before it turns on the tool and moves it for the first cut.  Ideally the first move would occur at the safe height then plunge down into the work from that height.  I dug around to find the post-processors (conveniently matching their name) for grbl using Finder on my mac.  These were stored in “/Users/<userid>/Library/Application Support/Autodesk/webdeploy/production/<some hex>/Libraries/Applications/CAM360/Data/Posts”  I copied the grbl.cps to ShapeOKO.cps and started hacking away.  The post processors appear to be coded in some type of Javascript and are fairly easy to understand.  I added a couple customizations to toggle wether G28 or a “safe” Z height should be used and saved the file.  The next time I ran my cam job and called the post-processor I selected my ShapeOKO.cps.  The startup Gcode comes out looking like this:

%
(1)
(T4  D=6.35 CR=0 - ZMIN=-19.525 - flat end mill)
G90 G94
G17
G21
G0 Z15

This sets it to 15mm (assuming the machine is in mm mode) above the work.  This makes the first move with the tool not drag the bit close to the top of the work.  Even better the settings can be toggled at runtime, on windows at least, by changing the parameters.  With the recent version of Fusion 360 the parameters can be saved in the cloud drive and accessed on all platforms.  Go to you A360 Drive and off the “Top” you’ll see a directory named “CAMPosts”.  Drop the ShapeOKO.cps in there and it will now show up with the cloud enabled settings.  In the Post Process dialog change the source to “My Cloud Posts” and select the ShapeOKO.cps as the post processor.

 

Screen Shot 2015-04-24 at 7.44.07 AM
Drop the ShapeOKO.cps into the CAMPosts directory on the cloud drive

 

Screen Shot 2015-04-24 at 7.46.23 AM
Select the “My Cloud Posts” as the source for the post processor.

You can download my custom post processor here:  ShapeOKO.cps.  This file needs to be decompressed before placing it in the CAMPosts cloud directory or in the local directory.  I take no responsibility for any bodily injury or damage you cause to your equipment using this post processor.  I only have limited testing on my machine and configuration.  In the future I plan on adding a dwell at the safe Z height for several seconds to enable the operator to turn on the spindle.  This code is partially implemented in this version but not yet enabled.