How to add a G0 command to the output with having to manually edit the G code

How to add a G0 command to the output with having to manually edit the G code

dave
Contributor Contributor
1,200 Views
3 Replies
Message 1 of 4

How to add a G0 command to the output with having to manually edit the G code

dave
Contributor
Contributor

Is there a way to add a line to the output prior to any move commands?

 

I have a desktop CNC mill with Mach3 and when I set the zero point and then start the gcode, it does not retract and goes to the start point and this often leaves a mark on the material. I have to manually raise the Z by about 5 to 10mm before starting the G code but sometimes I forget to do this and end up with a scrapped part. 😞 

 

For now I have started to include a G0 Z5. line that I manually enter into the post output but wondering if there is a way to do this automatically when I generate the code?

0 Likes
1,201 Views
3 Replies
Replies (3)
Message 2 of 4

HughesTooling
Consultant
Consultant

Search the forum a bit looking for G28 and Mach3. There's a post at least once a week where someone doesn't have limit switches and haven't homed their machine so G28 doesn't take the Z to fully retracted. Also you might want to google G28 for info on what it does.

 

Mark

Mark Hughes
Owner, Hughes Tooling
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


0 Likes
Message 3 of 4

dave
Contributor
Contributor

Not quite. I was referring to a retract when you start the machine. Here is the existing start of the Gcode output from Fusion 360 with the manually entered line. I would like this line to be automatic each time. I have disabled the G28 for my machine. Without this line, the machine moves to the start point based on the zero position and therefore may just mark the surface. It's minor but not ideal. The G0 Z5. prevents this.

 

G90 G94 G91.1 G40 G49 G17
G21

(2D CONTOUR1)
M5
M9
T6
S22000 M3
G54
M9
G0 Z5.                                    <---- Want this line inserted automatically. This was manually added.
G0 X23.203 Y35.536
G43 Z15. H6
Z5.
G1 Z2. F100.
Z-0.8
G19 G2 Y35.336 Z-1. J-0.2 K0.

0 Likes
Message 4 of 4

HughesTooling
Consultant
Consultant

Like I said look up what G28 does. If you home your machine the G53 offset will be where your limit switches are and G54 is your work datum so when a G28 Z0. is run the machine will go to the limit switch (G53 z0.) an fully retract the Z. There are several thread on the forum describing how to zero your G53 home position to a save place if you don't have limit switches. This is far safer if you need to change tools.

 

Mark

Mark Hughes
Owner, Hughes Tooling
Did you find this post helpful? Feel free to Like this post.
Did your question get successfully answered? Then click on the ACCEPT SOLUTION button.

EESignature


0 Likes