Trade Two PWM
Channels for a Whole
Bunch of Switches
By Jim Miller
PWM Data Channel
One day, I was working with some PWM circuits for
another project and it dawned on me that even though an
R/C radio sends an analog signal, with proper timing one
should be able to transmit discreet data elements over a
channel or a couple of channels. My first approach was to
simply encode a byte on an analog channel with switches.
A digital-to-analog circuit (DAC) at the controller would
build the byte, then at the receiver an analog-to-digital
circuit (ADC) would decode it into bits. Well, this plan
sounded great but failed on two levels. I could never get
the noise out of the DAC at the transmitter. Any wire I
connected to the transmitter became an antenna and
injected huge noise into the system.
It also had the negative aspect of robbing the
controller of one control axis on a joystick. You see, the
switch channels on the transmitter are binary. One cannot
simply replace a switch with a potentiometer and get
another analog channel. Analog is there, but the
transmitter software keeps it so you can’t get at it
electronically. So, the project got shelved for several years in
frustration. A few weeks ago, I ran across one of the
prototypes and I decided I would conquer the problem with
a new approach. If it worked, it would solve a big control
issue for me, so I sat a while and thought. On my six-channel system, two of the channels can be controlled as
binary ON/OFF modes. Why not use one for data and one
for timing? Then, these two channels become a
synchronous data stream! Voilà, it worked!
So now, I’m going to tell you how to trade two of your
PWM channels for a whole bunch of ON/OFF switches and
data. You’re going to have to do a little surgery on the
transmitter to intercept the switches. This article is based on
a JR-XP6102 six-channel radio and receiver; I’m sure other
brands will work similarly.
Theory of Operation
To get this theory off the ground, we should start with
a quick review of PWM at the servo level. We’ll start at the
robot end where the PWM signal comes out of the receiver.
Pulses flow continuously out of each receiver channel.
On each channel, a 0 to 1 transition happens about every
10 to 20 microseconds, depending on your brand of R/C
PHOTO 1. Transmitter
I like to build rovers, but communication
with them has always seemed like a dicey
proposition for real-time control. Two-way
data radios typically have short ranges for
mobile applications or are very pricey.
Packetized systems tend to get glitchy or
don’t like the whole ‘mobile’ thing very
much as packets get backed up and real
time changes to queue time. R/C radios are
fantastic for this purpose (mostly because
they are designed for it ... duh). They are a
very reliable and mature technology with
little, rugged low-current receivers. The BIG
problem with them in robotics applications
is that they only carry a few analog data
signals. If you want to do more than five or
six channels of analog, you have to set up
an entire auxiliary communications link via
XBee, WiFi, Blue Tooth, or some other
medium. That is massive overkill if you just
want to be able to control a few switch
channels like lights, cameras, pumps, or
select different operating modes like
manual, autopilot, hover, etc.
So, what do you do?
SERVO 04.2010 55