Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Suitable pwm frequency for motor control?

Status
Not open for further replies.

shehry

New Member
i was developing a motor control using pwm. and i have a 12V 6A DC motor. could anyone direct me as to what would be the appropriate pwm frequency?
 
shehry said:
i was developing a motor control using pwm. and i have a 12V 6A DC motor. could anyone direct me as to what would be the appropriate pwm frequency?

If you go too high then the inductance of the motor starts to have an effect, losing power and making the motor dissipate more heat - this isn't a good idea!. Going too low may make it jerky, so too low isn't good either.

I would suggest probably the low KHz range is a reasonable area, but you need to keep an ear open for audible effects from the motor - this is quite common in variable speed cordless drills!.
 
I have found that using a frequency between 10KHz and 15Khz has worked with most of my applications.

You can look on the internet for PWM frequencies and you might have a hard time finding a straight fits all rule of thumb. There is a lot going on with PWM that you might or might not want to know. My suggestion give it a try, start with the 10Khz and go up. Some people have used 30Khz, it all depends.

Make sure that you have those protective dioes, since they will be important. Check your IC to see if they are included internally otherwise make sure to have some fast switching diodes that handle the spikes.

Good Luck
 
When choosing your frequency, u must bear in mind that at some point in time u need to send 50% duty to stop. If your frequency is in the audiable range this is very irritating. So u need something above 18KHz atleat.
 
Hi,

I am newbie in electronics and I just had one question. I have a microcontroller and a motor controller for my task. Do the PWM frequencies need to match for both of them to get the correct results (i.e. - desired speed). In the datasheet for the motor controller, it gives me a upper bound on the PWM frequency (100kHz) but I don't see a way to set it to a certain frequency. I can configure the frequency on the microcontroller no problem, but I was wondering if that would be allright with the motor controller if I don't even tell it what frequency I'm using.

Thanks
 
What type of motor controller are you using? Are you generating the PWM with the MCU or is it generated by the motor controller. In the cases I have used, the PWM is generated by the MCU. The motor controller doesn't care what frequency it gets, so long as it is not too high.

Maybe you should start a new thread, too.

John
 
Hi John,

Sorry about the thread, if mods can move the these last 3 posts to a new thread, that'd be great. I didn't want to lose these posts.

Regarding the controller, yes, the PWM will be generated by a MCU (Microchip dsPIC33F to be exact, datasheet). The motor controller I'm thinking of is Toshiba’s TB6612FNG dual motor driver (datasheet).

What I'm wondering, for my own knowledge, is how does the motor controller "not care" what frequency it gets. Wouldn't the zero and full speed change based on the frequency?
 
If you go too high then the inductance of the motor starts to have an effect, losing power and making the motor dissipate more heat - this isn't a good idea!. Going too low may make it jerky, so too low isn't good either.

I would suggest probably the low KHz range is a reasonable area, but you need to keep an ear open for audible effects from the motor - this is quite common in variable speed cordless drills!.

Actually, motor controls rely on the motor inductance having an effect. We PWM at 18KHz to keep it out of the audible range. The higher frequencies cause more trouble because the power devices dissipate more.

The motor still sees DC current do to it's inductance, the problems are the inductive spike breaking down the insulation in high power motors and the switching pitting the bearings. Both of these effects are somewhat alleviated by design changes in "inverter duty" motors. They use beefier bearings and better insulation in the construction of these motors.

Dan
 
Those frequencies are way too high. Listen to your Makita cordless drill. Hear that 50-60hz hum? That's down where you want to run these things. You get better torque, and much better speed control. I started out with the higher frequencies, too, but after a lot of different controllers in a lot of different mechs, I've learned lower frequencies work better.
 
Those frequencies are way too high. Listen to your Makita cordless drill. Hear that 50-60hz hum? That's down where you want to run these things. You get better torque, and much better speed control. I started out with the higher frequencies, too, but after a lot of different controllers in a lot of different mechs, I've learned lower frequencies work better.
Not really, that is where it is cheapest to run them.

The fact is, a properly designed motor control act like a buck regulator with the motor inductance acting as the inductor running DC in the windings.

If what you are proposing were true there would be no industrial motor controls running at high audio frequencies, not to mention the 50-100KHz I see, and there would be no such thing as variable speed AC drives.

Dan
 
I've done quite a few motor control circuits, at both high and low frequencies, I don't champion the low frequency approach lightly.

I'm talking about DC brush type motors, the type OP is probably using.

A motor control circuit will act like a buck regulator and give you DC in the windings - but before you say that's the "proper" way to control it, try controlling motor speed with a DC power supply.

Go ahead, I'll wait.

...

See the problem? There's very little adjustment between "stall" and "too fast", particularly with a light or inertial load on the motor. The High-frequency PWM behaves the same way.

Now try the same test with a frequency around 60hz for a 12V, 6A motor like OP's (or 1khz for a small toy motor) using a variable PWM. You have a wide range of control over the speed. You can make it turn very SLOWLY, if you want. Try doing that at 18khz, or with DC.
 
Last edited:
I've done quite a few motor control circuits, at both high and low frequencies, I don't champion the low frequency approach lightly.

I'm talking about DC brush type motors, the type OP is probably using.

A motor control circuit will act like a buck regulator and give you DC in the windings - but before you say that's the "proper" way to control it, try controlling motor speed with a DC power supply.

Go ahead, I'll wait.

...

See the problem? There's very little adjustment between "stall" and "too fast", particularly with a light or inertial load on the motor. The High-frequency PWM behaves the same way.

Now try the same test with a frequency around 60hz for a 12V, 6A motor like OP's (or 1khz for a small toy motor) using a variable PWM. You have a wide range of control over the speed. You can make it turn very SLOWLY, if you want. Try doing that at 18khz, or with DC.
Could have fooled me. I design integral horsepower DC motor controls as part of my job.

You can talk about your hobbyist experiences all you want, I have a motor controller that runs a solid 36RPM on a 3600RPM motor driving capable of driving 25A at 30V into a 110V 38A motor.

As to your stall/too fast problem, it sounds like you are using an open loop PWM instead of a regulator. Ideal motor speed is directly proportional to motor voltage.

A fair approximation of a real motor would be a voltage source opposing the applied voltage with the armature resistance and load current source in series. The voltage source is proportional to speed, the current source is proportional to mechanical losses and load, and the resistance is the armature resistance. The sum is what you need to supply under any given load conditions.

To drive this mess you regulate the voltage applied to the motor, measure the current and compensate for the voltage drop it creates in the rotor resistance. In motor controllers the latter is called IR compensation and will have a trimmer to adjust so they will run a variety of motors properly.

Dan
 
I design motor controls as part of my job, too. I've used motor generator voltage to determine speed, motor current to sense load and stall conditions, designed dynamic and regenerative brakes, and written and tuned the associated PID loops for over twenty years now.

To drive this elegant control system, you adjust the frequency to the inertial mass of the rotor. This reduces overshoot with high torque loads at low RPM. When you get a little better with motor controls, you will discover what I'm talking about.
 
I design motor controls as part of my job, too. I've used motor generator voltage to determine speed, motor current to sense load and stall conditions, designed dynamic and regenerative brakes, and written and tuned the associated PID loops for over twenty years now.

To drive this elegant control system, you adjust the frequency to the inertial mass of the rotor. This reduces overshoot with high torque loads at low RPM. When you get a little better with motor controls, you will discover what I'm talking about.
Among the worst possible situations: extreme low speeds and overmax impulse loads. While it is a simple matter to make the system regenerative, we usually do not since it would require 4 $5 power components instead of 1 (thankfully we have located less expensive parts to use now)

PIDs border on useless before you take care of the known variables. You need to add in the IR compensation at the very least BEFORE the PID loop. It is also helpfull to sense and compensate for the power rail voltage before the PID.

The fact of the matter is that you can do a very stable accurate motor control with a simple voltage regulater chip with very few compensation difficulties at any frequency that you want to run it at. The problem is dropping pulses at high frequencies and low duty cycles. Even when the regulator is absolutely perfect you drop pulses due to the differing rise and fall delays in the power components resulting in oscilations as the control loop compensates for the lost PWM cycles.

The other thing that you seem to be missing is that higher frequency PWM motor drives ARE running DC current in the motor. The motor inductance keeps the current flowing when the switch is turned off. Unless there is a high speed diode across the motor or across every element in the bridge you WILL arc over something. Of course if you are using FETs you might be relying on the substrate diodes for this, and they should then be rated for use in this manner.

Dan
 
The other thing that you seem to be missing is that higher frequency PWM motor drives ARE running DC current in the motor.

I'm not missing this, I'm trying to tell you this is the problem. It's like trying to accurately control the motor speed by twisting the knob on a DC power supply, as I mentioned earlier. With the lower frequency you are dealing with something akin to inertia transfer in mechanical systems. With DC or high frequency AC it is more like trying to control the speed of a toy car by aiming a garden hose at it and adjusting the spigot - first it doesn't move, then it takes off like a shot.

Among the worst possible situations: extreme low speeds and overmax impulse loads.

I'm assuming you mean extreme low speed is the constraint and overmax impulse is the problem, I'm sure you don't think lowering the PWM rate affects the motor's top speed. The impulse is balanced against the rotor inertia. Obviously if the PWM speed is TOO low you will have an unwanted series of accelerations.

The problem is dropping pulses at high frequencies and low duty cycles. Even when the regulator is absolutely perfect you drop pulses due to the differing rise and fall delays in the power components resulting in oscilations as the control loop compensates for the lost PWM cycles.

Huh. Sounds more like a classic overshoot problem to me. Very common with high frequency motor drives. First it doesn't move, then it takes off like a shot, and the poor PWM drops pulses to try and compensate.

The motor inductance keeps the current flowing when the switch is turned off. Unless there is a high speed diode across the motor or across every element in the bridge you WILL arc over something.

Although basic EMF backspikes and freewheeling diodes are something any halfway decent engineer knows about, there's an element you failed to mention that really separates the men from the boys. Open up any good brush type motor made in the last ten years. See that little ring in there? The one the coils are soldered to? That's an MOV. It's in there to increase brush life. Kills the arc before it gets to the brushes.

Not that I would ever design a motor drive without backspike diodes, or trust the driver's substrate diodes to do the job.
 
Last edited:
As to your stall/too fast problem, it sounds like you are using an open loop PWM instead of a regulator. Ideal motor speed is directly proportional to motor voltage.

You've now totally changed the thread - we're all talking about PWM control, and you're talking about feedback control - this could explain why your point of view is totally different to everyone elses.
 
You've now totally changed the thread - we're all talking about PWM control, and you're talking about feedback control - this could explain why your point of view is totally different to everyone elses.
No it is still PWM. The only difference is that I am talking about closed loop PWM instead of open loop PWM.

BTW a PID loop IS a closed loop PWM system. What I have been saying is that you can not expect good speed control with out closing the loop and you can not expect any position control with out closing the loop on a BDC motor.

Dan
 
No it is still PWM. The only difference is that I am talking about closed loop PWM instead of open loop PWM.

Which is completely different to the point of this thread, a fact you never made clear - and means your comments about 100KHz whatever don't apply.

BTW a PID loop IS a closed loop PWM system. What I have been saying is that you can not expect good speed control with out closing the loop and you can not expect any position control with out closing the loop on a BDC motor.

Well I wouldn't say PID has to be PWM at all, but it is a closed system (obviously), regardless of it been PWM or analogue.
 
I don't hope that this thread is dead.

I still don't understand how to select the "right" PWM frequency for a brushed DC motor.

I have made some measuremens and the torque is increasing with lowering the PWM frequency. And I can also use a larger range (duty cycle) at lower frequency.
At 400 Hz
The range is 30-254. (0 is equal to 0Volt, 255 is equal to 12Volt)

At 3000Hz
The range is 50-254.

At 33KHz
The range is 130-254.

The motor also runs faster at lower PWM frequencies.

So which frequency should I chose?

The lower end close to the 300-400Hz range is not good the chosen motor. The rpm is not constant. Like you can see the frequency in the turns.
All frequencies below 20kHz are not ideal eighter, do my ears... :)
The loss of torque at high frequencies are for sure neighter a good idea.

Is profs. drives using variable PWM frequency or how do they do it?

Hope that someones can help me.

Thanks
Thomas
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top