This is my first attempt at an instructable. I hope it helps someone else.

Switches and Lights and fans, oh my...

Please read through the comments for more details.

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.soft-now.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.

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 the future?

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.

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.

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.

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 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.

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-25-Feet/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.

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-660v-10a-p-256918.html

Hooking up the switches and the connectors was the most time consuming part of the build.

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.

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.

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.

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.

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.

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.

Thank you very much!
I would suggest that you take a look at the GRBL website for deeper information about how GRBL works (also new versions have been released with new features). As I recall, the "home" location is completely virtual. That is it can be defined anywhere. That is the way it actually has to be because the software eventually has to be set to the actual parameters of the physical hardware of the machine. It could also be set to be a subset of the dimensions of the actual machine. Please read the info on the GRBL site about the z-axis touch mechanism. You could always make a z-axis touch sensor yourself. You could use a thin feeler guage blade. Attach a wire to it with an led (and resistor) or a buzzer in series with a battery. Attach the other side of the battery to your tool bit after it is installed in your spindle with an aligator clip. Knowing the thickness of the feeler guage you can find the z-axis zero by placing the feeler guage on the material you are working on or on your table and then lowering the tool bit until it touches the feeler guage and the led turns on or the buzzer sounds. Don't forget to account for the thickness of the feeler guage. I hope this is understandable. Good luck.
Legendary instructable!<br><br>I am not much familiar with GRBL or RPi so, many questions are popping up in my mind. Do you have a video of this awesome controller running the machine? How fast rapid travel this system supports? As I have said that I'm not familiar with the hardware or software could you please clear some air for me, I did not notice any feature related to Z axis tool job touch zero? And also you did not use homing switches.
Okay, lets see. I will try to answer your questions as I can. I do not have a video. I will try to make one soon. The movements of the machine are limited by the hardware - the machine itself, not a software limit but a machine limit. However you can limit the machines speed in the software so that it does not move too fast. Depending on what material you are working on the travel speed might need to be much, much slower than the machine is capable of. The machine will always be able to move too fast to produce a smooth surface. So the software controls the speed based on your inputs. There are two components to the z-axis. The physical movement of the z-axis, up and down, and the spindle, on or off. The z-axis is the third connector from the top. The spindle is the bottom connector and is yellow. Each axis connector contains eight wires, four are connected to the stepper motor and four are connected to the limit switches for that axis. There are six limit switches, two on each axis. I do not have a z-axis touch zero mechanism in my system. I believe that the new version of GRBL might have that built in but I am not sure how it would be implemented in my build. I might have to rebuild my controller to include that someday. I hope this has helped.
Thank you for your reply. Nicely answered all by doubts. It is because of the people like you, the community grows positively every day. Just one small thing about GRBL does it have a manual system for z axis touch zero for example if we jog slowly towards the material surface n when the tool touches it can we manually change the reading of z axis DRO to zero?
<p>This is an awesome instructable! Great Job!</p><p>I do have one question though. Does the CNC Shield actually &quot;plug&quot; into the alamode board? I see in your pictures that it looks like the pins do plug into the bottom header. And do they plug in on both sides? Sorry if I missed something in your awesome write up. </p><p>If they do plug in, I will be learning how to de-solder, as I soldered the non stackable headers in place.</p><p>Thanks!</p><p>Jon</p>
If you look at the pictures in step 3 you can see the stacking headers. <br>You can remove the old pins one ar a time with a soldering iron and something to grip the pin. Important: make sure that you clean up the holes after removing the old pins. Otherwise you could end up with bad solder joints later on.
<p>Excellent, Thank you for your help!</p>
<p>My CNC controller is going inside the case of an old Mac Mini I had laying around. Should be pretty slick. Thanks again for all of your guidance!</p>
Very nice - but I, as you can probably tell, do not like to see ANY individual wires anyplace. However, it looks pretty nice so far. Is your project based on my instructable? It looks a lot like mine did at one point. I would really like to see it after you get it all put together. Thanks for sharing what you have done thus far.
<p>Yes, It is absolutely based on your instructable! Those wires you see are only from the fan and small speaker in the original housing that have not been hooked up yet. I will gladly show you once I complete, hopefully soon.</p>
Thanks for your comments and good luck on your build.
<p>This is, without a doubt, one of the neatest, best-looking wiring harnesses I've seen on Instructables in a long time.</p>
<p>Hi cdtaylor, how did you wire the 8 pin aviation plugs? i cannot find a solution for both sides, sorry for the silly question.</p>
<p>Here is the graphic showing how the aviation plugs are wired.</p>
Please take a look at images that are attached to the comment dated May 24, 2014. There is a key in the upper right corner of the wiring diagram showing which wire I attached to each pin on the connector and what each wire is connected to. I am not at my computer and cannot attach the image again at this time. I used wires the colors I have indicated. It is best to attach the center wire to the connector first after that it really doesn't matter just stick with the color code the rest of the way around. I used some twisted pair shielded wire that I had for the limit switches. There is a limit switch at each end of travel on each axis. So there are two switches or four wires for the stepper motor and two wires each for the limit switches for a total of eight wires. Just remember that you are connecting these wires between the stepper motors and the stepper motor drivers - it is very important that you get them connected correctly or you could damage you drivers and your motors too. I made a little tester with an led for each wire to make sure that the cables worked correctly before I installed them in the box. I hope this helps.
<p>Just wanted to lead you know I enjoy reading your material and I'm going <br> to try my own control following your model, I thing I&acute;m goint to try <br>the protoner raspberri pi CNC and see how it goes.</p><p>Thanks for sharing and inspire!</p>
That's great. The Alamode board made everything go together so nicely. I know there are other solutions out there that do the signal translation too. Don't really know much about them. I can tell you that the Alamode board does work as advertised and so does the 100% GRBL Compatible CNC board. Good luck with your project and thanks for your comments.<br>
Hello, For the last 4 years I have been running a desktop cnc machine using an arduino due with atmega328 loaded with GRBL,now my machine originally came with a parallel port connector and all I had to do was wire the step and dir pins from the arduino to the driver board that came with my machine and load GRBL controller into my computer and it worked perfect ,for the drawing part I use corral draw and save as DFX or BMP,then I use Fengrave and/or potrace to convert my drawing to gcode,the code is than checked with notepad and loaded into GRBL controller or gcode sender and press run,I do not use a dongle as the screen controls work perfect.My control computer is an old xp machine.....WCH I think you did a lot more work than necessary....WCH
What does WCH mean? I am also a bit confused by the succesive periods. An ellipsis is usually three periods in succession. I am not sure what you are trying to say.
Ok, I guess. Thanks for looking at my instructable. Perhaps you should publish one youself - if you haven't already. I started with a concept and a clean slate. What is in my instructable is what I came up with. Take it or leave it or whatever. You might read through the comments. They contain a lot of information too. I specifically did not want to dedicate an external machine to run my mill. So that drove some of my design criteria. My machine is wireless now and I like it that way - and apparently so do a few others. It's easy to critique other peoples work. I am trying to encourage others to try new things too and I am willing to allow their enthuasim and their comments. This was never about the cost or the part count or even the wireing. It is about helping others to just see what I did and tell them a bit about how I did it. Hopefully, at least a few others have been inspired to do something their own way - with maybe a few suggested improvements along the way.
<p>Hi Great machine - I'm doing very well on the final stages of my machine following a very similar pattern to you. Using a Raspberry Pi - Arduino UNO and CNC Shield with A4988 driver and NEMA 17 motors.</p><p>I have a question before I turn all my kit on - its about the 4 wires going into the A4988</p><p>You have the following 4 wire colour coding </p><p>Pin 2B = Black +</p><p>Pin 2A = Green -</p><p>Pin 1A = Red +</p><p>Pin 1B = Blue -</p><p>(+ - + - )</p><p>However - I have seen someone else wire it</p><p>Pin 2B = Red +</p><p>Pin 2A = Blue -</p><p>Pin 1A = Green -</p><p>Pin 1B = Black +</p><p>(+ - - +)</p><p>I know keeping the pairs together for each coil is important but is the - + as important as I'm seeing many different ways to wire these A4988?</p><p>Any advice much appreciated.</p><p>The other bit of advice is what is the best way to calculate and set the max current of the A4988 I have</p><p>JKM NEMA17 Two Phase Hybrid Stepper Motor 78 Oz-in/48MM/1.8A Motif motors and again finding different calculations and formula - what did you use please?</p>
<p>Hi Mark, congrats on your project? I'm doing basically the same thing but I'm new to this. Would you mind answering a couple questions that might help me get through mine? </p><p>did you have all of your boards assembled...the pi, the uno and cnc shield before you started loading all of the software, or did you load the pi, save, shut down and then put the boards together before transfering data to the arduino? What link for loading the boards did you follow? I'm using an alamode/arduino board as per this instructible and performing the steps on the zapmaker link to load the software, Grbl and cnc files and have been having all kinds of trouble getting through it. I'm not sure what I'm doing wrong.</p>
Not addressed to me but on my Instructable. You really need to following instructions on the Alamode site here: http://wyolum.com/projects/alamode/<br><br>I didn't put the CNC Controller board on the stack until quite late in the project. Except for test fitting it. Didn't get driver boards till later on either. But neither of those itemshas much to do with getting te software working either.<br><br>Hope this helps. Make sure you go through the web pages for the CNC Controller too.
<p>what did you use for labeling on your enclosure?</p>
<p>Thanks, I have it running the grbl now. Had to combine some of the commands I got off of Wyolum and Zapmaker. I think it was the later model pi I'm using. I left the alamode connected through the entire process. I added the cnc shield after everything was loaded and like I said its working now. Thanks again for your help... i'm sure I'll have more questions later. </p>
<p>Congratulations on building a really nice project. Your project is larger than mine is. What do you anticipate making with it? One thing I thought about while looking over your pictures is that with that heavy spindle you might want to use two motors on the axis that moves the spindle. That is really easy to do with the CNC Controller shield that I used. Not sure if you used the same shield or not. I really like the LCD and that illuminated switches. One other switch that you might want to consider is an emergency stop/kill switch just in case something goes wrong. Some people have built what they refer to as a &quot;pendant&quot; for that purpose and to have a means of directly controlling the system too. I am thinking about doing that just for the experience of being able to used it. Otherwise, what a great project. I would really like to see it in action. Thanks for your comments and interest in my project.</p>
Thank you I'm pleased they way it's going. <br>I'm planning on using it for most of my DIY woodworking projects - and thought I could use something like PhotoVCarve making presents for family. I also have 3 children and thought I could get them into CAD and CNCing!<br><br>The motor on the Z axis is being replaced with a bigger stepper - however with the balancing and easy of movement on that axis I'm surprised the pilot .350 amp stepper moves it really well. <br><br>BIG RED EMERGENCY button is a must and will be fitted before I turn all on. <br><br>Not sure if pendant is the same thing as what I'm thinking but was trying to think of adding like a small joystick to control the axis's like to find 0,0 of work - what's a pendant?<br><br>I'm using the v3 Andruino CNC Shield from Hobby Components<br>http://hobbycomponents.com/shields/568-cnc-v30-arduino-compatible-shield<br>I'm having issues with getting the end stops to work I got basic open switches - I don't think it's the switch or wiring personally I think it's the GRBL Controller config but when I set the Boolean to 1 on the hard limits $21=1 it errors about homing and sets it back to zero. Not played with it much yesterday but will try again later on and see what's it's doing. <br><br>Thanks for your quick and helpful responses
<p>Thanks for looking over my project. I think that the best thing for you to do about the stepper motor wiring is to read through the page for the part and read the FAQ page that is mentioned on the Pololu website for their Allegro&rsquo;s A4988 stepper motor driver carrier.</p><p><a href="https://www.pololu.com/product/1182" rel="nofollow">https://www.pololu.com/product/1182</a></p><p>There is a very good and thorough video about how to set the current limit for the motor drivers on the product page above and I encourage you to watch and go through the steps carefully as is done in the video.</p><p><a href="https://www.pololu.com/product/1182/faqs" rel="nofollow">https://www.pololu.com/product/1182/faqs</a></p><p> The wiring is explained on the FAQ page in detail as is a procedure for setting the current limits for your motors. The pairing of the wires with respect to the winding is really important (meaning: if you get it wrong the motors will not turn or worse you may damage the driver and the motor).</p><p>I attached two pictures. In the first one you can see that I used keyed connectors for the stepper motors cables (the white connectors). In the other picture you can see the order of the wires that I used. Mine are wired Blue(1B), Red(1A), Green(2A), Black(2B). I have not looked at my controller for some time as we have moved and other things have taken priority. I looked at my controller to be sure. I miss wired the blue connector for the Z-Axis. I have now corrected that. If you look at the Allegro schematic for the A4988 that should clear it up. I had to rebuild that cable when I changed the order of the of the cables to match the correct color code. No camera at present or I would add a corrected picture. I will try to add another picture when I get my phone back. Sorry if my mistake caused any confusion.</p>
<p>Of all things, I'm having a very difficult time setting up my Realtek wireless module.The instructions that came with it instructed to download and exe setup file and the raspberry won't open it. It directs me to the raspberry site. Could use some assistance. Thanks</p>
<p>My original Wi-Fi dongle is a D-Link DWA121. I plugged it in and it worked right away. I am not sure that I did anything to get it working at all. I just purchased four other dongles and I am in the process of rebuilding the kernel for the second time trying to get this thing to work. The DWA121 is based on the RealTek chipset the new ones I bought are based on the RALink chipset. You might want to go and take a look at the supported devices list on the RPi site to reduce your problems with getting your device to work. Thanks for looking at my project. I think you will have to go to the manufacturers site or search for an answer on the internet.</p>
A pendant is a sort of remote control to &quot;manually&quot; control a machine. I have seen wired as well as wireless pendants. Custom made and purchased ones. I have also seen a game controller used as a pendant. Some have displays and some don't. Google CNC PENDANT for more info... Thanks for posting.
<p>Hi cdtaylor, this is probably the most advanced instructable ever... I wanted to ask however....<br>in your raspberry pi are you creating drawings for each part?<br>is there a way to interface or import AutoCAD models into the Pi??<br>Or going further what about importing/converting 3D files directly?? Something like a Step file or some such.... That would have some incredible applications...<br>Thanks any comments by you will be much appreciated!!</p>
The only software running on the RPi is the grbl controller. It has specific requirements of what is in its input. I would like to refer you to the grbl wiki for more information about what it can accept. For me sometimes I have more than one file to make a part. For example a Printed Circuit Board might have a trace isolation file, a hole drill file and a router file to remove excess material or to cut the perimeter of the board.
<p>Here is a couple of pics of my plywood DIY CNC Router rig - I've just got a couple more tweaks and bits to make - then its wire it all up so any advice on my previous post would be most appreciated - however no rush as I'm waiting for a nema 23 L bracket to arrive before I can actually finish and turn it on. </p><p>Thank you</p>
I am interested to make such controller for 250T metal press?
Not sure if you are asking a question for me. If you make post a picture and tell us about it. Good luck with your project and thanks for your comment.
<p>Thanks for you response. My machine is simiIiar in table design to a plasma, or router CNC except it is being used for pressure testing of foam materials. That's why the Z axis is just a actuator with a load cell. The table moves to a location and then the actuator drops to mutliple depths while the load cell readings are recorded. I was expecting that the drivers and power supply would be outside of your enclosure design and in a separate one. Ultimately, I'm wanting to input the control signal into my set of drivers. It seems like this should work. The signal going to the driver should be the same regardless of the driver correct?</p><p>Can you tell me what value your current limiting resistors are and also the model of your fans. </p>
I believe that you are correct about there driver signals but you need to confirm what your particular drivers are expecting. The current limiting resistors for the leds are about 500 Ohms. Just check out an led resistor calculator on the internet and decide how much current you want to light up the led and the led calculator will give you the value of the resistor to use. I didn't want leds to be very bright and I want them to last a long time so I used the resistors that I used. You might want the leds to be brighter or less bright. I would suggest that you use a breadboard and try some different resistor values and see what you prefer. I hope this helps.
<p>Your input is a great help, Thank you! I have about 1/3 of the compnents in. I didn't realize the CNC shield had to be assembled, but the supplier sent the link to the assembly instructions so I'll be ok. Adafruit was an awesome find! I really like their approach to marketing their products by educating their viewers on their products and applications. Great for novices like myself. Since I started this project i'm fiinding all kinds of educational stuff on youtube, and the raspberry pi site as well!</p>
No problem. I would like to see a picture of your build when you get it finished.
The model number of the fans is in the parts list that I posted in response to a previous comment. Nothing special, just 40x40x10 mm 12VDC case fans.
<p>That is an awesome CNC controller and your wiring is perfect! Thanks for the explaination..<br>How do you find the grbl controller software? have you compared it to something like LInuxCNC or Mach3/4? Also this would work with a larger stepper motor driver for the likes of a Nema23 or 34 right? or is the output voltages not enough to fire the drivers? Thanks!</p>
Thanks for the feedback. You can just Google for grbl and then read the Wiki pages for info on grbl. Grbl is available on github. As for larger motors: the grbl controller board is designed to handle 12 to 36 volts (you would want to read their pages too). There are a few different Pololu stepper driver modules that you can use at different voltage and current settings. Of course you would need to modify the wiring and perhaps provide better cooling if you used different power levels than I did. Just changing the power and the driver modules would be pretty easy to do. My build just used 5 volts and 12 volts. To use 36 volts you would have to bring 36 volts in from an external 36 volt power supply to the CNC controller board and you would need to replace the stepper driver modules with appropriate 36 volt modules. I also used 12 volts for my spindle functions. You may have different requirements than I have.
<p>This is really an awesome CNC project. Thank you for sharing all of this hard work. I'm working on a 3 axis gantry style CNC project now and have been thinking about how to use your design. Instead of a spindle on the z axis i'm using a actuator powered with a servo motor (so I'm not needing any relays for spindle speed, direction or coolant since there is no spindle motor), and stepper motors for the xy. A load cell is set on the end of the actuator. I'm looking to use nema 34 steppers with R1025 drivers. I'm still researching the servo for the Z axis since I need more torque for the actuator. Any thoughts or suggestions?</p>
Thanks for your interest in my project. There are a lot of things in my project that might be applicable to yours. However it is clear that your project would not fit into a small enclosure like mine did. As for the z-axis, you might be able to use a rotory solenoid actuator to get higher torque. I don't really know what you are doing so I can't really say that would work but it might be worth looking at. Thanks again for your comments and questions.
<p>Sweet Thanks for the reply. I know I would need to use external motor drivers. But I wasnt sure if it works as a relay and therefore could be driven by a lower voltage or if I need to run the actual voltage through the board.<br><br>My requirements are to convert a Optimum BF20L Mill which would require Nema34 motor and 2 Nema 23 motors. But the raised voltage may mean I need to use a conventional board as opposed to a GRBL/Arduino setup.</p>
You could certainly try using a CNC controller just like mine if you wanted to. As I mentioned previously you would need to provide the right voltage for your motors but there are driver modules that can handle up to 36 volts and 2.2 amps per coil. You could try that and Grbl if you wanted to. If it's too much then you could do something else and still have this controller as a backup or to test with or to use on another project. Personally I think my CNC controller would work (use the 8825 drivers at the correct voltage for your motors and leave the top off of the box until you understand the thermal issues). Alternatively, you may need functions that are not available in Grbl. So you might want to go with Mach or EMC or LinuxCNC or something else and that would mean that you wkuld not be able to use this controller. By the way, I really like the mill you chose. I would suggest that the first thing you do is install a good Digital ReadOut (DRO) on it. Then learn to use it manually. Then upgrade it to a CNC controlled machine. Make the parts to adapt it yourself. Learn all you can about using the machine first. Then you will understand what happened and why it happened when something goes wrong and you will be able to compensate for that intelligently.
Check out this site for a great DIY DRO project:<br>http://www.yuriystoys.com/?m=1

About This Instructable


1,052 favorites


Bio: Viet Nam War Veteran
More by cdtaylor51: Raspberry Pi Alamode CNC Controller
Add instructable to: