Maker Pro
Maker Pro

PWM

donkey

Feb 26, 2011
1,301
Joined
Feb 26, 2011
Messages
1,301
can anyone define pwm in a way that won't make my nose bleed?
if you can give an example too that would be awesome
 

donkey

Feb 26, 2011
1,301
Joined
Feb 26, 2011
Messages
1,301
so in essence its just giving less voltage to a device?
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,743
Joined
Nov 17, 2011
Messages
13,743
Yes - ans No.

The voltage is either 0 V or full scale. The average voltage (Vavg) is Vfullscale*DutyCycle where DutyCycle (short: DC) = ton/(ton+toff).

If DC=0, then the signal is constantly at 0V so Vavg = 0.
If DC=1, then the signal is constantly at Vfs, so Vavg = Vfs (Vfs = Vfullscale)
For any value of DC between 0 and 1 (other values are impossible!) the average voltage is proportional to the ducty cycle.
Consider, for example, a light bulb (tungsten type): If you switch it on and off in rapid succession, your eyes will be too slow to follow that switching. Instead you will perceive an average brightness. That is similar to the operation of a dimmer (which does essentially a kind of PWM for AC).

Note that PWM requires the circuit to be operated from it to have some inertia (liek the mechanical inertia of a motor or the optical inertia of the eye or the thermal inertia of a heater etc.). If you apply PWM to a circuit that operates on peak voltage (like a bridge rectifier with buffer capacitor), you will not achieve the averaging effect. In that case the circuit will detect tghe peak voltage (Vfs) and use it. E.g. the capacitor after the bridge rectifier will charge to Vfs during ton and will buffer the circuit behind during toff.

Harald
 

malikshahid06

May 26, 2012
4
Joined
May 26, 2012
Messages
4
i need the simulation circuit of pwm which generates 50hz ac output at 230volts from dc.......if any one can help me then plz contact me at [email protected]............i will be very thankful for a person who helps me in this regard..........it is very vital time for me
 

donkey

Feb 26, 2011
1,301
Joined
Feb 26, 2011
Messages
1,301
harald.... can you do me a favour and read my first post bout nose bleeds lol.
maliks thanks for the hijack lol

the reason i asked about pwm is arduino says it has pwm slots and that was suitable for driving motors forward/reverse and at different speeds. just trying to figure out why i would use a digital output for analogue control (analogue being stepping up voltage in this case)
 

timothy48342

Nov 28, 2011
218
Joined
Nov 28, 2011
Messages
218
malikshahid06,
230V at 50hz sounds just like the mains in some countries. Perhaps an invertor is what you need.
I don't think Pulse Width Modulation is the answer.
Please describe everything, but start a new thread with that.
Describe your DC source and describe how the output will be used.
Don't expect anyone to contact you directly. Just put all the information out there for everyone to see. (But in a new thread.)

donkey,
PWM is I think as Harold Kapp described. One key thing about it is that your not giving less voltage. Not at all. Instead your giving full voltage for less of the time.

Is your nose bleeding yet?

How about this for a very short definition for PWM:
Turning a circuit on and off very fast and by adjusting the length of the on time as opposed to the off time, controling (modulating) how much power or current is transfered.
-t
 

donkey

Feb 26, 2011
1,301
Joined
Feb 26, 2011
Messages
1,301
so n the case of an eletric motor it turns it on to get initial movement then off and on keeping the speed at a low rate right?
 

Rleo6965

Jan 22, 2012
585
Joined
Jan 22, 2012
Messages
585
In my understanding. Pulse With Modulation or PWM in power supply circuit. Inverter frequency must be 20khz or higher and high pulse width was variable to control the dc output of rectifier diode.
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
PWM without nosebleeds:

Problem: I want to supply half the power to my motor.

If I use a resistor to reduce the current, the resistor gets hot and power is wasted.

Solution: Turn the power on and off very quickly so that it is on half of the time.

Because the switch doesn't consume power when on or off, it doesn't waste power.

PWM = Turning the power on and off very quickly to simulate a lower average voltage (or current)
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,743
Joined
Nov 17, 2011
Messages
13,743
just trying to figure out why i would use a digital output for analogue control (analogue being stepping up voltage in this case)

Because it is difficult or comparatively expensive to realize a true analog output in a microcontroller. Analog circuits use different technologies than digital circuits.
But it is very easy to generate a "quasi-analog" signal using PWM.

Harald
 

CocaCola

Apr 7, 2012
3,635
Joined
Apr 7, 2012
Messages
3,635
If I use a resistor to reduce the current, the resistor gets hot and power is wasted.

And the motor might very well just sit there at idle as it might not get enough current to actually start turning...
 

(*steve*)

¡sǝpodᴉʇuɐ ǝɥʇ ɹɐǝɥd
Moderator
Jan 21, 2010
25,510
Joined
Jan 21, 2010
Messages
25,510
And the motor might very well just sit there at idle as it might not get enough current to actually start turning...

True.

However we could compare PWM and linear control like this:

Assume we have a potentiometer and a magic genie. The genie sits there observing the motor and controlling the potentiometer to achieve a desired outcome (speed, current, etc).

If we take that genie and move him over to where he controls the power switch (with no potentiometer), and he manipulates that in order to achieve the same outcome, he can do at least just as well, but he does so with less wastage of energy.

My apologies for having a male genie. But it stops your mind from wandering... :D
 

Harald Kapp

Moderator
Moderator
Nov 17, 2011
13,743
Joined
Nov 17, 2011
Messages
13,743
Since you mention the arduino, you're in a digital world. Here the PWM approach is definitely simpler, since PWM is digital, too. That is the reason why many microcontrollers have built-in PWM blocks.
For the arduino Google
arduino pwm
and one of the first hits is this: http://arduino.cc/it/Tutorial/PWM

If you want to go to and fro, a good controller uses an H-bridge like for example this one: http://bobblick.com/techref/projects/hbridge/hbridge.html
Using an H-bridge you can change the polarity to the motor's terminals, which allows you to control direction.
Controlling the H-bridge via PWM allows you to control the speed.

If you don't have to switch rapidly between forward and backward, you can substitute the H-bridge by a simple DPDT relay to control direction and a simple Transistor amplifier to control speed.

The BIG advantage of PWM over analog control (besides living in a digital world) is that you burn much less power in the controller/amplifier.
If the amplifier is off, I=0 and so P=0, too.
If the amplifier is on, V~0 (at least very small) and so P~0, too.
(I, V, P measured at the controller)
This is independent of the duty cycle of the PWM.
If you use an analog controller, the worst case is medium speed where V=1/2*Vmax and I=1/2*Imax which gives max. power loss at the controller (for other speeds either V or I decrease, thus P decreases, too).
I have simulated a very simple example:
attachment.php


Harald
 

Attachments

  • bla.gif
    bla.gif
    37.9 KB · Views: 164
Top