PWM SWITCHES

An open question to the collective:
I am about to start developing a switching system using two spare Tx channels on my radio gear, using the Arduino Nano.
The proposed system will use the first channel as a clock, with the second channel being used as a data channel. The two channels therefore combine to become a synchronous data stream.

THE THEORY
In a 6 channel Radio control system, channels 5 & 6 are binary (not proportional) and provide either a long or short pulse for two position servo control.

AT THE TX
The output cycle of one channel will be measured at the receiver. I expect the length of a channel pulse cycle to be in the vicinity of 120 micro seconds.
Cycling through 6 channels, then, takes roughly 120 micro seconds.
I will be using the Arduino Nano to monitor the position of a number of switches (N) attached to its inputs. The status of these switches (high or low) will be sent sequentially through channel (2) after the synch. pulse (high) of channel (1).

AT THE RX
On receiving the synch. pulse from binary channel (1), the next (N) pulses (long or short) from binary channel (2) will be used to form a word that is demuxed to control the on/off status of (N) number of relays/digital switches on board the UAV.
This output is refreshed every N*120us.
In the case of 6 external switches, I'm looking at up to 240us before the change in status of any given switch, which is fine for non critical switching like lights, flaps or other equipment where immediate response is not needed.

I suppose the big question is:
"Is there a more elegant way to achieve multi switch control to your UAV", or is this proposal in itself an elegant system?


E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • Thank you, Doug & thank you John for your observation and links.
    Curse my choice of cheap radio. I was lead to believe the binary channels were standard fare.
    I'll go away and rethink my strategy (and probably buy a more suitable radio).
  • Developer
    Dave, I think there certainly is a more elegant way. Channels 5 and 6 are binary only on the cheapest RC systems. In almost all systems they are proportional. The easiest hack would be to use a transmitter with a proportional slider or knob on channel 5 or 6 and replace the potentiometer with a ladder of resistors and switches. Then on the receiver side use Arduino to measure the pulse width and determine which combination of switches are thrown. Most RC systems I have looked at have a stability of better than +/- 3 microseconds, so that divides a 1000 usecond window into a lot of slices. I would think 6 switches on a single channel would be easy with this method.
  • Developer
    Only thing I can think of right now is that you could send both clock and data on a single channel with Biphase or Manchester coding. http://en.wikipedia.org/wiki/Biphase_mark_code
This reply was deleted.