Page 279 - Robot Builder's Bonanza
P. 279

248  USING DC MOTORS


                                On
                   +5 volts

                                                             Figure 22- 13  The speed of nearly all
                                                             DC motors may be varied by changing the
                                          Off
                    0 volts                                  duty cycle (on versus off times) of its supply
                                                             voltage. The longer the on time, the faster
                                      Period                 the motor will turn.

                   Remember: The frequency of the  pulses— how many occur in a  second— does not change, just
                   their relative on and off times. PWM frequencies of 1 kHz (1000 cycles per second) to over
           G       20 kHz are commonly used, depending on the motor.
                     Unless you have a specification sheet from the manufacturer of the motor, you may have to
                   do some experimentation to arrive at the “ideal” pulse frequency to use. You want to select the
                   frequency that offers maximum power with minimum current draw.


                   Bonus Projects: Interfacing to Motor
                   Bridge Modules


                   I’ve added a number of bonus motor bridge projects to the RBB Online Support site, including
                   using several brands of serial motor speed controllers with the Arduino microcontroller. You’ll
                   find connection schematics, programming code, and parts lists.
                     Also included are  hands- on sample code projects for using the venerable L293D, and the
                   L298, with the three controllers highlighted in this book: Arduino, PICAXE, and BASIC
                   Stamp. See Appendix A for more details about the RBB Online Support site.
                     The sample code demonstrates motor direction control, plus PWM speed control.





































   22-chapter-22.indd   248                                                                     4/21/11   11:50 AM
   274   275   276   277   278   279   280   281   282   283   284