# I need samples of 'dodgy' GCode

**URL:** <https://forums.maslowcnc.com/t/i-need-samples-of-dodgy-gcode/14061>\
**Category:** CAD/CAM Software Tips\
**Created:** [July 23, 2020, 11:29pm UTC](https://forums.maslowcnc.com/t/i-need-samples-of-dodgy-gcode/14061 "2020-07-23T23:29:07Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![md8n](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/md8n/32/28197_2.png) [@md8n](https://forums.maslowcnc.com/u/md8n)\
**Post date:** [July 23, 2020, 11:29pm UTC](https://forums.maslowcnc.com/t/i-need-samples-of-dodgy-gcode/14061/1 "2020-07-23T23:29:07Z")

</div>

Over the last few months I’ve been developing a GCode ‘linting’ utility. It’s not specific to the Maslow (it specifically follows the NIST spec), but I began developing it because of the issues I had with the GCode generated by the different software packages that we use.

The original forum thread for it is here:

> [@Command line utility to 'clean' GCode](https://forums.maslowcnc.com/t/command-line-utility-to-clean-gcode/13073/77):
>
> Version 0.8.8.0 is now on Github along with the release for Linux, OSX and Windows This is a partial answer to all those “why does it pointlessly raise and lower z-axis?” type of issues that we all have. First, all positive z-axis values are clamped to a single value. The default is 0.2"" or 5mm. Second, there is a command line option to change this value to something else (within limits). Finally, the existing deduping algorithm will remove some of the now pointless duplicate z-axis move…

Several of you have provided me with some awesome samples that have helped me to work out most of the kinks. But now I want to focus on one problem that we all seem to experience.

**[The Going-up-and-down-a-bit-and-then-moving-along Gertrude](https://www.imdb.com/title/tt0526726/quotes/qt0341280)**  
Quite a lot of the software we use seems to have a peculiar habit of needlessly moving the Z-Axis up and down. The last release I did fixes this problem partially, now I want to tackle it properly.  
If you have some GCode that does this, and are happy to share it, then please do so. It will help me find a way to eliminate this behaviour.

---

<div class="post-metadata">

**Author:** ![Superbender](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/superbender/32/10323_2.png) [@Superbender](https://forums.maslowcnc.com/u/Superbender)\
**Post date:** [July 24, 2020, 1:47am UTC](https://forums.maslowcnc.com/t/i-need-samples-of-dodgy-gcode/14061/2 "2020-07-24T01:47:49Z")

</div>

Gertrude? That is a funny autocorrection mistake. 😂

---

<div class="post-metadata">

**Author:** ![md8n](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/md8n/32/28197_2.png) [@md8n](https://forums.maslowcnc.com/u/md8n)\
**Post date:** [July 24, 2020, 3:53am UTC](https://forums.maslowcnc.com/t/i-need-samples-of-dodgy-gcode/14061/3 "2020-07-24T03:53:06Z")

</div>

Precisely the kind that Ben Elton built his comedy career out of.  
(Hmm, lockdown … time to watch a lot of Blackadder)

---

<div class="post-metadata">

**Author:** ![Blair](https://avatars.discourse-cdn.com/v4/letter/b/c37758/32.png) [@Blair](https://forums.maslowcnc.com/u/Blair)\
**Post date:** [July 24, 2020, 2:33pm UTC](https://forums.maslowcnc.com/t/i-need-samples-of-dodgy-gcode/14061/4 "2020-07-24T14:33:43Z")

</div>

Ive got some g code that moves the z axis 3 times for every individual z axis move. How can I get it to you?

---

<div class="post-metadata">

**Author:** ![Todderbod](https://avatars.discourse-cdn.com/v4/letter/t/73ab20/32.png) [@Todderbod](https://forums.maslowcnc.com/u/Todderbod)\
**Post date:** [July 24, 2020, 8:26pm UTC](https://forums.maslowcnc.com/t/i-need-samples-of-dodgy-gcode/14061/5 "2020-07-24T20:26:19Z")

</div>

This might be a dumb question to some but how do you use this program. Norton says its a virus

---

<div class="post-metadata">

**Author:** ![md8n](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/md8n/32/28197_2.png) [@md8n](https://forums.maslowcnc.com/u/md8n)\
**Post date:** [July 25, 2020, 3:08am UTC](https://forums.maslowcnc.com/t/i-need-samples-of-dodgy-gcode/14061/6 "2020-07-25T03:08:26Z")

</div>

> [@Todderbod](#):
>
> Norton says its a virus

Well … Norton’s would. This is an ‘unsigned’ executable. So you would need to find the way to bypass that. I haven’t used Norton’s in years so I wouldn’t know the correct steps currently.

The alternative is to do a pull from GitHub and build it yourself. But I appreciate that is a bit daunting for some people.

---

<div class="post-metadata">

**Author:** ![md8n](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/md8n/32/28197_2.png) [@md8n](https://forums.maslowcnc.com/u/md8n)\
**Post date:** [July 25, 2020, 3:09am UTC](https://forums.maslowcnc.com/t/i-need-samples-of-dodgy-gcode/14061/7 "2020-07-25T03:09:10Z")

</div>

A private message (PM) through the forum works. That’s how some people have shared their files so far.

---

<div class="post-metadata">

**Author:** ![mooselake](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/mooselake/32/6218_2.png) [@mooselake](https://forums.maslowcnc.com/u/mooselake)\
**Post date:** [July 25, 2020, 3:32pm UTC](https://forums.maslowcnc.com/t/i-need-samples-of-dodgy-gcode/14061/8 "2020-07-25T15:32:22Z")

</div>

Many say Norton is a virus. Too many false positives, likely because all those “viruses” it’s catching make you feel good about spending all that money.

Reportedly making msi installers cuts down on the false positive rate, it seemed to work for gearotic (supposedly Norton finds designing gears erotic).

---

<div class="post-metadata">

**Author:** ![Todderbod](https://avatars.discourse-cdn.com/v4/letter/t/73ab20/32.png) [@Todderbod](https://forums.maslowcnc.com/u/Todderbod)\
**Post date:** [July 25, 2020, 8:35pm UTC](https://forums.maslowcnc.com/t/i-need-samples-of-dodgy-gcode/14061/9 "2020-07-25T20:35:45Z")

</div>

Thank god I did not pay for it a simple uninstall and all is good … Thank You all for your responses

---

<div class="post-metadata">

**Author:** ![Todderbod](https://avatars.discourse-cdn.com/v4/letter/t/73ab20/32.png) [@Todderbod](https://forums.maslowcnc.com/u/Todderbod)\
**Post date:** [July 25, 2020, 9:01pm UTC](https://forums.maslowcnc.com/t/i-need-samples-of-dodgy-gcode/14061/10 "2020-07-25T21:01:16Z")

</div>

Is there a readme on how to use this program? Sorry its my second dumb question? I click on the exe. Screen pops up and goes away. I go to the command promp type the exe. and it Tells me it cant find my file, So I add my complete filepath. Thank you

---

<div class="post-metadata">

**Author:** ![md8n](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/md8n/32/28197_2.png) [@md8n](https://forums.maslowcnc.com/u/md8n)\
**Post date:** [July 26, 2020, 12:01am UTC](https://forums.maslowcnc.com/t/i-need-samples-of-dodgy-gcode/14061/11 "2020-07-26T00:01:03Z")

</div>

Open up a command prompt.  
Change to the folder where you put the .exe  
And run it from there.

There are some instructions in the README.md in the GitHub repository itself (where you got the file from):

> **[md8n/GCodeClean](https://github.com/md8n/GCodeClean)**
>
> A command line utility to 'clean' GCode (.nc) files - md8n/GCodeClean

---

<div class="post-metadata">

**Author:** ![kurt](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/kurt/32/13763_2.png) [@kurt](https://forums.maslowcnc.com/u/kurt)\
**Post date:** [July 27, 2020, 7:23pm UTC](https://forums.maslowcnc.com/t/i-need-samples-of-dodgy-gcode/14061/12 "2020-07-27T19:23:47Z")

</div>

Any chance that GCodeClean will make it to WebControl? As a plugin or so?

---

<div class="post-metadata">

**Author:** ![Orob](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/orob/32/16344_2.png) [@Orob](https://forums.maslowcnc.com/u/Orob)\
**Post date:** [July 27, 2020, 11:24pm UTC](https://forums.maslowcnc.com/t/i-need-samples-of-dodgy-gcode/14061/13 "2020-07-27T23:24:10Z")

</div>

I would suppose there is always a chance, but it would need to be wrapped to be called from webcontrol. @md8n might have insight on how to do that and if it would be a good idea.

---

<div class="post-metadata">

**Author:** ![md8n](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/md8n/32/28197_2.png) [@md8n](https://forums.maslowcnc.com/u/md8n)\
**Post date:** [July 28, 2020, 12:17am UTC](https://forums.maslowcnc.com/t/i-need-samples-of-dodgy-gcode/14061/14 "2020-07-28T00:17:29Z")

</div>

GCodeClean is a two part solution. There’s the ‘front end’ which is the actual command-line executable, and then there’s the library of all of the clean up routines. The only thing of real interest about the ‘front end’ is that it includes all of the default parameters that I’ve figured out over time, and also the default sequence of clean up routines that works best.

It could be ‘wrapped’ in several ways. It requires .Net Core (which runs on everything).

- I could convert it to an [ASP.Net](http://ASP.Net) Core project and then expose the functionality via an API, stick the thing in a Docker Container (running Ubuntu probably) and it would be just this ‘thing’, that you drop in.
- Or I could just ignore Docker altogether, because .Net Core runs on everything…
- Alternatively, it is a working library, but I haven’t tried calling .Net from Python (although I would be certain lots of people have).

.Net Core is not small, however GCodeClean works as a ‘streamed’ pipeline, so its memory consumption in operation is as small as I can make it. i.e. it will require more storage, but it won’t require more memory (to work).

---

<div class="post-metadata">

**Author:** ![kurt](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/kurt/32/13763_2.png) [@kurt](https://forums.maslowcnc.com/u/kurt)\
**Post date:** [July 28, 2020, 8:05pm UTC](https://forums.maslowcnc.com/t/i-need-samples-of-dodgy-gcode/14061/15 "2020-07-28T20:05:05Z")

</div>

Hihi,. had to watch a couple of these clips. 🙂

> Precisely the kind that Ben Elton built his comedy career out of.  
> (Hmm, lockdown … time to watch a lot of Blackadder)

---

<div class="post-metadata">

**Author:** ![mooselake](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/mooselake/32/6218_2.png) [@mooselake](https://forums.maslowcnc.com/u/mooselake)\
**Post date:** [July 30, 2020, 1:27am UTC](https://forums.maslowcnc.com/t/i-need-samples-of-dodgy-gcode/14061/16 "2020-07-30T01:27:22Z")

</div>

Just a follow-up. While I didn’t manage to generate any dodgy gcode I’ve been making kids number blocks on my non-maslow grbl controlled Zenbot Mini (6x7cm rounded corners blocks with a 60mm high number pocketed in the top of each one, and running the gcode cleaner on each file, 10 to 15k gcode lines on each (multiple blocks in each). No problems with the cleaned gcode, mini segment curves nicely turned into arcs. I was on the high side for feed rate/depth of cut for the curly maple I used and had some missed steps that will sand out, one more number to go that I may do uncleaned for a comparison.

Thanks for the effort!

---

<div class="post-metadata">

**Author:** ![md8n](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/md8n/32/28197_2.png) [@md8n](https://forums.maslowcnc.com/u/md8n)\
**Post date:** [July 30, 2020, 3:03am UTC](https://forums.maslowcnc.com/t/i-need-samples-of-dodgy-gcode/14061/17 "2020-07-30T03:03:10Z")

</div>

Glad it worked.

> [@mooselake](#):
>
> mini segment curves nicely turned into arcs

There’s still some optimisation for me to do with this. Obviously I’m working on Z-Axis improvement at the moment. But I do really want to revisit this behaviour, because I know that there’s some really good optimisation improvements to be made here.

---

<div class="post-metadata">

**Author:** ![md8n](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/md8n/32/28197_2.png) [@md8n](https://forums.maslowcnc.com/u/md8n)\
**Post date:** [July 31, 2020, 6:42am UTC](https://forums.maslowcnc.com/t/i-need-samples-of-dodgy-gcode/14061/18 "2020-07-31T06:42:49Z")

</div>

Oh look there’s a minor bug fix release over there --\> [Command line utility to 'clean' GCode](https://forums.maslowcnc.com/t/command-line-utility-to-clean-gcode/13073/78)

---

<div class="post-metadata">

**Author:** ![mooselake](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/mooselake/32/6218_2.png) [@mooselake](https://forums.maslowcnc.com/u/mooselake)\
**Post date:** [August 25, 2020, 9:48pm UTC](https://forums.maslowcnc.com/t/i-need-samples-of-dodgy-gcode/14061/19 "2020-08-25T21:48:23Z")

</div>

I managed to get some funny results. This is a set of nested squares done with increasing speeds from 100 to 500 mmpm, 4.5mm depth, 1.27mm doc done with Carbide Create. The unprocessed gcode runs as expected, the cleaned version runs does the last few passes with G0 instead of G1 which gets a bit miss-steppy. Pre and post cleaned files attached, along with the c2d (carbide create) file.

[Speed100-500-4-5mm.zip](https://forums.maslowcnc.com/uploads/short-url/hZ4PyBdZvNaI1PTdTcrV2LpBfhl.zip) (3.2 KB)

---

<div class="post-metadata">

**Author:** ![md8n](https://yyz1.discourse-cdn.com/flex031/user_avatar/forums.maslowcnc.com/md8n/32/28197_2.png) [@md8n](https://forums.maslowcnc.com/u/md8n)\
**Post date:** [August 26, 2020, 1:37am UTC](https://forums.maslowcnc.com/t/i-need-samples-of-dodgy-gcode/14061/20 "2020-08-26T01:37:06Z")

</div>

Thanks, I’ll have a look.

[Next page](https://forums.maslowcnc.com/t/i-need-samples-of-dodgy-gcode/14061.md?page=2)
