- #1
- 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:
After solving using an integrating factor, you get:
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:
So what's i(t)? if t = T, the integral only goes over one square pulse:
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:
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:
So...what do I do now? Ideally I'd like to get the result that i(t) is constant and equal to
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.
...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]
[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: