A site dedicated to CNC of Mini lathes - the 7x10, 7x12, 7x14, and 7x16


A major part of any CNC machine is the software that drives it.

The two major players in hobby CNC are LinuxCNC and Mach3 from Artsoft.

LinuxCNC is a free, fully featured machine controller based on ubuntu linux with a real time kernel. A real time kernel / operating system means precise timing is prioritised (i.e. steps are sent at the right time and not delayed).

I'm working on some guides for LinuxCNC.

Mach3 runs on Windows, which is not a real time operating system, so Mach3 does some complex stuff behind the scenes to get a similar result. Mach3 costs ~$150 and is available from a few sources at different prices, make sure to look around. It's usually cheaper when bought with stepper drivers etc. It is very widely used and there is a large support base.

Posted by  7xCNC  November 3, 2012

LinuxCNC (as of 2.5) has great lathe support.

LinuxCNC can seem daunting at first, and there is a common perception that you need to edit lots of code, but it's actually very easy to get going.

The stepconf wizard provides a graphical interface for setting up you machine. You can set lathe mode, driver settings, ports & pins, axis settings (and test them), spindles settings - all without digging through menus and obscure setting pages.

Posted by  7xCNC  November 3, 2012

For the princely sum of $6.50 I was able to get a jogging pendant going.

I bought a cheap imitation PS2 controller from ebay:

Ebay Joypad

I then followed a LinuxCNC wiki guide: Simple Remote Pendant using a $10-20 joypad with halui and hal_input and the adding more controls to pendant page

Note: To get the more complex joypad code working (with incremental jog) I had to comment out "loadrt near" and "addf near.0 servo-thread" in my main .hal file. I believe these are there for the spindle speed sensor, added by stepconf. In custom_postgui.hal I then increased the count of 'near' and renumbered the "near.n" (in the code example from the 2nd LinuxCNC page) for my spindle sensor.

Posted by  7xCNC  November 9, 2012

Z is the long axis of the lathe

Z0 is the end of the stock

-Z is then towards the chuck, and +Z towards the tailstock.

X is the cross slide

X0 is the centreline - the very point of the tool should be on the centreline at X0

+X depends on the machine, but in a converted manual lathe is usually towards the operator. And -X away from the operator.

Posted by  7xCNC  November 9, 2012

NGCGUI is a subroutine system for LinuxCNC. It's conversational CNC programming. That means rather than designing a model in CAD then running it through CAM to get Gcode which you run via LinuxCNC, you can enter a few parameters directly into LinuxCNC and go.

It's great for simple machining, and in fact can cover the majority of lathe operations. You can build a whole program from a number of different subroutines. For example, you can turn a length to size, then thread part of it and put a radius on the end. There are all sorts of combinations possible.

There are a whole bunch of subroutines available (most in the LinuxCNC forum) and you can easily write your own.

Posted by  7xCNC  December 29, 2012

If you are going to use more than one tool in a part with a CNC lathe, you'll need an accurate tool table.

The tool table tells the controller software where the cutting edge is in space. This is necessary as the G Code tells the controller to move, for example from Z0 to Z10 but doesn't contain any information about where the cutting edge is relative to the lathe. For instance, if you are using a left cutting tool and a right cutting tool, the Z position of the cutting edge will be different (Z offset). Or tools might protrude different distances from the tool post (X offset).

Decide on a system for numbering your tools. Label your tools with these numbers (whiteout correction fluid works well for this).

In LinuxCNC the tool table can be edited manually - either by text file, or more easily via the tool table editor, found in the file menu. You'll need to do some manual entry to set up tool angles for tool display in the preview.

Posted by  7xCNC  June 20, 2014

Probing is one of the great basic functions of a CNC setup. Easily find the top, edges of you work piece, or even find the centre of a hole.

LinuxCNC is very customisable in this area, like most others, but unfortunately you need some probing code. Never fear, I've collected a few useful bits of code and some subroutines to make probing easy!

Have a look at my guide on a Z Touch Off Plate for LinuxCNC. This is very useful for routers and other machines that have no way of a repeatable Z height for each tool. With a router, each time you change tools you end up with a different tool length sticking out. With this simple code you just place your plate under the tool and hit a button.

Next up we'll get a bit more complex with a NGCGUI subroutine for finding the corner of a workpiece and the Z height (this one needs a probe rather than a touch plate). It's configurable with probing speeds, distances, safe heights, and final position.

Posted by  7xCNC  December 18, 2013

Probing is one of the great basic functions of a CNC setup. Easily find the top, edges of you work piece, or even find the centre of a hole.

I'll explain here how to set up a Z axis Auto Touch Off plate for a router.


This is very simple. For a G540, or any BOB that uses inputs shorted to ground: I use a piece of blank PCB wired to pin 13 on my breakout board. I then have a wire from ground to an alligator clip on my spindle. When the tool touches down on the plate, a circuit is completed from ground to pin 13.

On my newer machines, I use a Mesanet 7i76. This has sinking inputs. They require +ve voltage connected to the input to trigger. This is a problem with my touch off plate, as the spindle is grounded, and connecting 12V to it via the touch off plate results in a short to ground. The solution is to have a pull up resistor. The wiring is: Ground connected to the tool. PCB plate connected to input of 7i76. A 2.2k resistor between the PCB plate and 12V. This 'pulls' the input high, then it goes low when the PCB and tool form a circuit to ground. In this setup, the pin is always high (triggered) except when the probe touches, so I invert the input in LinuxCNC.


A standard install of LinuxCNC has everything you need.

We are going to use G38.2 (probe toward workpiece, stop on contact, signal error if failure ) and G10 L20 P1 Z (Set Coordinate System to a calculated value that makes the current coordinates become the given value)

We are going to need to modify your .ini file, your .hal file, custompanel.xml, and custom_postgui.hal. We'll also need to create a file '100.ngc' and place that in the nc_files folder.

.hal first up:

Posted by  7xCNC  June 21, 2014

This guide will show you how to set up a probing routine for use on the mill/router. It finds the corner of your work (or vice). It uses an NGCGUI subroutine which has configurable settings. This is 95% based on great work from Rick G at LinuxCNC forums.

This Subroutine finds a corner (front (lower) left) and sets it to X0 Y0, it then probes Z at a set point and sets Z0
You need to jog the machine so your probe is near to the front of your work piece.

 - Fast probe Y+, retract, then slow probe Y+ to find Y0
 - Retracts, then moves along in X- direction by "Y Search increment"
 - At each increment it does a fast probe in Y+ until encounters material, then retracts and moves along next increment
 - If no material is encountered when moving Y+ within "Dist to Probe" it begans to probe in X+ direction
 - When it encounters material, it retracts in X-, then does a slow probe X+ to find X0
 - "Y Search Max" sets a maximum distance it will try to probe along X- to find the corner, if the corner is not found within this distance it will stop and error
 - Uses G92 to set X and Y axis at probe position minus radius of probe plus correction
 - Once X0Y0 is set, retracts Z up to "Z Safe" then travels to "X Coord" then "Y Coord" to perform a Z probe to set Z0
 - Finally moves to final coordinates "Z Safe" first, then "X Final Pos""Y Final Pos", then "Z Final Pos"

Warning: This code has been tested in simulation primarily. You need to test it yourself, on your machine, to make sure the world does not explode. I take no responsibility for what happens when you run this code. Pay particular attention to the tool change / Z offsets.

This code is intentionally quite slow. It uses G38.3 (probe) for all nearly all moves. It could be sped up significantly by using G0 (rapid) for the retracts etc.