HobbyKing.com New Products Flash Sale
Reply
Thread Tools
Old Nov 16, 2011, 07:02 PM
Up up and away!
FpvKiwi's Avatar
Sweden
Joined Oct 2010
703 Posts
New Product
Channel Wizard: Flexible PPM encoding/decoding/mixing

Dear DIY'ers,
I want to tell you about the circuit I've spent a long time developing. It's called Channel Wizard and the primary purpose is to add more PPM channels. Up to 8 inputs are either added to a PPM signal as regular channels or "multiplexed" into a single channel via an encoding scheme. If there's no PPM input, the device generates a new PPM so it can be used as PPM encoder. (See AddingChannels for a more verbose background.)

Here I use the trainer port of Futaba 9C to inject 8 extra channels to the DragonLink radio module. The device can also be installed in a transmitter to tap into existing pots and switches. On the receiving end, note that the Wizard connects to a servo port, not PPM output:

Channel Wizard adding 8 ch. via trainer (1 min 11 sec)


With multiplexing, another Wizard needs to be connected to the receiver to decode the "sub-channels" again. The downside of multiplexing is a reduced rate of sub-channel updates but since sub-channels are sent more often when they change, this isn't obvious unless many sub-channels change values at once. In the aircraft, it can also be used as a PPM decoder.

And an example of setting up Wizard as a PPM encoder, here used with a FrSky hack module:
Channel Wizard setup as PPM encoder (1 min 3 sec)


But there's lots more hiding under the hood. Via a command line available over the UART serial port each of the 8 ports labelled A-H can be independently configured as PPM or PWM inputs, analog inputs or PWM outputs. PWM and/or PPM outputs can use dozens of mathematical formulas to calculate each output channel from any inputs. This can for example be used as a channel mixer (see video clip below). Channels can also be controlled from a computer although I haven't written any computer program for this.
Some other software features: Input conditions can trigger user-defined actions such as changing channel values or channel mapping. Failsafe positions or custom actions can be defined. Sound output is possible at one port but amplification or loudspeaker is not included.

Here's an example where I used a Wizard in my FPV TwinStar to read PPM, duplicate one channel for use by the two pan servos and adjust another PPM channel in two different ways to synchronize the two tilt cameras as far as the servos will go. Towards the end, I change one channel on the fly (no pun intended) to control the speed of a servo instead of its position.

Channel Wizard controlling 2 pan/tilt (1 min 6 sec)


Hardware-wise, Channel Wizard has input signal amplification to manage the weak signals of Graupner and JR trainer ports. It can use the signal from Futaba module port without extra resistors. It accepts voltage levels of 3.3-18 V so both trainer and module ports can be used, or the 5 V used internally in Tx'es.
For use in aircrafts, the circuit features power filtering to avoid brown-outs and protection against flipped servo connectors. The circuit is 10 grams and 45x30 mm (plus servo connectors).
Two push buttons and a 16-position wheel are used for basic setup, or do all settings via the UART command line. (Or use UART to redefine the button actions.)
I used all pins of atmega328 to do this and almost all of the 32K flash memory. In fact, there are two firmware flavours since both multiplexing and demultiplexing won't fit. But the firmware can be replaced thanks to the UART bootloader.

For a complete description, see the manual: https://bitbucket.org/fpvkiwi/channel-wizard/wiki/Home

I've started to sell these for $50 plus worldwide shipping $8. It'd be gratifying if some of you wanted to take Wizard beyond the basic usage scenarios and include it in some cool DIY projects. I'm also working on a smaller version that includes I2C.

There was lots of interesting engineering involved if anyone is interested.
FpvKiwi is offline Find More Posts by FpvKiwi
Reply With Quote
Sign up now
to remove ads between posts
Old Nov 16, 2011, 07:04 PM
Up up and away!
FpvKiwi's Avatar
Sweden
Joined Oct 2010
703 Posts
Reserved.
FpvKiwi is offline Find More Posts by FpvKiwi
Reply With Quote
Old Dec 14, 2011, 04:44 PM
Up up and away!
FpvKiwi's Avatar
Sweden
Joined Oct 2010
703 Posts
bump.. getting ready to mass produce the device.
There are so many ways to use it...
FpvKiwi is offline Find More Posts by FpvKiwi
Reply With Quote
Old Dec 16, 2011, 12:57 AM
Life begins at transition
Australia, VIC, Sale
Joined May 2007
3,593 Posts
Funnily enough, I've been slowly working on a similar device with arduino. Good idea!

What resolution does the timer manage? (i.e. jitter in the servo signal)
Odysis is offline Find More Posts by Odysis
Reply With Quote
Old Dec 16, 2011, 11:13 AM
Up up and away!
FpvKiwi's Avatar
Sweden
Joined Oct 2010
703 Posts
That's cool, want to share any details?

The AVR runs at 8 MHz. I use this frequency for HW input capture and servo calculations. The eight extra ports use software-dependent input capture or PWM generation. The resolution becomes about 1us with careful software design.
FpvKiwi is offline Find More Posts by FpvKiwi
Reply With Quote
Old Dec 16, 2011, 06:30 PM
Life begins at transition
Australia, VIC, Sale
Joined May 2007
3,593 Posts
Wow, only 8mhz and you get that done fast enough? Nice! You must have much, much slicker code than I...

At the moment, all mine does is take two channels, one analogue and one digital, and send them through a single channel on the radio.
I use a 16MHz timer to capture the length of the PPM pulse. The left-most bit becomes my digital channel, the remaining bits are rolled left 1 and becomes the analogue. The two outputs are then driven accordingly (the digital can be any time for 0 or 1)

Very basic, but it's a way of combining landing gear and flaps, for example, onto one channel. It doesn't require any hardware at the TX side, just a small micro like the ATMega328P, or even a Tiny, at the RX side.
I would like to expand it to MIMO, but I'm still figuring out a few issues with interruppts being missed. I think I have two that stand on each other.
Odysis is offline Find More Posts by Odysis
Reply With Quote
Old Dec 17, 2011, 09:32 AM
Up up and away!
FpvKiwi's Avatar
Sweden
Joined Oct 2010
703 Posts
Thanks, I put emphasis on code efficiency throughout the code. But most important is to avoid busy-waiting and using hardware features like ICP, OC and interrupts.

So you use mixing in the Tx to combine two channels? A guy made a device "Dexplex" with the same principle. You probably need to be careful just around the middle point since if the combined value just crosses the middle point by mistake, both output channels will be reversed! (To visualize, note how binary 01111 is close to 10000 but means the opposite).

For your problem, spend as little time as possible in interrupts. Never call functions from within an interrupt. It's better to set a global flag to trigger the work from the main loop instead. And if you cli(), make sure to sei() again.
FpvKiwi is offline Find More Posts by FpvKiwi
Reply With Quote
Old Dec 17, 2011, 06:06 PM
Life begins at transition
Australia, VIC, Sale
Joined May 2007
3,593 Posts
Similar concept to the dexplex - yes!

I've got a deadband programmed in for the midpoint.

At the moment, all I'm using the interrupt for is finding the length of the input pulse.
I think the problem lies in my using of the Arduino libraries. I have no idea if any of them try to use ISRs too. Using CLI/SEI may actually be a very easy way to stop them, thanks muchly for the idea!
Odysis is offline Find More Posts by Odysis
Reply With Quote
Old Dec 22, 2011, 02:53 AM
Registered User
dc3t_driver's Avatar
Joined Nov 2006
29 Posts
Very nice!

Would it be possible to use the Wizard to get the full 16ch output from a Turnigy 9x TX using er9x software upgrade?
I have an FRSky module on the Turnigy.

Thank you in advance.
dc3t_driver is offline Find More Posts by dc3t_driver
Reply With Quote
Old Dec 22, 2011, 04:00 AM
Life begins at transition
Australia, VIC, Sale
Joined May 2007
3,593 Posts
Thats effectively what i'm aiming for (eventually)
Doing so will reduce the resolution of each channel though, by just over half...
Odysis is offline Find More Posts by Odysis
Reply With Quote
Old Dec 22, 2011, 03:48 PM
Up up and away!
FpvKiwi's Avatar
Sweden
Joined Oct 2010
703 Posts
dc3t_driver:
Thanks. Yes it would be possible to augment er9x with the multiplexing scheme to make Turnigy 9X transmit more (virtual) channels than FrSky supports. A Wizard in the plane would extract the extra channels again.

I had a look at the source code of er9x a while back but it'd take a while to get familiar with the code and setting up multiplexing requires modifying the GUI as well. So I put that project to the side, especially since I don't have a Turnigy 9X myself.

If someone wants to give it a try, I'm happy to share the code and I'll donate a Wizard to the cause too. On the mux side the algorithm is pretty simple. The major work lies in knowing the er9x code and adding GUI options, as mentioned.

Odysis: Maybe you're interested in using the Wizard hardware for your project? It has an atmega328p, guards against voltage dips from servos, has resistors to protect against flipped servo connectors and is compact for its capabilities (there's also a smaller version). ISP and UART connectors are available.
If you prefer to roll your own, no problem, I also like to design my own stuff.
FpvKiwi is offline Find More Posts by FpvKiwi
Reply With Quote
Old Dec 22, 2011, 03:59 PM
Up up and away!
FpvKiwi's Avatar
Sweden
Joined Oct 2010
703 Posts
I can add that I've since reworked the normal-size Wizard to be cheaper to manufacture (and smaller) and I'm waiting on the PCBs for evaluation before I have a batch assembled. If there's interest for enough volume, I can make the boards cheaper. They should be a good choice for different DIY projects involving servo signals.

It seems I can't get away from double-sided pick-and-place for Wizard Mini and the size saving won't be that great so I might not continue that one.
FpvKiwi is offline Find More Posts by FpvKiwi
Reply With Quote
Old Dec 23, 2011, 01:57 PM
Mobius Cables... I got em'
chanyote66's Avatar
United States, TN, Oak Ridge
Joined Dec 2011
3,885 Posts
is the channel that you want to multiplex selectable? for example if i have 6 channels now and want to sacrifice ch6 for multiplexing, can i tell it to use the CH6 as its carrier channel? or will it just "ADD" to the current signals?

Im building a customized CT6B with FR-SKY telemetry, Bluetooth and 1~2watt TX amplifier. I would love to throw a few more channels on this for FPV since its already modded so much. Then later roll it all over to a 9CH for even more capability.
chanyote66 is offline Find More Posts by chanyote66
RCG Plus Member
Old Dec 23, 2011, 06:12 PM
Up up and away!
FpvKiwi's Avatar
Sweden
Joined Oct 2010
703 Posts
Hi chanyote, yes the channel is flexible. You can add regular channels, use an existing channel for multiplexing, create PPM from scratch or a combination of the options. Actually you don't need to "sacrifice" a channel since the value that is replaced is also registered so it can be injected as a sub-channel too.
I tried to write an overview of the options.

That Tx project sounds like fun. I've myself replaced all electronics of a cheap Tx with a Wizard and FrSky module. I also had a shot at interfacing Wizard with a Bluetooth module but couldn't even start to talk to the module. I might give it another try. Maybe the module was just broken.

With some wireless add-on that talks UART, channels can be controlled remotely. Or just connect a Rx to the Wizard to combine several sources of PWM and PPM (combining the signals from two Tx'es). This is something I want to do myself for FPV.
FpvKiwi is offline Find More Posts by FpvKiwi
Reply With Quote
Old Dec 26, 2011, 08:27 PM
RCPlaye
United States, CT, East Hartford
Joined Aug 2009
711 Posts
Quote:
Originally Posted by FpvKiwi View Post
Hi chanyote, yes the channel is flexible. You can add regular channels, use an existing channel for multiplexing, create PPM from scratch or a combination of the options. Actually you don't need to "sacrifice" a channel since the value that is replaced is also registered so it can be injected as a sub-channel too.
I tried to write an overview of the options.

That Tx project sounds like fun. I've myself replaced all electronics of a cheap Tx with a Wizard and FrSky module. I also had a shot at interfacing Wizard with a Bluetooth module but couldn't even start to talk to the module. I might give it another try. Maybe the module was just broken.

With some wireless add-on that talks UART, channels can be controlled remotely. Or just connect a Rx to the Wizard to combine several sources of PWM and PPM (combining the signals from two Tx'es). This is something I want to do myself for FPV.
If you are able to get it to work with bluetooth maybe you can get it to sync with a smartphone and write an app that will allow you to control the wizard with your phone?
CoolBudz is offline Find More Posts by CoolBudz
Reply With Quote
Reply


Thread Tools

Similar Threads
Category Thread Thread Starter Forum Replies Last Post
Discussion Converting a PPM 9 channel to PPM 8 channel....... lazy-b DIY Electronics 5 Mar 10, 2011 12:22 PM
PPM decoding charles0198 DIY Electronics 5 Oct 24, 2004 05:29 AM
Anyone with knowledge of receiver construction - i.e. ppm decoding? Hodgepodge Radios 18 Sep 10, 2003 10:56 AM
PPM Encoding/Decoding Keith Watson Power Systems 34 Jun 21, 2001 05:59 AM