PWM Duty Cycle: Motor Speed Control Explained

In summary: But in fact, if you look at a light bulb in person, you'll see that it gradually brightens up again as you turn it off and on. This is because the light is being "smoothed" by the effects of the photons being randomly scattered.
  • #1
cepheid
Staff Emeritus
Science Advisor
Gold Member
5,199
38
I recently encountered (not for the first time) a situation in which a PWM output from a microcontroller is sent to a MOSFET bridge that drives a motor (a very high current, inductive load). I started to wonder exactly WHY it is that the duty cycle of the PWM controls the motor speed. I know that the average of the waveform is proportional to the duty cycle, but it seemed strange that the load would behave as though it were being exposed to the average voltage when in fact it was effectively being exposed to a rapidly time-varying one. Then I read something that hinted that the inductive load was somehow providing a smoothing effect. I figured that if I could just solve the system and figure out the current through the motor as a function of time, I'd be set. After all...

...presumably the current through the motor is proportional to its speed (if somebody knows otherwise, please let me know!)...

...so I modeled the system as a series RL circuit with a square wave voltage source v(t) (is this reasonable?)

I set up the typical DE:

[tex] v(t) = i(t)R + L\frac{di(t)}{dt} [/tex]​

After solving using an integrating factor, you get:

[tex] i(t) = \frac{e^{-\frac{R}{L}t}}{L}\int_0^t e^{\frac{R}{L}\tau} v(\tau)\, d\tau [/tex]​

I guess we can define the square wave piecewise, letting it have period T and duty cycle D where D is a number between 0 and 1 telling you for what fraction of the period it's high:

[tex] v(t) = V_{max}, \ \ \ \ 0 \leq t \leq DT [/tex]
[tex] v(t) = 0, \ \ \ \ DT \leq t \leq T [/tex]
[tex] v(t+T) = v(t) [/tex]​

So what's i(t)? if t = T, the integral only goes over one square pulse:

[tex] i(T) = \frac{e^{-\frac{R}{L}T}}{L}\int_0^{DT} V_{max} e^{\frac{R}{L}\tau} \, d\tau[/tex]​

Now it took me a while, but I finally figured that at some *arbitrary* time t, the integral will have gone over n square pulses where:

[tex] n = \left \lceil \frac{t}{T} \right\rceil [/tex]​

That's all well and good, but I don't know how to calculate that to get some sensible result for i(t). The integral works out to:

[tex] i(t) = n\frac{e^{-\frac{R}{L}t}}{R}V_{max} e^{\frac{R}{L}DT} [/tex]​

So...what do I do now? Ideally I'd like to get the result that i(t) is constant and equal to

[tex] D\frac{V_{max}}{R}[/tex]​

That would be *awesome*, because it would mean that the current is a fraction of the max that could be drawn, the fraction being determined by the duty cycle, and everything would make sense. But I don't know how to get there.

1. Does anybody know how to solve this math problem?

2. Am I thinking about this in the right way? Because I can't think of any other way that "PWM duty cycle controls motor speed" remotely makes any sort of sense.
 
Last edited:
Engineering news on Phys.org
  • #2
Something just struck me when I was considering a simpler example (a PWM light dimmer)

https://www.physicsforums.com/showthread.php?t=268283

Does this work as a good qualitative explanation for the *motor* as well? Still, it doesn't quite cut it. In the lightbulb, it doesn't matter that the current drops to zero during the off portion of the cycle, because we can't perceive it. Or maybe it doesn't drop to zero, due to back emf...in which case we're back to where we started...trying to solve for i(t) to figure out exactly what happens! Can somebody help me do the math?
 
  • #3
...so I modeled the system as a series RL circuit with a square wave voltage source v(t) (is this reasonable?)
I'm no expert but I think you will need to model using a Fourier integral. Since a pulse v(t) is the sum of all frequencies each having their own phase.
 
  • #4
cepheid said:
Something just struck me when I was considering a simpler example (a PWM light dimmer)

https://www.physicsforums.com/showthread.php?t=268283

Does this work as a good qualitative explanation for the *motor* as well? Still, it doesn't quite cut it. In the lightbulb, it doesn't matter that the current drops to zero during the off portion of the cycle, because we can't perceive it. Or maybe it doesn't drop to zero, due to back emf...in which case we're back to where we started...trying to solve for i(t) to figure out exactly what happens! Can somebody help me do the math?

I won't address the mathematical points of this discussion, but as for the qualitative hand-wavy arguments, well...

In the case of a motor driver driving a motor, the motor (and wheel, and robot / car, etc.) all have a certain (rotational) inertia. If the motor driver frequency were low enough, you would see the motor stop and go in jerky motions. But go above this critical frequency, and only smooth motion results.

In the case of an (incandescent) light, if you assume that the number of photons emitted might be high or zero (in reality, you receive a portion of the sine waveform), but you receive some total number of photons at your eyes every 1/30 of a second or so--roughly the upper limit of your eyes' 'sampling frequency'. As a result, you see the average of the intensity. For all of us, 50/60 Hz AC driven incandescent lights look continuous, despite a zero crossing 120 times a second--this might be due to the incandescent lights' inductance--but someone else would have to confirm that. Fluorescent lights are able to respond fast enough that they do flicker at 100/120 Hz. For most of us, this is imperceptible, but I know people who are driven crazy by fluorescents because they're able to see this constant flickering--or some beat frequency, at least.

If you're familiar with communications and the Nyquist theorem, these are both sort of physical manifestations of that.
 
  • #5
MATLABdude said:
In the case of a motor driver driving a motor, the motor (and wheel, and robot / car, etc.) all have a certain (rotational) inertia. If the motor driver frequency were low enough, you would see the motor stop and go in jerky motions. But go above this critical frequency, and only smooth motion results.

Yeah, that's a really good point, and I can't believe I didn't think of it. For this reason, the steadiness of i(t) doesn't matter quite as much, and so I've abandoned the mathematical analysis (I have other things to do).


MATLABdude said:
If you're familiar with communications and the Nyquist theorem, these are both sort of physical manifestations of that.

Yes I am, and we have since discussed this further in the other thread as well. Thank you very much for your remarks!
 
  • #6
Energy=power X time In a pulse width modulation circuit, you are not varying the power put into a load, that stays the same, but you are varying the time it is applied to it, thus varying the total energy delivered.
 
  • #7
famousken said:
Energy=power X time In a pulse width modulation circuit, you are not varying the power put into a load, that stays the same, but you are varying the time it is applied to it, thus varying the total energy delivered.

You can't really change one without changing the other in this case. Average the power and it certainly changes with duty cycle.
 
  • #8
average, yes, which is factors time into the equation.
 

FAQ: PWM Duty Cycle: Motor Speed Control Explained

What is PWM duty cycle?

PWM duty cycle refers to the percentage of time that a pulse width modulation (PWM) signal is in the "on" state compared to the "off" state. It is used to control the speed of a motor by adjusting the amount of power delivered to it.

How does PWM duty cycle affect motor speed?

The duty cycle directly affects the average power delivered to the motor. A higher duty cycle means more power is delivered, resulting in a faster motor speed. Conversely, a lower duty cycle results in less power delivered and a slower motor speed.

What is the range of duty cycle for motor speed control?

The duty cycle range for motor speed control typically varies between 0% and 100%, with 0% representing no power delivered and 100% representing full power delivered. However, the specific range may vary depending on the motor and its intended use.

Can PWM duty cycle be used to control motor direction?

Yes, PWM duty cycle can be used to control motor direction by using an H-bridge circuit. By adjusting the duty cycle in one direction, the motor will rotate in one direction, and by adjusting it in the opposite direction, the motor will rotate in the other direction.

What are the advantages of using PWM duty cycle for motor speed control?

Using PWM duty cycle for motor speed control allows for precise and efficient control of motor speed. It also allows for speed adjustments without the need for additional hardware, such as gears or belts. Additionally, PWM duty cycle control can help reduce motor wear and tear, as it reduces the amount of heat and stress on the motor.

Similar threads

Replies
1
Views
833
Replies
13
Views
683
Replies
23
Views
3K
Replies
11
Views
1K
Replies
1
Views
977
Replies
14
Views
3K
Replies
17
Views
2K
Back
Top