HeliPOV update (with videos!)
This post discusses the current status of the HeliPOV. Much progress has been made, but there are some very puzzling problems that I’m dealing with.
Once I got the blades balanced and the heli in the air, I got to work on the microcontroller firmware. After spending a long evening trying to get the whole thing working at once, I failed. But I did decide that as a reward to myself, I should take the heli for an indoor test flight with the non-working firmware loaded. If this was doing what it was supposed to, the blades would look like they were a pizza sliced up into 8 pieces. Instead, they’re just a disc of color. Still, it was fun to fly it in the math building and disrupt everyones studying for a few minutes.
The first video is just taking off and hovering around a little. You only see the top blue lights.
Right after that landing I spun up again to go a little higher so you could see the bottom gold lights. This lasted a few seconds before something gave out (I suspect my battery — it’s pretty old and I’ve been abusing it lately) and I had to make an “emergency landing.” It was a little bouncy, but nobody was hurt!
A few days later, after receiving some debugging tips from my buddy Kyle, I got the firmware working correctly. The sliced up pizza image was working, so it was time to work on formatting images for the blades. It took a few evenings to get it working, but with the help of the EasyBMP C++ Bitmap Library, I wrote a command-line program that takes a monochrome bitmap and processes it into bytecode that can be pasted into the microcontroller code. This means the microcontroller must be reprogrammed each time I want to change the image — not the most elegant solution, but it simplifies the AVR code and avoids the need of external memory. I’ll probably do a post about the firmware sometime to share some little tips I learned about AVRs along the way. Meanwhile, here’s a video of the HeliPOV doing the Marquette University “MU” logo.
As exciting as it was to hit this milestone, there is still work to do on the lights. For some reason, the bottom lights simply do not work with the exact same firmware that is running on the top blades. I’ve double- and triple-checked to make sure that both blades have the same fuse settings and same firmware, and for some reason the bottom blades just refuse to light up! I don’t know what my next step will be yet. So far I’ve tried writing a few programs for the blades to test individual aspects of the system, like timers, interrupts, and SPI. It seems that trying to send data using SPI within the TIMER0_COMPA ISR (the Timer0 compare match A interrupt service routine) does not work on the bottom blades. It works fine on the top blades, but not the bottom. However, moving the SPI code into the main loop and executing it only when a flag is set by the TIMER0_COMPA ISR didn’t seem to fix the problem. My next step is either going to be replacing the AVR on the bottom lights (hopefully not, because this would be a pain in the ass), or soldering some wires onto the board so I can hook a scope up to it and try to get a better idea of what’s going on (also a pain in the ass, but probably less so than replacing the AVR).
But the uncooperative bottom lights is not the only problem — a few scattered top lights are acting up as well. Most notably, (counting the LEDs from 1 on the inside to 32 on the outside) LEDs 11, 5, 6, 2, and 3 are often times off when they should be on. I haven’t figured out yet if this is a problem with the the microcontroller firmware, the hardware, or something else. I’ve eliminated the image converter as a possibility, because the effect happens when I write bytecode manually too. It happens when I manually light up one LED at a time, but when I light them all up at once, then the bad LEDs are fine and they turn on and off as they should. I haven’t explored any other combinations of lights yet, but that’s on the to-do list.
Also on the to-do list: I plan on making an SVN repository soon as a nice way to organize and share the schematic, board layout, microcontroller code, and image converter code for the HeliPOV. But first, I must figure out how to use SVN! My friends assure me it’s simple and awesome; I just haven’t taken the time to learn it yet. Look for that in the future.