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.
Allow me to offer information from my experience with motor PWM controls.

When powering small hobby motors (less than 1A or so), I've found that using lower frequencies (around 100Hz or so) is fairly effective in controlling motor speed. Using higher frequencies usually caused the motor to rotate either not at all, or too fast.

When powering larger motors, there was no noticeable difference between low (100Hz) and very high frequencies (50Khz). As stated in previous posts, frequencies greater than 20KHz or so are desirable since they reduce the irritating audible noise put off by the motors. There are other benefits of higher frequencies, including smaller components needed to reduce electrical noise.

In terms of power, every switch involves some losses. Higher frequencies mean more switches in any given period of time, and thus greater losses. There is a point at which the switching speed is slower than the PWM frequency (usually in the 100Khz + range, but can vary greatly), and the controller does nothing much but dissipate power. Therefor, if your controller works well at both 50Hz and 50Khz, you'll probably save battery power by running at 50Hz.


For your particular motor, WestKite, I think your best option depends on what you'll be using the motor for. From your post you say that a frequency of 400Hz results in visible pulses of the motor. This is expected, but will be more intense if the motor controller you use performs electrical braking (essentially shorting the motor terminals) during the off times of the PWM pulse. Without electrical braking, you might see a smoother motor speed - but you'll still need a over voltage protection diode in your circuit to prevent the voltage generated by the motor exceeding the ratings of your parts.

If the motor will drive a load with significant inertia (a heavy wheel, or a robot), you may be fine with the pulsed operation since it will become less noticeable with the larger load. I use a PWM frequency of 50Hz on a line following robot and don't notice any jumpiness in the operation due to the inertia of the robot tending to keep it moving at a constant speed.

As for the reduced usable duty cycle at higher frequencies, I've noticed this as well. I'm pretty sure it has a lot to do with the static friction of the motor being much higher than the dynamic friction: so the motor doesn't start going until significant voltage is applied, and then all of a sudden it goes fairly fast. I've seen this same result in many cheaper motors, especially the ones with plastic gearboxes. One solution to this problem is to purchase a more expensive motor with higher quality bearings. Or you might try one of those pancake motors with high torque and low max speed.

Finally, I find it interesting that the resulting torque is less at higher PWM frequencies. I suspect that either the transistors (or mosfets) used to switch the motor on and off are not switching fast enough, or that the circuit is performing electrical braking through lossy components. If you measure the voltage across the motor at full duty cycle (255 on your PWM), you should measure right around 12 volts. If you measure significantly less, then either your switching components are slow, or there is electrical braking occurring which is detrimental to the performance of the circuit. I can't really go into any more detail without assuming something about your actual schematic, so I'll leave it at that for now.

In short, 50Hz-20Khz should be fine for any smaller motor controller. At frequencies higher than 20Khz, you may start noticing switch turn on/off performance issues. To get switching frequencies of 100Khz +, motor controller designers have to do quite a bit of research into how to make their switches turn on and off fast enough to be effective.

Just ask if you think I can offer any more useful information. Thanks for reading!

- Xeno
 
hobbist PWM frequency datapoint for tamiya motor

Here is a datapoint on PWM frequencies to use with tamiya motors. I ran one of the motors from the Tamiya edge following robot kit at different PWM frequencies using an Arduino. The circuit was a single bipolar transistor driven through an opto-isolator. The motor had a flyback diode around it. Mechanically the motor has a worm gear that drives a spur gear and axle. The other end of the axle has 1/4 inch thick by 2 in diameter homemade wheel (i.e., not the best of conditions).

I used PWM frequencies of: 31.25, 500, 1k, and 32k Hz. The duty cycle was varied from 0 - 100% and 100 - 0% in steps of 10%.

The best motor response (motor voltage needed to turn wheel, and torque at low speed as measured by my finger - not too precise) and the most "ideal" oscilloscope waveforms came from the 32k Hz PWM frequency. Observing the waveforms from low to high frequency, they improved as I increased frequency. I might explore the gap between 1k and 32k Hz later, but I have moved on to a different issue.

I thought I would share my small bit of info.
 
you're reliving an old thread.
It's a topic that is still useful, why not revive it instead of creating new ones?

As a person who knows very little about this topic trying to learn from this thread I have to say it's very confusing. but that is understandable because it is not a simple subject.

I'm wondering if it even matters much with small brushed hobby motors, I've been playing around with them and it seems like most work in a very wide range. from the 10s of Hz to the ten thousands of kHz. It's only when I get into the extremely high frequency range (60kHz+) that the motor starts to just sit there. But I am using micro controllers and I just have it set to pulse high on one side and stay constantly low on the other, not this alternating to various degrees stuff, so maybe that is why. Without it going negative will Inductance even come into play? The potential across the motor in that case goes from (for example) 0 to 12 volts and back, never going negative. I can see it going either way as to if that causes the same problem or not.
 
So, here is the criteria you should use when selecting PWM frequency. This is an answer I gave in another similar thread:

The PWM frequency should be selected so that it does not create too much current ripple in the motor windings. Current ripple results in heating of the motor. If you know the terminal inductance L and the terminal resistance R of the motor, you can calculate the electrical time constant of the motor (t = L/R). With the time constant, t , calculated you should make the PWM frequency (much) higher than 1/t [Hz]. Good servomotors can have time constants as low as 50 to 150 microseconds, requiring PWM frequencies up to 40 kHz to 60 kHz.
 
But since were trying to reduce impedance isn't it a matter of balancing the reactance equation? In my (limited) understanding since Z(r) = R and Z(L) = jφL, isn't the only way to get the total lower to add in a calculated capacitance since Z(c) is 1/JφC. Or is impedance not what were talking about here?
 
motor inductance

Just 2 cents more in a $1,000,000 conversation. I think your getting there with the motor inductance. If you think about a single pulse of 5 usec at 20KHZ (10%) if the motor has much inductance (Let's say 1 MH and 5 ohms) the time constant is 200 usec. The torque is low. If the frequency is 200 HZ 10% is 500 usec. so full current is developed in a single pulse. I think this is why the little motors (lots of turns, low amps) like the low frequency while a big motor like an e-tek drive a lot of motor controllers into current limit on a single pulse (low inductance). I think I would use the highest frequency that gave me good low end torque. (the finger test)
 
Just to add my own 2p. I've spent the last week investigating the behaviour of a **broken link removed** and the Allegro **broken link removed** H-Bridge chip.

At 50% duty, varying the frequency from 10kHz to 80kHz doesn't seem to have much effect on the current drawn by the system, but it does reduce the peak-peak ripple current (red line).

However, at very low duty cycles, increasing the frequency does seem to reduce the motor speed. But looking at the waveforms shows why. The A-3950 includes a 600ns switch on time, and a 100ns switch off time. As the frequency increases, the enable pulse gets shorter, and when it approaches 650ns, the H-Bridge never turns on at all.

Also note that at 675ns, the shortest pulse which can enable the H-Bridge, the motor begins to rotate. So what duffy said about high frequencies is certainly not true for this particular motor. In fact, I have tried this motor with pure DC from a power supply, and it has superb low speed performance. I can ramp it up from very slow to very fast nice and smooth. Perhaps it's just that this is a very good quality motor, and duffy is using poor quality ones which benefit from the slight vibration caused by a 50Hz frequency.

In my experiments, I haven't found a reason to use lower frequencies, but higher frequencies seem to work a little bit nicer.

Hugo
 

Attachments

  • Ripple_current_vs_frequency.png
    Ripple_current_vs_frequency.png
    23.3 KB · Views: 896
  • Pulse_width_vs_gate_delay.png
    Pulse_width_vs_gate_delay.png
    16.6 KB · Views: 834
Good work Rocketmagnet! The selection of PWM frequency is always a compromise. Motors will run smoother and more efficiently with higher frequencies, but the control electronics are more efficient with lower frequencies. And at some point the control electronics stop working completely, as Rocketmagnet showed with his measurements.

Low quality dc-motors usually have high friction and therefore need a high current pulse to get started. That is why low frequency PWM seems to work better with some motors. Once you get the motor running it will perform well with higher frequency also.
 
Last edited:
Good work Rocketmagnet! The selection of PWM frequency is always a compromise. Motors will run smoother and more efficiently with higher frequencies, but the control electronics are more efficient with lower frequencies. And at some point the control electronics stop working completely, as Rocketmagnet showed with his measurements.

Low quality dc-motors usually have high friction and therefore need a high current pulse to get started. That is why low frequency PWM seems to work better with some motors. Once you get the motor running it will perform well with higher frequency also.

that is only true for simple sort of PWMs of the sort you see here using 555s and such.

you see the same effect if you try to start a motor on DC, on a 12V motor you might have to get up to 2V before it will start even though it will continue at 1V.

the motor voltage needs to be high enough to drive enough current through the amature resistance to overcome the motor friction. once it is running it needs to be high enough to over come the motor friction, BEMF, and load.

if your circuit commands BEMF while compensating for the power rail voltage and motor current it will not matter so much what type of motor you put in. that is still not a closed loop system in that it does not sense motor speed, it only compensates for supply voltage and motor current.

the motor current sense will up the applied voltage to "remove" the motor resistance from the equation. if you tell the circuit to supply 0.1V to a 10 ohm motor that requires 100mA to start, it will reach 1V and start since the one ohm needs 1V to draw the 100mA required to generate the torque to overcome the fiction. in reality you can not compensate it 100% since you will end up going full speed, this being positive feedback.

you can close the loop with either a speed sensor or motor voltage, though unless you are doing something critical you should not need to.

Dan
 
Last edited:
This thread is really old but wanted to post my experience. I used the max620 with external cap to get pwm voltage driving my h bridge. Few things I noticed playing with the inputs. I kept the supply steady at 5v and then varied pwm from function generator. It was really jumpy at 500 Hz but it ran much better at higher frequency, I liked 5 kHz. Then increase duty cycle (lowest 20% to 70%) and you can see increased in power. max620 is awesome to have.
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top