v0.8.5.4 is up in GitHub right now, along with the releases for OSX, Windows and Linux.
This fixes issue #1 removing the redundant (and according to the spec wrong) G0 command right at the start of some GCode files, e.g. those generating by Fusion 360.
The DedupLinearToArc function has also been improved to ‘screw up even less’. There still seems to be an issue in a handful of cases, current suspect is movement through the 3rd axis relative to the current ‘plane’.
A little bit of refactoring to remove some redundant constant values.
v0.8.6.0 is now up on GitHub, and the releases for Linux, OSX, and Windows as well.
This fixes the mis-handling of the I J K arguments, as a result I think this is now pretty close to being v1.
I’d appreciate anyone who wants to throw their own gcode at it to see how it compares.
So it now converts very short arcs (G2 and G3) into straight lines (G1).
And then ironically it feeds that back into the LinearToArcDedup algorithm, which results in much better curves.
I’ve also added command line options to set the general tolerance value (this affects the clipping of decimal places, and some maths operations), and an arcTolerance value for the above function.
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 movements.
I’d appreciate it if anyone can reply with GCode files that have the “uppy downy thing” happening (AKA “Raveling Nancy” for those who know their Blackadder).
I know it’s called GCodeClean and it does a few M-Codes but would it be possible to get the rest of the M-Codes? Sorry to be a bother. Thanks
M0 (Program Stop)
M1 (Optional Program Stop)
M2 (Program End)
M3 (Turn Spindle: Clockwise)
M4 (Turn Spindle: Counterclockwise)
M5 (Turn Spindle: Stop)
M6 (Tool Change)
M7 (Coolant: Mist, On)
M8 (Coolant: Flood, On)
M9 (Coolant: Mist and Flood, Off)
M10
M11
M13
M19
M21
M22
M23
M24
M30 (Program End, Pallet Shuttle, and Reset)
M41
M42
M43
M44
M48 (Speed and Feed Overrides: Enable)
M49 (Speed and Feed Overrides: Disable)
M52
M60 (Pallet Shuttle and Program Stop)
M98
M99
Thanks for your response. I own a miniature horizontal CNC mill and am a C# Visual Studio SQL programmer for a living. The programs the vendor provides with the mill have no comments.
After spending hours trying to memorize G-codes so I could understand their code, I was completely thrilled to find you efforts. I ran the vendor’s code through your program and finally was able to see what it was doing.
Paramount Die Company is very close to where I live and I want to talk to them about a part time programming job. http://www.paradie.com/
They use GibbsCam software and from their product line, it looks like they use lathes.
Here is the list of M Codes – CNC Milling and Lathe I was looking at:
Complete list of G and M codes which are common in almost all the cnc controls which are used in cnc machine workshops around the world.
If your utility could just display the Description that they have beside the codes, it would save the tremendous effort required to either memorize or look up each code as it it used.
Might be handy to put the gcode descriptions in an editable file (yes, I know source code is editable, but it’s a bigger project), at least for the non-RS274X codes added for 3D printers and controller vendor additions.
The code is already set up for me to add a command line option for this.
However, I need to expand the definition file so that command groups can be identified, as well as the priorities between commands, etc. And that requires dome refactoring.
No problems, obviously if you have a reliable source for those other codes feel free to send me a reference, or put them into tokenDefinitions.json yourself and send me a pull request (you may need to do a fork to get github to accept it back)