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