Are motor speeds proportional to PWM value?

Hi everyone,
I apologize in advance if I ask(ed) a stupid question. I’m a software person, so sometimes I don’t know what I’m talking about.

My question is: is the motor speed proportional to PWM value? For example, if I set (in software) the motor to spin at half value, will it go half as fast as it would at full power? Would it depend on the motor/speed controller? (we’re using Jaguars).

Thanks,
Kevin

There’s no such thing as stupid questions, even from a software person.:wink:

I know that the Victors were quite non-linear. They had a significant “deadband” near the mid-point (zero-velocity). Motor speed increased approximately linearly over a small range PWM values then would approach max speed asymptotically. The characteristics varied significantly from Victor to Victor as well.

You can measure motor speed vs Jaguar input with an encoder pretty easily. It would be good to do this free-running and with a mechanical load on the motor as well.

I participated in FIRST for 10 years before I ever thought to about this question. Especially with the Victor speed controllers, the answer is no. The Jaguars are much better.

See this thread on the FIRST forums: http://forums.usfirst.org/showthread.php?t=10182

In general, no. The PWM value is proportional to the (average) voltage coming out of the speed controller. The motors voltage/RPM curve is not very linear and it depends on the torque on the motor, amperage it can draw and perhaps other factors. If you put an encoder on your motor, you could plot this PWM/RPM graph and see what the curve looks like.

If you search the forums (or is it “fora”?), you should find a few whitepapers and threads that describe the operation of DC brush motors. I’ll give you a super-high-altitude summary.

With no frictional load attached to (or inside) the motor, a perfect power supply and a motor drive that efficiently and linearly converts PWM command into voltage, the motor speed will indeed be proportional to the PWM value. That’s a whole lot of IFs…

In general, approximating speed with PWM value is often good enough. But only you can know what’s “good enough” for your application. Deviations from that ideal can be due to nonlinear or inefficient motor drives, power supply sagging or frictional loads. There are also transient effects due to rotational inertia to consider.

It’s actually a really fun system to model. Do a search through CD and you’ll find some good resources if you’d like to learn more.

Russ

Just a little correction here… the PWM signal will pulse the voltage.
The voltage does not change it is pulsed to achieve the speed you desire from the motor.

PWM control (Pulse Width Modulation) varies the width of these pulses of voltage (presumably at 12 V) to achieve this control.
The motors see the same voltage at all times…

This is different than a “dimmer” type of motor controller … which actually varies the voltage in order to speed up or slow down the motor.
This is inherently inefficient because the lower voltage will provide less power along with the slower speed. We want to maintain the power, by using the same voltage at all times.

If you google Pulse Width Modulation it will tell you all about it.

good luck this year!!

With most small (toy type) motors, their unloaded rpm (after settling, as I’ll explain later) is directly proportional to the voltage they get. However, I don’t know about the larger motors we are using and how they behave under load. Plus, the PWM output from the motor controllers may not drive a motor to behave the same way as the average voltage would. In addition, the motor controller’s outputs aren’t perfect - most of them are nonlinear, as I read (this is my first year so I don’t have much personal experience.) In the end, they are probably very nonlinear, due to all the factors affecting your perfect relationship.:frowning:

If you look at the math, in a closer to instantaneous standpoint, the PWM (or average voltage) setting would actually control motor acceleration (get more instantaneous and you get into the back EMF and weird effects such as some motors, depending on how they are wound, actually speeding up when power is cut.) Plus, instantaneously, the PWM wouldn’t cycle immediatly. :eek: The motor controller would take something around 1/(operating frequency) seconds to change the outputs, and over time it is averaged my the motor’s behavior to act as an average voltage.

At the speed you would probably run your program (20-1000 Hz for an overly large range estimate) you would probably (using the encoders) detect the motor behaving as if the PWM output is proportional to acceleration. Most programs (except traction control and other fancier ones) just run the commanded power to the PWM outputs, and assume (over time, correctly) the PWM output has a one-to-one relationship with average motor velocity.

Everyone so far has neglected the motor power curves showing speed vs voltage vs load vs torque. None of the motors are linear except when no load is connected, so none of the motors connected to speed controllers can be linear. Furthermore, speed controllers apply varying pulse width to vary the average current in the motor not the average voltage. The voltage is always switched between 0 and 12 volts less the voltage drop in the wiring and FETs. The switching frequency also interacts with the segment spacing on the motor commutator and the winding inductance. Although motor manufacturing variations minimize winding inductance variances, they still exist and different motor types have wide variations in inductance, winding resistance and segment lengths. Since motors, speed contollers and drive PWM are never synchronized, neither are motor control outputs, rotations or exact output powers. Light dimmers also vary the pulse width but they synchronize to the power line to reduce RFI and the “singing” of incandescent filaments when power is switched on near the peak of a sine wave. This is often referred to as “zero cross switching”.

Even before I read Al’s impressive post, I was thinking that this is nearly a chaotic system, and the only good way to guarantee a desired result (such as “I want to go 20% faster”) is to test YOUR controllers, batteries, mechanisms, drive train, and wheels and map the desired PWM values to the desired behavior of the motor/device you are controlling. In this case, empiricism is better than theory, although it certainly doesn’t hurt to learn the theory, too.

All good answers. For accurate speed control you have to close the feedback loop. The typical way is to add an encoder which measures the speed of the wheels. Without a way to measure speed you have an open loop with no feedback, you set the control value and hope.

A closed feedback loop sets the control value (servo pwm) to the motor controller, the controller pulses the 12V to the motor, also called PWM but different, the motor under load does it’s thing, the drive train takes some power through friction, the wheels turn, you measure the speed and increase or decrease the motor control value based on the difference between what you are reading and what you desired.

This is a simple explaination of proportional feedback, look up PID on CD for many articles.