/building · 2017

Lego CNC

mindstorms nxt · lejos · ~20µm

A three-axis CNC machine built from Lego Mindstorms and a dremel, with worm-gear axes accurate to about twenty micrometers, carving shapes out of floral foam.

A Lego gantry machine over a glass bed, cutting a square groove into a block of floral foam

CNC machines have become a recent obsession of mine, and as a result, I decided to build one out of a Lego Mindstorms NXT kit. After leaving Legos sprawled across my room for over a week and a half, I finally finished creating a machine that can manipulate a cutting tool with some impressive precision.

A Lego gantry machine over a glass bed, cutting a square groove into a block of green floral foam
A second axis drive, with a chain running along a Technic beam
A close view of the Lego gear train and chain drive on one axis
The spindle carriage holding a hand dremel and its battery pack
The machine cutting a square pocket into floral foam on a glass bed.

The tool#

The cutting tool is a small hand dremel that I found on Amazon. It is excellent for cutting accurately through green floral foam.

The cutting tool is mounted to a linear actuator that uses a worm gear for maximum precision. One rotation of the worm gear moves the dremel 3 millimeters up or down, so the Lego motor's 2.5 degree accuracy gives an z-axis accuracy of the cutting head of approximately 20 micrometers!

A hand dremel held in a Lego carriage, cutting a square groove into a block of green floral foam
A close view of the Lego gear train and chain drive on one axis

To achieve the same level of accuracy on the other axis, I used a Lego bike chain with a 24 tooth gear. While this wasn't as precise as the worm gear, it was enough for what I had in mind.

A photo of the cutting head
A photo of the cutting head
The cutting head and the linear actuator.

The track that the cutting head moves on laterally has a space for the bike chain slide underneath. The yellow wheels ensure that there is no static friction when making minor adjustments to the cutting head's position.

Underneath the cutting table, there is another motor that drives a rack and pinion setup for the third axis of motion.

The software#

I used leJOS to write a Java program for controlling the cutting head, and I used Mathematica to communicate the coordinates for cutting out a 3D file. I'll update this post with screenshots of the software and rendering process when I get time.

cd /building