Skip to content

Running a job (#3): loading, preparing and running Gcode with LinuxCNC

Jason Webb edited this page Jul 5, 2017 · 17 revisions

Quick links:

  1. Launch LinuxCNC with Mesa 4x4 configuration
  2. Load and view your G-code
  3. Unlock and enable the machine
  4. Home all axes
  5. Jog machine to desired origin on workpiece
  6. Align machine coordinates to workpiece
  7. Jog the machine around your job to check travel
  8. Run your job in the air to check travel
  9. Touch off Z axis to top of workpiece
  10. Run your job
  11. Monitoring, pausing and stopping your job


IMPORTANT! Before you load and run any G-code make sure you have done the following:

  1. Checked the machine for any significant mechanical problems and cleared debris
  2. Properly installed an appropriate end mill or router bit into the spindle
  3. Powered on and checked the machine's electronics system
  4. Logged on to the host machine PC
  5. Secured your workpiece to the spoilboard


1. Launch LinuxCNC with Mesa 4x4 configuration

Use the "Mesa 4x4" desktop icon to launch LinuxCNC pre-configured with all the settings for our machine.


2. Load and view your G-code

Load your G-code file using File > Open.

Once loaded, use the mouse to fly the camera around and orient the screen in a way that makes sense to you. You can also use the X/Y/Z view buttons to snap to standard views.

Note the cube marked by the red dotted lines. This indicates the work envelope of the machine, and no toolpaths or movements are allowed outside of this box (they will be stopped by "soft" limits).


3. Unlock and enable the machine

  • For safety reasons the machine is locked until you manually enable it.
  • Click the red X button to disable Emergency Stop (or hit F1), which should enable other buttons on the toolbar.
  • One of these buttons is the Machine Power button directly next to the Emergency Stop button. Click it or hit F2 to power up the system. You may notice the machine jump slightly and start to hum - that means its alive!

4. Home all axes

Before the machine can understand where you want it to move to, it needs to first understand where it is. We do this with a process called homing, which involves slowly moving each axis until it hits it's respective minimum endstop, at which point the machine knows for sure that the axis is at the 0 position.

Although we have the ability to home all axes at once, I recommend homing each axis individually so that you can carefully watch the movement of each axis from start to finish at your own pace.

Start with Z axis to make sure spindle is up and out of the way of any clamps and workpieces._


5. Jog machine to desired origin on workpiece

Use the keyboard arrow keys to move the spindle to wherever you want the origin to be on your workpiece.

  • Move the X axis with left/right arrow keys.
  • Move the Y axis with up/down arrow keys.
  • Leave the Z axis all the way up for now.

If the machine is running too fast or too slow for you, check the movement increment in LinuxCNC. Be careful not to go too fast though!


6. Align machine coordinates to workpiece

Although we've physically moved the spindle to where we want our job to start, right now LinuxCNC still thinks that the origin (0,0) is at the very bottom left of the spoilboard. This means that if you were to hit the "Start" button to run your G-code, the machine would run all the way back there to cut out your part!

To tell the machine that we want it to consider the current position to be the new origin we need to touch off each axis using the following process:

  • In the Machine control (F3) tab on the left, make sure that the X axis is selected
  • Click the "Touch off" button.
  • Hit OK on the dialog box that pops up, and you should see the screen on the right update to shift the machine's coordinate system (in red) to line up with your job.
  • Repeat this process for the Y axis, but leave the Z axis alone for now.

7. Jog the machine around your job to check travel

With the Z axis still all the way up, use the keyboard arrow keys to carefully jog the machine all the way around your toolpath, checking to make sure that the movement is smooth and even and that there is no risk of the end mill, collet or dust shoe running into any clamps once they are lowered.


8. Run your job in the air to check travel

With the Z axis still all the way up, let's go ahead and do a test run of your job in the air to make extra sure that no problems will happen when the Z axis is lowered.

If your G-code has any retraction movements (negative Z values) in it, for example to cut out multiple, separate shapes, you may lower the Z axis an inch or so to give it some room. Just like the X and Y axes, use the keyboard page up/down buttons to move the Z axis to where you want it, then use the Z axis "Touch off" button to set the new 0 coordinate.

Hit the "Play" button to run your job, and get ready to hit the "Stop" button at any moment should anything go wrong.


9. Touch off Z axis to top of workpiece

If running your job in the air look good, you can now align the Z axis to your workpiece by using the keyboard page up/down keys. Use a relatively large movement increment when you're far away from the workpiece, then use a much smaller increment (like 0.1in) when you are getting close.

If you need to get it really accurate, try putting a piece of paper on the workpiece and moving the Z axis downward until you can just barely move the paper between the end mill and spoilboard.

In the near future we will have a more precise automatic Z height probe, but for now just get as close as you can!


10. Run your job

IMPORTANT! Put on safety glasses and hearing protection before running your job!

Check on last time for the following:

  1. Blue coolant should be flowing in and out of the spindle. If not, go back to the Machine setup step.
  2. The X, Y and Z axes should all be "touched off" so that the machine knows where your workpiece is.

If things look good, hit the "Play" button and be ready to hit the "Stop" or "Emergency Stop" button at any moment.

The spindle should spin up right away, then the machine will follow all of the toolpaths.


11. Monitoring, pausing and stopping your job

Clone this wiki locally