NES Arduino parts update 02/24/2010
As mentioned last Friday, I went ahead and ordered the male connectors that fit into the female NES controller ends. I just want to note how amazing it is that not only could I find these parts with ease, but that they are very inexpensive and they showed up at my house today. I think the total for 2 connectors + shipping was $4. Simply amazing. Thanks parallax! Here's a picture set of the NES connector. Because I'm not sure where they will be mounted (I havn't designed an enclosure yet..) I used some spare DB9 female connectors to interface with the NES connector, this was I didn't have to solder then unsolder/resolder later. Arduino + NES + 3 Axis = Pure Awesomeness! 02/23/2010
After a few hours of work tonight, I managed to mate the NES controller with my mill. Seems to be a match made in heaven. The video is below for proof and the code is below that if you want to try this out for yourself (it's very easy). I'm planning to make this a permanent feature of my mill. In order to give it a cleaner appearance (instead of just shoving wires into the controller), I've ordered a set of NES controller sockets from parallax which I will be mounting in my case. A couple of notes: 1.) The code is terrible, I will try to clean it up and re-post sometime soon. 2.) This is a very easy project, If you're trying to interface your easydrivers with a 3 axis mill, a homemade bot, or anything else and want to add NES controller pad capabilities, give this a look. You'll be surprised. 3.)The X axis on my machine is terribly loud. I need to fix that it....
02/24/2010 - EDIT: An updated version of the code used to drive 3 Easy Drivers via and Arduino and a classic NES controller. Not a whole lot of changes to the original, just a little bit cleaner, more concise, and thoroughly commented.
Turns out, it's not so bad after all! 02/19/2010
As mentioned yesterday, driving the mill with an N64 controller seems like an awesome idea. Today, I set to work trying to figure that out. I was almost immediately sidetracked As luck would have it, my stash of NES controllers (qty: 2) were in the same location as my stash or N64 controllers! I couldn't resist. Shapeoko needs a "joystick". All CNC machines have one. They are either software controlled (buttons on screen) or hardware. They are necessary to move the gantry out of the way and to "home" your machine to the material. I have an old joystick from an arcade I build a few years ago that I have been planning to use. However, one of the problems using a traditional joystick is that it takes up one port for each direction you are trying to capture. So in our case we would want: Forward, Back (Xaxis), Left, Right (Yaxis), Up, Down (Zaxis). That's 6 inputs we would need! The NES controller doesn't need one output for each button because it's digital. What's that mean? Good question. Here is how I understand the NES controller to work: The chip inside the controller is polling the status of the buttons at a rapid rate. When the buttons are not being pressed, the result of the poll looks like "11111111" (one bit for each button). After the controller is done polling, it sends that string to the console (in our case the Arduino) which is then interpretted by the program into whatever the button are mapped for. If you press a button then the string changes to reflect it. For instance if you press the select button the string changes to 11011111. The cool part about this is the arduino need only use 3 ports to interface with all 8 buttons! The three ports are for "Clock", "Latch", and of course data. The data wire is where all the action is! Clock and latch are there to keep the timing correct. To be honest I don't completely understand how it works, but I figured it out enough to capture the inputs with the Arduino and light up the corresponding LEDs! I would like to say, as a side note, working with a "digital" also prevents you from having to debounce the button pushes. Because that debounce logic is already in the chip that's doing a2d inside the controller! we're just taking the "clean" data :) Here's a quick video of the setup in action. The code is below if you want it. Now that the buttons are mapped and I feel pretty confident about capturing button presses, I am going to get to work on writing the code to control the step/dir functions of the easy drivers.
![]() After frying my old Arduino Duemilanove I knew that I'd need to get a new one, and fast. Sparkfun to the rescue. I sat down, ordered a new one (the standard chip is now an atmega328!), ordered some jumper wires and a new breadboard while I was at it. The three tiny breadboards were ordered before I fried my easyDrivers. FYI: they are the perfect size to hold and tie in to a single EasyDriver (v4.2) with headers soldered on! I also took the liberty of ordering an atmega328 chip with Arduino bootloader. Because of the semi low cost (~$5), i figured it was worth trying to revive my old arduino. First thing I did when the new gear came was pop the old chip out of the fried arduino and popped in the chip in. Yahtzee! My old Arduino is not only alive, it's also upgraded to a better chip. Needless to say, that was good news. While I decide what path to take for the rest of this project I also ordered more easy drivers. Although there's a good chance I will be using a different solution by the time I complete this project, but I feel comfortable with the easy drivers and know they will work for the time being. Also, I have been thinking very much about cutting the PC out of the loop entirely. As is, the PC (currently my Dell Mini 9) is simply streaming a gcode file to the arduino. From there, grbl does the rest. Seems like overkill to use a PC for such a simple task.....Enter a second arduino. The second Arduino will have some FAT library loaded as firmware (have yet to decide which one) and be connected to an SD card shield! The arduino will then read one line of gcode at a time, send it to the primary arduino and wait for the "OK" before sending the next line. Also, I ran across this instructable, which gave me a pretty rad idea: Why not use one of my old N64 controllers to control the mill? I'm thinking about going to a two Arduino setup as is, with one Arduino not doing much work there should be plenty of ports and programming space available to implement a program which will allow me to jog the machine around, along with possibly homing the Z axis. In fact, although the feature has a certain amount of "coolness", its quite practical. After all, one does need a way to gracefully move the machine to a "home" position. Right? While doing any long term project you are bound to run across three things: Good things, bad things, and downright ugly things. It's part of the territory. In fact, for a hobbiest, these are the things that make a project a project! The Good: A short blip about the project was mentioned in a recent article on Tom's Guide. Grant it, after seeing the posting on Sparkfun, I was actively pursuing being featured in the article, but none the less we made it in! That pretty much made my week. The Bad: Last Saturday I drove to a "local" (2 hours away) hackerspace meeting to meet up with fellow geeks and check out what other people have been up to. A couple of bad things happened: Only 2 people showed up (not including the host and hostess). This ended up being OK as the the host and hostess did a fantastic job of making us feel welcome. Even with the limited number, we managed to bottle some beer and have a generally good time BSing with each other. Worse: I tried showing off my mill project (yes, I brought it with me!) but for some reason, I couldn't get it to work. I thought that during the trip something on my protoboard became disconnected. After all it was the first time I had moved the machine and with extensive use of a breadboard, it wasn't exactly in mobile form to begin with. After troubleshooting for about 15 minutes, I couldn't figure it out and just packed it up. Not a big deal. I figured I'd get it running once I got back home. The Ugly: After making the 2 hours trip back to my house, I unpacked the mill and took it back into the Lab, hooked everything back up, put the meter to a few key connections, and tried to give it a test run. Nothing. OK. It had been a long day, I unplugged everything and let it sit. After a few busy days of domestic duties and work, I had some time Tuesday evening to work on it. After messing around disconnecting the easy drivers from the protoboard (not an easy task!) and simplifying my circuit to only one axis and a simple (known working) sketch. I couldn't get anything to work. I emailed the creator of the Easy Driver and asked him on a couple of things. Being the generous person he seems to be, he replied with a few tests (procedures) to check if the drivers were fried. Long story short: They were.... All three of them were fried! Here's a couple of pictures of my metering..... To make matters worse: I fried my Arduino too! It seems that when I tried to demo my machine at the hackerspace meeting I crossed the +24v from my Power Supply and the GND, which essentially meant that I sent 24V into the arduino and then into the Easy Drivers. Both of which were only expecting 5V.... Right now I have a new Arduino on its way from Sparkfun. I will order the easy drivers tonight. In the meantime I'm hoping to learn how one may protect against accidents like this.... But I'll stay positive because, to steal a quote from Dostoyevsky, "A just cause is not ruined by a few mistakes" :) Let's parse some gcode! (Shapeoko + Grbl) 02/05/2010
Here's a video of shapeoko + grbl parsing gcode being streamed from my Dell Mini9. (You can download the gcode below.) Clearly something is not right. However, the job will run identically, which makes me think that it's a simple software tweak as opposed to something more devistating like a hardware problem. Another positive sign is the fact that the z-axis height seems to be working just fine. This particular g-code calls for a clearance height of 6.25mm and a target depth of -1mm. Both of which seemed to be consistent throughout the job.
ShapeOko + grbl = Success! (Awesome) 01/26/2010
Here is a short video of ShapeOko drawing a box via grbl and hyperterminal. There is still a lot of work to do before this project is "production" ready. But it's really nice to make some progress every once in a while. The current setup includes: CNC Controller: Arduino running grbl Stepper Controllers: Easy Drivers Stepper Motors: 65oz/in bipolar Linear Rails: Salvaged from previous builds Power Supply: 24v 150W Frame: Custom Designed Laser Cut 1/4" MDF (from ponoko.com) Z Axis Mount/Slide: 3D Printed Custom Design (from shapeways.com) If anyone has an idea as to what is causing the wobble in the y-axis, please let me know. I'm open for suggestions :) ShapeOko is soooooooo close. 01/18/2010
What a long long night... grbl is definitely installed on my arduino. That is good news! Actually it's the only good news for the night. After getting home from work and getting the regular chores done, putting the baby to bed, and spending some time with my wife, I headed to the basement to put the final touches on this fantastic project. Honestly, I thought this was going to be "the" night. I couldn't have been any more wrong. First: my lab is a disaster, which I had forgotten about because it's been at least 3 weeks since I last stepped foot in there. It seems that I was using it for "temporary" storage during the holiday season, and have since neglected to remove the temporary items. OK, spent 10 minutes moving stuff around enough so I could at least sit down and reach all of the components. Two: The battery in my D630 laptop is totally gone. If I unplug it for a second, I get a critical beep and then BAM. power off. I should note that I'm using a power strip as an "e-stop". So, forgetting about the battery deal, i plug in my laptop, power up, log in, load the desktop (at least a 7 minute affair) and then decide to throw the power on the strip because I realize my soldering iron is plugged in. BAM, laptop powers off. I proceed to do this not once but TWO more times before i finally get smart an plugin to a dedicated strip. Three: I hadn't exactly completed breaking out the STEP/DIR pins for each axis. Not a huge deal, but i did have to strip some wire and do a quick bit of soldering. Here's a picture of the proto board fully loaded. In retrospect I should have done some color coding for step/dir and especially for the motor harnesses. Chalk that one up under being a rookie I suppose... OK, so now that everything was setup, I was ready to manually send gcode to the arduino via the serial monitor in the arduino IDE. Laptop is powered up, arduino is connected via USB, XYZ axis' are connected to the arduino. All Set: I power up the 24v Power supply and everything goes crazy. The X axis is wobbling back and forth, the Y axis is stalling itself out, and the Z axis was making a really creapy humming noise. Power off. Quick. After trying a few more times, and double checking the pinouts in Simen's config.h file. I couldn't locate the problem. All I know is that if I don't hook up the arduino then everything is fine. The motors will sit there quietly, and everything looks like it's in order. But, the moment I hook up the arduino... bad stuff happens. Here's a video demonstration. So, like I said: That's it for tonight. I'm going to enjoy this delicious Pale Ale from Bell's Brewery and go to bed. Maybe tomorrow will be the day? Project Update.... 01/13/2010
After a busy holiday season, it looks like we're back to work: eps files have been uploaded to Ponoko, and can be found by searching for "ShapeOko". From there you can order. It wasn't exactly necessary but removes one step of the process for anyone looking to build their own mill. Instead of having to upload the files, you can just add them to your cart, and go. Also, the files are freely available to anyone either through ponoko or through the forum here. Does anyone have experience releasing something under an open source license of an sort? After giving this some though I'd really like to get an official release method but don't really know where to start. Suggestions are welcome. Machine progress update:
Mill Progress....an update. 12/27/2009
I have managed to find some time during the holiday season to work on the mill. Here's a recap:
| |||||||||







