|
|
Subscribe / Log in / New account

Open-source CNCing

By John Coggeshall
July 29, 2020

Last year Sienci Labs finished its Kickstarter campaign for the open-source LongMill Benchtop CNC Router — its second successful open-source CNC machine Kickstarter campaign. CNC routers allow users to mill things (like parts) from raw materials (like a block of aluminum) based on a 3D-model. The LongMill is a significant improvement over the original sold-out Mill One and makes professional-quality machining based entirely on open-source technology a reality. As an owner of a LongMill, I will walk through the various open-source technologies that make this tool a cornerstone of my home workshop.

Hardware

The Sienci Labs LongMill is an impressive feat of engineering, using a combination of off-the-shelf hardware components alongside a plethora of 3D-printed parts. The machine, once assembled, is designed to be mounted to a board. This board, called a spoilboard, is a board the machine can "accidentally" cut into or otherwise suffer damage — designed to be occasionally replaced. In most circumstances, the spoilboard is the top of a table for the machine, and Sienci provides documentation on several different table builds done by the community. For builders short on space, the machine can be mounted on a wall.

The complete 3D plans for the machine are available for download, including a full bill of materials of all of the parts needed. The project also provides instructions to assemble the machine and how best to 3D print relevant components. The machine is controlled by the LongBoard CNC Controller, and Sienci Labs provides full schematics [23MB ZIP] of that as well. All mentioned materials are licensed under a Creative Commons BY-SA 4.0 license.

In addition to the open-source design of the machine itself, an open-source-minded community has formed around the project. The company's Facebook user group has 1,600 members, and an active community forum is hosted by the company, which discusses everything from tips to machine support. Community members contribute, among other things, various modifications to improve the original design or to add new features such as a laser engraver.

Software

When it comes to a fully functional CNC, the hardware behind it is only part of the equation. There is an entire software stack needed to go from a model to a physical thing. To explain this, I thought it best to have an example to refer to. For this example, I borrowed this design for a Tux drink coaster, scaled up its size, and used it to produce this quick example of the LongMill in action:

[Milled Tux]

There are a lot of different software options, both open source and commercial, that can be used to mill something like this. In this case, I am starting with an STL file and I need to translate that data into actions for the mill to take to carve the image. Looking at the entire process generically, the steps would be: design something, build tool paths (movements of the CNC machine), and then send tool paths to the machine. I already have the design, so I will start with generating tool paths.

The process of converting a design into a series of movements taken by a machine is called computer-aided machining (CAM). Depending on the work being done, there are many different types of CAM software available to take some sort of model and convert it into one (or more) tool paths. In the open-source world there are many choices — for example there is a list of open-source options that was compiled on Reddit. What CAM software is used depends greatly on the experience of the user and the needs of the project. In this case, I used CAMLab developed and hosted by Sienci Labs; CAMLab is based on the MIT-licensed Kiri:Moto project. CAMLab is meant to be a beginner-level tool that is easy to use; it operates directly on STL files. In other projects, such as when I am using the CNC to create my own prototype PCB circuit boards, open-source projects like FlatCAM (MIT-licensed) are a much better tool for the job. Unlike CAMLab, FlatCAM works from Gerber files generated by electronics-design tools like KiCad (GPLv3) — instead of STL files.

The job is the same regardless of the CAM software used: take the model provided, combine it with information about the material being cut along with the tool that will be used to cut it, and generate a tool path. What follows is a screenshot from CAMLab, showing the tool path generated by a 2mm cutting tool on our Tux model. In this screenshot, the tool path is indicated by the black lines, while non-cutting moves are indicated in blue:

[Tool path screenshot of Tux]

Observant readers may note that the generated tool path appears to ignore portions of the model — specifically the narrow lines in Tux's face. This is not an error, but captures that this model required making a second pass using a smaller 0.8mm tool to fill in the details that the larger tool couldn't accomplish. This tool path would be generated and run separately from the first, with a physical change in tools in between. Ultimately three separate tool paths needed to be generated and executed to complete the carve. Two of them were for the actual relief of Tux (a 2.0mm and 0.8mm end mill), and a third to cut the circle from the wood stock using an 8.0mm end mill.

Ultimately, the tool path generated by the CAM software is saved to a file to be transmitted to the CNC machine using a language known as G-code. Different CNC machine controllers implement different dialects of G-code, depending on the software of the controller. In the case of LongMill, the LongBoard CNC Controller uses an off-the-shelf Arduino Uno as its processing unit, running the open-source G-code interpreter Grbl (GPLv3). The G-code is sent to the Arduino Uno on the controller via a serial connection.

G-code is a line-based, interpreted language (G-code reference). Below is a small G-code example that sets the current position of the tool in the CNC machine as the origin, moves up 10mm, over on the Y axis 10mm, then returns to origin:

    P0 L20 X0 Y0 Z0 ; Set current location as origin
    G0 Z10          ; Move the head up 10mm
    G0 Y10          ; Move the head on the Y-axis 10mm
    G0 X0 Y0        ; Move back to origin for X/Y
    G0 Z0           ; Lower head back to origin

A look at Grbl internals would tell you that it can only buffer, at best, sixteen G-code instructions at a time. In contrast, tool paths generated by CAM software can be hundreds of thousands of lines of G-code. Thus, for sending the G-code file generated by a CAM tool, we need a utility that can buffer the G-code instructions sent to the CNC controller. Again, there are many different open-source tools available for a job like this, but I use a project called Universal Gcode Sender (UGS — GPLv3 licensed). I selected UGS because it offers features specifically for Grbl and overall works well. In my setup, UGS runs on a Raspberry Pi 4 connected to the LongMill's controller, where G-code files are then opened and transmitted to the CNC to do a job — in this case, carve out our Tux model.

While G-code is typically generated by CAM software, it is not uncommon for it also to be written by hand in a variety of contexts. Some CAM software offers the ability to inject custom G-code at various points in the tool path generation (for example), while almost all G-code sending platforms like UGS provide a serial console for manual G-code input — if not an entire G-code macro system. In typical usage, users often write small G-code scripts (or one-liners) by hand to do specific tasks unique to their device, situation, or preferences. For example, it is often faster to move the tool on a CNC to the desired location on the bed by a line of G-code than it would be to use the provided movement controls in an application like UGS.

Wrapping up

Working with a CNC is the subject of multitudes of books and web sites, and the number of open-source projects available in this space is probably just as large — we've only scratched the surface here. There are many more aspects of this space to cover, such as open-source modeling programs like OpenSCAD, that may make interesting subjects in the future. What we hope to have made clear is that CNC technology from start to finish is now available to the world in a reasonably accessible form — using nothing but gratis open-source projects. For open-source enthusiasts (or professionals), it is most welcome to see another historically proprietary space develop FOSS alternatives.



to post comments

Pointers to more information

Posted Jul 29, 2020 23:22 UTC (Wed) by michaelkjohnson (subscriber, #41438) [Link] (4 responses)

Thanks, John, for introducing your router. I'm glad you are having fun with it! I've been spending a lot of time in this area, and would like to chime in with what I hope is useful additional information for anyone whose interest was piqued by this article.

Many open source routers exist built on the OpenBuilds platform. Multiple companies deliver parts and products that are derived from the OX CNC platform built with OpenBuilds parts. Many people build their own from the OpenBuilds components, which are the trademarked plastic building blocks of the personal CNC scene. (I built a hybrid; I purchased pre-cut plates for an OX, but designed and built my own frame to my own specifications.) Other common CNC router designs in this space are the LowRider CNC and Maslow CNC. These designs typically use few or zero 3D-printed structural parts. Dust boots and spindle mounts are common exceptions. These product and projects have mostly moved away from trim routers to dedicated spindles and spindle controllers that allow you to control spindle speed from your system controller. They typically support higher speeds (up to 20K RPM is common) and choices are available between brushed DC (two wires, varied voltage) and brushless DC (three wires, requires an electronic speed control driver), as well as air cooled (simpler, louder) vs. water cooled (quieter, may last longer, makes a mess if the pipes break).

The MPCNC (Mostly-Printed CNC) and RS-CNC designs both make heavy use of 3D-printed structural components. They are smaller, relatively inexpensive, and have large user communities.

The Arduino control boards are getting "long in the tooth" — there are limitations inherent in limited memory and 8-bit processing, which for most people become evident when attempting to cut smooth arcs. 32-bit boards are now available at roughly equivalent cost. At the low cost end, Bart Dring's ESP-32-based boards are very capable and quite inexpensive. In the midrange, there are many ARM-based 32-bit control boards often used, including the original Smoothieboard and Duet2-family boards, as well as lots of inexpensive LPC1769-based boards, not all of which are truly open source. On the high end, Duet 3 and the upcoming Smoothieboard v2 boards are more capable examples for more money. Finally, LinuxCNC runs on full x86 Linux systems, and Machinekit is a fork of LinuxCNC that runs on additional hardware, including BeagleBone where it takes advantage of the two dedicated Programmable Realtime Units (PRUs) for hardware control.

For open source CAM, FreeCAD can be a bit daunting for the new user to get comfortable with, and it's not typically the right tool for attempting to turn an STL into an object. However, its "toolpathing" CAM support is one of its real highlights. Overall quality and usability has been increasing over the past few years. I've done work of moderate complexity in FreeCAD without CAD background. (For example, my son and I designed an air hockey table in FreeCAD and used its CAM capabilities to manufacture the pieces.)

LaserWeb / CNCWeb has a relatively impressive feature set but does not appear to have a lot of current maintenance activity at this time. It was originally written for laser CAM (cutting and engraving), and was later expanded to cover router CAM. It also incorporates a gcode sender.

I have had experiences with UGS, which is written in Java, failing for me. I have had consistently good experiences with Candle, a native Qt app.

I was deeply involved in rescuing multiple hobbyist laser cutter/engraver communities, as well as 3D printing and CNC router communities, from the wreckage of Google+ in early 2019. Those communities were not purely focused on open source, but contain a great deal of content about open source CNC, which is the backbone of hobbyist CNC. We have a very friendly community at MakerForums where there's also lots of archived information about these topics and more. The more the merrier!

Pointers to more information

Posted Jul 30, 2020 0:57 UTC (Thu) by kkremitzki (subscriber, #115703) [Link] (1 responses)

Thanks for mentioning FreeCAD, Michael, I came here to do just that (project dev/admin here.) The Path Workbench is the component of FreeCAD which deals with CAM/CNC, and it's one of the more active areas of current development; I suggest checking out the Path forum for anyone interested in checking things out with that.

Pointers to more information

Posted Jul 30, 2020 12:19 UTC (Thu) by michaelkjohnson (subscriber, #41438) [Link]

Thanks for your work on FreeCAD! I've really appreciated having such a powerful tool available. It has been my primary tool for toolpath generation.

I should have been a little clearer about FreeCAD and STLs; on re-reading I think I may have given a wrong impression. FreeCAD absolutely can handle STLs and has some powerful tooling available there. It's just that if someone is starting with an STL and doesn't yet know FreeCAD, FreeCAD might not be the shortest learning curve to toolpathing from an STL.

Pointers to more information

Posted Jul 30, 2020 18:58 UTC (Thu) by chrismakesstuff (guest, #140526) [Link] (1 responses)

Great info michaelkjohnson. I've never heard of the MakerForums community and am pumped to check it out. The Arduino-focused GRBL project certainly has always been up to the task of trying to do as much as possible with Unos, and now new boards are starting to come to market that are just as accessible and much more capable. When it comes to GRBL interface software options, CNCjs is another option that many of our customers have turned to if they find that UGS isn't meeting their needs. It's under an MIT license. There are even more options out there that you can find listed on the GRBL wiki, as well there are a handful that we've tested and put into a condensed list on our site resources.

One correction I felt I needed to add to what you said is that you mentioned the LowRider CNC as a CNC design that typically uses very few or zero 3D-printed structural parts but this isn't the case. Though it's feasible that the LowRiders parts could be machined, it's ultimately been designed to be heavily 3D printed just as the MPCNC is. These DIY kits also tend to still be split between spindles and routers since trim routers can be lower cost than many spindle options while being a self-contained system and still provide a large RPM range like the Makitas 10-30k RPM capabilities. Ultimately you summarized all the remaining options very well.

Pointers to more information

Posted Jul 30, 2020 19:28 UTC (Thu) by michaelkjohnson (subscriber, #41438) [Link]

Oops, thank you for the correction on LowRider — definitely missed fixing that when I was juggling how to present ideas. Quite right!

CNCjs is a great call-out. Also in the JavaScript space, ChiliPeppr is kind of sui generis. At least, I don't really know what else I would compare it to.

Open-source CNCing

Posted Jul 29, 2020 23:28 UTC (Wed) by gerdesj (subscriber, #5446) [Link]

Great write up. Now I want one! I put together a Prusa 3D printer kit recently and started getting to grips with extruding really long sub 0.4 mm plastic cylinders.

Slicing a model into something that can be printed or routered is a really complicated problem which seems to be solved only informally. I doubt that anyone can work from "I want this shape with these constraints on shear strength" and the print will be adjusted accordingly.

I have a 1/100 scale Centurion tank sat on my wfh desk (dining room table) and my large plastic garden storage thingie has new hinges on one door instead of being binned when a door fell off and contributing to micro plastic pollution.

I am seriously surprised at how few comments OP has received. It looks like we are turning into old ... people.

I'm nearly 50.

Open-source CNCing

Posted Jul 29, 2020 23:44 UTC (Wed) by vadim (subscriber, #35271) [Link] (6 responses)

For people thinking of getting into this area: do your research on what you want to accomplish. There are many machines that move in X, Y and Z directions that you can attach a spindle to, but construction matters a lot. Machines like the ones in this article mostly cut wood. Most don't have the rigidity necessary to work with metal.

If you want something for working with metal, probably want something more like a Sieg SX3. They're relatively easy to adapt to CNC, and instructions and kits for doing so are quite common.

Unfortunately this is an area where physics matter a lot, and where you actually need large amounts of heavy metal in your machine for it to have the necessary rigidity to perform well. If the machine is a light one, then there will be very significant limits to what you can do with it.

Cutting metal

Posted Jul 30, 2020 2:22 UTC (Thu) by michaelkjohnson (subscriber, #41438) [Link] (3 responses)

It's worth noting that it's not just mass: cast iron absorbs vibration, but aluminum rings like a bell, which ends up giving surface artifacts. There are two good materials like this in common use; cast iron and granite-filled epoxy. Both are expensive. This is why experienced machinists were skeptical of SwissMak's aluminum-frame construction. But it's worth considering routing and milling separately.

For routing aluminum plate, an aluminum frame driven by a leadscrew can produce fine results. The R7-CNC router uses OpenBuilds 4080 C-Beam extrusion for its frame and is lead-screw driven. It works well for cutting aluminum plate (I don't have one but I've seen pictures of very nice clean edges it has cut). With a brushless spindle capable of high torque at low speed with good speed control, it could work for cutting mild steel sheet and some thin mild steel plate as well. There's more in the R7 category at MakerForums if that sounds interesting.

But for milling, the cheapest way to get started if you are going to mill metal is indeed a Sieg-family mill; there are CNC conversion kits for most if not all sizes and many variants, not just the SX3. Also, some companies occasionally sell skeletons for CNC conversion so you don't end up throwing away an otherwise perfectly good trapezoidal lead screw when you substitute ball screws as is more appropriate for CNC.

Another forum friendly to hobbyists and with a lot of DIY/hobbyist mill conversion information is The Hobby-Machinist. It's not about open source, though it's friendly to open source when I've seen the topic come up, but it's the only machinist forum I've found that combines active members with deep machining experience (including lifetime work experience) with being friendly to those new to the craft. They understand limitations not only in material but in financial resources and can celebrate both "doing it right" and "making do with what you have" which is a nice balance.

Cutting metal

Posted Jul 31, 2020 3:23 UTC (Fri) by dgc (subscriber, #6611) [Link] (2 responses)

So.... milling metal with Sieg mills.....

Years ago I did a CNC fusion kit conversion of a Sieg X2 with an eye to milling aluminium parts for my race car. I now have a Sieg KX3 - a beefed up, factory CNC version of the SX3 that I got near new at a bargain basement price....

The bottom line is that the sieg mills just aren't designed for _regular_ milling of metals. The spindles are not powerful enough, and while the KX3 is far more rigid than then SX3, unless you are really careful and take small cuts the head still vibrates enough to cause chatter even on soft aluminium.

So while you can make decent parts from aluminium and various steels with sieg mills, it takes lots of time and care and many prototypes to dial in the feeds and speeds necessary to minimise vibration and chatter to get the desired accuracy and tolerances in the milled part.

Hence I think the most important question people looking at CNC mill conversions have to answer is this: do you just want to "learn CNC milling" or do you need a CNC mill to make parts for other projects?

If you just want to "learn CNC", then great - buy a second hand sieg mill off ebay and a conversion kit and off you go. That's exactly what I did with the X2. But be aware that you'll quickly outgrow it's capabilities if you want to do any serious metal milling with it - I found the X2 really couldn't mill aluminium with better than ~0.5mm accuracy or repeatability even after substantial modding to improve rigidity, minising play in the table, etc. Hence it was only as I graduated from "learning CNC" into "building other stuff" that I realised I'd started with the wrong mill for what I really wanted to do with a CNC mill.

Which brings me to the other side of the coin: Sieg mills really aren't that cheap. Here in .au, you can get a decent low end Hafco industrial mill/drill with a 1.5-2kW spindle with the weight and rigidity of a KX3 for not much more than a new SX3. These will do a much better job of milling metal than an SX3. And for a bit more $$$ you can get a really solid, good quality industrial mill that will perform far better on metal and run more reliably for longer than any heavily modded, high end hobby mill will ever do...

Hence before you start on your CNC mill adventure, decide/know what you are actually going to do with the CNC mill once it's built. Then go and buy a mill appropriate for that job rather than something that is cheap or "simple to convert". Finding out you can't do what you want to do with the mill after the conversion is complete is not much fun....

-Dave.

Cutting metal

Posted Jul 31, 2020 15:16 UTC (Fri) by joib (subscriber, #8541) [Link]

Sometimes one can find good deals from some metal workshop closing due to retirement/bankruptcy/etc.

Of course that's a 2m side cube that weights as much as a car and needs a sturdy concrete floor to stand on. Not really a solution for apartment dwellers. But hey, much less vibration..

Cutting metal

Posted Jul 31, 2020 21:32 UTC (Fri) by michaelkjohnson (subscriber, #41438) [Link]

Completely agree with your conclusion to start with the destination in mind!

There is an astounding variety of quality available in Sieg and Sieg-derived equipment due to different levels of quality control by different sellers... There are a lot of people getting way better than an astoundingly bad 0.5mm tolerance out of even small sieg-style mills in CNC conversions. Sorry for your bad experience; there have definitely been others with better experiences. Heck, 0.5mm is bad tolerance for a 3D printer, let alone a mill.

Availability of "old iron" for conversion is a highly localized phenomenon. In the US, it's often been relatively easy to come by in the "rust belt" — but you're pretty lucky to find something reasonable in other places.

But we're going way beyond LWN here, so these details probably make more sense in one of the machining forums populated by machinists. ☺

Open-source CNCing

Posted Jul 30, 2020 15:39 UTC (Thu) by coogle (guest, #138507) [Link]

I avoided discussing the LongMill in too much depth as a tool in my article in order to focus on the open-source side of things, but to address this point it is worth noting that LongMill absolutely is rigid and well-designed enough to mill some metals (and specifically aluminum):

https://www.youtube.com/watch?v=BYkk0dFohZs&feature=y...

Open-source CNCing

Posted Jul 30, 2020 17:58 UTC (Thu) by chrismakesstuff (guest, #140526) [Link]

vadim, yeah it's certainly really important to ask yourself what you're looking to get out of your machine. Our LongMill CNC is a great and reasonably solid build for the price and accessibility that we offer but certainly can't compete with a converted milling machine or even a bulkier built tabletop CNC router or mill. If anyone calls up and tells me they're looking to cut metal all day long with our machine, I tell them that they're in the wrong place and try to point them in a better direction.

What I can say though is that if you're looking for a machine with a mid-sized cutting area that you can have fun with - cutting woods and plastics without breaking the bank or having to source individual parts for yourself - that's what we offer with the LongMill. It's not for everyone, but there are certainly garage woodworkers who don't want to tackle their own build and like the idea of a reasonably priced, mid-sized machine. Designing our CNC around more readily available components also gives people the option to tackle the build themselves if they so choose 👍

Open-source CNCing

Posted Jul 30, 2020 6:12 UTC (Thu) by haizzus (guest, #109109) [Link] (1 responses)

I'll get one if it can do PCB too, like the one from Bantam tools

PCB Isolation Milling

Posted Jul 30, 2020 18:58 UTC (Thu) by chrismakesstuff (guest, #140526) [Link]

The precision that the lead-screws offer in combination with its anti-backlash delrin nuts allow it to cut very accurately, so we've made good PCBs on our in-house test machine. However, it's certainly not a machine that's purpose-built for PCBs - its larger cutting area is better suited for cutting woods and plastics.


Copyright © 2020, Eklektix, Inc.
This article may be redistributed under the terms of the Creative Commons CC BY-SA 4.0 license
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds