Toolhead goes to non-home position after cut

I’ve recently started using Fusion360 for my cam work, I’ve probably made 10 successful cuts with it. Until, today. I made two separate cuts for the piece, a chamfer, and a contour (both super simple, it’s just a hexagon perimeter), and they both display the exact same weird behavior that no cut in the past has:
Cut goes fine.
When it finishes, The toolhead lifts to Z15.
Then it shoots of to the top-righthand corner of the machine while dropping Z straight into the bed, ruining the piece, and me frantically going to press the emergency stop.
I’m using UGS to send the gcode.

Below is the end of the gcode, showing from the last successful move (G0 Z15).
Here’s what’s weird: If I compare this “failed” gcode to gcode that “works”, they’re the exact same.

… bunch of gcode from a cut that fails…
G0 Z15
M9
G28 G91 X0 Y0
M30
%

… bunch of gcode from a cut that works…
G0 Z15
M9
G28 G91 X0 Y0
M30
%

What am I missing here? Thanks!

So, I think I figured out what’s causing it. It’s the line:
G28 G91 X0 Y0

This is sending it to machine home after the cut, not the work home (where I zeroed it before the cut). In this case, when I turned on the machine to do my last cut, I had done an experiment previous, where I had lowered the chuck all the way to the wasteboard : That was now machine home when I turned the machine on, and that’s where it decided to go after the cut was over. If I remove that G28 line, the toolhead raises, stops, and all is well.

At first I was perplexed as to why this new behavior was happening: I compared gcode made my fusion360 vs meshcam (which I have been using) : Meshcam simply issues a
G0 Z2.54
at the end, raising the bit and leaving it there. The postprocessor I’m using for F360 must be adding in this code, and thus creating new unfamliiar behaviors. I’ll just manually remove that line until I figure out how to make my own postprocessors.

One last update: As it turns out, I was using the wrong postprocessor in F360 : I’d found one online (a “ShapeOKO” one), and was causing this “G28 problem”. As it turns out, F360 comes with a “generic grbl” postprocessor. One only needs to set “useG28” to “No” in it’s properties section, and the cut behaves like it used to: Simply raises Z upon completion.

Is there? I’ve been using my xcarve for a little over a year now, but the whole postprocessor thing is a bit new to me, I’m never exactly sure if what I got is right or not :wink:

There is an Easel postprocessor, you have to add it manually though. Just Google for the instructions. It’s only necessary if your using Easel to run the Gcode. I use UGS, and Fusion’s generic grbl works fine with that.

I’d actually found that easel one you’re talking about, but since I don’t use easel much anymore, I didn’t actually try it, ha!