Electronic – How to control DC motor speed by motor driver with PWM input

dc motorpwm

I'm running series of experiments using a 6V DC motor. I'm using desktop DC power supply to power the motor and regulate its speed and everything works just fine, the setup has been running for months.

Now I need to use Arduino motor shield to power the motor and run a particular control sequence (involving motor speed, direction, brake). Arduino is powered by 9V DC supply brick (from an 110V outlet), and delivers approx. 8.5V on its outlet power pins. Once I connect the motor the voltage I read on the pins is approx. 6.8V using my multi-meter. I cannot measure the current, once I connect the multi-meter the RPM drops dramatically, I guess I'm affecting the circuit somehow.

So far i have been using Arduino's PWM control successfully but only for motors rated for voltage equal or greater than that of the power supply. This time I'm conscious of the max. voltage/current on/through the motor. I understand that PWM will reduce the average voltage but my understanding is that the motor will see the full voltage only at shorter intervals. Will this damage the motor? Playing with different PWM values I was able to get the same voltage as previously from bench DC power supply (say, 3V) but the motor noise is quite different. Motor is much louder and it sound as if it's struggling to work. I'm still measuring the same average voltage of 3V on the motor's power pins. I'm afraid this will reduce motor life or burn it completely if I continue letting 6.8V (8.5V?) directly onto it. How safe is to continue this operation?

I also saw a good discussion on regulators here on StackExchange. If PWM is not suitable, should I try a voltage regulator? Ultimately, what I'm trying to achieve is for motor to change the speed/RPM but also the direction – not sure if I can pull this off with the regulators. What would be your advice for this application?

Please don't mind if I used inappropriate terminology – I'm just a daft mechanical guy trying to figure the electrical part of how I can run this safely. I'd appreciate any input. Thanks.

EDIT: This is to provide info on PWM frequencies/mark/space ratios. I hope a chart is OK, it might be easier to explain.

The way Arduino works is you set PWM via a byte, so sending a value between 0 and 255. 0 will let no marks through, 255 will have no spaces.

I plotted here the voltage measurements across motor contacts when: a) no motor is connected, b) when motor was connected and rotation was set to CW, and c) when motor was connected and rotating CCW. CCW rotation voltage should have "-" sign in front but I plotted it this way to be easier to read and compare. Motor had no mechanical load on it.

For the motor, I stopped plotting PWM at point when I almost reached the rated voltage. I'd like to run the motor at minimum of 2.5V, and I'm interested to know how high I can go. Also if this minimum is OK or not (so far it worked just fine off of a bench DC supply).

I hope this makes sense and please let me know if there's anything else I should check and provide.

Best Answer

You can use PWM control under the following two conditions:

  • The average voltage applied does not exceed the rated voltage of the motor. This ensures that the average power rating of the motor is not exceeded.
  • The duration of the PWM pulse does not cause the winding current to saturate. The rotor windings act like an inductor, which smooths the current, but if the PWM frequency is too low, you won't get a smooth current but rather high current pulses during each PWM pulse.

To do a quick and dirty test, just set the PWM frequency to 20kHz, and set the duty cycle so that the effective voltage applied to the motor, d*Vin, = Vrated.