CNC Zyto + Raspberry Pi
In the beginning was the Wall.....
The wall kicked of my interest in metal casting and CNC. This was as much by necessity as anything else. If you can't source what you want, then you have to go make it yourself. I wanted some cast cheek plates and also thought it would be nice to have a cast plaque to leave my mark.
Couldn't source either, so set about learning the fine art of metal casting. The cheek plates turned out OK. Getting the plaque turned out to ba a longer and still ongoing project. The only suppliers of so called bespoke plaques seemed only to be able to do a couple of styles of predetermined lettering & size. on the whole rather banal. Not what I wanted at all. I guess that I had other excuses for setting about building a CNC machine, but it's been so long I have forgotton what they were.
My interest in Raspberry Pi computers also happened at about the same time. So it all came together in the way that it did as much by luck as design. Originally I was intending to build a vanilla gantry type CNC machine, but decided to re task the remnants of a Zyto lathe into a CNC Mill / Lathe hybrid affair. I did this for a number of reasons that include the following:
Firstly I had the Zyto lathe bed frame, and trying to find parts to put it back to original spec seemed a bit boring and pointless with so few parts to start with.
Secondly I had a fully tooled up and operational Zyto lathe so all chucks, collets, faceplates, amd other misc tooling would be fully interchangable.
Thirdly, it would give me CNC metal cutting capability over the gantry router type machine.
And fourthly.... Why the hell not!
So a bit of background about the Zyto Lathe remnants before they were retasked.
Fast forward to the current semi operational version which mostly looks thke this but with some more and better gards, dust extraction and such.
In this current horizontal mode, there is useable cutting area of about 170 x 80mm for soft metal and a little bit more for wood, plastics & composites. This is the high speed spindle end. The existing low speed lathe spindle at the other end can be employed for more "grunty" activities like milling steel but over a smaller area circa 100 x 75mm pending what you are trying to do.
Currently I have the physical backlash down to circa 0.06mm depending on how and where you measure it. The backlash can be compensated for in software, but it is still physically there. Orthogonal error is something like 0.05m per 100mm.
The system control computer is a Raspberry Pi v2 running Machinekit (aka LinuxCNC) as the CNC controller.
See here for more info on that:
Here is a pic of it doing something slightly more interesting than milling an angle plate.
That's about it for the intro.
I'll start filling in the big gap in the middle shortly.
Hi MrGreg, Its interesting to see a CNC machine being driven by a Raspberry pi. I am in the early design phase of building a CNC router and thought it might be good to use a SBC (single board Computer) as the host for Mach3/LinuxCNC. All the advise I received was that the timing demands to quicly respond/drive the stepper motors would make a SBC unusable. I didn't see the Raspberry Pi on the LinuxCNC hardware guide. It will be nice seeing how you progress, very interested in the results.
Take a look at "Machinekit" It is the fork from LinuxCNC devoted to ARM and similar SBC type devices. LinuxCNC as such is primarilly for 086 machines only.
There are quite a few well proven CNC solutions using SBC type devices. The Raspberry Pi, my preference, uses a PIC microcontroller to do all the "realtime" stuff where timings are crucial. IE the equivelent of the "Step Generator" in LinuxCNC which does all it's stuff in an 086 machine in local software. So the issues of timing don't really apply to the RPI + PIC (PiCNC) as traditionally understood. Have a good read through the link to the RPI forum link stuff above.
As for results, the last test run I did lasting circa 8 & 1/2 Hrs CNC machineing time came out fine. No evidence of a glitch. Just did what it was told to do.
The Beaglebone board also has a Machinekit (LinuxCNC) proven solution. Worth a google if you are interested? There is a thread somwhere on this forum with a chap sucessfully running this system (don't remember where, search it)
If you want Mach3 or poss Mach4 then you will need the Intel Atom board (086) to run the MS Windoze thing for it to work AFAIK.
There are other solutions if the above are not to your liking?
Thank MrGreg, I am not a windows fan, I will look at machinekit. I would like to avoid putting a desktop in the shop. I am not as neat as others and I know the dust will kill it. I have been looking at SBC's, there seems to be many applications for them in my home and the price is right.
Yes, SBCs don't need fans. (apart from people who like them ) so no dust. Ha Ha
Some links that may be of interest.
In the first instance... Look up the Linaro project.
For a start..then...Go explore
A little more gap filling on the info relating to SBCs or SOC boards and similar for CNC
They are in the main ARM based processor systems running Linux. Linux & ARM systems are not some wierd geek thing. The ARM + Linux thing is what runs some 75% of all modern smartphones. They tend to use the Android system (linux based) which is easy and friendly enough for most folks.
I put myself in the " Most Folks" bracket. But I do go the extra mile to get what I want. So, If you want to play with these things, don't expect that it will all be easy as pie. You have to get out of the comfort zone and learn new stuff if you don't have the skill set. It's not difficult rocket science stuff, but can seem a little intimidating at first. Some basic Linux skills will be necessary, like being able to compile software using the command line terminal.
So, here goes some links and info, some of it repeated from previous parts of this thread:
Thread from Raspberry forum for LinuxCNC (Machinekit)
The above is a mighty big thread. It will take some time to read and absorb. I will give a V brief description of some of the highlights and abstract some of the more useful links.
The Raspberry PI + PiCNC combination uses a PIC microcomtroller to do the fast realtime step generating thing thing. There are 4 axies available for steppers + configurable output for spindle, PWM for spindle speed, coolent on/off, etc. There are inputs available for Home and limits switches. As best I recall the max step speed is IRO 40kHz which is plenty fast enough for most applications.
For full details of of this see:
The PICnc version 2.1 ( this one has integral stepper drivers on board) bare board is available here:
A link to Pololu Stepper drivers for the above board here: There are various options. The DRV8825 is the higher power option @ circa 2A. You can buy a cheap Chinese version from the E-bay . These can push a nema17 comfortably and nema23 with some limitations to torque and speed. I used this setup for all my testing & prototyping with a nema23.
More details of the PWM for spindle speed control here:
I think that cover the main areas for this approach using Machinekit + Raspberry Pi + the Picnc
I will try to cover an alternative approach using a different CNC / SBC / other computer hardware shortly
nice design of the boards, it looks simple enough that with a little rearranging, it looks like it could easly be made into a single layer pcb, so anyone can make the board themselves. I wonder how hard it would be to program the chip tho, all I have is an old pickit2 from ages ago that Im not sure will do the 32x series chips or any of the newer ones. I also think it would be cool to redesign it a bit to make it into a raspberry pi shield, so the whole computer, drivers, cnc board, etc would be all built into one single little block/case.
cae2100, remember that the beauty of a SBC is the ability to use commodity OS (Linux) and commodity IDE (Integrated Development Environment, Eclipse) and program it using C/C++ to access the GPIO pins. Hardware becomes a cheap commodity and software is free modifiable open source. You can run LinuxCNC and drive your CNC machine.
yea, I know, Ive messed with raspberry pi computers since the beginning and actually had gotten a few of the earliest ones, even one or two of the original 10,000, and have made a bunch of robots, and integrated a few into 3d printers and such. (btw, eben is a blast to talk with if you ever get a chance to talk to when he's not being swampped by people, lol) Ive used mint linux (mate) as my main OS on my laptop here for a few years now, and ubuntu 10.04 since it was released before that. I used to make circuit boards all the time for projects, and even designed my own custom boards for the 3d printers so that I didnt have to pay the 80-100 dollars at the time for a 3d printer board, and they're still running perfectly fine, lol.
Originally Posted by caster
I used to do java, c++ and python programming, the java and c++ was for work, but python was more interesting to me due to the fact that it was easily run cross platforms. I was going to make a cnc for the longest time, but one project got in front of another and it just was put on the back burner and eventually forgotten about really, but with increasingly more projects that would benefit a from a cnc router, the time to revisit that idea might be coming sooner than later.
Thanks mrgreg, I didnt even think about the rpi as a programmer, I havnt done that kind of stuff in forever, but I have a bunch of older programmers that I have thrown into a drawer for programming PIC, AVR, and some for cyrix microcontrollers along with some altera chip programmers for jobs that needed a little more oomph. I used to do alot of high speed data connections and building USB devices, and I know how annoying cross signals from too close of traces or the impediance of the wires can be in high speed communications, lol.
Thanks again for the info, this stuff is defenitely going in the bookmarks to be used as a reference later when I build mine.
Yes, it can be cobbled together on a bit of stripboard. The only bit that needs a bit of care is the SPI port connection to the Raspberry Pi. That bit needs to be short, neat and sweet. Ribbon connector ideally with grounds between the signal lines. suggest no more than 100mm long.
The original design PiCNC board was as you suggested. A shield like affair that connected directly onto the Raspberry Pi GPIO. The Raspberry Pi has evolved a bit since the v1 and the GPIO has expanded twice. The current design will fit all versions. If doing a self build then connecting directly would be a good way to go.
A PICkit programmer is not necessary. Programming the firmware can be done with the Raspberry Pi using OCD. Take a look at the Github link above.
Or here to go straight to it:
So that's another thing that you don't need to go out and buy.
Tags for this Thread