Electronic – Multiple PWM signals from a single audio channel

audioiphonemotormotor controllerpwm

Here's my project in a nutshell: I'm building a quadcopter and I need to control each of the four motors independently. I'm using an iPhone as the "brain" of the quadcopter, with of all the control logic being implemented in software on the phone.

Somehow, I need to interface my iPhone with the ESCs for each of the brushless motors. I don't have access to the Lightning port (or the money to join Apple's MFI program), so that leaves me with the headphone jack. It would be reasonably simple to control the frequency/amplitude of the two audio channels and convert the signals to PWM, but I need to extract FOUR signals from the two channels.

My idea is this: "encode" two signals per channel by dedicating two different frequencies (say, 100Hz and 1000Hz) and modulating their amplitude in the software. Then I need a way to split the frequencies into their own independent signals to convert to PWM, before reaching the ESCs. What could I do to make this work?

Or, is there an easier way to accomplish what I need? I'm a Software Engineer by trade and a wanna-be EE by hobby, so my electronics experience is limited. A Fourier Transform would be the answer in the digital world, but I'm not sure how to make this work in the analog world. If somebody has a better solution, I'd love to hear it!

Best Answer

sounds like you want to use a PPM signal. Instead of modulating the pulse width, you're modulating the time between pulses.

Say you want to control six servos using a single channel: You'll build a 'packet' with seven pulses, the time between the pulses indicates to the receiver the desired servo position, nominally 1500uS. Let's say we want all six servos to be at dead center. In this case you'll send the seven pulses, each separated by 1500uS. On the receiver end, you'll map each gap between pulses to a servo where you can generate a continuous PWM signal with the desired period and duty. I'll throw up some code if you'd like.