# Weird Grbl behavior with UGS

**URL:** <https://community.inventables.com/t/weird-grbl-behavior-with-ugs/23972>\
**Category:** X-Carve\
**Created:** [May 20, 2016, 3:55pm UTC](https://community.inventables.com/t/weird-grbl-behavior-with-ugs/23972 "2016-05-20T15:55:13Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![RogerAndre](https://yyz1.discourse-cdn.com/flex009/user_avatar/community.inventables.com/rogerandre/32/67298_2.png) [@RogerAndre](https://community.inventables.com/u/RogerAndre)\
**Post date:** [May 20, 2016, 3:55pm UTC](https://community.inventables.com/t/weird-grbl-behavior-with-ugs/23972/1 "2016-05-20T15:55:14Z")

</div>

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 `

---

<div class="post-metadata">

**Author:** ![ErikJenkins](https://yyz1.discourse-cdn.com/flex009/user_avatar/community.inventables.com/erikjenkins/32/84368_2.png) [@ErikJenkins](https://community.inventables.com/u/ErikJenkins)\
**Post date:** [May 20, 2016, 4:23pm UTC](https://community.inventables.com/t/weird-grbl-behavior-with-ugs/23972/2 "2016-05-20T16:23:02Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![RogerAndre](https://yyz1.discourse-cdn.com/flex009/user_avatar/community.inventables.com/rogerandre/32/67298_2.png) [@RogerAndre](https://community.inventables.com/u/RogerAndre)\
**Post date:** [May 21, 2016, 4:57am UTC](https://community.inventables.com/t/weird-grbl-behavior-with-ugs/23972/3 "2016-05-21T04:57:20Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![RogerAndre](https://yyz1.discourse-cdn.com/flex009/user_avatar/community.inventables.com/rogerandre/32/67298_2.png) [@RogerAndre](https://community.inventables.com/u/RogerAndre)\
**Post date:** [May 21, 2016, 4:49pm UTC](https://community.inventables.com/t/weird-grbl-behavior-with-ugs/23972/5 "2016-05-21T16:49:24Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![cncrockstar](https://yyz1.discourse-cdn.com/flex009/user_avatar/community.inventables.com/cncrockstar/32/82500_2.png) [@cncrockstar](https://community.inventables.com/u/cncrockstar)\
**Post date:** [May 21, 2016, 7:19pm UTC](https://community.inventables.com/t/weird-grbl-behavior-with-ugs/23972/6 "2016-05-21T19:19:40Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![LarryM](https://yyz1.discourse-cdn.com/flex009/user_avatar/community.inventables.com/larrym/32/51450_2.png) [@LarryM](https://community.inventables.com/u/LarryM)\
**Post date:** [October 3, 2018, 5:42pm UTC](https://community.inventables.com/t/weird-grbl-behavior-with-ugs/23972/7 "2018-10-03T17:42:52Z")

</div>

> [@RogerAndre](#):
>
> That’s the code exactly as exported by Easel. I’ve since tried running it in Bcnc and had no problems whatsoever.

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