PWM in the book

Thread Starter

Wendy

Joined Mar 24, 2008
21,840
I'm reviewing the AAC book for any sections on PWM, and can't find anything. Anyone else see something I'm missing?
 

Attachments

Last edited:

hgmjr

Joined Jan 28, 2005
9,029
Bill,

Are you thinking of taking on this topic. I say go for it. There seems to be tons of interest in the topic so it would be nice to have a place to which interested members could be directed.

Harry
 

Thread Starter

Wendy

Joined Mar 24, 2008
21,840
Heh, I could do that. I was looking for references for my 555 PWM circuit. Since there aren't any I guess I have to create some. :D Since Dave has been scarce for the last month or so I'll ask the mods (and anyone else that is interested) to proof it. I'll write it on this thread, I figure three posts (which I'll reserve) will do it.

Going through the book I think the end of Volume 4 Chapter 13 (Digital-Analog Conversion) would be the right place for it, since PWM is a method of encoding analog within a digital signal.

On a different note I've felt that the basic multivibrator families could use a little more coverage. They are mentioned, but the classic two gate (usually inverters) types are not covered well. I think this is a weakness, and also plays into PWM in that a classic two inverter astable multivibrator is a fixed PWM generator.
 
Last edited:

Thread Starter

Wendy

Joined Mar 24, 2008
21,840
Status: Ready to Proof Read.

Pulse Width Modulation

Pulse Width Modulation (PWM) uses digital signals to control power applications, as well as being fairly easy to convert back to analog with a minimum of hardware.

Analog systems, such as linear power supplies, tend to generate a lot of heat since they are basically variable resistors carrying a lot of current. Digital systems don't generally generate as much heat. Almost all the heat generated by a switching device is during the transition (which is done quickly), while the device is neither on nor off, but in between. This is because power follows the following formula:

P = E I, or Watts = Voltage X Current

If either voltage or current is near zero then power will be near zero. PWM takes full advantage of this fact.

PWM can have many of the characteristics of an analog control system, in that the digital signal can be free wheeling. PWM does not have to capture data, although there are exceptions to this with higher end controllers

One of the parameters of any square wave is duty cycle. Most square waves are 50%, this is the norm when discussing them, but they don't have to be symmetrical. The ON time can be varied completely between signal being off to being fully on, 0% to 100%, and all ranges between.

Shown below are examples of a 10%, 50%, and 90% duty cycle. While the frequency is the same for each, this is not a requirement.



The reason PWM is popular is simple. Many loads, such as resistors, integrate the power into a number matching the percentage. Conversion into its analog equivalent value is straightforward. LEDs are very nonlinear in their response to current, give an LED half its rated current you you still get more than half the light the LED can produce. With PWM the light level produced by the LED is very linear. Motors, which will be covered later, are also very responsive to PWM.

One of several ways PWM can be produced is by using a sawtooth waveform and a comparator. As shown below the sawtooth (or triangle wave) need not be symmetrical, but linearity of the waveform is important. The frequency of the sawtooth waveform is the sampling rate for the signal.


...................................PWM Modulator...............................................Why Ramp Symmetry Doesn't Matter

If there isn't any computation involved PWM can be fast. The limiting factor is the comparator's frequency response. This may not be an issue since quite a few of the uses are fairly low speed. Some microcontrollers have PWM built in, and can record or create signals on demand.

Uses for PWM vary widely. It is the heart of Class D audio amplifiers, by increasing the voltages you increase the maximum output, and by selecting a frequency beyond human hearing (typically 44Khz) PWM can be used. The speakers do not respond to the high frequency, but duplicates the low frequency, which is the audio signal. Higher sampling rates can be used for even better fidelity, and 100Khz or much higher is not unheard of.


...................................................How an Audio Signal is modulated with PWM

Another popular application is motor speed control. Motors as a class require very high currents to operate. Being able to vary their speed with PWM increases the efficiency of the total system by quite a bit. PWM is more effective at controlling motor speeds at low RPM than linear methods.

PWM is often used in conjunction with an H-Bridge. This configuration is so named because it resembles the letter H, and allows the effective voltage across the load to be doubled, since the power supply can be switched across both sides of the load. In the case of inductive loads, such as motors, diodes are used to suppress inductive spikes, which may damage the transistors. The inductance in a motor also tends to reject the high frequency component of the waveform. This configuration can also be used with speakers for Class D audio amps.

While basically accurate, this schematic of an H-Bridge has one serious flaw, it is possible while transitioning between the MOSFETs that both transistors on top and bottom will be on simultaneously, and will take the full brunt of what the power supply can provide. This condition is referred to as shoot through, and can happen with any type of transistor used in a H-Bridge. If the power supply is powerful enough the transistors will not survive. It is handled by using drivers in front of the transistors that allow one to turn off before allowing the other to turn on.


...........................A simplified H Bridge

Switching Mode Power Supplies (SMPS) can also use PWM, although other methods also exist. Adding topologies that use the stored power in both inductors and capacitors after the main switching components can boost the efficiencies for these devices quite high, exceeding 90% in some cases. Below is an example of such a configuration.


........................................Example of SMPS using PWM

Efficiency in this case is measured as wattage. If you have a SMPS with 90% efficiency, and it converts 12VDC to 5VDC at 10 Amps, the 12V side will be pulling approximately 4.6 Amps. The 10% (5 watts) not accounted for will show up as waste heat. While being slightly noisier, this type of regulator will run much cooler than its linear counterpart.
 
Last edited:

Thread Starter

Wendy

Joined Mar 24, 2008
21,840
OK, have I missed anything, or is there something that comes out clunky that needs work? I am also willing to touch up the pictures where needed.
 
Last edited:

SgtWookie

Joined Jul 17, 2007
22,201
Status: Ready to Proof Read.

Pulse Width Modulation

Pulse Width Modulation (PWM) uses digital signals to control power applications, as well as being extremely easy to convert back to analog with a minimum of hardware.
You might wish to de-emphasize the "extremely easy" part; as it may not seem that easy to the reader. A link reference to low-pass filters/integrators would be good; maybe something like this: http://www.allaboutcircuits.com/vol_1/chpt_16/4.html

Analog systems, such as power supplies,
Might want to qualify that as "linear" power supplies...
... tend to generate a lot of heat since they are basically variable resistors carrying a lot of current.
... qualify with : as Power(Watts) = Current(Amps)Squared times Resistance(Ohms)
Digital systems don't generally generate as much heat. Almost all the heat generated by a switching device is during the transition, while the device is neither on nor off, but in between.
...and the transition times are kept as brief as possible.

This is because power follows the following forumula:

P (Watts) = E I (Voltage X Current)

If either voltage or current is near zero then power will be near zero. PWM takes full advantage of this fact.
You might want to restate the formula in it's typical form with explaining beside it, like:
P=EI (or Power_in_Watts = Voltage * Current_in_Amperes )

PWM still maintains many of the characteristics of analog, in that there aren't any direct numbers associated with the digital signal. It is not generally meant to capture data.
Ahhh, this isn't quite the case. Take a look at the datasheet of a Microchip PIC that has a capture/compare/PWM (CCP) module, such as a PIC12F683, or better yet look at this Application Note:
http://www.microchip.com/stellent/idcplg?IdcService=SS_GET_PAGE&nodeId=1824&appnote=en011064

Or, if you want your PWM examples to be limited to use with such things as 555 timers and the like - you'll need to preface the discussion with it.

One of the parameters of any square wave is duty cycle. Most square waves are 50%, this is the norm when discussing them, but they don't have to be symmetrical. The ON time can be varied completely between signal being off to being fully on, 0% to 100%, and all ranges between.
Equate the ON time to "duty cycle percentage"

Shown below are examples of a 10%, 50%, and 90% duty cycle. While the frequency is the same for each, this is not a requirement.

Somewhere around here, you should touch on PRF vs PRT and their 1/= relationship.

The reason PWM is popular is simple, many loads, such as resistors, integrate the power into a number matching the percentage. Conversion into an analog value is automatic. LEDs are very nonlinear in their response to current, give an LED half its rated current you you still get more than half the light the LED can produce. With PWM the light level produced by the LED is very linear.
While LEDs are a workable example, an electric motor might be even better; as using PWM is more effective at controlling motor speed at low RPM than linear means.

PWM can be produced by using a sawtooth waveform and a comparator. As shown below the sawtooth (or triangle wave) need not be symmetrical, but linearity of the waveform is important. The frequency of the sawtooth waveform is the sampling rate for the signal.



Because there isn't any computation involved, PWM is fast. The limiting factor is the comparator's frequency response. In many cases this isn't an issue since many of the uses are fairly low speed.

Uses for PWM vary widely. It is the heart of Class D audio amplifiers, by increasing the voltages you increase the maximum output, and by selecting a frequency beyond human hearing (typically 24Khz) PWM can be used. The speakers do not respond to the high frequency, but duplicates the low frequency, which is the audio signal. Higher sampling rates can be used for even better fidelity.

You might want to reference Rod Elliot's page here: http://sound.westhost.com/articles/pwm.htm
Great intro to D-class amplifiers.

Another popular application is motor speed control. Motors as a class require extremely high currents to operate. Being able to vary their speed with PWM increases the efficiency of the total system.
Might want to change "extremely" to "very", or rephrase to something like "Motors as a class generally require high current to operate" - "extreme" is extremely overused nowadays by advertising types.... :rolleyes:

PWM is often used in conjunction with an H-Bridge. This configuration is so named because it resembles the letter H, and boosts the effective voltage of the power supply to double what it's actual rating is.
This is not correct. It doesn't "boost" the voltage, or "effective voltage" at all.
What it DOES do is allow either "end" of the load to be arbitrarily connected to +V, -V, or disconnected. This is different from connecting one end of the load to ground, and then driving the other end to +V and -V. The total differential achievable is thus nearly twice the supply rails, but it does not "boost" the rails.
In the case of inductive loads, such as motors, diodes are used to suppress inductive spikes, which may damage the transistors.



Switching Mode Power Supplies (SMPS) can also use PWM, although other methods also exist.
PWM with inductors is basically how most of them work!
Adding topologies that use the stored power in both inductors and capacitors after the main switching components can boost the efficiencies for these devices to be quite high, approaching 90% in some cases. Below is an example of such a configuration.

There are some switching supplies that exceed 97% efficiency.
 

Thread Starter

Wendy

Joined Mar 24, 2008
21,840
Thanks Wook.

Can't promise I'll use it all, but I use what I can. This is meant for the text book, some generalizations will have to do. It being paper we can't do some of the tricks we use with the forums, and I need to follow the conventions already set out.

I avoided discussing any particular technology (such as 555's), this is meant to introduce new students to the concept of PWM. I made sure to add the qualifier that PWM could be produced with a triangle wave, not that it was (implying it was the only technique).

Somewhere around here, you should touch on PRF vs PRT and their 1/= relationship.
Huh? You lost me there. If it is something that it needs added then I need to do some research. Hint please?

I've given the big four examples I'm aware of for PWM control, LEDs, Motors, Audio, and Voltage (or power). Did I miss anything?
 
Last edited:

beenthere

Joined Apr 20, 2004
15,808
Another question, Bill. Do you want to limit examples to analog PWM? If you want to touch on digital PWM, then this statement won't be true
Because there isn't any computation involved, PWM is fast. The limiting factor is the comparator's frequency response. In many cases this isn't an issue since many of the uses are fairly low speed
as computation will come into play.

I might expand on SgtWookie's suggestion
While LEDs are a workable example, an electric motor might be even better; as using PWM is more effective at controlling motor speed at low RPM than linear means.
thusly:

"While LEDs are a workable example, an electric motor might be even better; as using PWM is more effective at controlling motor speed at low RPM than linear means because the motor always receives full current and so does not lose torque."
 

Thread Starter

Wendy

Joined Mar 24, 2008
21,840
I was editing this while you made the post. Currently my blurb on motors reads,

Another popular application is motor speed control. Motors as a class require very high currents to operate. Being able to vary their speed with PWM increases the efficiency of the total system. PWM is more effective at controlling motor speeds at low RPM than linear methods.
Do you still think I need to change the paragraph about the LEDs?

I mean this as an honest question.

**************************

OK, I think I managed to fit the salient points in.

Harder than I thought it would be, my biases are showing. :D

Thank you both.
 
Last edited:

bertus

Joined Apr 5, 2008
19,947
Hello, Bill,


Shown below are examples of a 10%, 50%, and 90% duty cycle. While the frequency is the same for each, this is not a requirement.



The reason PWM is popular is simple. Many loads, such as resistors, integrate the power into a number matching the percentage. Conversion into an analog value is automatic. LEDs are very nonlinear in their response to current, give an LED half its rated current you you still get more than half the light the LED can produce. With PWM the light level produced by the LED is very linear. Motors, which will be covered later, are also very responsive to PWM.
Perhaps it is an idea to put the "effective" value in the drawing as a dotted line.

Uses for PWM vary widely. It is the heart of Class D audio amplifiers, by increasing the voltages you increase the maximum output, and by selecting a frequency beyond human hearing (typically 24Khz) PWM can be used. The speakers do not respond to the high frequency, but duplicates the low frequency, which is the audio signal. Higher sampling rates can be used for even better fidelity. 100Khz is not unheard of.

For class D amplifiers even higher frequencies are used.
I have seen designs with frequencies between 300 and 500 kHz.

Greetings,
Bertus
 

Thread Starter

Wendy

Joined Mar 24, 2008
21,840
Would this illustration be better?



I'm having a bit of trouble with my albums at the moment, but it so happens for this thread I used attachments. I could also merge the concepts, keep the size of the original and use the above.

Some of the pictures I've been pulling from my archives helping other people. I have a lot of pictures associated with my profile.
 

Thread Starter

Wendy

Joined Mar 24, 2008
21,840
Maybe something like this perhaps?

 
Last edited:

bertus

Joined Apr 5, 2008
19,947
Hello,

The shape does not really matter, as long as it shows the average value of the voltage or power.
The shape depends on the load and filtering.

Greetings,
Bertus
 

Thread Starter

Wendy

Joined Mar 24, 2008
21,840
OK, thanks. So far I've been able to use most of the ideas.

I have to say I didn't know as much as I thought I did. :rolleyes:

Then again, when I started this thread I hadn't planned on writing an article for the AAC ebook.

I figure I'll leave this up for another full week for review, then pack it for Dennis.
 

hgmjr

Joined Jan 28, 2005
9,029
Bill_M,

The reason PWM is popular is simple. Many loads, such as resistors, integrate the power into a number matching the percentage. Conversion into an analog value is automatic. LEDs are very nonlinear in their response to current, give an LED half its rated current you you still get more than half the light the LED can produce. With PWM the light level produced by the LED is very linear. Motors, which will be covered later, are also very responsive to PWM.
In the above paragraph, the sentence "Conversion into an analog value is automatic.", would it be clearer to say "Conversion back into its analog equivalent value is straightforward.".The word "automatic" infers little or no effort involved while the word "straightforward" conveys that such conversions, while feasible, entail some effort.

Sorry if this sounds a bit nit-picky.

hgmjr
 
Top