Tutorial: The "Start From Selected Line" Function

Resuming an Interrupted Milling Progam on PlanetCNC

Planet CNC offers the option to "Start From a Selected Line" instead of from the beginning of the G-code. This can be useful for resuming a job that was stopped for various reasons, such as a software/computer crash, a broken tool, a power outage or an emergency stop...

While this function is very useful, it is important to understand how it works in order to avoid errors, as misusing it can cause the machine to run the end mill across the whole panel and even break your tool.

Planet Cnc Start From Selected Line

Coordinates' Conservation

If your program stops or the machine turns off, but the motors do not get blocked or stalled, the coordinates are probably still valid, so you can easily resume the program without needing to home. But if the program was stopped because of a crash or machine jam, the motors might have lost steps and the coordinates will no longer be valid. Resuming the program now will most likely result in discrepancies and offsets with the previous cuts.

If you have any doubts, it is always better to do a new Home and Square (as long as you also did them before starting the original job);

IMPORTANT: Whatever you do, do not change the Working Coordinates (do not press the X0Y0 button!) and ensure that your panel does not move throughout the process. If you have to change the tool, measuring the Z height with the probe is possible but once again, without moving the panel.

Finding the Right Line

To resume at the right place, you’ll need to know/find the G-code line corresponding to the place the program stopped, or a close one.

If the software is still open at the stop, take note of the line number where the program is stuck, this will be helpful to get back to it later as some actions may scroll back the whole G-code to the beginning.

If you don't know the line, here are tips to find a good place to resume:

  • If your program has different operations that are not to long, you can find the beginning of the last operation started. Maybe the machine will run a few lines of "air-milling" inside places that were already milled, but at some point it will reach the place where it stopped.
    (You can use the "find line" tools of planet CNC to find the next comment in the code, or the next tool change for example).

    Planetcnc Find Line Operation Start

  • You can also try to get as close as possible to the line where it stopped by checking the line content: find a line with the right Z-height corresponding to the stop point.
    Then starting from here, scroll down until you find a line with XY coordinates close to the stopping point. (be careful if you had multiple pass, as the machine will run multiple times the saxe XY coordinates but at different Z height, you need the right one).

    When you click on a line, the planetCNC display will show the corresponding path on the screen with a red line and a red circle/cone that represents the END of the orders given by the selected line (the coordinates where the line requests the tool to go, NOT where it will start).

    Here in example, the line selected says X0, which is where the Red circle is, but the red line shows the toolpath from the previous line to this one (more informations below).

    Red Indicators Selected Line Toolpath

In any case, you are better off choosing a line a little bit earlier than the stop point and doing some "air-cnc" for a while. This way you can also see instantly if your coordinates are still aligned as the tool should not be touching anything if it has already been milled.

Understanding the Function

Basically, this function starts the G-code from the line of the program that you selected on the right panel of Planet CNC.

In G-code, however, a line only indicates what needs to be done at a very specific moment, starting from the position it ended up in the previous line(s).
Therefore, when launching from a specific line, the software has to look back through the code to determine where it was supposed to be placed before executing that line of code.

This is where it can get tricky, let's use the example from above:

If I want to start from this line #31, it only tells the machine to go to X0.
But at what X, Y and Z coordinates does it have to start from?

The machine will look at the previous lines until it finds the last known X, Y and Z coordinates.
In this case, we can see that, on the line just above, the machine was going to X=119,134 and Y=117,361.

Previous Line Coordinates

So, we have the X and Y where it would start, but to find the Z, we have to go back many lines: as the machine was running a contour cut, the depth was constant and it was set at the begining of the operation. 
On line #18, we see the latest Z command, that sets Z=7,4.

Finding Z Coordinate

Let's summarise:

When launching from this line #31, the tool will first need to reach its starting point of :
X=119,134  Y=117,361  Z=7.4

To do so it will go in a straight line from its current position to these coordinates.
If your tool is not positioned directly above the starting point, it will travel at full speed diagonally to reach that location, which is usually below the surface of the panel. This often results in an unwanted cut across the whole panel, potentially ruining your previous work and breaking the tool.

Here is a video that illustrates what will happen as a result of that mistake:

- The program is launched from the begining, then stopped at line 30.
- Then the tool is moved away manually (symbolizing a Homing for example)
- Then the program is started again from line 31 without replacing the tool above the position.
- An unwanted cut at high speed happens accros the work, ruining the parts, before the machine continues with the program.

Using the Function Properly

Here's the full procedure to avoid making mistakes:

  • When you have picked the line you want to start from, check where its starting point is.
  • Don't trust the red dot on the screen, as this shows the destination of the selected line, not its starting point. Look at the red path to see where it starts.
  • Then, place your tool right above this starting point. If you can see the latest X and Y coordinates in a G-code line above yours: place your tool exactly at those coordinates (with the Z above the panel).
  • Go to "Machine" / "Start Options" / "Start from Selected Line" (or right click on the line if you use a mouse).
  • Keep and hand on the Emergency-Stop in case you made a mistake as the machine will move rapidly.

If you put your tool in the right place, it will go down to reach the XYZ starting point. Then it will do what the selected G-code line tells it to do, and carry on with the program as expected.

About Mekanika

Mekanika is a Belgian company based in Brussels whose ambition is to make local production more accessible thanks to a 100% open-source approach.

We design and produce high quality machines for CNC milling and screen printing, which have been recognized for their reliability and ease of use. Our tools are delivered as kits and fully documented, allowing to easily adapt them to specific needs.

Visit our shop to find out more, or check out our online resources and tutorials to continue learning.

Related Articles

 <img src="image.jpg" alt="">
Understanding & Optimizing Your Vacuum Table

Find out how to maximize the performance of your vacuum table by learning practical tips on cutting strategies, spoilerboard maintenance and many more.

Maxime G.

Maxime G.

Product Engineering