I spent a little time last night looking over the wiring and found that I had reversed 2  wires on each stepper motor........which is why my motors were traveling in the "opposite" direction that I expected. Gotta say, I felt pretty dumb but pretty happy to catch that one.

Tonight I loaded up a gcode file I had created a while back of the sparkfun logo (they have a pretty comprehensive logo page in their about section with a ton of different logos, shapes, etc, etc, in high quality vector (PDF & EPS) files. I used cambam to generate the code (flawless I must say) and have just been waiting to use it.

Turns out that my mill actually works. I shouldn't bee too surprised, I mean after 3 years of tinkering around you'd figure I'd get lucky sooner or later. My next task is to design a dremel mount. At my rate that will probalby take a year, but at least I can draw with a pen until then :-)
 
Quick Update: 04/04/2010
 
Here are a few pictures ofthe "more permanent solution" for my stepper drivers.... more to come.
 
 
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....
nes_stepper.pde
File Size: 5 kb
File Type: pde
Download File

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.
nes_stepper_cleanedup.pde
File Size: 4 kb
File Type: pde
Download File

 
 
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.
simplenes_led.pde
File Size: 3 kb
File Type: pde
Download File

 
 
Picture
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?

 
 
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.
helloworld.gcode
File Size: 11 kb
File Type: gcode
Download File

 
 
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 :)
 
 
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.
Picture
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?