In my previous post I had built and flown this little 250mm quad with the Flip32 flight controller on board. I was waiting for the arrival of a tiny level-shifter I'd ordered from Sparkfun, to connect the 1.8v UART on the ODROID U-3 to the 5v UART on the Flip32. (I also took some time off to attend "Dronefest", a wondeful day-long event organized by a couple of really cool guys Colgate University, where my students and I presented some of our work.)
Looking more closely at the small UART header on the U-3, I realized that it would take more engineering skills than I possessed to build a robust connection to the flight controller. Fortunately, the latest Ubuntu release for the U-3 (14.04) supports USB OTG on the U-3's micro USB port, and of course the Flip32 has its own USB port that you use to configure it through Baseflight or Cleanflight. So all that remained was to find a little USB OTG cable to connect the two devices. This nifty little cable from 3DR, designed to connect an Android device to a 3DR radio, was just the ticket. (And it'll even let you connect the ODROID U-3's micro USB OTG to a Pixhawk, if you used one of these ingenious little USB/UART adapters!)
To power the U-3, I soldered some female jumpers onto a DC plug sold specifically for it:
With all the electronic components in hand, it was time to design a plate to support the U-3 on top of the Flip32. With some help from TinkerCAD, I modified the plate I'd printed in Part I to hold the U-3:
Here's the vehicle with the plate on it, plus some 20mm M3 nylon hex standoffs from McMasterr-Carr, ready to mount the ODROID:
Here's the ODROID mounted on the vehicle:
Another tiny socket-wrench head from Lowes was just right for deez nuts!
Here's a closeup of the power and USB connections:
So now it was time to program the ODROID to show a simple proof-of-concept that it could fly the vehicle autonomously. A network cable plus SSH from my Ubuntu laptop (use PuTTY on Windows) made it easy to interactively adapt an example Python program from our MSPPG examples to do something really simple, like pitching the vehicle forward when the channel 5 switch was down. Remember, the ODROID is a complete computer on a single board!
Once everything was ready I flew the vehicle and found that it had a weird response in when I flipped the autopilot switch: instead of pitching forward as expected, it pitched and rolled back -- right into my *&^in' arm!
THIS is why I prefer to experiment with the smallest vehicle possible: imagine what the 9" prop on a mid-sized bird would have done!
After nearly giving up for the evening, I figured I'd try a flight without the ODROID connected to the Flip32. Sure enough, same behavior -- flip the switch, vehicle lurches. Again, bad things happen when you aren't thorough: in this case, I'd only configured the Flip32 for horizontal (stable) flight in the topmost switch position, the default being rate mode. So the configuration of the flight controller was masking the RC-demand messages from the ODROID. Here's the right way to confgiure it in Baseflight:
After configuring the modes properly, it flew as expected: flip the switch, it pitches forward; flip it off, regain ordinary transmitter control. Fortunately, the furniture had been removed from "Dronehenge" for floor waxing, so I had a big space in which to fly. Unfortunately, I didn't have any help this time, so you have to take my word for it: when you see the vehicle lurch forward suddenly in this video, it's because I've hit the autopilot switch.
So, the good news is, the whole crazy thing worked as expected, and you can have the basis for a sophisticated autonomous flight system, using Python, for under $400 ($281 from previous post, $75 for the ODROID U-3, plus a few bucks for cables and fasteners).
The bad news is, ODROID has discontinued the amazing little U-3 board -- without a doubt the most advanced combination of mini form factor, super processing power, and low price I've ever seen. So I've switched to working with the Raspberry Pi 2. Although slower (900 MHz) than the U-3 (1.7GHz), the Pi 2 has (1) a similar ARM Cortex quad-core processor to the U-3, supporting parallelization of crucial algorithms like optical flow; (2) an inexpensive camera module that connects directly to the Pi using the Camera Serial Interface (CSI) protocol cable, instead of bulky USB; (3) a 3.3v UART that may be able to talk directly to the Flip32 and Pixhawk UARTs without an adapter. In a future post I will report on my experiments using the Raspberry Pi 2 for this sort of work.