Safe and efficient movement after repetitive cuts

I have been doing cuts on work pieces where I have to do the cut, replace the work piece and repeat.

After each cut I wanted to move the router out of the way so I could switch pieces easily. I started out doing it manually using the UGS jogger but found that to be risky (because I’m clumsy sometimes). If I moved the machine too far in any direction and jammed the carriage it would throw off the settings causing me to have to re-zero everything.

Talking to Andy last week, he suggested that I put in a line at the end of the g-code that would move the router to a known safe position. Well, being an old programmer I saw that this was a great solution, one that I should have thought of myself. Doh.

What I do now is determine where I want the machine to rest at the end of the cut and what is a safe path to get there. I then add or replace the line at the end of the g-code that returns the cutter to zero.

For example, in one instance my zero point is bottom left. I use Vcarve Desktop and it sets the final spot to be about 20 mm above the zero point using two separate commands: “G0Z20.32” and “G0.000X0Y0.000”. Be careful here, other CAM apps like Carbide Create might go back to Z0 also so you probably do not want to drag the cutter across your work piece at that height.

I figured that the best resting point after this particular cut would be 110 mm up the Y axis and 110 mm to the right on the X axis. This position is both out of the way and also has a clear path from the end of the cut and to the zero start point for the next cut.

Using my trusty UltraEdit I changed the “G0X0.000Y0.000” at the end to “G0X110Y110”.

Now when the cut is done, I have room to safely replace the work piece and then hit start again to do the next cut. This also has the added benefit of speeding up the process in general.

One last thing, remember that if you decide to change the tool path(s) you will have to edit the g-code again to insert the correct command.

I hope this is helpful. Thanks to Andy for the hint.



Great tip, Ron. tks. I find myself always changing the jog distance so that I can get the router out of the way of my hold downs at the end of a job. Generally, getting set up for a job, I’ve reduced the x and y jog to something very small so that I can sneak up on 0. Then, when the job is done. I increase the jog to quickly move the router out of the way. It’s not a big deal, but it is a pain. Your edit will move the router out of the way quickly and easily.

1 Like

I know it goes without saying, but at some point every CNC user does it (I’ve done it more than once :frowning: ) But make sure you raise your cutter to a safe Z height BEFORE moving it “out of the way”.

As an additional idea, you could modify the post processor you are using to add a movement to a save height and location after every job without requiring manual editing.

I believe the NYCNC Guy on YouTube has some examples of playing around with the post processor for Fusion360, but I suspect the concepts apply to whatever CAM you are using.


I will check out the possibility to modify the post processor in VCarve.

However, I do not want the machine to go to the same spot after every tool path. It will depend on the work piece shape, where the cutting is being done, where the hold downs are, etc. So it might not be such a great thing to have it in the post processor.

Time will tell.


The machine returns to the position it was in when you power it on. All I do is jog it to where I want it for tool changes etc. then toggle it on and off again.

Mine does not return to where it was when I powered it on. It returns to 0,0,0. That is the final line in the Gcode that Vcarve creates. Maybe that’s different for other CAM software.

Your machine should return to where you set the initial 0,0,0 point at the start of the job. Not the machine 0,0,0. Once you set the 0 point on your work piece that is where it should go back too every time.

Just to clarify, there is no “always” when working with the g-code generated by the CAM software .

The return position of the cutter will depend on the CAM software that generates the g-code.

For example the free version Carbide Create generates g-code to return to X0Y0Z0 by default. I don’t know how to change it.

In my case, Vcarve Desktop has a default setting of X0Y0Z0.80 inches.
That results in G-code:


Note that this puts the mill 0.8 inches (20.32 mm) above the zero point.

Since I want the router to move out of the way so I can change to the next piece I use my text editor to change the code to:


Then I just change the work piece and hit start again.

I could also change the post processor, but would have to do that for every time I want to change the end location.

Again, the end position will depend on the CAM software and any modifications you might make to the g-code.

Cheers. Ron

1 Like