PWM Frequency for DC Motor Control
PWM Frequency for DC Motor Control
(OP)
I am programming a microcontroller to function as my PID control for a DC motor. The current is delivered via jfet stimulated by the microcontroller using PWM. I understand enough about PWM and dc motor control to make me a little dangerous. I know I need to set the period and duty cycle, but what I do not know and what I have not been able to find how to set them. That is, from what I can gather, the period is usually in the neighborhood of 0.5mS (2KHz). Ok, so outside of setting the motor up and running with that and a 50% duty cycle, is there some way to know if it will work ok, or is it a trial/error process?
I would thik that there shuld be some sort of guide for this. Does anyone have any advice/suggestions?
I would thik that there shuld be some sort of guide for this. Does anyone have any advice/suggestions?





RE: PWM Frequency for DC Motor Control
This is the resolution of your output control.
Until you can do this and get a varying output speed of your motor you can't even consider PID.
Keith Cress
Flamin Systems, Inc.- http://www.flaminsystems.com
RE: PWM Frequency for DC Motor Control
Is there no guideline by which I set the frequency and duty cycle or is it just trial and error?
In other words, is there no way of knowing BEFOREHAND what frequency and duty cycle I should use to drive a particular size motor?
RE: PWM Frequency for DC Motor Control
The PWM percentage translates to the average voltage you are presenting to your DC motor.
If it's a 12 V motor and you have 12 V supply, you should be able to apply 0%...100% duty cycle for full range speed regulation.
If it's a 12 V motor and you have 24 V supply, your DC would vary between 0%...50% for full control.
And so on.
2 kHz is not a bad choice, at higher frequencies with cheap "can" DC motors you get significant iron losses from my experience.
Benta.
RE: PWM Frequency for DC Motor Control
I have a 0.25HP DC bushed motor.
I want to drive this motor using a microcontroller.
The FLA of the motor will be about 4A @ 90V.
This is WAY too high to drive from the output of the microcontroller, so I want to use a JFET to drive it, but I also want to minimize energy consumption while maximizing efficiency.
I opt for PWM of the DC power.
Now, how do I choose the frequency for the PWM signal? Is this an arbitrary choice? Is there a formula based on motor size or dc voltage level?
Does this help you understand what I am really asking about?
RE: PWM Frequency for DC Motor Control
The r.p.m. of the motor is proportional to the voltage applied, in your case proportional to your duty cycle.
The current drawn by the motor is proportional to the torque needed by your load.
I don't see how you can talk about efficiency or reduction of energy consumption here, that's given by your mechanical requirements.
Benta.
RE: PWM Frequency for DC Motor Control
RE: PWM Frequency for DC Motor Control
----------------------------------
If we learn from our mistakes I'm getting a great education!
RE: PWM Frequency for DC Motor Control
I really had no idea this was so difficult a question.
I'll try this again and leav off the crap that does not really have ANYthing to do with the question I am asking.
I want to drive a dc motor with PMW. Is there a way to know what frequency I should use for the PWM signal with no trial and error?
In other words, is there a way to calculate the frequency that will work best given any a particular motor?
Again, what frequency should I use and why?
Lastly, I want to know how to determine the FREQUENCY of the PWM signal I should use for my motor.
RE: PWM Frequency for DC Motor Control
Pls try to reply yourself on following questions:
1. Do you want control of DC motor speed with/without speed sensor?
2. How do you to limit max motor current for acceleration/deceleration? How do current sensing?
3. What kind of PWM you plan to emplement - unipolar or bipolar?
Pay attention optimal PWM frequency is around 20 kHz - not 2kHz as posted above!
RE: PWM Frequency for DC Motor Control
RE: PWM Frequency for DC Motor Control
You posted it. What do you expect us to do with it except try to answer your poorly structured question?
Normally a DC motor works best on pure DC. Any AC component usually requires are derating of the motor, so the closer you can get to pure DC the better. Work out what gives the best result in your circuit. You've seen the circuit, we haven't so don't expect us to be able to comment on it.
I've never seen a rule-of-thumb that relates switching frequency to motor size or motor speed, motor construction, or anything else in any meaningful manner which could be loosely fitted to an equation. A higher PWM frequency will allow you to use a faster control loop if this is a servo application. A lower PWM frequency will reduce your switching losses, which are usually the dominant losses in a PWM design. It is a trade-off of one thing against another to optimise the design of your overall system for whatever application you're using it for. But that's a secret, isn't it?
----------------------------------
If we learn from our mistakes I'm getting a great education!
RE: PWM Frequency for DC Motor Control
You answered that. Faster is better, but it's a crap shoot.
Thanks.
Wow.
I feel like I've been running a marathon.
RE: PWM Frequency for DC Motor Control
"Fast enough" and you won't hear that typical electric wheel chair, whining noise.
Too fast and your switching element,(a MOSFET), will melt.
There is NO optimal size verse PWM frequency rule.
Keith Cress
Flamin Systems, Inc.- http://www.flaminsystems.com
RE: PWM Frequency for DC Motor Control
Read my post again - slower will almost certainly be cooler in operation and so implicitly slower will likely be be more efficient because the losses are lower. Faster offers possibilities for tighter control if the rest of the system is designed to take advantage of this.
----------------------------------
If we learn from our mistakes I'm getting a great education!
RE: PWM Frequency for DC Motor Control
The more L and the less R, the longer the time constant. There is also the question if this is a four quadrant, two quadrant or single quadrant application.
A single quadrant (one rotation direction and one torque direction) can, and should, use a free-wheeling diode.
Other applications can or can ot have them, depending on where you put them and if the it is speed or torque that changes direction.
Now, back to frequency. If this is an application with only one torque direction, you can use a rather high switching frequency since you do not have a lot of switching losses, thanks to the free-wheeling diode. And iron losses also stay rather low.
In an application where you need an H bridge, which seems unlikely in this case, you may need to think about cross-conduction and make sure your high and low transistors do not conduct overlapping. That reduces possible frequency to levels somewhere between 10 and 50 kHz, depending on transistor types and power levels. But, at those switching speeds, you need a fast micro to get the resolution you need.
That said, I would use your 2 kHz, which seems to be a good choice for a simple micro. That will give you enough resolution. But noise will probably be very irritating.
So, where does L/R time constant come into this? Simple, you probably want the torque ripple to be below a certain level. By making the switching period small compared to L/R, you can reduce torque ripple arbitrarily.
If there is a simple formula where you can plug in your parameters? Surely. One can set up all relationsships in the circuit and motor as a set of equations and solve for whatever is needed. But a little testing and some gut feeling works very well here.
Gunnar Englund
www.gke.org
--------------------------------------
100 % recycled posting: Electrons, ideas, finger-tips have been used over and over again...
RE: PWM Frequency for DC Motor Control
In my application where I was trying to control the current (to control the torque) of the dc motor, having a smooth current waveform was essential for servo control.
For instance, if your PWM frequency is lower than your motor electrical frequency (R/L), you won't get an average current that you are "expecting" for servo control: the inductance isn't big enough to filter out the PWM effects.
For my application, I found that:
Frequency PWM = 10 times R/L
The motor I used was R/L ~ 100 Hz; I endup up using a 5,000 Hz PWM. My application was for research/proof of concept, so I wasn't even considering the losses: just wanted to get my current control to work well ;)
Now, this was for my application. If you're not trying to control the motor current, having a smooth current waveform might not be as important, and the PWM losses might be more significant to consider. Like everything in engineering, it's a design trade-off.
RE: PWM Frequency for DC Motor Control