Sourcing Your CNC Tools In 2016: Build Them

Perhaps the tolerances on today’s hobbyist machines just aren’t good enough for you, or perhaps the work area is just too cramped. Either way, there are times when an off-the-shelf solution just wont fit your needs, and you resolve to build your own CNC machine. Fortunately, none of us are alone in this endeavor because hobbyists have been building their own automation equipment for years. Whether you’re talking building the machine, generating the G-code, or interpreting that G-code into motor signal pulses, the DIY CNC community has evolved a sophisticated set of tools aimed at getting the job done.  I thought I’d take a tour of some of the hobbyist’s tools that hallmark 2016 as the best year yet to build your CNC machine.

Hardware

In the last few years, affordable extruded profiles and brackets have made leaps and bounds to satisfy a hungry DIY 3D printer community. Beyond 3D printers, these beams and brackets are a good start for some of our needs in the world of linear motion control. Here’s a quick look at a few components off-the-shelf.

Makerslide Extruded Profiles

ms_long_smUnless you’ve discovered a deal on eBay or AliExpress, building up a machine from precision linear rails can be a pricey ordeal. Linear rails offer us a rigid, wiggle-free guide for motion along a single axis, but in some cases, the cost needed for hobbyists to afford this precision is outside their budget. [Barton Dring] took the idea of guided linear motion and launched a custom extruded rail that enables bearings to slide freely along an axis. Dubbed Makerslide, this extruded rail features a groove embedded directly into the extrusion and aims to be compatible with most other 20-mm extruded profiles like those from Misumi and Rexroth.

OpenBuilds V-Grooved Rail Attachments

Open-Rail-Description
Image Credit: Ooznest

On a similar note, the folks at OpenBuilds took [Barton’s] concept in a slightly different direction. For many of us who have already committed to extrusions from one vendor and have our closets gushing with excess tubes, Open Rail is an extruded v-groove attachment that enables bearing-mounted plates to slide freely just like the extrusions of Makerslide. Unlike Makerslide, however, almost any 20-mm extrusion can be retrofitted with Open Rail, rather than requiring a specialized extrusion.

OpenBuilds Linear Actuator Kits

CNC machines encompass a wide variety of machine designs that spans far beyond this article’s scope. For conventional machines, however, a single motor drives a motion along a single axis. To add direction in a separate dimension, we can sometimes chain together two of the same linear motion units. The folks at OpenBuilds have taken this principle to heart offering single-axis systems as kits. With some creativity and forethought, users can develop a number of automated solutions based on the principle of appending multiple axes. Of course, the folks at OpenBuilds haven’t stumbled upon a never-before-seen solution. Misumi, Rexroth, and other professional automation equipment companies have been selling linear motion systems for years; however, their price range easily leaps beyond the 10K mark.

Not an End-All, but a Solid Start

Despite the design flexibility, neither Makerslide nor OpenBuilds is the all-encompassing solution for every CNC endeavor. Specifically, for rigid machines that can chew through steel, a structure built from bolted aluminum extrusions will be far less rigid than professional machines of a similar scale. Nevertheless, for machines that don’t experience heavy loads, like a 3D printer, a laser cutter, or even some small routers, both Makerslide and OpenBuilds offer an excellent starting point.

Software

With our hands full of stepper motors, extruded profiles, and belts, it’s time to start exploring a software solution to drive it all. While there are plenty of machine-specific solutions, I thought I’d highlight two that are flexible enough to be tuned to a custom machine.

G-code Interpreters

G-code interpreters do just that: they accept input commands in G-code (be it directly from a file or serially through a cable) and convert the commands to step and direction digital outputs with the right timings to produce the control signals for stepper motor drivers. In one sense, they’re the “brains” of the machine, taking the G-code “instruction set” and outputting behaviors that correspond to the input instructions.

LinuxCNC

axisubuntu
Image Credit: LinuxCNC Wiki

LinuxCNC spun out from a US-government-funded initiative to develop a motion control package for standards testing back in the 90s. Over time, it has evolved into a software package designed to turn a PC into a G-code interpreter, and it’s currently packaged as real-time Linux distribution. From your LinuxCNC-configured PC, you can simply connect your stepper motors, limit switches and other digital I/O devices to the PC’s parallel port which, in turn, outputs motor step and direction pulses to drive your physical hardware.

LinuxCNC isn’t just a G-code interpreter, though. The 15+ years of active development have given it a solid foundation which makes it one of the most adaptable software packages for developing custom machines. By enabling custom kinematics, users can drive non-Cartesian machines like SCARA arms. With a core operating system based on Debian Linux, users can link additional PC peripherals, like USB game controllers, to drive their machines. Some devoted software hackers have even fleshed out the current user interface to directly generate G-code for simple cuts, rather than simply run existing G-code.

Grbl

With over 7 years of active development, Grbl has proven itself to be simple, reliable G-code interpreter firmware for the Arduino Uno. Simply connect your motor controllers and limit switches to the Uno, and Grbl firmware handles the step and direction pulse timing for all 3 axes of your machine. Grbl doesn’t aim to be an all-encompassing interpreter like LinuxCNC, but in exchange it’s a far simpler solution that is relatively easy to set up and works for most, if not all, typical use-cases for a 3-axis machine.

Though Grbl drives the physical hardware, it still requires a serial interface to receive G-code instructions to execute. Fortunately, G-code-streaming packages exist: bCNC and UGS, which have been tested specifically with Grbl.

G-code Generators

Having a fancy CNC machine doesn’t say much if we can’t generate instructions to drive it to cut parts! We need a solution for generating G-code, and, once again, the open source software community has jumped in to provide several packages.

dxf2gcode

dxf2gcodeIt’s not unlikely that many of your designs may boil down to a collection of flat plates with simple features on them. For 2D milling, dxf2gcode simplifies the process of generating G-code based on an original design file, in this case: a dxf. The project also features automatic cutter compensation done in software, a very handy feature that will generate an offset toolpath based on the diameter of the tool and the type of cut (pocket or outside edge).

gcmc

gcmc
Image Credit: gcmc homepage

If you’ve ever tried writing G-code manually, you’ll quickly realize just how unreadable it is without having memorized the majority of the commands. GCMC is a front-end language aimed at producing human-readable machine routines. By abstracting away the unnecessary idiosyncrasies of the language, gcmc facilitates the generation of complex tool motions and patterns simply by tweaking a few parameters.

Doing the Research

Building your own CNC machine may just be your next labor of love, but unless you prefer to reinvent the wheel (and, hey, starting from first principles isn’t always a bad thing), it’s worth taking a look at the tomes of build logs, forum posts, and existing software from the gurus who have built CNCs before us. While I’ve highlighted a few of the more common tools in the land of hardware and software, this list is far from complete. So go forth! Do your research–and, of course, let us know what you find in the comments.

Donuts Of ShmooCon

This weekend is ShmooCon, a hacker convention held in Washington DC. Brian Benchoff and I will be there, both of us for the first time. We’d love your input on what talks look the most interesting. Check out the schedule of speakers, then leave a comment below to let us know which talks you think we should cover.

It’s great hearing the big presentations, but I find a lot of times great hacks can be found in smaller venues, or just by walking around. Two examples from 2015 DEF CON: the best talk I sat in on had about 10 people spectating in the IoT village, and I had a great time trying to track down everyone who had an unofficial hardware badge. If you’re at ShmooCon and have something to show off, please find us (@szczys, @bbenchoff)!

On Saturday join us for a Hackaday meetup in the lobby of the Washington Hilton. ShmooCon is well-regarded for the quality of its “lobby-con”, what better place to gather? Look for the Hackaday crowd starting Saturday 1/16 at 8:45am. We’ll bring the donuts, and some swag like Hackaday Omnibus Vol. 02 and of course, some Jolly Wrencher stickers.

Hackaday Links: January 10, 2016

Everybody loves cheap stuff, and we hate telling everyone about coupon codes. That said, TI has a new LaunchPad development board they’re promoting. It’s based on the MSP432, the ARM extension of their MSP430 line. The MSP432 is an ARM Cortex M4F, low power, and planned for production later this year.

Here’s your daily CES garbage post. Through a collaboration between Sony and Nissan, a car has become a video game controller controller. A controller plugs into the ODB II port, reads throttle, brake, and steering wheel positions (and buttons on the dash/steering wheel, I guess), and translates that into controller input for a PlayStation 4. What games do they play with a car? You would think Gran Turismo, Rocket League, or other games with cars in them. Nope. Football.

Dangerous Prototypes is a legal Chinese company! [Ian] didn’t say anything about the process about becoming a legal Chinese company because he wrote a blog post, not a book. Shenzhen Dangerous Prototypes Electronics Technology Limited allows them to have an office in the Shenzhen electronics market, hire local and foreign hackers, host Hacker Camp Shenzhen, and allow people to apply for ‘Authorized Authority’ visa letters for the people who need them. Great news for a great company.

The Forge hackerspace in Greensboro, NC is growing. In just over a year they have 160 members and they’ve already outgrown their 3,400 square foot space. Now they’re moving to a larger space that’s twice the size and they’re looking for donations.

People have been taking old iPad screens and turning them into HDMI displays for years now. [Dave] got his mitts on a panel from a Macbook Pro 17″, and turned it into a monitor. It required a $50 LVDS adapter, but the end result is great – a 1920×1200 panel that looks pretty good.

Hacklet 90: Schlieren Videos And Jigsaw Puzzle Robots

Happy new year, and welcome to the first Hacklet of 2016! The Hacklet is one of my favorite columns to write, as I get to talk about the great projects people are working on at Hackaday.io. Generally these articles follow a theme, but this being a new year, I’m going to try something new. As Hackaday’s community editor, I keep an eye on the new and updated projects feeds over on Hackaday.io. Every single week I see projects that surprise, impress, and inspire me. This week, I’m going to highlight a couple that I think are just freaking awesome.

torch[Jana Marie] created the Schlieren-Videography project. Schlieren photography is used to image changing densities in fluids and this includes capturing density changes in air. Super and Hypersonic wind tunnels often use this technique to show airflow around a test model. Outside of the wind tunnel, Schlieren is great for showing density changes due to heat or different gasses. That’s exactly what [Jana] is doing in this project.

There are several ways to create Schlieren images, everything from lasers, to diffraction gratings, to razor blades can be used. [Jana] is using a simple moiré pattern and a couple of video tricks to capture Schlieren video. A high density moiré pattern will appear to flicker as density changes bend the light from the moiré stripes. [Jana] simply takes a reference image, then subtracts that image from the live video. The result of the subtraction is the Schlieren images you see above. [Jana] did more than explain the technique she’s used to create the videos, she’s also uploaded a processing sketch which performs the video subtraction magic.

jigsolve[Dan Royer] has a more domestic problem – his family loves starting jigsaw puzzles, but never seems to finish them. He’s decided to invite around 3 billion of his closest friends in the form of JigSolve, an internet connected jigsaw puzzle robot. JigSolve’s Cartesian platform  is a CoreXY based design. [Dan] used CoreXY as a guideline, but designed and built the hardware himself. The electronic hardware side borrows from RepRap 3D printers. An Arduino Mega2560 and RAMPS board control two NEMA 17 stepper motors. The Arduino is running firmware from Makelangelo, [Dan’s] own open source art robot.

The internet connected portion of the project comes in the form of a Java based IRC bot and a connection to the Freenode IRC network. The internet connected masses will have to see what they are working on, so a Logitech webcam will stream video to the ‘net.

The hardest part of JigSolve thus far has been the nozzle. Much like an SMT pick and place machine, the nozzle needs to pick up parts with a vacuum, then rotate them to the desired orientation. [Dan] is looking at different kinds of silicon, and he’s asking for suggestions. Stop over on the project page and offer him a hand!

That’s it for this week’s Hacklet. As always, see you next week. Same hack time, same hack channel, bringing you the best of Hackaday.io!

Ode To The TL431, And A LiFePO4 Battery Charger

Nerd Ralph loves cheap and dirty hacks, and for that we applaud him. His latest endeavor is a LiFePO4 battery charger that he made out of parts he had on hand for under $0.50 US. (Although we think he really made it for the fun of making it.)

The circuit is centered around a TL431 programmable shunt regulator, which is an awesome and underrated chip in its own right. If you don’t know the TL431 (aka LM431), you owe it to yourself to fetch the datasheet and pick up a couple with your next electronics part order. In fact, it’s such a great chip, we can’t resist telling you about it for a minute.

Continue reading “Ode To The TL431, And A LiFePO4 Battery Charger” →

How To Find A Lost Drone With The Integral

If I asked you to find the area of a square, you would have no problem doing so. It would be the same if I asked you to find the volume of a cone or rectangle or any other regular shape. You might have to turn to Google to get the proper formula, but it would be a trivial process nonetheless. But what if I asked you to find the volume of some random vase sitting on a kitchen counter? How does one go about finding the volume of irregular shapes?

One way would be to fill the vase with much smaller objects of a known volume. Then you could add up the smaller volumes to get an estimate of the total volume of the vase. For instance, imagine we fill the vase with marbles. A marble is a sphere, and we can calculate the volume of each marble with the formula zeno014/3πr3. We count all of our marbles and multiply the total by the volume of a single marble and arrive at our answer. It is not perfect, however. There is a lot of empty space that exists between the marbles as they fill the vase. We are forced to conclude that our estimated volume will be lower that the actual volume.

It would be about this time when our good friend Isaac Newton would ask the question “What if you made the marbles smaller?” Reducing the size of each marble would reduce the empty space that exists between them as they pile up in the vase, giving us a more accurate total volume. But how small? Is there a limit to how small we can make them? “Do not trouble yourself with the limit.” says [Newton]. “You will find that as you make the marbles smaller and smaller, you will begin to converge on a single number – and that number will be the exact volume of your vase.”

Reducing the size of the marble to get a more exact volume demonstrates the idea of the integral – one of the two fundamental principles of The Calculus. The other principle is known as the derivative, which we explained in our previous article by taking a very careful and tedious examination of an arrow in flight. In this article, we shall take the same approach toward the integral. By the end, you will have a fundamental understanding of what the integral is, and more importantly, how it works. Our vase example gives you a good mental image of what the integral is all about, but it is hardly a fundamental understanding of it. Just how do you make those marbles smaller? To answer this question, let us look again at one of Zeno’s moving arrows.

Continue reading “How To Find A Lost Drone With The Integral” →

Hacking When It Counts: The Great Depression

In the summer of 1929, it would probably have been hard for the average Joe to imagine the degree to which his life was about to change. In October of that year, the US stock market tumbled, which in concert with myriad economic factors kicked off the Great Depression, a worldwide economic disaster that would send ripples through history to this very day. At its heart, the Depression was about a loss of confidence, manifested in bank failures, foreclosures, unemployment, and extreme austerity. People were thrust into situations for which they were ill-prepared, and if they were going to survive, they needed to adapt and do what they could with what they had on hand. In short, they needed to hack their way out of the Depression.

Social Hacking: Welcome to the Jungle

Hobos2
Bindlestiffs ambulating down the high iron. Source: Wikipedia

One reaction to the change in the social contract in the 1930s was increased vagrancy. While homelessness was certainly thrust upon some people by circumstances – in the depth of the Depression in 1933, something like 25% of men were unemployed, after all – life on the road was clearly a choice for millions. A typical story was that of the bored teenage boy, facing no prospects for a job and wishing to relieve his large family of the burden of one more mouth to feed. Hitting the road with a few possessions in his “bindle,” he learned the craft of life on the road from more experienced vagrants. And thus another hobo was created.

The popular image of the hobos as unique to the Depression is a little awry. Economic upheaval certainly swelled their ranks, but in America, hobos had first appeared after the Civil War, with war-weary veterans riding the rails looking for work. By the time the Depression hit, there was an extensive hobo culture in the United States, complete with its own slang and a rough code of ethics.

Hobos were top of the heap in the vagrant hierarchy, the “knights of the road.” They were migrant workers, generally unskilled, willing to stay in one place for a paying job but unwilling to commit to settling down. When the job was done or he had made enough money, he moved on. Tramps were the next step down – wanderers who were willing to work but only when absolutely necessary. Lowest in the pecking order were the bums who stayed put and relied on the kindness of strangers for their survival. Regardless of rank, all the vagrants had one thing in common – the road. More or less constantly on the move, they had to quickly learn how to provide for themselves without the creature comforts, which before the Depression hit had begun to include many modern conveniences.

rocket-stove-12
Hobo stove in action. Source: Log Cabin Cooking

Cooking arrangements were one thing hobos excelled at, whether on the road or in one of the many hobo camps, or jungles, that sprung up at railroad crossings outside of towns. A campfire in a ring of rocks is the traditional view of outdoor cookery, but the hobos quickly learned that it’s not terribly fuel-efficient. One solution to this problem was the hobo stove, an ancestor of the rocket stove. Relying on convection to draw a huge volume of air into a combustion chamber, hobo stoves were easily fabricated from tin cans and other metal scraps that were easy to come by in a world before recycling and large municipal landfills. Most were assembled on the spot and served for a meal or two before being abandoned, but some actually had insulation between double walls and clever arrangements of the fuel shelf to feed automatically as the fuel burned away. Scraps of wood, pinecones, newspapers and cardboard – a hobo stove will eat almost anything, and burn hot enough that even damp fuel isn’t a problem.

Often finding himself with time on his hands, many a hobo kept himself busy with arts and crafts projects in camp. Making hobo nickels was a popular way to pass the time, and often resulted in a trade item far more valuable than the base value of the starting material. The Indian head figure on the US Buffalo nickels of the day were modified with tools fabricated from old nails and files; metal was pushed around the coin to create features on the figure, usually a bowler hat and facial hair. A ‘bo could trade the miniature bas-relief sculpture for a good meal; today genuine hobo nickels from the Depression era command high prices from collectors.

Radio: Razor Blades and Copper Pipe

Unless the hobo was flopping in town or at a really well-equipped jungle, chances are pretty good he wasn’t listening to the radio too much. From our 21st century outlook, it’s sometimes hard to appreciate how new and exciting radio was and the impact it had on everyday life in America during the Depression. Radio connected the nation in a way no other medium ever had. That the Depression did not kill this infant technology in its cradle is a testament to both its power as a medium – families would stop making payments on almost everything else so they could keep their radio sets – and to the tenacity of early electronics hobbyists, who learned to keep radios alive and even to fabricate them from almost nothing.

CrystalRadio
“CrystalRadio” by JA.Davidson

Although tube-type superheterodyne receivers were widely available all through the Depression, crystal sets were still a popular and sometimes necessary hacker project during the Depression. Relying on nothing more than a tuned circuit and a detector connected to an antenna and high-impedance headphones, a crystal set was able to pick up strong AM broadcasts and sometimes even shortwave stations. The earliest detectors were crystals of galena probed by a tiny “cat’s whisker” wire, but metal oxides could also form the necessary rectifying junction, leading to detectors built out of razor blades and safety pins. Crystal radio skills would serve many a Depression-era farm boy well during the next decade as they went off to war in Europe and the Pacific; there they created foxhole radios to listen in on broadcasts without the risk of a more sophisticated radio set, whose local oscillator could be detected by the enemy.

tnt
VE7SL’s replica 1929 TNT transmitter, a close relative of the Hartley. Source: The VE7SL Radio Notebook

Receivers weren’t the only area in which Depression-era hackers made an impact. As commercial broadcasting took off, so did amateur radio, and few commercial transmitters were available to satisfy the burgeoning ham market. Depression-era hams had to home-brew almost everything and came up with some beautiful designs that modern glowbug hams recreate with loving attention to detail. A popular transmitter back in the day was based on the Hartley oscillator (PDF link). Using only a single triode tube and a tuned circuit with coils wound from 1/4″ copper tubing, Hartley transmitters could be built on a literal breadboard from scraps and widely available parts. Tuned to the 40- or 80-meter band, or even down to the 160-meter band, a Hartley or the closely related Tuned-Not-Tuned (TNT) or Tune-Plate-Tuned-Grid (TPTG) continuous-wave (CW) transmitters could put out enough power to work coast-to-coast contacts, or QSOs. Modern hams pay homage to the Depression-era pioneers of amateur radio with regular “QSO Parties” using replica Hartleys – most with bypass capacitors to keep the lethal voltages their forebears had to deal with off the coils.

The Great Depression lasted through the 1930s in America, finally dissipating just before the country mobilized for World War II. With factories suddenly working beyond capacity to supply the war effort, unemployment figures quickly plummeted, and the austere practices of the Depression were generally rolled back. Hobo culture declined and amateur radio was shut down by the federal government for the duration of the war, but neither the war effort nor full employment could kill the hobo spirit — modern hobos still ply the rails to this day. And the skills and mindsets developed by Depression-era social and electronics hackers paved the way for a lot of what was to come in the post-war years.