So, as hinted previously, I’ve been working out how to fly a remote control helicopter with the N900 – an idea I had when I first requested a trial. And – it works:
How well does it work?
Pretty well, given the limitations, though it’s not as good as it could be (I don’t have the time to write better software to control it). I can fly it about as well as with the actual transmitter (so not very well then!).
The range of the N900′s IR transmitter is about 2 feet, which makes controlling the helicopter tricky, as it flies out of range easily, and also the angle of control is low. The N900 has to stay pointed at the base of the chopper. And flying a helicopter a couple of feet from your face isn’t the best idea in the world!
So how does this work?
Simple version: the N900 has an IR transmitter, the PicooZ helicopter is controlled by IR, so I use the N900 to send control signals instead of the usual remote.
More complicated version: The chopper understands IR signals, the N900 can send them. So I need the N900 to send the same signals the chopper expects. My first approach, which worked to some extent, was to use LIRC on a linux pc, along with a Microsoft MCE USB IR receiver (from a remote) to record signals sent from the real remote. I then use these to create a LIRC configuration file for the N900. I recorded a series of inputs corresponding to different power levels, and different steering input. Then I wrote an interactive bash script to run on the N900, which allows me to adjust the power level, and steering input and sends the appropriate IR signal.
So on the N900, the way it works is I press E for more power, D for less, and U and I to turn left and right.
I can handle the truth! You can’t handle the truth! The final control method was a lot more complex than the above. This didn’t give me accurate enough control to hover (the signals I recorded were either too much, or too little power). But the IR signal isn’t unstructured, it follows a known encoding. So studying my recorded signals for LIRC, and using some existing code, I was able to write a small program to generate IR control signals, in LIRC format, for a given input. I then used this to generate a much finer series of control signals for a (modified) version of my bash script to use. (15 levels of thrust, 2 levels of yaw, and trimming control to be precise).
Can I fly my helicopter with my N900?
Well, if it’s the same (or similar) to mine, yes. If you understood all the above, and still want the code – post in the comments and I’ll see about putting it online. You’ll want to be comfortable with the command line, bash scripts, C++ and LIRC to understand and use it. I could provide slightly easier to use code and instructions if you have a channel A picooZ copter like mine.