Thursday 26 April 2012

Speed Control - Pulse Width Modulation

Because the microprocessor gives a digital signal out - either 5v or 0v and nothing in between, we must use Pulse Width Modulation (PWM) to control the speed of a D.C. motor.

This uses the Mark to Space ratio to vary the speed - that is the time a motor is on for (Mark) and the time the motor is off for (Space).  This is in order of milliseconds so that it happens so quickly you can't see the pulse, only a constant speed.



Examples of the programs required for these graphs:

green: high 7                                             blue: high 7
           pause 20                                                  pause 10
           low 7                                                        high 7
           pause 10                                                  pause 20
           goto green                                               goto blue

Because the motor is on longer than it is off in the green graph, this is the program which will make the motor turn faster.  You can increase the mark to space ratio to get a bigger difference in speed.

No comments:

Post a Comment