Thank you very much. I am playing around with Z0 and getting good results. I will let you know if it works perfectly.
Caution here though... The first G00 Z0 line I highlighted occurs *after* the first XY movement...
G00 X-4.291 Y16.566 '''Move to First XY Coord.
G00 Z0 '''Move to Z0
These two lines are the first two movement lines in the Gcode you shared above.
If you simply modify that Z0 to something else, the machine may still drag the bit through the material or along the CNC bed.
It would be best to place an 'additional' line before this.
G00 == Rapid Movement. ( Can move one or more Axis at the same time by using X, Y, or Z followed by the *position/Distance for each Axis)
G00 Z2 ''' will Rapid Move the Z-Axis to 2mm high (or 2mm higher depending on operation mode)
Easiest would be to put this Immediately before the "First XY Coord." movement.
The rest of your code looks fine. The Code does move the cutting tool up by itself after a cut, and between cuts, so this should only be necessary before the very first move.
Typical CNC GCode programs start with a number of 'G' and 'M' codes . This is typically the 'setup block' of the file which is supposed to 'cancel' any previous modes, and 'set' the modes required for the file.
An example of this is 'G21' used at the very beginning. This sets the operation mode to 'mm' ... otherwise if you had previously operated in Inches, your program could end up wrong.
After these 'mode-set' commands, the machine is typically moved 'rapidly' to it's beginning position with the G00 command . Look for this!
If there is a G00 command that moves the X and|or Y direction *before* a G00 command that moves the Z direction, you may have a problem.
After this first move, the machine typically 'feeds' into the material with the G01 command. This command can and often will have all 3 axis (X, Y and Z) but may only have Z when operated on the Type of CNC you have.
GCode is simply a list of instructions and moves for the machine to make. Once you understand that G00 is 'rapid' and G01 is 'Feed' ... you should be able to read the file manually to determine if the machine makes any odd moves, or to determine what may have gone wrong.
G00 should *never* make a move that would touch the material or table... This is a 'rapid' move and is often much too fast for the bit... This can result in damage to the bit or machine.
Only the G01 command should issue a move that may touch the material.