[Laser] PWM of LED in QST

C. Turner turner at ussc.com
Tue Sep 28 19:45:16 EDT 2010


Hello all,

It would seem that there is a misunderstanding about PWM and the like, so I'll share my observations on the topic.

First of all, the majority of cheap (and not so cheap) digital music players use PWM of some form to generate their audio outputs rather than what one would consider to be a conventional "D/A" converter.  The reason for this is cost:  It's much easier to make a set of counters than to fabricate precision resistors/current sources/whatever in silicon.  In theory, the resolution of a PWM-type D/A converter is limited only by the available clock rate and the speed of the silicon.

A pretty good, graphical explanation is here:

http://electronics.howstuffworks.com/question620.htm
and another explanation is here:
http://en.wikipedia.org/wiki/1-bit_DAC

Another common application of PWM is that used in a Class-D switching-type audio power amplifier.  These are far more common than you might realize and your portable music player very probably has one!  The main advantage of this circuit topology is that, with the proper selection of components, the amplifier can be made to be VERY efficient as is possible to arrange time constants/reactances/etc. such that the power switches (almost) never have to switch any current - that is, they can do their switching at the voltage across them is either very low or zero, or into an inductive load in which case the current at the instant of the application of the voltage is zero for an ideal inductor.

An article about that is here:
http://en.wikipedia.org/wiki/Class_D_Amplifier

For an example of how PWM might be applied to modulating a laser or LED, take a look at this diagram, built by K7RJ:

http://modulatedlight.org/optical_comms/LASER_COMM_simple.gif

In this diagram, we see a 555 being used to generate a sawtooth wave at a fixed frequency.  The microphone - amplified to several volts by the op amp - is applied to the LM311 comparator and as can be seen by the waveforms on the schematic the duty cycle will vary proportionally to the applied voltage.

This is just a form of digital sampling and Nyquist tells us that as long as the modulating frequency is less than half of the carrier (or switching) frequency, we can represent it.  Practically speaking, one picks a carrier (switching) frequency that is several times (say, 3-10) for a simple circuit so that we can minimize (or eliminate) low-pass filtering to avoid "aliasing" distortion.  In this system, with the carrier (switching) frequency of about 40 kHz, we are pretty safe as that implies a maximum frequency modulating frequency of 20 kHz.  Since there is very little energy in the human voice above 3-4 kHz on average, we don't worry - hence the complete lack of lowpass filter in this design.  Unlike a digitally-based PWM system using counters, the resolution of a completely analog PWM system like this is theoretically infinite:  There's nothing about the analog system that sets discrete/minimum step sizes in the duty cycle.

For an example of THAT exact modulator being used on a laser over a 23km line-of-sight path, listen here to K7RJ's commentary:

http://ka7oei.com/optical_comms/laser_led_sprinkler_1a.mp3

(The first 90 seconds of this audio file is via the laser pointer and the rest of it is via the LED.)

The schematic that appeared in QST takes advantage of the fact that the 555 contains a number of comparators with fixed voltage references.  It can just as easily vary the duty cycle of the output over quite a range (a VERY similar circuit - probably using a 555 - probably lurks in your battery-powered hand drill!) - although it's a bit more difficult to achieve this as it's hard to avoid changing the frequency at least slightly and attaining the extremes of duty cycle (near 0% or near 100%) can be somewhat tricky.

***

It is simply not true that one has to "stay away" from 0% or 100% PWM in order to maintain linearity in general, but this may be true of a particular circuit.  As mentioned, the simple 555 PWM has trouble doing this, but the circuit built by K7RJ DOES NOT - and neither does the PWM circuit shown on this page:

http://modulatedlight.com/optical_comms/simpler_pulse_width_modulator.html

The above circuit can produce low-distortion sine waves (only a few percent - the distortion mostly limited by quantization of the synthesized sine wave and the intrinsic distortion imposed by the resolution, etc.) and this will modulate the LED/Laser to nearly 100%.  Now, I say "nearly" because it's best to keep 1-2% away from the edges if there's fixed-point math involved and rounding-off errors may result, but that has nothing to do with the PWMing itself.

That device can also produce very good-sounding speech as well (unfortunately I don't seem to have any audio files available online at the moment - that page is a work in progress...) but there is, as you might suspect, an absolute clipping limit imposed:  You can't go below 0% or above 100%.

As can be heard from K7RJ's commentary about the sprinkler in the laser path, there's a significant amount of distortion.  If one examines the audio files (you can use the Audacity program to do this) there is significant clipping.  In this case - even with rather severe clipping - the intelligibility was not significantly impacted even though the fidelity was reduced.

This brings up another point:  It is better to clip than undermodulate!  One of the problems with attempting to modulate a laser pointer by varying its operating current (with a transformer or through the conductance of a transistor) is that one must stay well away from the device's operating limits:  Too low of a current and it quits lasing (it just "plays LED") and just a smidgen too much current and it quits lasing permanently.  If one wishes to fully-modulate a laser with this method, one must keep close tabs on either extreme and be mindful of the fact that these parameters tend to be different from device-to-device (even ones of the same type from the same manufacturer) and they also change with temperature.  Considering that it is important for the optimum link performance to fully-modulate all of the available power, the complexity involved in doing this with a "current" method on a laser rapidly becomes complicated.

PWM sidesteps that problem since you either turn it on, or turn it off.  Cheap laser pointers already have some sort of current limiting built into them of the simplest sort which also means that they typically lack capacitors or anything that puts an obvious limit on their switching rate:  10's of kHz is no problem and MHz of switching rate using the dirt-cheap laser pointer modules have been reported.

Now, if one uses PWM techniques and then filters them to an analog voltage (removing the switching waveforms) and THEN applies the result to a laser or LED, then all bets are off:  At that point the laser/LED is being current modulated again and the "on/off" benefits of PWMing the device are lost.


***

For demodulation of PWM, there's really no problem in most cases because of the way must make a sensitive receiver.  If the receiver is designed to be maximally sensitive and is intended for speech (or narrower!) bandwidth, the compromises in the design impose an intrinsic upper frequency limit on the receiver itself.  In the case of a high-gain Transimpedance Amplifier (which includes devices like the rather expensive OPT101, OPT201, OPT212 and similar that have a photodiode and op-amp in the same, clear package) the slew rate of the amplifier is dramatically limited by device and stray capacitance and the gain-bandwidth of the amplifier (often an op amp) itself.  In circuits such as the K3PGP, it's mainly the photodiode/gate/Miller capacitance of the first stage that limits the frequency response in conjunction with the impedance while with the KA7OEI V3.xx receiver the stronger lowpass response is imposed by the design of the differentiator section.  Alternatively, the Ramsey laser communicator kit has a multi-pole lowpass filter in the audio path to perform the same effect.

As can be heard from the above audio file - at least with my V3.xx receiver - the 40 kHz PWM frequency has caused no problem with the 32ksps digitization rate of our digital audio recorders:  Originally a point of concern (my prototype 3.xx receiver actually has a switchable lowpass filter) the later revisions have omitted this as it wasn't necessary!

***

So, if one wants to build the simplest, cheapest PWM system possible, there are a few possibilities:

- Jellybean circuit.  That is, use common, jellybean devices such as op amps and timers.  The circuit in the QST column - while it works - is rather limited in its abilities, but a much more-capable circuit using a 556 (a dual 555) could be easily constructed, or you could just use a circuit like K7RJ's!
- Microprocessor-based circuit.  At the risk of blowing my own horn, the "Simple PWM" circuit shown is a prototype and is overly complicated and could be stripped down significantly - but still provide handy (optional) features like a built-in tone generator and (optional) built-in audio AGC.  You could also use the modulator of the Ramsey kit, too...

Then again, there are lots of other possibilities.

73,

Clint
KA7OEI






More information about the Laser mailing list