Motor Current Control
James Newman
Posts: 133
Let's say we have a motor being controlled by a switching device, and we want to control the current to it by varying a pwm duty cycle. If we're using a 20khz or so pwm frequency, what speed of a adc would we want? I'd like to not only be able to set the current, but also display it. Would a 20k sample/second adc be the most I could control anyway since beyond that is beyond my switching freq?
Comments
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
- Stephen
Edit: I found the following·at ·http://www.picotech.com/applications/pwm_drivers/·but·the author·doesn't sound very authoritative in the article. He can't even find web links in section 5...
"The best switching conditions are when the switch frequency is much higher than the dynamics of the motor. The motor should “think” that it is powered from a true DC voltage. Due to different references the frequency must be at least 5 times higher than the rotation speed of the motor. I.e. if the motor rotates at 6000 rpm (100 rps) the frequency must be higher than 5 * 100 Hz = 500 Hz. A theoretically better explanation is that switching frequency must be much higher than 1/Ta where Ta = L/R is the electric time constant of the motor. Here L is the inductance and R the inner resistance of the motor. For a typical DC motor (200 W, 24 V) L = 1 mH and R = 0.5 Ohm. This again means that the frequency must be much higher than 1/Ta = R/L = 0.5 / 0.001 Hz = 500 Hz. Usually a frequency around 20 kHz is used. This also avoids noise from the motor in the audio range."
If that's true, why do RC servos still use 50 hz? Simple tradition and backwards compatability?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."
Post Edited (erco) : 3/24/2010 4:54:06 AM GMT
Inside the servo is the circuit to control the motor. The 50hz pulse stream is only telling the servo where it "should" be.
Rich H
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
The Simple Servo Tester, a kit from Gadget Gangster.
Basically to reduce audible noise...
Technically a motor can be modeled as a low pass filter, so the higher frequencies would make sense. The filter components being the inductor (motor coils) and a capacitor (mechanical spinning motion of the motor). The difficulty is that the L and C value would vary greatly depending on the speed of the motor. So setting a very high frequency sets an upper envelope that encompasses any motor variations that would be present.
For another effective method of reducing noise, it helps to know the architecture of the motor as far as how many poles there are. Using a tachometer or feedback of some kind to determine the motor speed and dynamically adjusting the frequency so that it matches the number of poles times the speed or a multiple of that, you can very effectively obscure any audible motor whining noise within the normal audible range of the motor without needing the higher frequencies mentioned above.
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
Beau Schwabe
IC Layout Engineer
Parallax, Inc.
RC servos use 50 Hz (20 ms) pulses for signaling only. That's not the same PWM that actually drives the motor. Those pulses will be at a much higher frequency, as determined by the internal controller chip.
-Phil
@Phil, do you know the typical PWM freqs going into the servo's DC motor?
▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔▔
·"If you build it, they will come."
Don't really have any real restrictions at the moment as I'm brainstorming.
I mentioned 20khz as the switching speed because I figure that the fastest I can decide to throttle current to the motor is dependent on my switching speed. I may go with some completely different value later, but I wanted to have a hard number in here incase anyone used it as a basis for some calculation/explanation. I further said 20khz because it's a common motor switching frequency as its just barely out of human hearing range.
I don't really care about the display update frequency... it's going to be insanely slow (and filtered) compared to everything else... ever seen a digital display that updates really fast? mightaswell replace the least significant digits with 8s...
I would have figured that the motor would do a pretty good job of filtering the current seen by a current sense resistor? Guess I need to take a look at that.
So... really I guess my question is if a sample rate above or equal to the switching frequency will be as adequate as I will ever need?
Stop sidetracking! >.>