| It's Alive!
Well, so to speak at least. I have one leg mounted on a test stand so that I can test the first version of the embedded leg code. This is running on a prototype leg controller made via toner transfer.
I've attached a youtube video that shows the leg going through a walk cycle. The brain instructs the leg to move in a linear fashion to the end of its range of motion. At this point the brain tells the leg to lift and reset its position. The leg manages this entirely on its own. Once the leg sets back down on the ground, the brain takes over again.
Since posting this video I have been working on making the final versions of the leg controller and brain board. Here are descriptions of the two boards.
The leg controller boards are 0.8" x 1.8" and feature a dsPIC33FJ64MC804. The dsPIC is a QFN part so we'll see how successful I am in soldering it. I have an AOYUE hotair station so it should be OK. My original design supported 3 servos. I added a fourth for future projects. My first code used interrupts to time the servo control pulses but in the next iteration I plan to use the built in PWM hardware. It supports a one shot mode that should be perfect. This chip supports 4 independent PWM channels hence 4 servos. The leg controller will normally operate as an I2C slave. Optionally you can add two pullups to the leg controller and use it as an I2C master. This way you could gang a few leg controllers together via I2C, change the software and maybe do some animatronics. Something for the future.
For each of the four servo channels I've added an N-channel mosfet so that I can power off servos as needed to save power. Not sure if this will work or not.
The Brain board (2.5" x 1.9") is more ambitious and time will tell whether everything works.
This project has been a lot of fun so far. Routing the boards was challenging but very satisfying when done. I may kick myself for switching to TQFN, QFN and 0603 parts but I've caught the miniaturization bug. Smaller, smaller, smaller! Anyway, I've sent off the boards to GoldPhoenix in China to be fab'd. Hope I've not made too many mistakes.
Update: August 6, 2011
Isn't it always the way that you spot problems after it's too late. So far I've spotted one Ohhh and one Oops in my board designs but nothing fatal so far.
1) I designed the brain board around a micro USB connector. I'd never heard of micro USB before and confused this in my mind with mini USB. When the part arrived from digi-key I realized my error. Not a problem though. I'll just have to buy a micro USB cable.
2) The second error is more embarrassing. I forgot to route the micro SD chipselect line and I routed two small components on the wrong side of the board (i.e. under the SD connector). Doh! Not show stoppers though. The one component is a bypass cap and frankly there ought to be enough of these elsewhere so I'll omit this one. The second is a pull-up resistor on the /CS line. Since I neglected to route the /CS line I can omit the resistor as well, I'll just drill a small hole by the resistor pad and connect it to ground with a small jumper to enable the SD card.
3) I ended up ordering some dust again. I wasn't paying enough attention and ordered 3.3pF caps in 0201. Turns out 0201 in metric is 0603 which is what I though I was ordering but not in metric.
4) I also erred in the dsPIC order. I ordered dsPIC33FJ128MC804 instead of dsPIC33FJ128GP804. Although the pins are almost identical the MC component is missing 4 analog ports and the PWM is quite different due to it being aimed at motor control. I'll have to order more dsPICS.
5) Placed a resistor too close to a servo socket! I can just manage to squeeze in a 0603 but it's still wrong.
6) Placed another dsPIC bypass cap on the wrong side. Hope it's not too serious a problem.