Electronic – arduino – motor hums arduino PWM

arduino

I have a motor driver interfaced to an arduino using AnalogWrite() for PWM, for some strange reason it only spins the motor from values 210 to 255(full on) with analogwrite, anything lower will make the motor hum very aduible PWM and not spin…any ideas on how to correct this? Do I need Fast PWM?a

Best Answer

According to the reference for AnalogWrite(), this will generate PWM at a frequency of about 490 Hz. This pretty inefficient. It means that you deliver a parcel of energy every \$1/490Hz \approx 2ms\$. Normally the inductance of the motor smooths out these parcels such that you get a mostly constant current, but at this low speed, the inductance of your motor probably isn't sufficient to do that.

It's as if you are turning a shaft with pulses of torque and hoping it will turn at a constant speed, but you have a tiny flywheel on it. Torque is proportional to current, and an inductor is like a flywheel for current in that it resists abrupt changes in current. Bigger inductors resist more, like a heavier flywheel resists changes in speed more.

If you are supplying the motor with 5V, and the motor inductance is 1.5mH, then the current will change at a rate of:

$$ \frac{di}{dt} = \frac{v}{L} = \frac{5V}{1.5mH} \approx 300 A/s $$

Over the course of the \$2ms\$ between pulses, that equates to a change on the order of:

$$ 300A/s \cdot 2ms \approx 600mA $$

These are just very rough estimates, because the analysis of what the current will actually do over the PWM period is more complicated, but the point is this: the current in the motor windings is changing a lot with the PWM waveform.

The torque the motor produces is proportional to the winding current. So what happens is probably this: the PWM switches high, and the current gets pretty big. This would turn the motor, except that before long, the PWM switches low, and the current goes back down to about nothing. So you aren't applying a constant torque; you are just applying spurts of torque. These short spurts of torque aren't enough to get the motor going unless you turn the duty cycle way up, so you motor just hums at about 490 Hz.

I bet if you attach some mass to the motor (like a flywheel), and give it a little shove, it will get going. In this case, you are augmenting your lack of "electrical flywheel" (inductance) with a real mechanical flywheel. A higher PWM frequency would be more efficient, but isn't necessary to have a working system.