CNC/RepRap Linear Motion – How to Move Things With Stepper Motors

Whether it’s a CNC, RepRap, or the Audrey Braille Display, linear motion is key. And that’s FAST linear motion, by the way – as fast as possible. After all, the goal is to move a CNC or RepRap head as fast as possible, while producing a nicely formed object.

To translate the veritable stepper motor’s turning into a back and forth motion breaks roughly into two camps – screws and wheels (gears). With wheel motion, you turn a gear and it turns a belt, other gear(s), or a chain, for example; with screws, a turn of the motor turns a screw, be it all thread, acme thread, or something else (of course, there’s variations, since you can turn an Acme screw indirectly via a gear or belt, but we’re referring really to the final result, not the method to get there).

That’s theory; but what’s the practice? The fact is, for motion movement on a budget, the problem breaks down into two sections:

  • I want to use a wheel to drive a belt or chain, for example.
  • I want to use a screw, such as an Acme or allthread.

By the way, Acme/allthread are common names for specific types of threads – allthread is the type of thread you find in long rods at the hardware shop. It’s cheap and simple to use; just match a nut or two to it, and use that to convert the motor turning into linear motion, by attaching it to a platform. However, allthread suffers from a very real problem: friction. A typical screw is designed to be full of friction – after all, you don’t want your bolts to loosen easily, do you? But this friction makes it harder for a linear motion system, perhaps too hard for normal use (although many hobby CNC machines have successfully used allthread for linear motion). As well, they tend to be imprecise, although a typical non-professional user would likely never notice.

In contrast, Acme thread is a different design, with shallow angled threads, so friction is reduced. This means it’s better for linear motion – turn the thread with your motor, and use a nut on the Acme thread to get the forward/backward motion – attach that nut to a platform (ideally, rolling on bearings for a low-friction ride), and you have one axis of a CNC machine, or the travel part of the Braille display.

However, both types of threads suffer from another problem – speed. For example, I can find acme rod (also called lead screw) on eBay with 10 or 16 turns per inch. That means to travel one inch linearly, my motor has to turn at least 10 times. Using my 1.8 degree step stepper motors (which means 200 steps per turn), that ends up being 200×10=2,000 steps just to move an inch! That sounds very precise, and if all components are carefully designed, it is. But contrast the really slow speed of the design with ultra precise cutting at 1/2000 of an inch – is it worth it? For a hobbyist, not likely – even 1/250 of an inch (about 1/10 of a millimeter) is precise enough for most work. And in my Braille display, left/right motion of 0.25-0.5 mm per step is fine – which works out to be about 1/100 – 1/50 of an inch.

Of course, we’re not the only ones concerned with this speed issue, and the makers of ACME rods have come up with a solution – starts. Starts means you have more than one thread per rod (a different ‘start’ – get it?) and each of these threads winds around the rod separately like the stripes on an old-fashioned barber pole, never touching. However, the result is that the speed of the rod is increased by the number of starts. For example, a 10 thread per inch ACME rod with 2 starts is actually 10/2=5 threads per inch, as far as the stepper motor is concerned, since it only moves on one start or the other (actually, straddling both together for strength, but you get my drift). The result is faster movement.

As you can imagine, this comes at a cost, since specialized ACME designs require specialized forming and cutting, and specialized screws to attach to them, which means you likely won’t be using a multi-start rod on any hobby project. However, I am still exploring how hard it would be to cut my own low-tech multi-start rod for the Braille display – after all, if I could get it down to an effective 2-4 turns per inch, I’d be in a great position to use threaded rod for the linear drive in the Display. Don’t forget the math – at 200 steps per turn on my stepper, 2 turns per inch for the threaded rod means 2×200=400 steps to move an inch, which is 1/400″ or 0.64mm per step – and 4 turns per inch would halve that distance.

By now, you probably realize that threaded rod of any sort is a problem for any hobby motion movement (and I haven’t even gotten to whiplash, where a long thin threaded rod turning fast can oscillate and whip around in the middle, forcing the device to go slower than it has to). Fortunately, there’s other options, like geared belts and chains. These take a turn of the motor and turn it more directly into motion – attach the chain or belt to a platform, and each step moves the platform appreciably.

However, even they have issues. Belts, for example, require a certain number of teeth to remain on the wheel at all times for gripping (typically six or more), so very small wheels are not practical. The result is that fine motion is hard to do, unless you move to very, very small belts; in turn this means you can’t move bigger loads. Likewise, chains require bigger wheels, again making motion a problem.

How big an issue is this really? Well, you can get an estimate of linear motion from a gear by taking the gear’s circumference (or else the diameter times pi) and dividing by the steps per turn (actually, you’d more accurately work with the diameter to where the gears mainly mesh, called the pitch diameter, but for rough calculations the full diameter will do). So for an example, a two inch diameter gear has about a 6.28 inch circumference; divide that by my 200 steps/rotation motor, and I get about 0.031 inches per step, or close to 1/32 inch. We can also reverse the math, since if I want 0.25mm motion per step, I need 200×0.25mm=50mm per turn for the circumference, which means a diameter of 50/3.1415 or about 16mm – a very small gear indeed! And to keep at least 6 teeth on it I’d be looking at a small belt with notches less than 2mm apart, which reduces my carrying capacity.

One way machines use to solve this is by moving stepper motors in partial steps, called microstepping. Using software or hardware chips, it’s possible to break a step into fractions like 16ths or halves, effectively increasing your precision. This is done by pulling each step in two directions at once, so the motor is caught in between steps. However, not all stepper motors are exactly precise when it comes to micro stepping; in addition, micro stepping significantly reduces the power of the motor, since it requires the motor to ‘fight’ with itself, by pulling in two directions. However, it can be a solution to get finer control out of a gear or leadscrew.

Chains are worse than belts in this instance, since they are likely not small enough for this kind of job. Of course, if you are moving large loads, or gearing down the motor, then chains can be a cheap solution (for example, by using salvaged bicycle chains). Be warned that they are heavy and sag, which can affect your actual motion. However, they can be tensioned tighter than belts, which makes them more responsive and precise.

Have I left anything off? Yes, deliberately so. A rack and pinion is like two gears, in which one is ‘unrolled’ into a straight line. Move the round gear, and the rack moves back and forth as you wish. It’s got the low-friction benefits of the gears/belts versus threads, but of course it’s more complicated. However, it’s cheap; since you can cut out your rack out of just about any material, it is ideally suited for places where specialized materials are hard to come by. However, a rack is rigid, which means it’s a pain to shoehorn into a small device (like a Braille display!), so even it ends up being a compromise.

There you have it – a quick look at the types of linear drives you’ll likely use in most designs. While this doesn’t cover everything, it’s the price/performance area many hobbyists are into. It’s also the majority of the designs I looked at for the Braille Display – and ones you’ll likely consider for your next RepRap or CNC machine.

Adding an Opto-Interruptor Part 3

As I’ve already discussed here and here, opto detectors are one way to sense position. Unlike a switch, there’s no moving parts, so reliability is high. However, the compromise is a more complicated setup.

In a previous article, I showed a schematic that sent a signal to the Arduino when the light beam was unbroken between diode and sensor, and turned off when it was broken. One reader commented that the usual way was the reverse, and included a link to a schematic. The result? Two resistors instead of three, and a simple wiring job to add photo detection to the Arduino.

The devices I’m using are the HY306-02 photoelectric sensors, which I got on eBay for under 75 cents each (in packs of 10, of course), but any optical (photoelectric) sensors on eBay should work. The procedure is simple: an infrared diode shines into a detector, and both are held in place by a plastic casing (which also provides the gap between them, and the thin slit to let light pass).

Showing the glue, heat tubing, and solder - a compact mess!


Using this new circuit, the device is pretty simple to get going. One caveat: although the layout looks nice and neat here, in fact the device has reversed leads from the schematic (I reversed the detector leads on the diagram so the schematic wouldn’t look so messy with crossover leads). This means you’ll need to wire one resistor crossing over the other. In my case, I first filled the void with hot glue from a glue gun to keep the bare leads in place (apart). I then twisted on the two resistors, using a shrink heat tube to physically space the wires from each other. Finally, I soldered it all up.

The result is a nice tight bundle ready to go into the Braille device. Three wires come out of it: ground, power, and the Arduino detection wire (which can go to any digital pin). The signal is reversed (the Arduino detects a HIGH on the pin when the light beam is interrupted), but that’s a small price to pay for a circuit that is compact and easy to put together.

Finished device with wiring


While a switch is much simpler to wire, this opto circuit has one benefit (besides no wear of course) – it can be used easily for left and right detection of end stops. In my current design, it sits below the motor, perpendicular to travel. At each end of travel, I have a small flap of material to block the light – the result is it can detect left and right end without a second switch or sensor.

Although a bit tricky to use, optos like this are very handy for devices that need high reliability. For future use, I may consider just soldering four wires to it, and then bringing them out and wiring the resistors where there’s more room – however, for now it works, and that’s the main thing!

The Braille Display Movable Head

For Phase 2, I decided to change some of the details for the device. In particular, I didn’t like the flexibility of the Acrylic pieces, and needed something more solid – solid means faster motion, which means speed in updating.

My solution was to create the head out of plates of acrylic, which are then bolted together. The result is much stiffer, much stronger, and therefore faster moving:

Another change is the use of linear bearings for the motion (orange tubes in diagram). The layers of acrylic hold the tubes in place, with the end pieces slightly smaller to prevent them from slipping out. This lets them ride on two solid steel rails for smooth and easy speeding. The result so far is ‘finger-tip’ movement, which means the motor doesn’t have to work as hard to move the head.

Another feature of the head is the incorporation of sensors – the yellow ones (gear positioning), and green (switches for end motion). Not shown are the opto sensors at the bottom, for detecting end of travel. I put space for two in the design, but only one is currently needed (end of motion for both left and right can be detected with a single sensor). However, I may use the second one later if I can’t detect Braille rod positioning well enough – in that case, I could use it on a cut slotted rail that would show when we are on a rod (hole) and in between (blocked).

So far the head is performing well – while there is a bit of play in the bearings, I’m hoping it won’t cause any problems. The bearings are 8mm, while the rod is 5/16″ – the difference is only a few hundredths of an inch (5/16″=7.9375mm), but that plus the natural spacing in the bearing leads to some give. Nonetheless, as I am moving it from the center (the hole at the top is for attaching the sideways movement racks) the play is negligible – it only appears if I try an off-center pressure.

Already I am tweaking the design – the holes are a bit small, the sensor area needs a bit more room, etc – but I’m happy with it overall. Now I’m on to the other drive, and the gearing…

Audrey Pankhurst, 1927-2008

Today marks the fourth anniversary of my mother passing.

I find there isn’t much I can (or wish to) say here about my mother. She taught me to strive to be good, no matter what others try and do. She was a voracious reader (part of the reason I felt she should be the namesake of the Braille Reader/Refreshable Display). She was a kind person, and she is missed.

Here’s a picture of her, taken about four years before the end.

It’s a day she was out with her daughter and her grandchildren, who she loved. It’s one of my favorites, because it shows her joy, despite crippling arthritis.

My sister Maureen kindly agreed to let me use this photo for the project – while I haven’t figured exactly how best to use it, I am leaning towards an artistic rendering, like this:

Or this:

In any case, it seems appropriate on this day to let all my readers know about who the ‘Audrey’ Braille machine is named after – and why.

ASC VI and Makerspace Moving

Monday Feb 6 was the next ASC (#6), and the event was over the top in a number of ways. Previously, the highest level of grant was $500-$600 (with an upper limit of $1,000 if enough judges participated); this time extra funds from corporate groups raised it to $3,500. As well, the judging was two-phased; the initial ten (of which eight actually appeared) were winnowed down to a top three on Monday, and on Thursday the final three make a second pitch for winning.

Our pitch was for Makerspace to move into town. Currently, we’re north in Saanich, a fairly steep trip for those of us not inclined to drive. Moving into town accomplishes several things: closer access makes it likely more will join; it is better poised to help incubate business ideas (like the Braille display); and we’ll finally become the ‘Victoria’ Makerspace, instead of ‘Victoria-Adjacent’!

For the presentation, I was asked to be an assistant. Besides showcasing the various items that could be made at the Makerspace, I also was able to discuss my Braille project briefly, and how Makerspace made it possible to move ahead with it.

Fortunately, our group made it into the top three – now, we pitch again on Thursday, and try to solidify the case for Makerspace moving. Hopefully, it will convince everyone, and we’ll be on the move shortly. But even if not, the other finalists are all good causes – and after all, what’s a little bus trip now and then?