Converting an STL file to Gcode to drive a CNC mill or lathe
November 4, 2012
As mentioned in my blog, "Multipurpose Mini Machine" DAGU wants to develop a low cost CNC machine kit. The models shown here will not be the final product, they are simply what I used for testing the quality of the components.
Part of the kit will be an Arduino compatible controller. Ok, I know, nothing new so far.
What I hope will be new is that I want to be able to make an object just by inserting an SD card with an STL file on it. I want it to be self contained without needing a PC to drive it. The advantages are:
- Simplicity - no cables or wireless links to your PC.
- If your computer crashes it won't affect production of the parts.
- Your computer is not slowed down because it is trying to drive 1 or more machines.
- Your laptop is not tied to the machines, you can take your laptop with you while the machines keep on working.
I know there is software availble now that converts STL to gcode, perhaps the most well known is Skeinforge. The problem is I think the process is unecessarily complex. To begin with you need to install Python. Then it is recommended to install Psyco to speed it up. Then you can install / run Skeinforge. Then you need to configure the program Then you can generate your gcode. Admittedly, once this is done you can put your gcode onto an SD card.
I just want to put the STL file straight into the controller and have the machine do the rest. Maybe I am just dreaming but from what I have read of the STL file format I think it is possible. It is all simple trigonometry and floating point math. Although the Arduino is not a fast processor, it is still much faster than the actual machine. I think it should be possible for the Arduino to convert the STL file on the fly.
At this point I want to know:
- Am I re-inventing the wheel? Is there an Arduino Library or easy to use software already?
- Am I missing some important factor that makes this project impossible?
- Is this project impractical in some way?