Weird Grbl behavior with UGS

I’ve been running some tests using UGS to air-carve some of my Easel projects that I exported as gcode. One of them, the simplest one, is actually causing some weird behavior. The job starts out fine in UGS and proceeds line by line until reaching the end. At that point though, the machine just keeps repeating the same passes it just completed - over and over.

Has anyone else seen something like this? My gcode is below:

G21 G90 G1 Z3.810 F228.6 G0 X46.825 Y108.825 G1 Z-0.200 F228.6 G1 X46.825 Y108.825 F750.0 G1 X43.175 Y108.825 F750.0 G1 X43.175 Y3.175 F750.0 G1 X46.825 Y3.175 F750.0 G1 X46.825 Y108.825 F750.0 G1 X46.825 Y108.825 F750.0 G1 Z-0.400 F228.6 G1 X46.825 Y108.825 F750.0 G1 X43.175 Y108.825 F750.0 G1 X43.175 Y3.175 F750.0 G1 X46.825 Y3.175 F750.0 G1 X46.825 Y108.825 F750.0 G1 X46.825 Y108.825 F750.0 G1 Z-0.600 F228.6 G1 X46.825 Y108.825 F750.0 G1 X43.175 Y108.825 F750.0 G1 X43.175 Y3.175 F750.0 G1 X46.825 Y3.175 F750.0 G1 X46.825 Y108.825 F750.0 G1 X46.825 Y108.825 F750.0 G1 Z-0.800 F228.6 G1 X46.825 Y108.825 F750.0 G1 X43.175 Y108.825 F750.0 G1 X43.175 Y3.175 F750.0 G1 X46.825 Y3.175 F750.0 G1 X46.825 Y108.825 F750.0 G1 X46.825 Y108.825 F750.0 G1 Z-1.000 F228.6 G1 X46.825 Y108.825 F750.0 G1 X43.175 Y108.825 F750.0 G1 X43.175 Y3.175 F750.0 G1 X46.825 Y3.175 F750.0 G1 X46.825 Y108.825 F750.0 G1 X46.825 Y108.825 F750.0 G1 Z-1.200 F228.6 G1 X46.825 Y108.825 F750.0 G1 X43.175 Y108.825 F750.0 G1 X43.175 Y3.175 F750.0 G1 X46.825 Y3.175 F750.0 G1 X46.825 Y108.825 F750.0 G1 X46.825 Y108.825 F750.0 G1 Z-1.400 F228.6 G1 X46.825 Y108.825 F750.0 G1 X43.175 Y108.825 F750.0 G1 X43.175 Y3.175 F750.0 G1 X46.825 Y3.175 F750.0 G1 X46.825 Y108.825 F750.0 G1 X46.825 Y108.825 F750.0 G1 Z-1.600 F228.6 G1 X46.825 Y108.825 F750.0 G1 X43.175 Y108.825 F750.0 G1 X43.175 Y3.175 F750.0 G1 X46.825 Y3.175 F750.0 G1 X46.825 Y108.825 F750.0 G1 X46.825 Y108.825 F750.0 G1 Z-1.800 F228.6 G1 X46.825 Y108.825 F750.0 G1 X43.175 Y108.825 F750.0 G1 X43.175 Y3.175 F750.0 G1 X46.825 Y3.175 F750.0 G1 X46.825 Y108.825 F750.0 G1 X46.825 Y108.825 F750.0 G1 Z-2.000 F228.6 G1 X46.825 Y108.825 F750.0 G1 X43.175 Y108.825 F750.0 G1 X43.175 Y3.175 F750.0 G1 X46.825 Y3.175 F750.0 G1 X46.825 Y108.825 F750.0 G21 G90 G1 Z3.810 F228.6 G0 X0.000 Y0.000 G4 P0.1

I have seen some erratic behavior using the G4 command. Is there a reason you are using that at the end of your code?

Try removing that and doing another aircut.

If that is your complete g-code, replace the G4 P0.1 with M30.

That’s the code exactly as exported by Easel. I’ve since tried running it in Bcnc and had no problems whatsoever. While I slightly prefer the UGS ui, I am by no means committed to using it. I am exploring the options available for offline gcode senders and UGS was the 1st on my list.

Truth is, I detest Java, so having a working Python solution is nice to have.

Oh you bet. I spent too many years living the promise of Java and managing servers running Tomcat. I-hate-it-with-a-passion. That being said, if UGS had worked properly out the gate with a simple gcode file, I’d still be using it. Bcnc seems decent, if a bit cluttered from a UI standpoint. It seems like the developer is very responsive too, which I like seeing.

I use UGS, and don’t use and M2 or M30 at the end, I just send it to a clearance position in my current work offset.
It does weird stuff every now and then, but nothing I can’t stop before a crash.

So, what makes you think it’s grbl and not UGCS?