# Understanding signals in PWM

#### JonnyDriller

Apr 6, 2020
9
Guys I've been researching SPWM for several hours. I know it's a technique used to convert DC to AC. I know how it works using the little square waves in graph B to produce an average Sine wave.
Now it's these saw tooth signals that are confusing me.
Either they're another way to display the square waves
Or
More likely if I understand correctly it's some method used to correct harmonics in the output?

#### Harald Kapp

##### Moderator
Moderator
Nov 17, 2011
12,890
More likely if I understand correctly it's some method used to correct harmonics in the output?
Definitely not. PWM creates harmonics, it does not reduce them.
Where is the image from? Where that image comes from you should find an accompanying text that explains the graphs. I suppose that the image shows the result of low pass filtering the different pulsed of triangular waveforms. The low pass filter is what removes the harmonics, leaving the fundamental sine wave.

#### Audioguru

Sep 24, 2016
3,650
Your signals are not Pulse Width Modulation because all your pulses have the same width. Instead it is Pulse Position Modulation but as shown in the datasheet of an LM555.

Moderator
Nov 8, 2019
2,792

#### Attachments

• SPWM_etc.pdf
326.6 KB · Views: 3

#### JonnyDriller

Apr 6, 2020
9
Thanks guys I get the principal of how this works. This diagram I got from google images. See to my understanding you should do the square wave pulses. And out should come the sinusodial wave. But every diagram I look at has these saw tooth images as well. What is their purpose? Is it just another way to display the square waves

#### Audioguru

Sep 24, 2016
3,650
A PWM sinewave is made by using a comparator with a triangle wave as the high frequency carrier frequency and a pure sinewave as the modulation frequency. Then the output of the comparator has pulses with widths according to the comparison.

PWM has square waves only when the modulation is 50%. The pulses are rectangular with equal amplitude but the widths of the pulses vary according to the modulation.

#### Nanren888

Nov 8, 2015
623
Not really an expert at this S-version PWM, but one thing the pulse width modulator must do is decide when to turn on and when to turn off, or when should be high and when should be low.
Usually pulses have a fixed frequency and one controlls the width, the time the pulse spends high and low.
Each pulse, being fixed height corresponds to energy proportional to its width,, each delivering a packet of energy, proportional to the width of that pulse.

So this is linear with width,
The sides oof a triangle, or one-sided sawtooth, are linear with time.
So if we draw the sinusoid that we want and draw also a trinagle wave, or one-sided sawtoth, where the width, period of the saw tooth is the same as the maximum pulse width, the time the sawtooth is above the sinusoid tells us when it would be too high. The time below the sine tells us when is is lower than needed.
That is the time that triangle signal the crosses to above the sine signal is the time to switch the drive, pulse off.
.
I'll try to post the figure in the document posted by bertus.

Or if you prefer from
https://electronics.stackexchange.com/questions/214902/pwm-frequency-and-lc-filter

Obviously, the resultant is only sinusoidal in some average sense. As basically a series of squange pulses, there are a lot of harmonics. Smoothing can follow, or be done as part of the load.
Moving the pulses round, or subtly changing their position can change the harmonic content. Sometime harmonic content is important.

Last edited:

#### Audioguru

Sep 24, 2016
3,650
Usually the carrier triangle wave frequency is much higher than the sinewave modulation frequency.

#### JonnyDriller

Apr 6, 2020
9
Thanks guys... I need to study some of these terminologies you have up here. I'm studying another module atm so I might return to this later. Ty

Replies
5
Views
944
Replies
2
Views
323
Replies
6
Views
882
Replies
5
Views
944
Replies
5
Views
827