Newbie in need of CNC G-code help eliminating "multiple straight line moves" (Mastercam/Camworks/etc.)

Hello all,

I found a GO program that has one feature I really need. It “kills redundant code, and just tries to make Grbl and the router waste less time”.

I need to eliminate redundant code. One company I’m doing work for has very old machines with limited memory and no decimal points allowed therefore having extra code gets to be a challenge to clean-up on large programs. I’m attaching some simple examples for your reference.

Example code noted below is to show the before and after G-CODE going at a two different angles. One "multiple straight line move " is at zero degrees and the other one at a 45 degrees angle to better explain my issue.


BEFORE G-CODE EXAMPLE:

%
O0001
G54 H9 T9 M6 (.200 dia test tool=no dia comp)
G0 G15 X12000 Y0 S2000 M3 H1
G90 Z1000 M8
G1 Z0 F200
X10000
X0
X-2000
G0 Z1000
X1414 Y-1414
G1 Z0 F200
X0 Y0
X7071 Y7071
X-8485 Y8485
G0 Z1000 M9
M2
%


AFTER EDITING:

%
O0001
G54 H9 T9 M6 (.200 dia test tool=no dia comp)
G0 G15 X12000 Y0 S2000 M3 H1
G90 Z1000 M8
G1 Z0 F200
X-2000
G0 Z1000
X1414 Y-1414
G1 Z0 F200
X-8485 Y8485
G0 Z1000 M9
M2
%


Thanks in advance!

Ez

2 Likes

That sounds neat, but at least I don’t speak G-code and it’s not super clear to me what you need help with (optimizing away redundant moves, yes, but something specific in terms of Go?). :slight_smile:

I believe that Joushou has that program I need done already but I had problems making it run on my computer :frowning:

Original “Staight line Coordinates” have intermediate coordinates that are not needed to make a straight line:

EXTRA MOVES
X12000 Y0
X10000 (not needed)
X0 (not needed)
X-2000


Eliminating those extra moves helps save memory for these old machines. To make a straight line I only need the start and end point therefore the need to get rid of any extra “Straight Line Coordinate” moves not needed on large programs:

NEEDED MOVES ONLY
X12000 Y0
X-2000

Thanks

I would like to thank you all for your interest in helping out. I’m glad I searched around and found this site. It’s awesome having forums like this. I will definitely take some of the GO training classes offered on this community after I finish with the project I’m working on.

Jousuo updated the installation program to work with Windows 10 and we’re almost there :slight_smile:

1 Like

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.