Вы находитесь на странице: 1из 28

Food

Living

Outside

Play

Technology

Workshop

Raspberry Pi Alamode CNC Controller


by cdtaylor51 on May 10, 2014

Table of Contents
Raspberry Pi Alamode CNC Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Intro: Raspberry Pi Alamode CNC Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 1: 100% Grbl Compatible CNC Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 2: Raspberry Pi . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 3: Raspberry Pi Alamode . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 4: Stack 'em Up . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 5: An Enclosure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .

Step 6: The Hard Part . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10


Step 7: The External World . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10
Step 8: Power Distribution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12
Step 9: Putting it all together . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14
Step 10: Wiring the carrier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 15
Step 11: Installing the carrier . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16
Step 12: Connecting to the external world . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Step 13: Testing . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17
Related Instructables . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Advertisements . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Comments . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 19
Step 1: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Step 2: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Step 3: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Step 4: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22
Step 5: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Step 6: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23
Step 7: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24
Step 8: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
Step 9: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 25

http://www.instructables.com/id/Raspberry-Pi-Alamode-CNC-Controller/

Author:cdtaylor51
Viet Nam War Veteran

Intro: Raspberry Pi Alamode CNC Controller


This is my first attempt at an instructable. I hope it helps someone else.
Switches and Lights and fans, oh my...
I bought a CNC machine some time ago and I was never happy with it. It used a traditional parallel port controller and of course no modern computers have those. So it
was always a point of frustration. I used an old Pentium based computer and ran LinuxCNC on it for a while but was still not happy with that. So I started looking for
another solution. I decided that I would try to put together an Arduino based controller and try to use USB to communicate with it.
After studying that for a while I came to realize the Arduino was just not going to be able to do all that needed to be done on its own. The Arduino UNO just does not have
enough memory or processing capacity to process a design file by itself. So I modified my solution and started working on using a Raspberry Pi as my host computer.
I created a Visio drawing of what I intended to do: It didn't turn out that way and the drawing continued to evolve as I learned more. It kept on changing until I finally got
my project completed.
I have now built an Arduino based CNC Controller system that uses a Raspberry Pi as its host computer. The Raspberry Pi processes an "nc" file that contains a design
that is described in GCode commands that can be understood by the Arduino. I have used a few tools on my Windows 8.1 Pro laptop to design a few simple things (like
tutorials in makercam here: http://www.makercam.com/). This is a great introduction to designing things for CAD/CAM and it is really easy to use.
After creating a design that I wanted to use I wirelessly connected to the Raspberry Pi using WinSCP to transfer design files to the Raspberry Pi. You can get WinSCP
here: http://www.softnow.com/listing/123823/WinSCP?did=11055&pid=1&ppd=search,44532390848,winscp20download,e,,c,0,,,&gclid=CJuIkNHds74CFagWMgodpxMAJw. Its great, you
can just drag a file from one window to the other to move files between systems. You will have to know the IP address of your Raspberry Pi to connect to it. If you have
gone through the initial setup of the Raspberry Pi and setup a network connection you can get the IP address by using the ifconfig command on the Raspberry PI. A
really helpful tool for getting your IP address and seeing that your Pi is online is a tool called the Advanced IP Scanner here: http://www.advanced-ip-scanner.com/.
Another great tool is Wireshark: http://www.wireshark.org/
I then used Remote Desktop Connection (Remote Desktop connection is part of Windows and should be on your Windows machine. It can be run by entering mstsc in
the Run Open: box) to connect to my Raspberry Pi. Otherwise you could use VNC or TightVNC: http://www.tightvnc.com/. TightVNC is what you need to put on your
Raspberry Pi to allow you to use Remote Desktop Connection from another machine. I can now run the Grbl Controller on the Raspberry Pi which in turn connects to an
Alamode (an Arduino like board that plugs directly into the GPIO connector on the Raspberry Pi and provides automatic voltage level translation. So that the Arduino can
communicate with the Raspberry Pi directly. The Alamode also provides Arduino headers to allow for Arduino shields to be plugged directly into it. So I ended up with a
stack of three boards that are tightly integrated due to being plugged directly into each other. The Alamode (Arduino) processes the GCode commands from the
Raspberry Pi into signals that are sent to the CNC Controller shield to run the stepper motors and passes the various function signals on to the CNC Controller shield too.
They can then be accessed from the external world. All is well so far... But now I have to connect these things to the external world.

http://www.instructables.com/id/Raspberry-Pi-Alamode-CNC-Controller/

Step 1: 100% Grbl Compatible CNC Controller


First, I purchased the 100% Grbl compatible CNC Controller shield from: http://blog.protoneer.co.nz/arduino-cnc-shield. I already had an Arduino and intended to use that
with the CNC Controller shield and run something on my laptop to control everything. Then I found out that the Arduino would not be able to process an entire design file
all by itself. This is due to it not having enough memory to handle more than one GCode command at a time. In fact not all GCode commands are currently completely
implemented in the Arduino Grbl software. However, the Arduino does directly interface with the CNC Controller shield and can pass commands to the stepper drivers on
the CNC Controller shield without any additional circuitry.
The sets of three yellow jumpers that you see in the pictures set the micro stepping for the stepper motors. The one single yellow jumper selects how the limit switches
work. Mine are set up so that when the switch closes a ground is detected (the default). The alternative is to sense a hi when Vcc is selected. That is to say that the limit
switch logic can be set to sense a hi or lo, your choice. The two yellow jumpers on the left side of the picture are for selecting which axis the A-axis mirrors (two motors on
one axis).
I used polarized headers to connect to the stepper drivers so that I would not be able to plug in my stepper motors backwards - that's pretty important.
The 100% Grbl compatible CNC Controller shield does not actually include any stepper motor drivers. It is only a means of integrating the stepper motor drivers into an
Arduino shield conveniently and it works great for that purpose. The CNC Controller shield is designed to use the Pololu type step driver modules like the A4988 stepper
motor driver carrier that is shown here: http://www.pololu.com/product/1182
I purchased some from China that were about $4.00 each and appear to be exactly the same (we shall see when I actually try to use them). They came with some heat
sinks too but I decided to use the ones you see (from Adafruit) instead of the ones that were included instead. You actually only need to populate the X, Y and Z stepper
driver carriers on the CNC Controller board (because the Grbl software on the Arduino only knows about three axes). Unless you intend to use the A-Axis too (for a
second motor on one of the primary axes). The CNC Controller allows you to mirror the control signals from X, Y or Z to the A axis by using jumpers. I am not using the
fourth axis. I just included the fourth stepper driver carrier so that I would have a spare in case one of the others stops working. Then again who knows what might be in

http://www.instructables.com/id/Raspberry-Pi-Alamode-CNC-Controller/

the future?

Image Notes
1. Select A-axis mirroring here
2. X-axis Microstepping Jumpers
3. External Swiches Header
4. Limit Switches Header
5. Reset Switch
6. Limit Switch Logic Selector
7. Spindle Control Functions Header
8. Z-axis Stepper Motor Header
9. Y-axis Stepper Motor Driver Carrier Headers, Microstepping Jumpers and
Capacitor
Image Notes
1. Stepper Motor Driver Chip Heat Sink
2. Stepper Motor Current Limit Adjustment Pot

Image Notes
1. Polarized Stepper Motor Header

http://www.instructables.com/id/Raspberry-Pi-Alamode-CNC-Controller/

Step 2: Raspberry Pi
It became clear that I needed some way to process a complete design file and break it into individual GCode commands that the Arduino could then pass on to the CNC
Controller shield. Many articles are available on the internet about running the Grbl Controller software which provides this specific function on a Raspberry Pi. I had a
Raspberry Pi that I had played with a bit, some time ago, but it was an older version. I am sure it would have worked but I decided to get a new one and dedicate the new
one to being the host in my new CNC Controller system. For more information about running the Grbl Controller software on a Raspberry Pi look here:
http://zapmaker.org/raspberry-pi/running-grbl-controller-on-raspberry-pi/
Due to reading a lot of those articles that I mentioned I became concerned that the Raspberry Pi would overheat when inside of an enclosure so I put heat sinks on it.
Then I had to trim down the heat sink on the processor as it was too tall.
I also came to realize that the Arduino and the Raspberry Pi are slightly, electrically incompatible. The Arduino operates with 5V logic and the Raspberry Pi operates with
3.3 V logic. So a voltage level translator of some sort is required as an interface between the two environments. I looked around for a solution and found a few. I didn't
really like anything that I was finding and it took a while to get to what I wanted but I eventually found the Raspberry Pi Alamode board.

Image Notes
1. Alamode Spacer
2. 16 GB SD Card
3. Processor Heat Sink

Step 3: Raspberry Pi Alamode


The Alamode board plugs directly into the GPIO connector on the Raspberry Pi and provides the level shifting function that is needed for the Arudino to communicate with
it. It also provides Arduino compatible headers so that any standard Arduino shield can be plugged into it too. Including the CNC Controller shield. So it now appeared
that I could have a stack of three boards that communicate with each other properly and elegantly - with no additional circuitry required.
Some quick features of the Alamode - that I am interested in: The Alamode has a real time clock that is directly available to the Raspberry Pi (with a coin cell battery
backup). The Alamode can be powered from the Raspberry Pi or it can be powered directly through its own micro USB connector. There is a tiny jumper that allows you
to select how you want to power it. The jumper header fell off of my board (probably my own fault). I looked at it and decided I just didn't need it as I intended on powering
it through its own micro USB port anyway. The big deal is that the Alamode includes the signal level shifting that is required for an Arduino to communicate with a
Raspberry Pi.
Once the Alamode is connected to the Raspberry PI you can then load the Grbl software onto the Alamode. The Grbl code is loaded into the Alamode with the Arduino
IDE. You need to load the Arduino IDE onto the Raspberry Pi to load the Grbl code into the Alamode. The Getting Started instructions at the Alamode site are very good
and complete: http://wyolum.com/projects/alamode. Refer to the User Guide for instructions on how to set up the real time clock.
Let me just say that it works exactly as they say it does. It is a bit of a task to get everything together to actually use it but once it is set up (mostly on the Raspberry Pi) it
works great.

Image Notes
1. Real Time Clock Battery
2. Glued on standoff

http://www.instructables.com/id/Raspberry-Pi-Alamode-CNC-Controller/

3. Glued on standoff

http://www.instructables.com/id/Raspberry-Pi-Alamode-CNC-Controller/

Step 4: Stack 'em Up


So now I have a stack of three boards. With the Raspberry Pi on the bottom, the Alamode in the middle and the CNC Controller shield on the top. All plugged together.
One problem for me was that the Alamode does not provide any mounting holes. It does provide a rubber pad that goes on the top of the RJ-45 Ethernet connector on
the Raspberry Pi and is the right height (must be very carefully positioned on the RJ-45 connector) but there is no solid connection point other than the GPIO connector.
The CNC Controller shield is like most other Arduino shields and is very well held in place due to the friction of the header extenders that are on the Arduino. My original
Raspberry Pi did not have mounting holes in it either. That is part of the reason why I decided to get a new one and use it instead. Later on, I purchased an assortment of
nylon standoffs and attached a couple of them to the Raspberry Pi - with a couple of washers to get the height right. Then I very carefully put a drop of super glue on the
top of each of the nylon standoffs and put the Alamode onto the Raspberry Pi. I then left it alone for a while. I was later able to take the screws out of the bottom of the
Raspberry Pi and take the Alamode off with the standoffs attached to the Alamode - it worked! I also attached a standoff between the Alamode and the CNC Controller
shield as there was a hole in a place that made that possible on both boards. So now I have all three boards securely connected together.

http://www.instructables.com/id/Raspberry-Pi-Alamode-CNC-Controller/

Image Notes
1. WiFI Adapter

Step 5: An Enclosure
Early on I decided to use some sort of enclosure to protect my finished project. So I bought one and then came to realize it was not large enough and had to measure
everything and buy another one. The one I used is is nice box but turned out to be a challenge anyway. This box is made by Bud and I got through Amazon here:
http://www.amazon.com/dp/B005T7ARB6/ref=pe_385040_30332190_TE_M3T1_ST1_dp_1. It is a BUD Industries PN-1339-DG High-Impact ABS NEMA 4x Indoor Box,
6-19/64" Length x 6-19/64" Width x 3-17/32" Height, Dark Gray Finish enclosure.
There are some nice brass threaded mounting holes in the corners inside of the box and the box comes with screws to secure the top to the bottom with the brass
threaded holes in the outside corners. The box also has a gasket to make it waterproof if you need that. In my case it just makes for a very nicely sealed box.
I came to believe that I needed to have some sort of carrier to mount my "stack" to inside of the box. So I bought a sheet of acetal from Zoro Tools:
http://www.zoro.com/g/Acetal%20Sheet%20Stock/00153128/. Acetal is supposed to be somewhat ESD safe but I have not studied that out entirely either. After I got the
sheet of acetal I cut a piece that would fit inside of the enclosure with my Dremel tool. It isn't pretty and this is one of the things I plan to replace when I finally get my
milling machine working again. I ended up having to cut cutouts on both sides of my initial carrier to provide better access for the wires and cables that connect the
"stack" to the external world.
I also felt that it was important to make sure that there is adequate ventilation in the box. So I mounted two 40mm, 12 VDC, exhaust fans on the top and two inlet vents

http://www.instructables.com/id/Raspberry-Pi-Alamode-CNC-Controller/

with filters on the bottom.


In the pictures you can see that there are a couple of extra holes in the carrier - Oops.
I made a 1:1 scale drawings of the openings to be put into the box in Visio and then printed those out on my printer. Then I cut out the printed drawings and taped them to
the box and used them as templates. It wasn't perfect, of course, but was pretty good. I started each modification to the box by using an Exacto knife to carefully mark
through the templates and then used a Sharpie to make sure I got it right. Then I used my Dremel to cut out the various openings in the box. Not too difficult to do but you
have to be patient and let the Dremel do the work or you will end up with a lot of melted plastic on your hands and the nib that you are using in the Dremel will try to dig
into the material occasionally. My only advice is be patient, take you time, don't press to hard, cut in the right direction and it will all work out acceptably - no one is
perfect. The hardest openings to cut were the ones for the switches and the connectors. Each of the connectors and switches have flat spots on opposite sides. All of my
switches and connectors are 16mm. The flat spots keep the switches or connectors from turning in the chassis. That is great if you are using chassis punches but I do not
know of any of those that are designed to work on plastic. So I had to very carefully cut the holes by hand with my Dremel. I cut them and test fitted each connector one
at a time and as soon as I was able to get the switch or connector in the hole I stopped. They are pretty good but a nice CNC machine would have done a better job than
I did - maybe next time I will have a working CNC machine and I can try that.

Image Notes
1. Oops!

Image Notes
1. 40mm Quiet Fans on the Top with Fan Guards on top and bottom.

Image Notes
1. 40mm Air Filters on the Bottom

http://www.instructables.com/id/Raspberry-Pi-Alamode-CNC-Controller/

Step 6: The Hard Part


So here is the hard part. Most CNC machines (milling machines, laser cutters, engravers, water jets, etc.) use stepper motors to position the axes. The CNC Controller
board provides X, Y and Z axes as well as an A-Axis that can be used to supplement one of the other axes if needed with an additional motor or a fourth axis could be
implemented (but Grbl only knows about three axes right now). My implementation is only going to use three axes at this time. However, I decided that I needed to bring
the A-Axis out because I might someday want to use it. Further, the CNC Controller board provides for the control functions to enable the spindle as well as two other
functions. By default they are spindle cooling and spindle direction (alternately these functions can be used to control a laser, a vacuum hold down or a blower / fume
extractor and a heating mat for a 3D printer). I did not know what I might want to control later on so I decided to bring those signals out of the box too. I ended up with five
connectors on one side of my box that can be used to connect to the machine that I want to control. I have labelled everything and everything is also color coded.
I want to mention that I used expandable sleeving to bundle wires together where ever possible and to reduce the number of unbundled wires in the build. It helps in a lot
of ways and protects the wires a bit but most importantly it makes it really clear what each of the bundles is for. It also makes the entire project a lot better looking. Here is
one place that you can get expandable sleeving: https://www.parts-express.com/Search.aspx?keyword=expandable%20sleeving&sitesearch=true. NTE provides wire
and heat shrink tubing assortments that are really useful in building electronics.
NTE / Elenco hookup wire assortment: http://www.amazon.com/Elenco-Electronics-WK-106-Storage-25Feet/dp/B008L3QJAS/ref=sr_1_1?ie=UTF8&qid=1400363023&sr=8-1&keywords=elenco+wire
Heat shrink tubing assortment: http://www.amazon.com/NTE-Heat-Shrink-Assorted-Colors/dp/B000FIDTYG
Other useful things are like these:
Crimping Tool to put pins onto the ends of wires to be plugged into the various places: http://www.pololu.com/product/1928. This is a really nice tool and works better
than a lot of other crimpers that are a lot more expensive. Of course, you need to have pins and housings to complete a connection. You can see that I used many pins
and housings in building my CNC Controller.

Step 7: The External World


The next thing that had to be done was to connect the inside of the box to the external world. Switches to control the system and plugs to get the signals to the stepper
motors and the spindle and finally a connection to a power supply.
The switches are all connected to one header that plugs into the CNC Controller shield and another one that plugs into the power distribution board for the LEDs that are
in the switches. So the switches have a connection both below the carrier and above the carrier.
The switches are E-Stop or Arduino Reset (Red), Abort Reset (Yellow), Pause / Feed Hold (Blue) and Cycle Start / Resume (Green). The Reset, Abort and Hold switches
are push-push switches. That is they stay pushed in until you push them again. That gives a positive indication of whether or not a button was pushed. The Resume
button is a momentary push button and only stays in as long as you hold it in. Each button illuminates so that you can clearly see if it is pushed in or not. As you can see
in the pictures I used colored expandable sleeving and shrink tubing of the same color as the button for each function to make it easier for me to keep everything straight.
The connectors on the other side of the box are color coded too. They are X-Axis (Green), Y-Axis (Blue), Z-Axis (Red), A-Axis (Purple) and Spindle (Yellow). These
colors match up with the cables on my milling machine. The X, Y and Z axes contain the wires for the stepper motors and for the limit switches. The A-Axis is only stepper
motor wires and will not be used on my milling machine. The Spindle connector has the Spindle Enable, Spindle Direction and Cooling Enable wires in it. Again you can
see that I tried to use the same color expandable sleeving and heat shrink tubing as much as possible.

http://www.instructables.com/id/Raspberry-Pi-Alamode-CNC-Controller/

I connected the two 12 VDC exhaust fans to a header that eventually connects to the power distribution board.
Finally, I used a PowerWerks PowerPole snap-in chassis mount that provides 5 VDC through a red connector and red cable, 12 VDC through a yellow connector and
yellow cable and a ground for each side through black connectors. The chassis mount holds the PowerPole connector housings in place inside of the snap-in chassis
mount with a pin and these connectors are very well made. More information about the PowerWerks PowerPole connectors can be found here:
http://www.powerwerx.com/powerpole-accessories/pow...
Externally I am using an ATX power supply that has been slightly modified to provide power for my milling machine (it came with my machine). I built a cable with the
PowerWerks PowerPole connections on it that match up to my CNC Controller box PowerPole snap-in chassis mount. Later on I added an emergency power off switch to
my power supply. You can see the emergency switch here: http://www.sourcingmap.com/red-mushroom-cap-1no-1nc-dpst-emergency-stop-push-button-switch-ac-660v10a-p-256918.html
Hooking up the switches and the connectors was the most time consuming part of the build.

Image Notes
1. 1x12 Female Header for LEDs
2. Fan Connector Header
3. Reset Button to CNC Controller Shield Header
4. Abort, Hold, Resume Button to CNC Controller Shield Header
5. Polarized Stepper Motor Header
6. Limit Switches to CNC Controller Shield Header

Image Notes
1. Input Power - +5VDC and Ground Header
2. Input Power - +12VDC and Ground Header
3. Spindle Relay Grounds Locking Header
4. Spindle Relay Functions Header
5. 1x12 Female Header for LEDs

http://www.instructables.com/id/Raspberry-Pi-Alamode-CNC-Controller/

Image Notes
1. Limit Switches to CNC Controller Connector Header
2. Fan Connector Header
3. Abort, Hold, Resume Switches to CNC Controller Header

Image Notes
1. Spindle Relay Fuctions Header
2. Spindle Relay Grounds Locking Header
3. Input Power - +5VDC and Ground Header
4. Input Power - +12VDC and Ground Header
5. 1x12 Female Header for LEDs

Step 8: Power Distribution


The next issue was how to get power to my "stack". I decided to build a power distribution board. I also had an issue with the switches that I used. As you can see they
have LEDs inside of them. The LEDs are completely separate from the switches. On top of that the switches just provide a path to ground for the CNC Controller /
Alamode. So, to get the LEDs to light up when the switch is depressed I had to use an inverter (SN7404 Hex Inverter). The LED power function is most of the circuitry on
the prototype board. Power is on the edges with 5 VDC on one edge and 12 VDC on the other edge. The four resistors are current limiting resistors to limit the current
going through the LEDs. The 12 pin header is where the switches plug into the board. The headers provide power for everything in the box. 5 VDC for the Raspberry Pi
and the Alamode. 12 VDC for the fans and the 12 VDC circuitry on the CNC Controller shield and for the 12 VDC path through the relays. The black connector on the
prototype board is used to provide the grounds for the signals being controlled by the relay stack. Notice that I tied all of the grounds together on the power distribution
board.
I used a temporary breadboard to figure out how to get the LEDs to work the way I wanted them to work. Then I moved the circuit to an Adafruit Perma-Proto Half-sized
Breadboard PCB. It went pretty quickly and easily.
There are pull up resistors in the Alamode (Arduino) that pull up the voltage to near Vcc on the Alamode for each of the functions. A function change of state is sensed
when the voltage is pulled lo or to ground. The CNC Controller shield provides the function pins and matching ground pins. Shorting the function to ground changes the
state of the function and is sensed by the Arduino code. I wired up the switches to do just that. Press the switch and the function is connected to its respective ground pin.
However, I also ran a wire from each of the switches to one of the four Inverters that I used (two of the inverters in the HEX Inverter chip are not used). So that when the
switch is open a high or Vcc is on the input to the inverter which results in a low is on the output and the LED is off. Pressing the switch puts a low or ground on the input
to the inverter and hence the output of the inverter transitions to a hi and the LED turns on.

http://www.instructables.com/id/Raspberry-Pi-Alamode-CNC-Controller/

Image Notes
1. Arduino Reset
2. Abort
3. Feed Hold
4. Resume

Image Notes
1. SN7404 Hex Inverter
2. 1x12 Male Header for LEDs
3. +12VDC and Ground
4. +5VDC and Ground
5. Spindle Relay Grounds

Image Notes
1. Polarized Stepper Motor Connector

Image Notes
1. +5VDC and +12VDC Grounds Tied Together
2. +12VDC and Ground
3. +5VDC and Ground

Image Notes
1. +12VDC Power Distribution
2. 5VDC Power Distribution
3. RPi and Alamode +5VDC Power

http://www.instructables.com/id/Raspberry-Pi-Alamode-CNC-Controller/

Step 9: Putting it all together


I looked into connecting a video display to the enclosure but did not have enough USB ports. So I bought a 3-port USB hub. It came in a black plastic housing but that
was way too big to fit into my box. So I took it out of its housing and then used a zip tie to anchor it to my carrier. Now I have four usable USB ports. One has a wireless
network adapter in it. I also used one with a miniature keyboard but I am not using it now as I am using the Remote Desktop Connection instead. I also looked at adding
an LCD display to the box but found that I just do not have enough room in the box. Another of the USB ports would have been used to connect a touch screen to the
system.
Next I attached the stack to the top side of the carrier and the power distribution board to the bottom side with nylon standoffs.
The last pieces to go onto the carrier were the relays. There are three relays. One for the spindle, One for spindle direction and the last one for spindle cooling. They got
put into a stack and mounted on the carrier with nylon standoffs too.

Image Notes
1. Oops!

http://www.instructables.com/id/Raspberry-Pi-Alamode-CNC-Controller/

Image Notes
1. WiFi Adapter

Image Notes
1. Locking Header Connection

Step 10: Wiring the carrier


After getting all of the pieces mounted on the carrier they needed to be connected electrically. I built a small wiring harness to connect the relays to the power distribution
board and to the CNC Controller board. Each relay connects to its control pin on the CNC Controller board (the white expandable sleeving bundle). Then each relay gets
connected to the power distribution board for 12 VDC power. On the other side of the relays I made a couple of cables that provide the ground for the signals being
controlled by the relays and a very small cable to connect the relays to the spindle connector. It is sleeved with yellow on this side as it connects directly to the Spindle
connector on the side of the box. I used inline connections to allow me to more easily disconnect the cables and get the carrier into and out of the box.
The relays are controlled directly from the Alamode via the CNC Controller shield. Of course, you could use these three relays to control the functions mentioned but they
could also be used to control the functions of the print head and heat pad on a 3D printer or a LASER in a laser engraver along with a fume extractor or whatever. I plan
on being able to move this control system between all of those environments in the future - unless I decide to dedicate this one and build more of them for my future
machines. It would also be really easy to use the 5 VDC relays to switch 12 VDC and then use that to control a solid state relay or whatever is wanted.
I built another small wiring harness to connect 12 VDC from the power distribution board to the CNC Controller shield. This 12 VDC is used to power the stepper motors.

http://www.instructables.com/id/Raspberry-Pi-Alamode-CNC-Controller/

Image Notes
1. Spindle Cooling Control and Power
2. Spindle Direction Control and Power
3. Spindle Enable Control and Power
4. Spindle Relay Functions Control
5. RPi and Alamode Power

Image Notes
1. RPi and Alamode Power
2. 12VDC to Relays
3. 12VDC for Stepper Motors
4. Spindle Relay Function Contols

Image Notes
1. Relay Functions to Outside

Step 11: Installing the carrier


Now it was time to install the carrier with all of its boards and cables into the enclosure. The hardest part is connecting the power to the power distribution board. First I
plugged in the connector to the LEDs that are in the switches. Next comes the fans and finally the power. Everything is color coded because I am notorious for incorrectly
connecting things. The cables that are attached to the switches and the connectors have to be gently pushed and pulled to get the carrier in the box but once there is sits
comfortably.

Image Notes

http://www.instructables.com/id/Raspberry-Pi-Alamode-CNC-Controller/

1. +12VDC Power Distribution


2. +5VDC Power Distribution

Step 12: Connecting to the external world


After getting the carrier board connected and in place and then screwed down at its corners the remaining steps are to connect the switches to the CNC Controller shield.
Followed by connecting the axes cables to the CNC Controller shield. Finally the last connections are the relays and the ground for the spindle connection. It is tight but
there is enough room for everything to fit nicely into the box.

Image Notes
1. Arduino Reset Switch Header
Image Notes
1. Input power - Yellow is +12VDC, Red is +5VDC, Black is ground for each
voltage.

Image Notes
1. Abort, Hold, Resume Switches Header
2. Spindle Enable, Direction, Cooling Switches Header
3. X, Y and Z Limit Switches Header

Image Notes
1. Wireless Keyboard Adapter

Step 13: Testing


After getting everything hooked up I powered up the box and started testing everything. The switches worked and I was able to control the system as I thought it should
work.
Next I went to my laptop and used the Remote Desktop Connection to log into my Raspberry Pi.
I had already installed the Arduino IDE on the Raspberry Pi and done a lot to prepare to run the system. It was a learning experience and I did not know what else I might
need to do to make everything work. So I got the software working before I ever put anything in the box. The biggest difference between my getting the software working
and the current state is that I now have the switches too and can control the system by pressing those buttons and it all works.
I ran the Grbl Control program on my Raspberry Pi and connected to the Grbl program that is running on the Alamode. I opened a file that I had created (a modified
coaster tutorial) and ran the program. It ran all the way through and stopped as I expected it to.
I checked to make sure that nothing got hot. Now I have to get out my milling machine and get it back together and try to make something.
Thanks for reading my instructable.
Let me know what might have done differently. Maybe I will make another one.

http://www.instructables.com/id/Raspberry-Pi-Alamode-CNC-Controller/

http://www.instructables.com/id/Raspberry-Pi-Alamode-CNC-Controller/

Related Instructables

Arduino CNC by
JohnnieT

Biofeedback
Cinema by
PrivateHQ

The MicroSlice
V1 | A tiny
Arduino laser
cutter by
SilverJimny

3 Axis Arduino
Based CNC
Controller by
rjkorn

Make Your Own


Customizable
GRBL CNC
and
Pendant by
Autonomous
CNC machine by rawkstar320
pblankinho

Advertisements

Comments
50 comments Add Comment

joaoji says:

view all 104 comments


Jan 24, 2015. 6:09 AM REPLY

Very good your work, worthy of a good teacher!


Could you post a video on youtube of your CNC showing some details mainly featuring the g-code transfer process for processing?

cdtaylor51 says:

Jan 24, 2015. 1:20 PM REPLY


Well, I am not in a position to do a video so here is an explanation about what is going on with the software. I made a few assumptions that I guess I should
not have made. Hopefully, this will clear things up for anyone who is confused by what I previously posted. In Step 13: Testing, I showed how the
software works. As I said, I used Remote Desktop to connect to my Raspberry Pi from my laptop.
1st Picture:
The first picture that has a large raspberry in the middle of it is the desktop of my Raspberry Pi. Notice that is just shows a few icons. Notice that one of the
icons is for the GrblController. To test the system I clicked on the GrblController icon which brought up the GrblController window that you can see in the
next image.
2nd Picture:
In this image you should be able to see that the Port name is populated with the name of the port that the RPi is using to talk with the Arduino/Alamode. It
should be ttyS0 and the Baud Rate should be 9600. If all of this is right then you would next click on the Open button to establish a connection between
the RPi and the Arduino/Alamode and that will take you to the next image.
3rd Picture:
The text on the Open button will change to Close/Reset and the button will go red. Notice that the Port name and the Baud Rate are greyed out and
cannot be changed at this time. Once the connection between the RPi and the Arduino/Alamode is established the GrblController will automatically send a
message to the Grbl Interpreter on the Arduino/Alamode and the Grbl Interpreter will respond with the information that you see in the window under the
Command box. You can get the Grbl Interpreter to send that information again if you enter $$ in the Command window. Notice that anything sent to the
Grbl Interpreter is preceded by a right arrow symbol >. The system is now waiting for something to do.
You can use the arrow keys in the Axis Control window to move the desired axis of your machine or you can go to the advanced window to manually enter
Gcode commands or you can go to the Visualizer window (more about that later) or you can select a design file that contains Gcode.
4th Picture:
I loaded a design file that I made with makercam (see the introduction). As you can see I chose a design file the ends with the .nc suffix.

http://www.instructables.com/id/Raspberry-Pi-Alamode-CNC-Controller/

5th Picture:
In the next picture I clicked on the Begin button. That causes the Choose File and Begin buttons to get greyed out and the Stop button is now
available. The visualizer will automatically show you what the design will look like. Notice that the image of the T is blue and the machine and work
coordinates are all zeros (before the Begin button is clicked).
6th Picture:
The next image shows more data in the window on the left. Notice that Gcode commands are showing up in the list. Also notice that a statement telling you
that the GrblController is Sending a file to the Arduino/Alamode/Grbl Interpreter. Also you should notice that the Queued Commands bar is showing
some depth. This is because several Gcode commands have been queued up for execution. Further, the Machine and Work coordinates have changed
and they are no longer zeros. Lastly note that the image in the Visualizer window has some green lines that are replacing the blue lines. This shows you
what segments of the design file the system has completed and where it is currently working. As work progresses through the design file the lines will
continue to go from blue to green and the coordinates will continue to update and the lines in the information window will continue to appear. You can click
on the stop button anytime you want to interrupt the system. You can see that eventually all of the blue lines have been replaced by green ones indicating
that the design file has been completely processed.
7th Picture:
Finally in the last picture, after the design has been completed the system moves back to the origin and the coordinates go back to zeros and the design is
finished. Now the system is once again waiting for something to do.

vtstruct says:

Dec 26, 2014. 10:53 AM REPLY

Very interesting project, thanks for posting this!


A couple questions:
1.) if I already have individual commercial stepper drivers, can I eliminate the shield board?
2.)
Does GRBL provide look ahead buffer capabilities for motion control -how square would corners be if this system was running a mill, and does
the feed rate slow down from a straight line on doing arcs an circles
made of polylines?

cdtaylor51 says:

Dec 26, 2014. 5:38 PM REPLY


There are many ways to drive the stepper motors. As for information about GRBL I would suggest that you contact the GRBL authors. I am a relative novice
and still don't know as much as I need to know and I do not feel confident in answering your questions. Thanks for taking a look at my project.

cdtaylor51 says:

Dec 29, 2014. 9:42 AM REPLY


You would probably want to use an Arduino prototyping shield to provide an interface between the Arduino and you drivers.

EricP5 says:

Dec 28, 2014. 10:27 PM REPLY

Well Mr. Taylor after reading your instructible I have FINALLY


decided to take the plunge and build a CNC. I have the plans, about 96%
of the parts, and have been working with the Arduino/Raspberry PI boards
for a year or so now. I guess, after reading through your instructions,
I have a few questions that I am somewhat fuzzy on
1) You mention
a power distribution board but I don't recall if that is a part that I
need to purchase or make. If I need to make it is there a schematic
available?
2) It looks like I maybe misunderstood how the
Raspberry PI works with the Arduino... I thought that I needed to run
LinuxCNC as the OS on my PI and then control or send the Gcode to the
Alamode via the GPIO so that the GRBL would intrepret it and then send
the stepper motor instructions to the CNC board. Do I NOT need to use
LinuxCNC? If not how do I send the Gcode to the Alamode - via the IDE?
Those
questions posited I have to add on to the choir that this is an
excellent and well thought out instructible and your end result was
elegant. Hell, it impressed me enough to finally get off of my butt and
get this done. Plenty of folks would tell you that is a feat in itself.

cdtaylor51 says:

Dec 29, 2014. 9:35 AM REPLY


The power distribution board that I mentioned is not completely necessary but just a convenient way to get power where I want it and I also put the hex
inverter that I used to drive the LEDs on it. You obviously do not need to have illuminated switches either. The power distribution function is really simple. I
just used the power rails on either side of the board to pick off the power where I needed it. The rails are on either side with +5V and ground on one side and
+12V and ground on the other side (with the grounds tied together). I included a small schematic showing how the switches and LEDs are wired up in a
previous comment. Take a look at the other comments. They present some good information too.
As for the software I used: GRBL is implemented by putting the GRBL interpreter on the Arduino (Alamode in my project) and the GRBL Controller on the
Raspberry Pi. I am not using LinuxCNC at all. I would refer you to the GRBL authors if you want to use the interpreter in a different way. The screenshots in
the last step show what you would see on the screen of the RPi while running the GRBL Interpreter on the Arduino and the GRBL Controller on the RPi. You
would need some other piece of software to make a design file to process with the GRBL software.

http://www.instructables.com/id/Raspberry-Pi-Alamode-CNC-Controller/

I hope that makes things more understandable. Good luck with your project and thanks for looking at mine also thanks for the comments too.

DanB7 says:

Dec 7, 2014. 11:09 AM REPLY


Cool!...I multiplied every long word by 10 minutes as I read....Impressed but I think I have to find a quicker solution - I have only so many years left and need
to get my project up and running too......I am working backwards from the steel frame.....and have a long way to go (further now than I first envisaged..;-).)
But thank you especially for your organisational skills.....

cdtaylor51 says:

Dec 7, 2014. 3:30 PM REPLY


DanB7 - I am not sure what you meant with your first sentence, maybe you could clarify that and then I might be able respond. if there is anything that is mot
explained well enough let me know and I will try to help. Not sure what the second sentence means either. I guess you believe that my instuctable is too
long. Working backwards from a steel frame might mean that you have a machine with a steel frame and you are now looking for a controller for it but I am
not sure as the context does not provide any way to know for sure. If that is the case then you could simply purchase a CNC controller system through ebay
or elsewhere on the Internet and completely skip building your own. This instuctable is my first attempt to put something like this together. It was meant to
help others who might want to do something similar and it is just the way I did it and did not intend to restrict anyone from doing something differently. It also
shows some of the prototyping techniques that I have learned and used over the years. My hope was to help others to raise the quality of their projects to a
higher level that they would be happier with. I am still learning too. When I read through an instructable about something that I have not done before I always
learn about things that I previously did not know. Sometimes the learning curve is high and it is difficult to understand. I am always grateful to learn more
especially about things that I knew nothing about before. I hope that my little instructable has added a bit, and elevated the journey's of, the more than
100,000 people who have read it. Thanks for your comments and just ask if I need to explain something better and I will do my best to do so. Please be as
specific as possible and I will do the same.

DanB7 says:

Dec 8, 2014. 11:23 AM REPLY


I am in awe at your knowledge, learning and application. You must have spent a long time on it. Your clear words must have been magnified 10 fold
in the actual application of your knowledge. I am very impressed by your result but doubt I could emulate it and may have to initially think "simple" to
start with.

cdtaylor51 says:

Dec 8, 2014. 3:07 PM REPLY


Well DanB7, I believe you could do this too. Just take one step at a time. Get all of the parts and tools that you need and take you time. I recommend
that you start by getting the software working on the Raspberry Pi and the Arduino/Alamode. Then add on the 100% GRBL Compati le CNC
Controller. At that point you could temporarily attach you stepper motors and verify that everything works as it should. Then you can start thinking
about packaging everything. Thatis really what instuctable is abou. Use expandable sleeving to bundle wires together in a logical way. Expandable
sleeving needs to be cut with a hottool to melt the fibers together but further you need to reminate the expandable sleeving with heat shrink tubing.
That will help to hold the sleeving in place and protect the ends too - it also looks better. You need to be careful though because you can easily melt
the pin housings by getting them too hot (read, voice of experience here). Putting the holes in the box and making the carrier plate were the hardest
parts because I had to do those things by hand with my Dremel tool. Read the other commentsfor more info about that. I am sure that youcan do it.
Thanks fir your comments.

cdtaylor51 says:

Dec 8, 2014. 3:14 PM REPLY


I read my reply twice to make sure there were no typos, etc. Then posted and read again and there are typos. What can I say?

dgaynor says:

Nov 3, 2014. 11:04 AM REPLY


Why didn't you use the 12-36V stepper power supply on the GRBL board? Aren't the stepper motors going to be under powered now?

cdtaylor51 says:

Nov 3, 2014. 12:57 PM REPLY


My stepper motors are all 12 volts and so is my spindle. Changing the wiring for other voltages would be pretty easy to do and the CNC Controller board is
already able to handle 12 - 36 volts.

branilson says:

Oct 14, 2014. 10:39 AM REPLY

Very nice and organized assembling. Congratulations!.


Today with the the new raspberrry Pi B+ with more GPIO lines, i am thinking in use the raspberry to control the drivers directily. I think in use some kind of
simplified version of linuxcnc to run into the raspberry pi.

cdtaylor51 says:

Oct 27, 2014. 9:39 AM REPLY


Using the RPI to directly drive the stepper motor drivers should be possible. You would need to use a real time operating system and some custom
programming to do that. You would also need to provide some sort of mechanical and electrical interface. The RPI is a low voltage and low power device
whereas the steppers are higher voltage and higher power. It could be done and would be a great project but it would also be a lot more complicated than
what I did. Good luck, if you decide to do it. I would be interested in seeing how it all came together if you do it.

sylvain.de.crom says:

Oct 15, 2014. 10:39 AM REPLY

Hi Chuck,
Very impressive project; I am contemplating a CNC setup myself and I am very interested to hear how your new control setup is working out.
Thanks
Sylvain

http://www.instructables.com/id/Raspberry-Pi-Alamode-CNC-Controller/

cdtaylor51 says:

Oct 15, 2014. 12:45 PM REPLY


As I mentioned in my previous replies I recently moved and other things have taken priority for a while. I know my controller works as i have tested it but my
milling machine is a different matter. I have to custom create some parts to get it back together. It will take me some time to get there. Thanks for your
feedback.

Festrada007 says:

Aug 20, 2014. 4:10 PM REPLY


Really great job, what I would find most useful is where you got the software, how you installed it step by step. That would be truly needed information, as
the stuff I am finding is a few years old and the links are old and broken. Thanks!

cdtaylor51 says:

Aug 20, 2014. 7:58 PM REPLY

Thanks for your feedback. It took me a while to find everything too.

Festrada007 says:

Aug 20, 2014. 9:58 PM REPLY


The i love the way you put it all in a nice box. Its beautiful. It brought a tear to my eye. :) i was able to get GRBL working on my pi and loaded on my
Uno. Now if i can make something half as nice as you did ill be happy.

cdtaylor51 says:

Aug 20, 2014. 10:29 PM REPLY

Thanks, I am happy to have helped.

jetxu2014 says:

Aug 7, 2014. 7:41 PM REPLY

you can try to use the Banana Pi, i think it will give you suprise. you can know more from: www.bananapi.com

cdtaylor51 says:

Aug 7, 2014. 9:56 PM REPLY


I read about the BananaPi before but thought it was a bit too new and not stable yet. Maybe it would be good in a future project. Thanks for your feedback.

skaufman3 says:

Jun 22, 2014. 10:22 PM REPLY

You wouldnt happen to have a parts list for this design would you?

cdtaylor51 says:

Jun 23, 2014. 2:38 PM REPLY

No I didn't but I put this together... Hope it helps... Took a while to find everything again.

Step 1:
makercam: http://www.makercam.com/
WinSCP: http://www.softnow.com/listing/123823/WinSCP?did=11055&pid=1&ppd=search,44532390848,winscp20download,e,,c,0,,,&gclid=CJuIkNHds74CFagWMgodpxMAJw
Advanced IP Scanner: http://www.advanced-ip-scanner.com/
Wireshark: http://www.wireshark.org/
TightVNC: http://www.tightvnc.com/
Grbl Controller software
for Raspberry Pi: http://zapmaker.org/raspberry-pi/running-grbl-controller-on-raspberry-pi/

Step 2:
100%
Grbl compatible CNC Controller shield: http://stores.ebay.com/Protoneer
A4988 stepper motor driver
carrier: http://www.ebay.com/itm/1PC-A4988-3D-Printer-Driver-Module-Reprap-Prus-StepStick-Stepper-Motor-Driver-GE/121323519502?pt=LH_DefaultDomain_0&hash=item1c3f71fe0e
Like:
http://www.pololu.com/product/1182
Adafruit
Heatsinks For Stepper Drivers:
3 x Aluminum SMT Heat Sink 0.4"x0.4" square[ID:1042]
http://www.adafruit.com/products/1042

Step 3:
Alamode:http://www.seeedstudio.com/depot/Alamode-Arduino-Compatible-Raspberry-Pi-Plate-p-1285.html?cPath=122_111

Step 4:
Raspberry Pi Model B 756-8308 Raspberry Pi B

http://www.instructables.com/id/Raspberry-Pi-Alamode-CNC-Controller/

http://www.amazon.com/dp/B009SQQF9C/ref=pe_385040_30332200_pe_309540_26725410_item
M3 Nylon Hex Spacers Screw Nut Assortment Kit Stand off Plastic Accessories
Set
http://www.ebay.com/itm/M3-Nylon-Hex-Spacers-Screw-Nut-Assortment-Kit-Stand-off-Plastic-Accessories-Set-/231018719344
I replaced most of these with brass.
Raspberry Pi Premium Aluminum Heatsink Kit
http://www.ebay.com/itm/Raspberry-Pi-Premium-Aluminum-Heatsink-Kit-Protect-your-Pi-from-Overheating-/151106065337?
Super Glue I already had
some.

Step 5:
Box: http://www.amazon.com/dp/B005T7ARB6/ref=pe_385040_30332190_TE_M3T1_ST1_dp_1
Acetal Sheet:
Sheet,Acetal,Wh,1/8 In T,12x12 In
http://www.zoro.com/g/Acetal%20Sheet%20Stock/00153128/
40mm, 12 VDC, fan:
Gino DC 12V 0.1A 40mm x 40mm 2 Pin
Connector PC CPU Computer Case Brushless DC Fan
http://www.amazon.com/dp/B00E1JO8SG/ref=pe_385040_30332200_pe_309540_26725410_item
Black Plastic Fan
Grill for 40x40mm 40mm 4cm AC DC PC Fan New
http://www.ebay.com/itm/Black-Plastic-Fan-Grill-for-40x40mm-40mm-4cm-AC-DC-PC-Fan-New-/290931250087?ssPageName=ADME:L:OC:US:3160
5pc Plastic Fan
grill for 4x4 4x4cm 40x40mm AC DC Fan Taiwan
http://www.ebay.com/itm/5pc-Plastic-Fan-grill-for-4x4-4x4cm-40x40mm-AC-DC-Fan-Taiwan-/131023725508?
Inlet vents with filters:
EverCool FGP-40 40mm Plastic Fan Filter & Grill, Black
http://www.ebay.com/itm/EverCool-FGP-40-40mm-Plastic-Fan-Filter-Grill-Black-/280900161495?

Step 6:
5New Aviation Plug 8-Pin 16mm GX16-8 Male and Female Panel Metal Connector
http://www.ebay.com/itm/5-New-Aviation-Plug-8-Pin-16mm-GX16-8-Male-and-Female-Panel-Metal-Connector-/110983775612?
I painted bands on
the connectors with model enamel that I already had.
Expandable Sleeving:
1/8" BRAIDED EXPANDABLE SLEEVING many colors
- choose the length.
http://www.ebay.com/itm/230819113119?item=230819113119&var=530065579529&viewitem=&vxp=mtr
https://www.parts-express.com/Search.aspx?keyword=expandable%20sleeving&sitesearch=true
Hookup Wire Assortment 6
x 25 ft. spools of #22 gauge solid, insulated copper wirehttp://www.amazon.com/dp/B008L3QJAS/ref=pe_385040_30332200_pe_309540_26725410_item
And
1 x Hook Up Wire Set, 24AWG SOLID CORE,
UL / CSA, 6 x 25 ft spools, Black/Red/Yellow/Green/Blue/White (KCW803-STD)
http://www.allspectrum.com/store/hook-up-wire-set-24awg-solid-core-ul-csa-25-ft-spools-blackredyellowgreenbluewhite-p-8220.html
Heat Shrink Tubing
Assortment: http://www.amazon.com/NTE-Heat-Shrink-Assorted-Colors/dp/B000FIDTYG
Crimping Tool: http://www.pololu.com/product/1928
1 x #1928 Crimping Tool: 0.1-1.0 mm Capacity,
16-28 AWG
Pins
http://www.pololu.com/product/1930

http://www.instructables.com/id/Raspberry-Pi-Alamode-CNC-Controller/

1 x #1930 Female Crimp Pins for


0.1" Housings 100-Pack
1 x #1931 Male Crimp Pins for
0.1" Housings 100-Pack
10PCS 2.54mm 2 x 40 Pin Male Double Row Right Angle Pin Header Strip
http://www.ebay.com/itm/10PCS-2-54mm-2-x-40-Pin-Male-Double-Row-Right-Angle-Pin-Header-Strip-/200926099791?ssPageName=ADME:L:OC:US:3160
Housings
http://www.pololu.com/product/1900
1 x #1900 0.1" (2.54mm) Crimp
Connector Housing: 1x1-Pin 25-Pack
1 x #1901 0.1" (2.54mm) Crimp
Connector Housing: 1x2-Pin 25-Pack
1 x #1902 0.1" (2.54mm) Crimp
Connector Housing: 1x3-Pin 25-Pack
1 x #1903 0.1" (2.54mm) Crimp
Connector Housing: 1x4-Pin 10-Pack
1 x #1910 0.1" (2.54mm) Crimp
Connector Housing: 2x2-Pin 10-Pack
1 x #1912 0.1" (2.54mm) Crimp
Connector Housing: 2x4-Pin 10-Pack
1 x #1913 0.1" (2.54mm) Crimp
Connector Housing: 2x5-Pin 5-Pack
1 x #1921 0.1" (2.54mm) Crimp
Connector Housing: 2x12-Pin 5-Pack
1 x #1918 0.1" (2.54mm) Crimp
Connector Housing: 2x16-Pin 5-Pack
http://www.adafruit.com/products/1390
2x
USB DIY Connector Shell - Type Micro-B Plug[ID:1390]
Polarized Axes Connectors
https://www.sparkfun.com/products/8231
4 - PRT-08231 - Polarized
Connectors - Header (4-Pin)
4 - PRT-08097 - Polarized Connectors
- Housing (4-Pin)
4 - PRT-08100 - Polarized
Connectors - Crimp Pins
2 - PRT-11417 - Arduino
Stackable Header Kit - R3

Step 7:
Switches
Adafruit
E-Stop or Arduino Reset (Red)
1
x 16mm Illuminated Pushbutton - Red Latching On/Off Switch[ID:1442]
http://www.adafruit.com/products/1442
Abort Reset (Yellow)
1
x 16mm Illuminated Pushbutton - Yellow Latching On/Off Switch[ID:1444]
http://www.adafruit.com/products/1444
Pause / Feed Hold (Blue)
1
x 16mm Illuminated Pushbutton - Blue Latching On/Off Switch[ID:1476]
http://www.adafruit.com/products/1476

http://www.instructables.com/id/Raspberry-Pi-Alamode-CNC-Controller/

Cycle Start / Resume (Green)


1
x 16mm Illuminated Pushbutton - Green Momentary[ID:1440]
http://www.adafruit.com/products/1440
PowerWerks PowerPole connectors can be found here:
http://www.powerwerx.com/anderson-powerpoles/housings-contacts/
HSUN-4

Chassis
Mount for 2 Powerpoles Sets (4 conductors) (Configuration: Unassembled)

ACP-15

Assorted
Color Powerpole Connectors Kit (Size: 15 Amp, 16-20 GA)

TRIcrimp

TRIcrimp,
the ideal Powerpole Crimping Tool for 15, 30 and 45 amp contacts

RT-1

Anderson
Powerpole Removal, Insertion/Extraction Tool

SNAP-IN PLUG Powerpole Pak Connector; 4 Pole; Snap-In Plug; 30 Amps


http://www.alliedelec.com/
Retaining Pin

Power
Pole, Retaining; Thermoplastic; Black; UL Recognized, CSA Certified

Connector Housing

connector,
housing only, yellow

Connector Housing PowerPole Housings; 2200; UL94 V-0, Black


Connector Housing

Conn; Rect; High Current Hsg; PP15/45 Ser; Powerpole;


Red; 15A; 600V; Bulk

Emergency Switch: http://www.sourcingmap.com/red-mushroom-cap-1no-1nc-dpst-emergency-stop-push-button-switch-ac-660v-10a-p-256918.html

Step 8:
SN7404 Hex Inverter- I already had some of these
Four Current Limiting
Resistors- 650 Ohms - I already had
some of these
Adafruit Perma-Proto Half-sized Breadboard
PCB
http://www.adafruit.com/product/1609

Step 9:
USB Hub
Mini 3 Port USB 2.0 Rotate Splitter Adapter Hub for PC Laptop Notebook
Expansion
http://www.ebay.com/itm/Mini-3-Port-USB-2-0-Rotate-Splitter-Adapter-Hub-for-PC-Laptop-Notebook-Expansion/231109121837?ssPageName=ADME:L:OU:US:1120
Miniature Keyboard
FAVI FE02RF-BL
Mini 2.4GHz Wireless PC / Tablet Keyboard Designed for SmartStick
http://www.amazon.com/dp/B0090BTY8Y/ref=pe_385040_30332200_pe_309540_26725410_item
Electronic
Brick - 5V Relay
http://imall.iteadstudio.com/im120710007.html
Wireless Network Adapter
- I already had a few of these

http://www.instructables.com/id/Raspberry-Pi-Alamode-CNC-Controller/

EdBet says:

Jun 11, 2014. 6:43 PM REPLY


There is not much more I can add to what has already been stated, GREAT JOB. I am retired and living in the Philippines and in the process of developing a
Maker Space for all the kids in the family, including my grandson. I have ordered a 3D Printer and parts for a CNC Router from OpenBuilds for my workshop and
am glad I waited to order the controls. I just placed the order for the controls based on your instructable and hope it will be as easy as it looks. Have you used
the controls for a project yet and how did it perform? Do you think a Beaglebone Black or a PCduino would work as good or better than the RPI? I already have
a RPI and was just wondering. I sure hope when I am done the kids will learn something using the Maker Space.

cdtaylor51 says:

Jun 13, 2014. 10:22 AM REPLY


I tried to respond to you previously but my computer hiccupped and I lost my response twice.Thanks for looking over my build and thanks for commenting on
it too.I lived in Cavite City outside of Sangley Point Naval Station for my last two years of high school.I really enjoyed living there and will never forget it.I
have not used my controller to make anything yet.I have tested it though and everything works as expected.I built a small tester to check that my stepper
motor cables are constructed correctly.It is pretty simple.One LED for each wire.Push a button and all of the LEDs turn on.If one of the LEDs does not light
then that wire has a problem.If all of the LEDs light then all is well.I also
built a connector with three LEDs on it to test the spindle connector.I am able to turn on the spindle, set the direction and turn on the cooling circuit with M
codes from the RPI.I also plugged a stepper motor into each of the stepper motor connectors, one at a time, and tested that I was able to send commands
from the RPI to the motors. I am able to run the motor in both directions on each of the axes.It all works as expected.I have seen the BBB and PCduino
approaches
too.I wanted to make a simple CNC controller that did not use a parallel port connection.As I mentioned, I originally thought of using a USB connection but
as others have pointed out and I believe too, the USB is not a real time bus and therefore is not suitable for directly controlling motors in real time.The
Arduino is
great for controlling motors. It is cheap and easy to use.Grbl is available for the Arduino and the Grbl Controller software is available for the RPI.You
certainly could use a BBB or PCduino as a host computer just like I used the RPI.But then you might want to look at LinuxCNC instead of Grbl.I thought that
the other approaches were a lot more involved and that going with the Arduino (Alamode) and RPI was just an easier thing to do.

vincent7520 says:

May 25, 2014. 11:41 AM REPLY

Beautiful construction

cdtaylor51 says:

Jun 9, 2014. 8:37 PM REPLY

Thanks

daemonic says:

May 26, 2014. 12:01 AM REPLY

Very nice build and great attention to detail, love the colour coded sleaving :)
Can i ask where you sourced your illuminated switches from?

cdtaylor51 says:

May 26, 2014. 8:28 AM REPLY

Thanks. I got the switches from Adafruit.

michaelmacnz says:

Jun 9, 2014. 1:51 AM REPLY

try this for switches too


http://wholesale.alibaba.com/snapshot/6117622102.html

cdtaylor51 says:

Jun 9, 2014. 9:44 AM REPLY


Thanks for the pointer to Alibabas site. As it turned out the switches that I had from Adafruit (probably came from Alibaba in the first place) worked
the way I needed them to work. The LED in the switch is independent of the switch. So it can be set up by external circuitry to illuminate under any
condition that is desired. In this case the LED needed to turn on when the voltage on the function pin went to ground. LEDs won't work that way. That
is what required me to use the Inverter circuit so that I could have the drive current needed to illuminated the LED. A switch that has the LED tied to
the function of the switch won't work because when the switch is taken to ground then there is no drive current on the other side of the LED. As I
mentioned, the function pin has a pull up resistor on it inside of the chip and so it is pulled up to near Vcc. The input to the inverter is wired to the
function pin and is held high by the pull up resistor too. Pushing the switch pulls the function pin low by connecting it to ground (along with the input
of the inverter) that causes the output of the inverter to go hi or close to Vcc (+5VDC) and the LED lights up. Releasing the switch removes the
ground and lets the pull up resistor take the function pin (and the inverters input) back up to Vcc and LED goes out.

http://www.instructables.com/id/Raspberry-Pi-Alamode-CNC-Controller/

michaelmacnz says:

Jun 9, 2014. 12:51 AM REPLY

Wow... so well laid out -- thought out and executed.. well done

cdtaylor51 says:

Jun 9, 2014. 8:05 AM REPLY

Thanks

ninjanody says:

Jun 6, 2014. 2:38 PM REPLY

One of the best projects in this category i had ever seen.


I must finish mine custom arduino shield for easydrives sometime. :)

cdtaylor51 says:

Jun 6, 2014. 5:51 PM REPLY

Thanks

gumby_kevbo says:

May 31, 2014. 3:03 PM REPLY


I have implemented a number of industrial control systems. No way do you want windows or even Linux trying to run a real time system. No way to know
when exactly anything will happen. QNX, VLC, or TwinCAT can do it no problem. The last two basically rootkit windows, and will keep running fine even if
(when!) wibiws bluescreens.
But even then, 5-6 years down the road, the PC dies and is totally obsolete, and nothing you can buy now will work. (Comm ports, windows version, etc etc.)
With a cheap custom controller as in this 'inlet, you can set a lifetime supply of spares on the shelf for $100 or so, and keep your system ticking without ever
having to re-do it.

cdtaylor51 says:

May 31, 2014. 4:32 PM REPLY


You have made some really good points here. Most people are not really very familiar with realtime systems - if they have even heard of them. I believe that
getting a replacement for the RPi, if, or when, I need one should be pretty easy - I have two right now. You also have to admit that the way the RPi is
supported is pretty impressive too. I feel pretty good about my controller project. Thanks for your comments.

TAWP Tool says:

May 25, 2014. 10:30 AM REPLY


Chuck, your build is not only beautiful, it is very timely for me. I have collected all of the parts for my CNC engraver/light milling machine. I have many
Arduinos and just purchased a GRBL shield. I hadn't considered using my RPi with this setup until reading your Instructable. Thank you for sharing your
creation with us in this very clear and well thought out Instructable!

cdtaylor51 says:

May 26, 2014. 7:41 PM REPLY

Thanks for your feedback and good luck on your build.

onesharp says:

May 26, 2014. 6:46 PM REPLY


I'm interested in CNC projects but know nothing about controllers (nor electronics in general). I echo TAWP Tool's comments on the beauty of this
design. I was immediately struck by the attention to detail, the care in construction and the overall sense of order that you brought to the final project.
Bravo! and I only hope I can pull off something equally as well executed on my own projects.

cdtaylor51 says:

May 26, 2014. 7:28 PM REPLY


Thanks for your comment. I was once a novice at building electronic projects too - albeit that was a few years ago. I was hoping that I could share some
of the things that I had learned to do along the way. It does take some pre-planning and thinking it through before you start. You can't completely do that
but you can get a lot of general things in order before you get too involved with building a project. I would still do a few things differently but I guess that
is just the engineer in me. Good luck with your build.

http://www.instructables.com/id/Raspberry-Pi-Alamode-CNC-Controller/

davisbr9 says:

May 26, 2014. 9:55 AM REPLY


You don't need a serial port to run Arduino + GRBL. You can stream g-code direct to the device over a standard USB port, using something like
gcodesender.exe or putty, etc. Streaming the gcode from your computer means you're using the existing RTC to help execute the code as well, so no onboard RTC is necessary. If you really wanted to get fancy, you could even build a cable to run it over the HDMI or Ethernet. No Serial needed!
Granted, to use Arduino + GRBL you're basically tethered to a laptop or something, but it's a really nice way to save a ton of money by not building a
dedicated machine.
How is cooling in your enclosure? I noticed the fans are placed nicely, but I worry that the wiring and other guts interfere with efficient airflow. Have you
noticed heat issues?

cdtaylor51 says:

May 26, 2014. 1:56 PM REPLY


Thanks for your comments. I do not really understand your point in the first paragraph. However, there are some issues with trying to operate a real time
system with a time slicing or multiuser system. Also, the USB bus its self is not designed to operate in a real time manner. I have read a lot about these
things too. But I am sure that there is a lot that I do not know too. In the second paragraph the idea that I am working with is that I am using a Raspberry Pi a $35.00 computer rather than a laptop as my host machine. I have a 16 GB SD card in it so it can hold some pretty big design files too. I really do not need
to have a laptop or any external computer connected to my CNC Control System once the design file is being executed on the RPi. As for the cooling issue:
I am not using any sort of direct display connected to the RPi so it doesn't have to work very hard and doesn't get very hot. I am actually running the fans on
5VDC rather than 12VDC right now. As I said, I have not seen any sort of heat issues yet. If I do then I can move the fans to the 12VDC bus. I am pretty
sure that will suffice with the heat sinks in place too. I still have not run the system actually connected to my milling machine yet so I have not put any current
through my stepper motor drivers yet. I still have more to learn and understand.

davisbr9 says:

May 26, 2014. 2:15 PM REPLY


No worries, I'm building one using the Arduino method. But I have a spare laptop laying around. I'm not setting it up to run a design file from the MCU
itself, since my laptop has the RTC and plenty of space. The gcode streamer takes care of the transfer, line by line, with an 8-line buffer. It's simple
enough for a USB to handle.
I did some cost roll-ups of various options, and for me the Arduino + GRBL shield made more sense considering what I already had laying around.
My Pololu drivers run hot. I have to sink them individually, really well, or they shut down if not burn out. My system uses 12VDC motors rated for
750mA per phase, and my drivers are set to limit the output current to match that. They still get hot. My MCU doesn't heat up much at all.
A stand alone CNC control unit can be purchased on EBay for $80-$125, no stepper motors. RPi @ $35, Alamode adapter @$35, GRBL shield
@$35, and drivers at $36 for 3: total cost is $141 without stepper motors.
I do LOVE your enclosure and wiring and buttons and connections, etc. I think packaging was great! I just don't see the cost advantage over either
buying a ready-made control scheme or Arduino + GRBL (and a spare laptop).

cdtaylor51 says:

May 26, 2014. 3:12 PM REPLY


I understand your thinking but I didn't really do this to save any money or anything like that. I believe that most people spend more on hobbies than
they actually need to because that is the nature of hobbies. I did this because I like building things and this just seemed like a great project that I
could be happy with. There certainly are multiple ways to control a CNC machine. I think that my build is about as good as any other professionally
built CNC Controller that I have come across and it is better than many that I have seen too. I also wanted a package that I could move from one
machine to another if I wanted to. I might not move it around in the end. I might just make a new one for each of the machines that I am going to use
- I do not have any spare laptops laying around. As I said, once the design is loaded on the RPi and started then I no longer need to be connected to
the machine with another computer. If I build more of these then I could have multiple things being done on multiple machines at the same time.
Each one completely independent of the other ones. I am happier with having spent a bit more money and built my own system than I would have
been if I would have just bought a system from someone else; and I have learned a lot in the process. To me the CNC world is still a huge mystery to
me and I am learning more about it all of the time. The same idea holds for the CNC milling machine that I bought. I tried to use it to make some
printed circuit boards but the machine was just not accurate enough and when I tried to run a hole drill file after the circuit was engraved the holes did
not end up where they needed to be. So I had to figure out what was wrong with my machine. I have done that and I am reworking my machine now
to make it more accurate and more repeatable. Figuring out what was wrong with my machine and this project have been great learning experiences
for me. What is that worth? To me it is worth a lot more than the difference between the price of my controller and a cheap controller from eBay or
the difference in price between my machine and a much better machine like the Shapeoko 2 kit. The learning experience has been the driving force
behind this project for me. Plus, I just love this stuff...

urant says:

May 26, 2014. 9:40 AM REPLY

One word
WOW

cdtaylor51 says:
Thanks

view all 104 comments

http://www.instructables.com/id/Raspberry-Pi-Alamode-CNC-Controller/

May 26, 2014. 9:51 AM REPLY

Вам также может понравиться