## How PWM works?

Interested in Robotics? Here's the place to be.
cato
Posts: 366
Joined: Sun Sep 07, 2003 1:01 am
Contact:

### Re: How PWM works?

How about this. <p>In your simulation, replace the inductor with a wire. Does the current wave form stay the same? <p>I'm pretty sure that the slightly rippled DC current you have now, will become a square wave in phase with the voltage pulses that are your input. I believe that is pretty strong evidence that the inductive reactance of the coil is providing low pass filtering. With the coil, the current doesn't go as high as it does with the wire, nor does it go as low. The coil is impeding the change in current flow.

Ron H
Posts: 360
Joined: Tue Dec 18, 2001 1:01 am
Location: Boise, ID
Contact:

### Re: How PWM works?

Here is a recent picture of me.

Isenbergdoug
Posts: 31
Joined: Sat Dec 15, 2001 1:01 am
Location: N.C.
Contact:

### Re: How PWM works?

Sunil, the physics is perhaps less important than the concept and idea. By varying the duty cycle, the time averaged amplitude is changed. Regardless of what is on the other end, if an o-scope is connected to a wire and a square wave is seen on the screen with a duty cycle of 50% with 5 V pk-pk, then the time average of that signal is going to be 2.5 V "virtual DC". It is not really DC, but mathematically the signal averages out to be DC over a period of time.

If anybody wants to solve this problem by hand,
the differential equation describing a DC motor is
Vt=RaIa+La(di/dt)+k(phi)w<p>where phi=magnetic flux
Vt=supply voltage i.e. (from PWM driven source)
and w=angular velocity
the last term in the equation is the back emf, which I don't recall being mentioned yet which will depend on speed, which will depend on PWM. It's a fairly complex problem.<p>It has been a while since I have had differential equations in school, so I'm not going to do it, but one could find the Fourier Series of the PWM wave for a given duty cycle, solve the DE for each component of the FS (enough times to find a pattern) which can then be summed again, and then repeat for another duty cycle. This would be assuming that the motor driver exibits 0 output resistance and is able to deliver the exact PWM wave form to the motor. I suppose that this would be the "physics" of PWM. Ignoring back emf would make this easier but not as accurate. <p>This may be a little off the subject, bit when driving low resistance loads, one must consider the output resistance of the driver in simulation and analysis. For example if the output resistance is .5 ohms, and the motor resistance is .5 ohms, then only half the voltage is going to the motor. This is mandatory to get an acurate hand analysis, but I am sure that good software like pspice would take care of it in a PC simulation.

MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

### Re: How PWM works?

Hello again,<p>Ron:
Hee hee, funny pic there.<p>
Isenbergdoug:
Yes the resistance of the source would have to be
considered in any practical application. I was
mainly talking theory though and assumed any
practical considerations would come later.<p>
cato:
You're right when you say the inductor acts to
impede any change in the current through it,
however the dc component doesnt CHANGE.
I never said this doesnt act as a low pass filter,
because it does, but a low pass filter does just
that: it passes low frequencies unchanged while
greatly affecting higher frequencies. Since dc
is as low as you can get, it passes unchanged.
We already know how to find the dc part of the
pulsing wave, so we immediately know the output
because the inductor acts like a wire for dc.
Note that it will still act on the ac components
and affects them according to their frequencies.<p>Here's a short table of output amplitudes for
our circuit looking at it as a low pass filter,
where the output is the voltage across the resistor.<p>The following table shows frequencies
followed by the peak amplitude of the
ac output voltage using a 5v peak ac
input wave at the given frequency.<p>100000 Hz, 0.0007958 v
010000 Hz, 0.007958 v
001000 Hz, 0.07957 v
000100 Hz, 0.7859 v
000010 Hz, 4.234 v
000001 Hz, 4.99 v
0000.1 Hz, 5 v <p>Note that at high frequencies, the output
is very small, but at very low frequencies
the input passes to the output unchanged.
The dc component is as low as you can get
and so passes without any change at all.<p>If you replace the inductor with a wire
you see the complete square wave across
the resistor rather then a sawtooth, but
the dc component is still Vp*D. It doesnt
matter that the wave is a square wave
because we know how to compute the average
dc of a square wave. Also, the ac components
dont add to the dc component in any way because
their average is zero.<p>
Take care,
Al
LEDs vs Bulbs, LEDs are winning.

Will
Posts: 310
Joined: Tue Feb 11, 2003 1:01 am
Location: Katy Texas
Contact:

### Re: How PWM works?

This is good stuff Mr Al but sometimes your terminology seems, perhaps, a little mis-applied. For starters, the DC does not pass through unchanged as you say, it's wavefront (Theroetically a square wave, is altered by the series inductance, both of the circuit inductance and that of the motor windings. DC only passes through an inductance 'unchanged' after the end of several time constant periods I.e. 5 for with 1%) - but it cannot do that in this case because it is continuously switched OFF by the PWN. What really changes with the inductances is that whereas if you had a pure square wave working into a pure resistor then the DC (Voltage - ignoring real losses) component i.e. the mean of the square pulses would be exactly 50% of the applied voltage irrespective of the frequency. With inductance in circuit with consequent modification of both leading and trailing edges of the square waves then the average, or mean DC current or voltage will be diminished below 50% by some value dependent upon the square wave frequency and/or the ratio of the PWM switching frequency to the inductive reactance time constant.
Still having fun
BB

MrAl
Posts: 3862
Joined: Fri Jan 11, 2002 1:01 am
Location: NewJersey
Contact:

### Re: How PWM works?

Hello there Will,<p>You bring up some good points as others did, which i would like
Since there has been some disagreement about what the inductor
does or doesnt do when pulsed with a rectangular wave, i decided
to actually calculate the output values using all three methods
and record the results. I've presented these results in the
form of the table below.<p>
You'll notice that in a previous post i mentioned that fact that
you have to wait 10 time constants before you start to measure the
average dc value. The input average dc occurs as a step voltage, not
a square wave, but i think that's maybe what you meant anyway For these tables i waited a full one-half second to make sure
the response had stabilized.<p>The following analysis table is obtained by
pulsing the series inductor-resistor circuit with a 10v
pulse of varying duty cycle. The input voltage is the
pulse waveform and the output voltage is measured
across the resistor. The inductance is 10mH and the
resistance is 10 ohms, the frequency 1kHz, although
several frequencies showed the same results. The duty
cycle varies from 25% to 75%. The average dc of the
input wave is recorded, and the average dc of the output
voltage is recorded for each of three different methods
of obtaining the output dc average voltage.<p>
The following table shows the duty cycle D followed by:<p>PIWA=input, average dc voltage of the Pulsed Input Wave
LMA=output, average dc voltage using the Laplace Method
RAA=output, average dc voltage using the Recursive Method
CSA=output, average dc voltage using the Circuit Simulator program<p>
TABLE
-----------------------------------------------------------
D=25%, PIWA=2.5v, LMA=2.5v, RAA=2.5v, CSA=2.5v<p>D=50%, PIWA=5.0v, LMA=5.0v, RAA=5.0v, CSA=5.0v<p>D=75%, PIWA=7.5v, LMA=7.5v, RAA=7.5v, CSA=7.5v
-----------------------------------------------------------<p>
Notice that not one, not two, but THREE entirely different
methods were used to obtain the average dc output voltage
across the resistor, and they all agree.<p>The only conclusion must be:<p>THE AVERAGE DC OF THE PULSED WAVE PASSES UNCHANGED THOUGH THE INDUCTOR
TO THE OUTPUT INDEPENDENT OF DUTY CYCLE OR FREQUENCY.<p>
If anyone would like to repeat this in a circuit analysis program,
connect a pulse source to a series inductor/resistor and look at
the average voltage across the resistor after 1/2 second had passed.
Compare this to the input voltage peak and duty cycle.<p>The relationship is<p>VdcOut=Vp*D<p>as before.<p>Another argument could be:
Output power is related to the average
dc value with a smooth dc voltage.
If the average dc output was different then the
input there would have to be energy either lost
or gained in the inductor. The inductor only
stores energy--the ideal inductor doesnt
create or dissipate energy.<p>Take care,
Al
LEDs vs Bulbs, LEDs are winning.

dyarker
Posts: 1721
Joined: Fri Aug 22, 2003 1:01 am
Location: Izmir, Turkiye; from Rochester, NY
Contact:

### Re: How PWM works?

My college time on this subject is too rusty to speak with authority, so I only watched this thread. But it triggered a question. Because this thread is two pages, I started a new thread to ask the question (More?? - How PWM Works?).
Dale Y

### Who is online

Users browsing this forum: No registered users and 1 guest