In this column, Kristen answers questions about all aspects of electronics, including computer
hardware, software, circuits, electronic theory, troubleshooting, and anything else of interest to
the hobbyist. Feel free to participate with your questions, comments, or suggestions. Send all
questions and comments to: Q&A@nutsvolts.com.
; WITH KRISTEN A. McINTYRE
Stable PWM Integration
QI want to use a standard small RC transmitter and receiver to control a large servo amplifier that, in turn, drives a very large DC motor. The input to the motor servo amp
is a high impedance DC level (I don’t care what level,
just as long as it is a pure stable DC level). Searching
the Internet, there seems to be nothing that converts
RC PCM (Pulse Code Modulation) to analog. Using
a resistor-capacitor-integrator scheme gives erratic
results. Is there a circuit that would convert RC PCM to
Jesse W. Roche
AYour question mentions converting PCM to analog using an integrator. If what you are receiving is truly pulse codes, then that will most definitely not give the desired results.
Pulse codes are bit streams that encode a number for
each sample interval, representing the amplitude of
an impulse at the instant a signal was sampled; in this
case, perhaps a lever on the RC controller.
Sampling theory tells us that if we have a time-domain signal where the maximum frequency in that
signal does not exceed half of the sample rate, it can be
exactly reproduced from a set of impulse amplitudes.
That frequency condition is called the Nyquist Criteria,
and the frequency limit is called the Nyquist Frequency.
Of course, if we encode the samples as numbers, we
are already going to sacrifice exactness, but it’s close
enough for most applications. This is a theory after all,
so it deals in mathematical exactness.
Radio control servo pulse codes appear to be
eight to 10 bits in a stream, with frame synchronizing
bits and a CRC (cyclic redundancy check) at the end
of the frame for error detection. That can be decoded
using some software that samples the bitstream much
faster than the individual bit rate (four to 16 times
the rate is not uncommon). There is
a ServoDecode library for Arduino
that does just that — use your favorite
search engine to find it.
Once you have the data stream
in hand, an A/D (Analog-to-Digital)
converter can be used to create an equivalent analog
signal. Many Arduino boards have a built-in converter.
That analog signal, however, will be composed of “
stair-steps,” as the value will abruptly change from sample to
sample. This is where sampling theory applies again.
A filter with fairly sharp roll-off is required to try
to enforce the Nyquist criteria during reproduction
as best one can. The filter should roll off at half the
sample rate/frequency. So, if the samples are taken or
synthesized at a 100 Hz frequency, the filter needs to
be designed for 50 Hz. I think four or six poles would
be good here. That gives us between 12 dB and 18 dB
per octave roll-off.
In this case, I recommend one of my favorites: the
Sallen-Key active filter. You can build them with any
gain-of-one amplification element. Op-amps are not
uncommon in this application, but an emitter-follower
transistor is quite convenient and there are fewer
pins to solder! You can see an example of an emitter-
• Stable PWM Integration
• Fixing a Dead Power Supply
Q & A
; FIGURE 1. Sallen-Key low pass filter topology.
6 November 2017