1. 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.
    Dismiss Notice

Suitable pwm frequency for motor control?

Discussion in 'Robotics & Mechatronics' started by shehry, Jan 1, 2006.

  1. shehry

    shehry New Member

    Joined:
    Mar 27, 2005
    Messages:
    22
    Likes:
    0
    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?
     
  2. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,330
    Likes:
    653
    Location:
    Derbyshire, UK
    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!.
     
  3. ivancho

    ivancho New Member

    Joined:
    Aug 20, 2003
    Messages:
    333
    Likes:
    0
    Location:
    Kansas
    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
     
  4. dave

    Dave New Member

    Joined:
    Jan 12, 1997
    Messages:
    -
    Likes:
    0


     
  5. mfaradays

    mfaradays New Member

    Joined:
    Oct 21, 2007
    Messages:
    1
    Likes:
    0

    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.
     
  6. therompalace

    therompalace New Member

    Joined:
    Jan 24, 2009
    Messages:
    2
    Likes:
    0
    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
     
  7. jpanhalt

    jpanhalt Well-Known Member Most Helpful Member

    Joined:
    Jun 21, 2006
    Messages:
    6,068
    Likes:
    523
    Location:
    Cleveland, OH, USA
    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
     
  8. therompalace

    therompalace New Member

    Joined:
    Jan 24, 2009
    Messages:
    2
    Likes:
    0
    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?
     
  9. Ubergeek63

    Ubergeek63 Well-Known Member

    Joined:
    Apr 16, 2008
    Messages:
    1,886
    Likes:
    37
    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
     
  10. duffy

    duffy New Member

    Joined:
    Dec 22, 2008
    Messages:
    2,618
    Likes:
    73
    Location:
    nortern 'sconsin
    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.
     
  11. blueroomelectronics

    blueroomelectronics Well-Known Member

    Joined:
    Jan 21, 2007
    Messages:
    12,536
    Likes:
    170
    Location:
    Toronto, Canada
    It depends on the motor but with the small Tamiya gearbox motors they seem to work best between 800Hz & 1.4kHz.
     
  12. Ubergeek63

    Ubergeek63 Well-Known Member

    Joined:
    Apr 16, 2008
    Messages:
    1,886
    Likes:
    37
    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
     
  13. duffy

    duffy New Member

    Joined:
    Dec 22, 2008
    Messages:
    2,618
    Likes:
    73
    Location:
    nortern 'sconsin
    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: Jan 27, 2009
  14. Ubergeek63

    Ubergeek63 Well-Known Member

    Joined:
    Apr 16, 2008
    Messages:
    1,886
    Likes:
    37
    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
     
  15. duffy

    duffy New Member

    Joined:
    Dec 22, 2008
    Messages:
    2,618
    Likes:
    73
    Location:
    nortern 'sconsin
    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.
     
  16. Ubergeek63

    Ubergeek63 Well-Known Member

    Joined:
    Apr 16, 2008
    Messages:
    1,886
    Likes:
    37
    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
     
  17. duffy

    duffy New Member

    Joined:
    Dec 22, 2008
    Messages:
    2,618
    Likes:
    73
    Location:
    nortern 'sconsin
    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.

    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.

    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.

    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: Jan 27, 2009
  18. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,330
    Likes:
    653
    Location:
    Derbyshire, UK
    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.
     
  19. Ubergeek63

    Ubergeek63 Well-Known Member

    Joined:
    Apr 16, 2008
    Messages:
    1,886
    Likes:
    37
    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
     
  20. Nigel Goodwin

    Nigel Goodwin Super Moderator Most Helpful Member

    Joined:
    Nov 17, 2003
    Messages:
    39,330
    Likes:
    653
    Location:
    Derbyshire, UK
    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.

    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.
     
  21. WestKite

    WestKite New Member

    Joined:
    Oct 26, 2009
    Messages:
    1
    Likes:
    0
    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
     

Share This Page