Page 289 - Robot Builder's Bonanza
P. 289

258  USING SERVO MOTORS


                   digital servo means the motor is drawing more current from its power source, which means
                   batteries tend not to last as long between charges.
                     For most robotics applications, digital servos are not required. You can get by with the less
                   expensive standard analog servos. An exception is when building a walking robot, where the
                   extra torque of digital servos comes in handy.  Six- legged walking bots may use 12 and even
                   18 servos just for the legs. The higher torque helps to offset the added weight of all those
                   servos.

                   Electronics for Controlling a Servo


                   Unlike a DC motor, which runs if you simply attach a battery to it, a servo motor requires
                   proper interface electronics in order to rotate its output shaft. While the need for interface
                   electronics may complicate to some degree your use of servos, the electronics are actually
                   rather simple. And if you plan on operating your servos with a PC or microcontroller (such as
                   the Arduino, PICAXE, or BASIC Stamp), all you need for the job is a few lines of software.
                     A DC motor typically needs power transistors, MOSFETs, or relays if it is interfaced to a
                   computer. A servo, on the other hand, can be directly coupled to a circuit or microcontroller
                   with no additional electronics. All of the  power- handling needs are taken care of by the
                   control circuitry in the servo, saving you the hassle. This is one of the key benefits of using
                   servos with  computer- controlled robots.

                   CONTROLLING A SERVO VIA A MICROCONTROLLER
                   All microcontrollers can be used to control an R/C servo. The basic connection scheme is
                   shown in Figure 23- 8.

                   •   The microcontroller and servo can share the same power source, assuming the controller
                     has an onboard regulator, but it’s much better to use a separate source for the servo. Why?
                     Servos draw a lot of current when they’re first turned on or are in motion. By using sepa-



                       +V for
                      controller        6 volts


                                             470 - 1k ohm
                                               resistor
                       Micro                   (optional)
                     controller  Output pin            Signal
                                                        +V
                         Ground                        Ground
                                                         Servo
                                                 Ground for       Figure 23- 8  General
                                                 servo power      connection diagram for attaching a
                    Ground for                                    microcontroller to a servo motor. The
                   microcontroller                                470 to 1  k  resistor is optional, and
                      power                                       is included to prevent excessive
                                  Connect the
                                grounds together                  current draw by the servo.









   23-chapter-23.indd   258                                                                     4/21/11   11:51 AM
   284   285   286   287   288   289   290   291   292   293   294