Hello everyone!
I’ve been working on a hexapod project for over six months now. It all started out by a friend showing me Zenta’s Phoenix videos on Youtube and I was like “DO WANT”.
So I got the MSR-H01 Kit (sorry, LM, shipping to Europe is pretty expensive and I like having metric parts in my metric world) with servos for one Leg in Fall 2008 and got more servos for Christmas and my birthday in January.
One of the self-set challenges was to design the whole electronics more or less from the ground up.
Originally, I planned creating a robot controller on a single FPGA board, using a MIPS compatible Soft-CPU.
This kind of worked, see youtube: youtube.com/watch?v=uINYeGkGkdE
However, as can be seen in that video, the board I used was pretty large, it was a Digilent Spartan 3 Starter Kit board I borrowed from the Uni.
That board was running a 25 MHz Soft-CPU and had a megabyte of external RAM hooked up to the CPU. PWM generation was implemented by a few counters and a register block implemented in dual ported RAM, with the simple implementation having 24 PWM channels with a resolution of about 2-3 microseconds.
Software running on the CPU was transfered via a RS232 (there’s a MAX3232 and DB9 socket on the Starter Kit board), the CPU had a simple bootloader compiled into the VHDL code. For cross-compilation, I used a gcc/binutils/newlib toolchain with soft float emulation enabled, the CPU has no FPU.
After the budget allowed it, I got some new electronics. First, a new FPGA board. The current board is a Simple Solutions Zefant LC-3E board featuring a Spartan 3E 250 FPGA, 66 MHz Oscillator, Flash for storing the FPGA configuration and some 8 bit RAM.
Porting over the existing code to the new board was pretty straightforward and the new FPGA even allowed a clock frequency increase of the on-chip CPU to 33 MHz. But since I didn’t really pay attention to the type of RAM, I later found out that the 8 bit RAM isn’t really suitable for my 32 bit CPU (the S3 Starter Kit board had 1 MB of 10ns 32 bit RAM, the new board has 70ns 8 bit RAM).
Also the on-FPGA RAM ressources are pretty limited, the current version uses 16k RAM, 8k for the bootloader, 8k for my code. The code from the demo above is ~50k.
However, I together with the new FPGA board, I ordered an Eddy 2.1 ARM9 module to tinker with. See embeddedmodule dot com for more info on this, it’s a really tiny 200 MHz Atmel AT91sam9260 based embedded Linux module with 32 MB SDRAM and 8 MB Flash.
After figuring out how to reprogram the module without the ~350 bucks Eddy development kit (the module itself is ~ 90 Euros including tax), I ported the higher level functions to Linux (since everything was C code, this again was pretty easy) and connected the SPI interface of the microcontroller to my FPGA.
The on-FPGA CPU is still there, but it got a slave SPI interface, and now is only responsible for receiving data via SPI and writing that to the PWM registers.
Here is another youtube-video showing that setup: youtube.com/watch?v=q_5nvM7TouY
Other additions are a UART HCI compliant bluetooth module and two weeks ago, I finally got a suitable battery. The bot is now powered by a 2S 7.4V 5000 mAh (woohoo!) Turnigy LiPo battery mounted below the robot’s body, a Turnigy 8-15A UBEC provides power to the servos and electronics.
Finally: Code, Pictures, random stuff:
This tarball includes the current Linux and SPI controller code, as well as a simple OpenGL hexapod model viewer currently compiling on Mac OS X.