What passes as Pulse Width Modulation in DC Motor Control?

Jan 27, 2009 72 Replies

formatting link

MOSFETS! This is PWM controller with speed regulation and the better circuit for slow rotor speeds??

I'm probably wrong! :c)

You need to start with the basics first:

formatting link

If you don't understand what most of that stuff is in the first place then it can get confusing. It helps to understand the basic's before worrying about practical details.

No, it might be fine at slow speeds? I didn't see anything that showed other wise.

Slow speeds just me's low voltage or current to the motor.

Using PWM that means choosing a low duty cycle(so very low current actually gets through on average).

For the bjt circuit it means low average current.

Well, looks like it is the voltage that sets the motor current. Do you know anything about op amps? If not you should learn them before trying to learn something that uses them.

If you understand mosfets it should be pretty easy to see what's going on. (specially since most of the ideas are labeled)

I don't do motors but there may be insight for someone in my writing.

I have been working with PWM the past two months as a hobbyist using a PIC after this group SEB recommended the PIC approach. It is a simple device yet a marvelous compliment reflecting the genius of modern engineers. Many of my future projects will utilize the PIC now that I have passed through the learning curve.

PWM creates a controlled average voltage to a device by "varying the duty cycle" using any fixed frequency. What varies is how long the voltage is on. If you chose one hertz for the PWM frequency (which could be any freq depending on the app) and then you pulsed the PWM ON for 1/100th of a second then the load would get 1% of the available voltage/energy. If the pulse was ON for 99/100th of a second then OFF for 1/100th of a second then the load has 99% of the available voltage/energy.

This approach has advantages in that load gets good torque if needed with most of the energy to the device load and not lost like across a variable resistance.

This biggest advantage for "me" is PWM can be generated ideally by a Computer/PIC output. It transforms a dumb device/circuit into one that can monitor and correct for environmental changes. I use one diode and one capacitor on the output of the PWM to get a smooth +4v to +8v controlled voltage sweep. This drives a circuit that requires only one milliamp.

I have never worked in electronics so go easy gentlemen if some of my terminology is weak.

  • * * *

Christopher

Temecula CA.USA

formatting link

H -bridge is a *switch* arrangement.

Does not that imply PWM?

In the bjt circuit, is not the transistor acting as a kind of variable resistance? Therefore not PWM?

To answer my own question:

No, not necessarily. In this case H bridge is used simply to change motor direction, not as a switching element in PWM.

Circuit "not* PWM.

Okay, the only circuits I can find use tachometer control. I've not seen any PWM circuits that speed regulate using the monitoring of voltage across armature, or current through armature.

I stand corrected: I think this is one:

formatting link

Only one I seem to have found. I'll see if I can make it work with my 12v

2.5A DC brushed motor.

Now that it's all sorted out. Assuming a PWM 50% duty cycle, If I put an ampmeter in the positive lead from the battery and a second ampmeter in series with the motor, Will the two ampmeters read the same? Mike

Wow, you finally found a PWM motor, circuit.

btw, that's not reversing.. (regenerative).

formatting link
"

No. That may seem to be a little strange but it is true.

Lets take an example. We have an ideal motor (i.e. no resistance losses, etc.) which is being driven by an ideal PWM (i.e. a PWM with no losses). Also let us assume that the PWM is being powered by 20 volt DC supply and the PWM is switching the motor drive between 20 volts and 0 volts. And we are driving the motor with a 10% duty cycle and that the average motor current is 3 amps. We will also assume that the PWM frequency is high enough that there no significant changes in the motor speed and current during a cycle. (This is usually a reasonable assumption. PWMs are usually run at a high enough frequency to make this true. See below.)

The average voltage at the motor is 2 volts (20v times 10%). The power in the motor is 3 amps times 2 volts = 6 watts. Since there are no losses with our ideal motor and ideal PWM, then the power from the 20 volts power supply must also be 6 watts. The power from the supply is only provided while the PWM is turned on (i.e. during the 10% on part of the cycle). During the on part of the cycle we have to be providing 60 watts of power (6 watts / 10% = 60 watts). This means that we are getting 3 amps (60 watts divided by 20 volts during the 'on' cycle. (So in this sense the currents are equal since we are putting 3 amps into the motor and we are drawing 3 amps from the power supply during the 'on' cycle.) HOWEVER the ammeter connected to the power supply will indicate the average current from the supply. Since we are supply 3 amps for 10% of the cycle and

0 amps for 90% of the cycle, we will an average current of 0.3 amps.

So the average motor current will be 3 amps and the average power supply current will be 0.3 amps.

This leaves a few questions:

1) What is supplying the 3 amps of motor current during the 90% part of the duty cycle when the PWM circuit is 'off'?

The PWM is switching the drive between 20 volts and 0 volts. During the 'off' part of the cycle, the 3 amps is being pulled from the 0 volt side of the PWM (i.e. the motor is pulling current from the circuit ground).

2) Is the motor's current and speed really constant the entire PWM cycle?

In theory, no. There is always a small amount of speed and current ripple but the amount of ripple can be made very small by increasing the PWM frequency. Since we are assuming an ideal motor (i.e. no resistance losses) then our motor looks like it has a back EMF and a series inductance. the back EMF of the motor will be equal to the 2 volt average voltage at the motor. (A real motor with a non-zero winding resistance would have a lower back EMF since there would be some voltage drop across the winding resistance.)

During the 'on' part of the PWM cycle, there is an 18 volt difference (20 volt power supply versus a 2 volt back EMF) between the motor's back EMF and the power supply. This voltage difference will try to increase the current flowing into the motor. The inductance of the motor will limit the increase in current. But there is a small (usually very small) increase in current during the 'on' part of the cycle. This increased current will try to accelerate the motor. However the inertia of the motor and its connected load will oppose the acceleration but there will be a small change in speed.

During the 'off' part of the cycle, there is -2 volt difference between the motor's back EMF and the drive voltage from the PWM circuit. This -2 volts will try to decrease the motor current. The decrease in current will decrease the motor's torque and motor will start to slow down. Once again, the motor's inductance will oppose the change in the motor's current. The inertia of the motor and its connected load will oppose the change in speed. The rate of decrease in current speed will be 1/9 (18 volts version 2 volts) of the rate of increase in speed and current during the on part of the cycle but it also lasts 9 times as long. Thus the total increases and decreases will balance.

So there is some small changes in motor current and speed during the PWM's period. However if the PWM frequency is 100 kHz and the motor and its connected load weigh 10 pounds, the changes in speed will be very very small.

A couple of final notes:

Please note that PWM circuits are not magical, even though we are only drawing an average of 0.3 amps from the power supply, we are drawing

6 watts. This is the same 6 watts that is being provided by the motor to its load. We are not getting something for nothing.

In much of the previous analysis, it is very important that we are looking at a motor being driven by a PWM. If, instead of motor, we are driving a simple resistor, then the current through the resistor and the current from the power supply would be exactly the same. The resistor does not store any energy. However the motor stores energy in both its inductance and the inertia of the motor and its connected load.

Dan

My original spec was for a bi-directional, PWM, constant speed, and *not* to rely on a tachometer.

My motors seem to be designed for one direction only, so I'll ditch the bi-directional requirement.

It also may be that perhaps PWM might not be so critical for slow speed. I think I'll build two circuits:

formatting link

PWM, constant speed, no tachometer.

formatting link

Not PWM, consant speed, no tachometer. But it might be perfectly okay.

formatting link

I might even do this, just to mess with tachometer. But there will be plenty of other tachometer-based circuits.

But, in general I seem to have found it hard to discover a circuit that's PWM with constant speed control, that's *not* tachometer based.

Should have written:

PWM, constant speed, no tachometer:

formatting link

Not PWM, constant speed, no tachometer. But it might be perfectly okay:

formatting link

Not PWM, constant speed, bi-directional:

formatting link

I might even do this, just to mess with tachometer. But there will be plenty of other tachometer-based circuits:

formatting link

Although it's not easy to read the circuits. Designed that way I think.

formatting link

What does anyone think the reference input is meant to be here it is marked "Input voltage from computer"?

I don't understand why the input is meant to come from a computer.

Op amp "31" I take to be a differential amplifier.

Before I go any further is this correct?

I don't think there is any real definition that says PWM must us a rectangular pulse. This is just what is the easiest to use and hence most common. (hence it is almost the definition)

You can obviously do "PWM" with any function. Simply the time it is at low verses the time it is not gives the duty cycle and it will always be some fraction of the duty-cycle when compared to the function switching exactly between the low and hi state. But then any function can be considered PWM. (the point here is that the output is at some fraction of the input and that fraction depends on the ratio of the area to the total area)

The easiest way to do PWM with arbitrary function without being to ambiguous is to use periodic functions that are 0 after a portion of the period.

i.e., f(t)*H(d*P - t). No matter how crazy f(t) is, the time average is a fraction of d. This is because I clearly defined the off state but not the on state. With rectangular pulses both states are clearly defined so it is easy to define the duty cycle. (i.e., it is well defined too)

We can define the duty cycle as int(f(t),t=0..P)/(P*max(f(t))). It is ratio of the area of f(t) to the total area.

This holds for rectangular pulses and so is as generalization other functions. (you can see it is almost simply the time-average/max(f(t)))

exp(t) on [0,1] gives 1 - 1/e so we would say the duty cycle ~= 63%. This means the function would give the equivalent average output as a rectangular pulse with a duty cycle of 63%.

Another way to think about it that we set g(t) = f(t)/max(f(t)) then we compute the time-average and we call it's value a duty cycle. A rectangular pulse using that same vaule will also have the same duty cycle and same average output.

But does exp(t) seem like a "pulse". If so then the definition of duty cycle can be used but IMO it seems a bit ambiguous for such functions that don't clearly transition between the high and low state and are not off for a clearly defined portion of their period.

I guess the real problem is the definition of "pulse". What is it?

BTW, this says that for any arbitrary function we can just use rectuangular pulses using the appropriate duty cycle. So if you wanted to use your super duper f(t) I could just caclulate it using above(which is just calculating the time average after normalizing) and use rectangular pulses. I'd bet my circuit would out-perform yours in just about every way.

So if you find someone not using rectangular pulses you know somethings fishy.

Well, dog-gone they are different (no pun intended). I though they will surely be the same.

formatting link

formatting link

formatting link

Hi Dan, I new the answer, I just wanted to see the responses to the inquiry. It took me a while to get my head around it. When someone finally pointed out Power in = Power out. Duh! So if we have 20v battery pack flowing .3 amps that's 6 watts. If we have a 50% duty cycle the average voltage is 10 volts so the current must be .6amps. You described it well, especially where that current comes from. Thanks, Mike

Um that simply isn't true. It's not a transformer!

You cut the voltage down you cut the power!!

When you have a simple 2nd grade electronics circuit like

V --- Switch---Light----GND

And you flip the switch really fast does the light stay the brightness? (or approximately) Does the load change?(exclude temperature)

You have the same load but only power hookup up to it part of the time... how can you then have the same power as if it was always hooked up?

--- Not true, since lowering the voltage into the motor in order to reduce its speed will also lower its stall torque and cause excessive power dissipation and heating to occur if the lowered stall torque is exceeded.

PWM'ing the motor will cure that problem by allowing the higher stall torque available using the higher voltage while using the width of the pulse to determine how far the armature can travel in one PWM period.

That is, how fast it goes.

JF

You have just demonstrated that you know nothing of electricity and motors. Please study some, before you try to correct people. Or they will see you as a troll.

Join the Discussion

Have something to add? Share your thoughts — no account required.

Didn't find your answer?

Ask the community — no account required