TimPaterson / Fusion360-Batch-Post

Fusion add-in to post all CAM setups at once, optionally dividing them into folders.
The Unlicense
128 stars 25 forks source link

shapeoko gcode #37

Closed ex-nerd closed 2 years ago

ex-nerd commented 2 years ago

I was poking around the gcode output from this script (and the new F360) in comparison with some older multi-toolpath exports that I still have sitting around.

This is the transition point currently output from this script (with the "gcode that mark ending sequence" set to M30, which is all the post-processor sets), with that lone M5 being everything I think I need to add for my shapeoko3's toolchange functionality (which will either prompt the user to turn off the spindle, or actually turn it off if they have the proper hardware):

(Above this line, you find the final "true" move in the X/Y plane)
G00 Z15.0 (Changed from: "Z15")
G28 G91 Z0
G90
G28 G91 X0 Y0
G90

(When using Fusion 360 for Personal Use, the feedrate of)
(rapid moves is reduced to match the feedrate of cutting)
(moves, which can increase machining time. Unrestricted rapid)
(moves are available with a Fusion 360 Subscription.)
(Morphed Spiral2)
M5
T2075 M6

Compare this to a similar transition from an older F360 (and startup license) that supported multi-tool exports:

(Above this line, you find the final "true" move in the X/Y plane)
G0 Z15
M5
G28 G91 Z0
G90

(Horizontal)
T2075 M6

The actual ending sequence used by my post-processor looks something like this:

G1 Z15
G17
G28 G91 Z0
G90
G28 G91 X0 Y0
G90
M30

It looks like what I'd want that "ending sequence" setting to be is G28 G91 Z0;G90;G28 G91 X0 Y0;G90 (or rather, a regex that would actually match the newlines) rather than simply looking for M30. Unfortunately, my reading of the docs is that the current matching technique is "any one of these individual gcodes" so I couldn't even match that longer G28 G91 X0 Y0 (which also happens to occur at the beginning of the file, so maybe isn't the best match).

If there was a way to catch the "ending sequence" using a pattern, or even just a longer string, it would allow replacing the entire ending sequence, especially that very annoying G28 G91 X0 Y0 that remains in place even between same-tool toolpaths (unnecessarily sending the carriage to the back left corner between the joined files), but also turn off the spindle sooner as a slight improvement in safety.

TimPaterson commented 2 years ago

If I understand you, this is working but is not optimal. Unfortunately, PostProcessAll looks at each line by itself to find the ending marker, so there's no easy way to have it look at a sequence of several lines.

If you have any programming experience (you know "regex"!), then your best bet might be editing the post processor itself to not emit the X-Y home. You did not mention what post processor you're using so I can't offer specific suggestions.