Shop OBEX P1 Docs P2 Docs Learn Events
Connecting Servos To a Propeller — Parallax Forums

Connecting Servos To a Propeller

Duane DegnDuane Degn Posts: 10,588
edited 2015-03-04 15:25 in Robotics
I was recently asked about how to connect multiple servos to a Propeller. This seemed like it would be a good idea to dedicated thread on the topic.

I'll keep this top post as a sort of "Table of Contents" to the ideas mentioned in this thread.

I plan to reserve the first six posts. Any interested parties should check back soon as I add content to these posts.

I've listed some servo related links in post #10 of my index. Much of the information will be repeated in thread.

Post #2: Techniques I've used to connect servos to a Propeller.

Comments

  • Duane DegnDuane Degn Posts: 10,588
    edited 2015-02-17 11:51
    Some of the ways I've used to connect servos to a Propeller chip.

    In my Halloween Hex project, I'm driving a total of 22 servos. 18 of the servos are connected to two small servo expansion boards I designed and had made at OSH Park.

    attachment.php?attachmentid=111330&d=1412792872

    attachment.php?attachmentid=111329&d=1412792870

    The Gerber files used to have the above PCBs made are attached to post #72 of the Halloween Hex thread.

    I don't recall how much the PCBs cost but it probably wasn't very much. OSH Park charges $5 a square inch for three boards (or $1.66 per square inch if you think of it per board). I think the cost for the three boards was about $5.

    If anyone wants to have boards made for themselves, just submit the zip file to OSH Park's automated submission form.

    Before making these servo connector boards, I had made some out of perf board.

    attachment.php?attachmentid=111141&d=1411665864

    I used a pair of these to connect the servos in my Popsicle Stick Hexapod.

    When I made my 32 servo demo, I used a breadboard to connect all the servos to the QuickStart board. The signal lines went from the QuickStart board to the breadboard where power and ground connections were added. I powered the QuickStart board with four AA NiMH cells and I powered the servos from two large LiPo pack. The voltage of the LiPo packs was reduced with a couple of switching regulators.

    If pins 28-31 are used to drive servos, you might need a way of disconnecting the servo while the Propeller is being programmed or booting up (turned on).

    It's possible to drive more than 32 servos with a single Propeller (and from a single cog) by adding some additional hardware. Beau showed how to do this in this thread.

    I generally don't use resistors on the signal lines. I know it's very common to do so and I think there are times when having a series resistor on the signal line is a good idea. I have had trouble when using resistors with some servos. While all the servos I've used will accept the 3.3V logic from the Propeller as logic high, some servos won't see the high signal if the resistor on the line is too high of a value. I know I've had trouble with 10k resistors and I think 4.7k resistors have also caused me trouble.

    One of the biggest challenges in using lots of servos with a Propeller is finding a way to power all the servos. Most servos will be damaged by the voltage of a two cell LiPo battery so in order to power the servos from a 2S LiPo pack a voltage regulator needs to be used. I used to use regulators from Dimension Engineering but I have since found many sources for regulators which cost much less.

    I'm using two 15A switching regulators on my Halloween Hex.

    attachment.php?attachmentid=111704&d=1414727617

    These regulators are available from a lot of sources. I purchased at least one off ebay and I also purchased at least one from ICStation.

    I'm using one of these 15A regulators on my small hexapod.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2015-02-17 11:51
    Reserved for servo connections techniques used by Parallax.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2015-02-17 11:52
    Favorite Servos

    Servos I've used a lot and really like:

    Parallax's High Speed Continuous Rotation Servos
    HobbyKing's HX12K Metal Gear Servos
    HobbyKing's HXT900 Mini Servos (These have 180 degree travel.)

    Servos I've used but not enough to have a strong opinion about them:

    Parallax's Continuous Rotation Servos
    Parallax's Standard Servos
    HobbyKing's VS11 Vigor Extra Large Servos

    Servo I plan to try:

    HobbyKing's HK15318B Low Voltage Micro Servos
    I'm using the HX12K servos in large hexapod and they appear to work well. Apparently some servos with this same name can use 7.2V as a supply voltage. Many of the HX12K servos I'm using complain (shake) when used at this higher voltage.

    I'm using the HXT900 servos in my mini hexapod and to move the eyes of the large hexapod. These servos seem to be very strong for their size. These will burn out when used at 8V.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2015-02-17 11:52
    One of the challenges with controlling lots of servos is providing enough current to the servos.

    Many microcontroller board use a linear regulator to provide a stable 5V source for the microcontroller and sensors. A linear regulator would probably work okay for one or two servos but if one wants to use lots of servos a linear regulator isn't a very good choice.

    Linear regulators get hot pretty fast when used with high current devices. If one uses an 8V source and uses a linear regulator to power 5V servos pulling a total of 2A then the regulator needs to convert 6 Watts of power to heat. To determine the amount of heat generated you multiply the voltage drop by the current through the regulator. In this example this is 3V times 2A. 6W is a lot of heat to get rid of.

    If you have a battery pack at the correct voltage you could use it to power the servos without a regulator. Four rechargeable batteries (NiMH or NiCd) could be used without a regulator. Five rechargeable cells would probably be okay for many servos but a freshly charged set of five NiMH cells could have a voltage higher than 6.6V. This probably wouldn't hurt most servos but I'm not sure about this.

    I like to use Lithium Polymer (LiPo) packs with my robots. With a LiPo cells, one cell wouldn't have a high enough voltage to power many servos and two cells would produce too much voltage for most servos.

    With several of my robots, I've decided to use two LiPo cells and a switching voltage regulator. Switching regulators don't get nearly as hot as linear regulators. Rather than dropping the voltage by dumping power as heat, switching regulators use more complex electronics to drop the voltage and are much more efficient than switching regulators. Not only do switching regulators not get as hot as linear regulators but the battery packs last much longer since there isn't as much power lost as heat.

    I'm far from an expert on switching regulators but here are a few I've used.

    I'm using one of these 15A regulators in my mini hexapod and two of them in my large hexapod.

    I have a bunch of cheap LM2596 regulators. There's some discussion about these regulators in this thread. Make sure and check around for better prices. The links posted here on in the other threads might not be the best price right now.

    Here's an alternative to the LM2596 regulators. There's some more discussion about voltage regulators in this thread.

    Here's another regulator I've used from ElectroDragon.

    In the 32-servo demo, I used regulators from Dimension Engineering. These regulators work fine but they're much more expensive than the options mentioned above.

    One thing to watch out for when using switching regulators is radio interference. I've has several projects which worked fine on the bench but when I tried to use them with a switching regulator, they no longer worked. These projects include a transmitter to control a helicopter and a GPS logger.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2015-02-17 11:53
    Reserved 6 of 6.
  • JonnyMacJonnyMac Posts: 8,993
    edited 2015-02-17 12:22
    I tend to use the TC4427 which is one of my favorite interface parts for the Propeller. It was designed as a MOSFET driver, but I have found it useful for many things: driving servos, driving WS2812 sitings -- anything that can use a stiff bump from 3.3V to 5 or higher.

    True story: My friend Lou (who sadly passed last October) used to have a company that built camera accessories for budget filmmakers. One of the devices I helped with was a focus and zoom controller that used servos. It worked great -- until a customer extended the connection from the device to servos by 20 feet. We modified the circuit by changing to a 6v supply and putting a TC4427 between the Propeller and the servo outputs. The servos got a little extra with 6v, and the pulse going to them (Vcc of 4427) was also 6v. No more cable problems. All of my servo-based designs use this now; it's not expensive and it can drive a clean pulse over a distance.
  • Duane DegnDuane Degn Posts: 10,588
    edited 2015-03-04 15:25
    I just added some information about voltage regulators to post #5 above.
Sign In or Register to comment.