|MinIMU-9 on custom carrier board
After performing some breadboard-based testing on my black Friday Pololu MinIMU-9 and associated Arduino-based AHRS software, it was time to stick it all on a printed circuit board. That way it'll be easier to mount to Data Bus for field testing.
The purpose of the AHRS is to provide an accurate and precise heading and attitude for dead reckoning calculations despite robot acceleration and travel over road surfaces that stray from perfectly level. More on those topics in future articles.
For sake of simplicity, I had planned to start with an Arduino, since the code works out of the box, and migrate to something else: mbed, LPCXpresso, etc.
Rather than an all-in-one board, I created two modules: one to secure the MinIMU-9 board and another for the Arduino AHRS. Later I can build a board with a different MCU and replace the Arduino board.
But, I screwed up. The Arduino board doesn't quite work. More on that in a minute. Here's the schematic and board.
Pretty straightforward on the MinIMU-9 side of things; we just need a place to solder the pin headers and a hole for mounting the thing.
The Arduino side of things, the electronics are straightforward, but it doesn't want to load code. All I had on hand was a 20MHz ceramic resonator, and that probably threw off the baud rate for the bootloader. I tried a few things but I'll have to revisit this later. EDIT: see comments from my readers who quickly pointed out the issues at hand :)
I was going to port the AHRS code anyway so that's what I did. To the mbed platform (here). The code I started with is a derivative of ArduPilot 1.5, ported by Pololu and adapted to the MinIMU-9 devices.
For those that don't know, ArduPilot uses the DCM AHRS algorithm (pdf) found in MatrixPilot, as implemented by William Premerlani and Paul Bizard.
I massaged the code so the DCM AHRS algorithm is encapsulated as a completely standalone C++ library, decoupled from the hardware, making it significantly easier to swap out sensors or entire IMUs.
After running the code in a test program I migrated it into my 2012 AVC code base. After ensuring proper compass calibration, I'll work on dead reckoning and accuracy refinement.
Still on the waiting list to enter the 2012 AVC...