Shop OBEX P1 Docs P2 Docs Learn Events
How to hack servos... — Parallax Forums

How to hack servos...

RavenkallenRavenkallen Posts: 1,057
edited 2010-12-30 07:27 in General Discussion
I don't know about the other forum members, but i tend to hack my servos for continuous rotation in a different way then most...

1: First unscrew the servos completely and put the screws aside...

2: Carefully remove the housing from the top and bottom(Try not to loose the gears)

3: Pull out the drive electronics/ motor carefully and put aside

4: On the main gear(located on the feedback shaft) you should see the protruding "tooth" that gets in the way of the other gears(this keeps the servo from moving to far in any direction). You must carefully remove this tooth in a way that it doesn't affect the rest of the gear. I used a power drill to drill a hole through it and then bent the rest off with pliers.

5: Down in the feedback mechanism, there will be another tooth to remove. I remove it by taking the whole thing out and using pliers(and brute force) to literally bend the tooth or break off the whole feedback doohickey. That should leave you with the feedback shaft that is able to rotate 360 degrees

6: Take the drive electronics and unsolder the motor from the board. Solder your own wires to the motor

7: Put everything back together the way you found it(put the motor back in, the gears back in place, etc..) you may have to drill a bigger hole in the bottom to fit wires

8: Cool, now you have a motor with gears :)

What you have now is a nice little DC gearbox that doesn't need sophisticated electronics to drive it. They are great for(slow) robots and any application that needs high torque.. Did i mention it is also cheap.. Sorry about the bad quality pics. I am using a dorky key chain camera :)
640 x 480 - 87K
640 x 480 - 79K
640 x 480 - 68K
«1

Comments

  • ercoerco Posts: 20,260
    edited 2010-12-20 22:05
    OK, you changed the servo into a gearmotor. That's good for some applications. Simple enough to make it rotate continuously, but now you have the issue of how to drive it. Will you use a relay (my fave) or build an H-bridge to control it? That will consume some hardware and a pin or two. You discarded the built-in control electronics, which are actually quite useful; they allow total one-pin control of the motor (speed and direction). The usual servo hacks usually remove or disconnect the onboard 5K potentiometer and replace with two 2.4K resistors as a fixed, centered voltage divider. This lets you stop the servo with a string of 1.5 ms pulses, or drive it proportionally forward or backward with pulses ranging from 1 to 2 ms.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2010-12-20 22:16
    You could possibly have used the PWM to drive the modified motor. IF that is gone, Solarbotics makes an installable H-Bridge that fits inside the servo as another option.

    Hacks are quite fun and empowering. I've got my eye on a Wall-E bot at the Disney site for a hackable package as it is only $49 USD when other robot platforms are so much more.

    But, be advised - NOT all servos are hackable. Some don't have complete circular gears for full rotation and others may be constructed in ways that make a changeover quite difficult.

    Hacking is fun and certainly has its place in learning and creativity, but at times one can hit a brick wall. Parallax sells specially made Futaba servos with an adjustment screw to set zero rotation. Having done the hack, I find these are as good or better. And of course, once you hack the servo - it is no longer of any use for its original task. I have an R/C airplane that needs traditional servos.
  • RavenkallenRavenkallen Posts: 1,057
    edited 2010-12-21 12:29
    Yeah, i am going to use a homemade H-Bridge...I understand it would be easier to use the on-board control electronics, but i never do anything easy :)...I am using these on a new robot i am making(Think snow plow).
  • Martin_HMartin_H Posts: 4,051
    edited 2010-12-21 18:31
    Beam robot builders like servos modified like this because BEAM analog control circuits work well with them. So Solarbotics sells servos already modified like this. The beam motor control circuits are pretty alien to someone like me who got started using PPM with a basic stamp.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2010-12-22 00:14
    There are genuine advantages to using an H-bridge rather than PWM. It is a very valid alternative design and often frees up the microcontroller's timer resources to do other things.

    The servo is just a handy package for a motor in such a hack. Some people provide just two wires out of the motor and have the H-bridge outboard. Others prefer to have an 'inboard H-bridge' and several more control wires going in and out.
  • RavenkallenRavenkallen Posts: 1,057
    edited 2010-12-22 11:34
    @Loopy... Exactly. A H-Bridge is extremely easy to make/ control. I will have my H-Bridge outboard(It will control two motors each)
  • ercoerco Posts: 20,260
    edited 2010-12-22 11:42
    My favorite homebuilt relay H-bridge allows coasting, too: http://forums.parallax.com/showthread.php?106382
  • $WMc%$WMc% Posts: 1,884
    edited 2010-12-22 18:40
    @Loopy... Exactly. A H-Bridge is extremely easy to make/ control. I will have my H-Bridge outboard(It will control two motors each)
    '
    I'd like to see what you come up with for an H-Bridge controller. Just for a design comparison with what I have come up with.
  • RavenkallenRavenkallen Posts: 1,057
    edited 2010-12-22 20:04
    @_$WMc%_... This is the circuit i modeled mine after. I used a lower resistor value though.

    http://static.electro-tech-online.com/imgcache/572-hbridge.gif
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2010-12-23 01:52
    TIP120! They are bit of overkill, but they will work. I'd use 2N2222 and their compliment - the 2N2907 - in a very compact design. Also, only two TIP120s should be used in your example, there should be a pair of TIP125s to compliment them. That isn't a very electronic design.

    http://www.beamitaly.solarbotics.net/library/circuits/driver_hbridge.html Go here.

    One very often overlooked point about adapting servos to use with an H-bridge is that they then can employ PID control. I've never seen anyone bother to attempt PID control with PWM.

    Low power H-Bridges are very forgiving and can be build in a variety of ways. BEAM websites had years and years of discussion and development of nuance for extreme low power H-bridges. And of course, it is extremely easy to impliment a relay H-Bridge is timing isn't critical.

    BTW, I have several pairs of good DC motors for robotic that sit around ignored - just because they are harder to mount to a chassis than an R/C servo or they don't have the right gear ratios or they don't have an easy way to attach wheels or a level arm.

    Soo... hacking the servo can make one move ahead quite easily.
  • ercoerco Posts: 20,260
    edited 2010-12-23 09:37
    My least favorite thing about bipolar transistor H-bridges is that you'll lose a volt or more going through two transistors. That's a noticeable slowdown in small 6-volt-ish robots. That's one reason I favor low-power relays (no voltage drop); the other is full dynamic braking.

    But from my many posts on the subject, no one except me cares about my beloved dynamic braking, so I'll take my low-power, polarized coil, high-efficiency relays and go home...
  • RavenkallenRavenkallen Posts: 1,057
    edited 2010-12-23 11:20
    @loopy...I used the TIP120's because i plan to operate two motors on each H-bridge, because i wanted to make sure i wasn't going to burn them out(My servos can probably pull a couple of amps under a heavy load, plus i want two motors on each). Why do you need a different kind of transistor than the other two? I used 4 TIP120's and it worked fine?

    @Erco... i am not ignoring you, i just don't have any relays in my lab. I have been meaning to buy a couple, but i have never got the chance. Any recommendations for a general purpose relay? The voltage drop is annoying, but i like transistors :)
  • $WMc%$WMc% Posts: 1,884
    edited 2010-12-23 15:28
    @loopy...I used the TIP120's because i plan to operate two motors on each H-bridge, because i wanted to make sure i wasn't going to burn them out(My servos can probably pull a couple of amps under a heavy load, plus i want two motors on each). Why do you need a different kind of transistor than the other two? I used 4 TIP120's and it worked fine?

    @Erco... i am not ignoring you, i just don't have any relays in my lab. I have been meaning to buy a couple, but i have never got the chance. Any recommendations for a general purpose relay? The voltage drop is annoying, but i like transistors :)
    '
    Ravenkallen:...Thanks for sharing your H-B circuit. I came up with an almost identical circuit.I just added some EMF diodes.I even choose the TIP120's. I was just wondering if we all were on the same page with H-B controllers. I didn't want to fall behind. Thanks again.
    '
    I'm looking forward to see what loopy... has to say about the need for different transistors?
  • lardomlardom Posts: 1,659
    edited 2010-12-26 08:18
    My hack was to remove the pot and replace it with two closely matched resistors. I think I used 2.2K or 3.3K ohm. I soldered the resistors together at one end. They looked like an "M" when I soldered them into the 3 holes where the potentiometer used to be. I "Dremeled" the notch off.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2010-12-27 00:55
    Be aware that the TIP120s are Darlingtons and you have may have twice the voltage drop through the H-bridge that you would with normal BJT transistors. If you are really trying for low voltage, low power operation ( which 6 volt powered servos are), it might just be easier to use small relays. The Darlingtons might require 9 volts in order to get 6-7 volts at the motor - at least the 9 volts does NOT have to be regulated. Having two motors in parallel on one H-bridge is possible with BJTs and maybe even the 2n2222/2n2907 might work well. First I'd try to sort out exactly how much current you need per motor. Then I'd have to look around for high power transistor to drive a bit more power. A good MOSfet H-bridge might be your best bet if you must have solid state. It is just that solid-state power engineering gets tight when you get closer and closer to 5 volts.
  • KaosKiddKaosKidd Posts: 296
    edited 2010-12-27 07:09
    You could possibly have used the PWM to drive the modified motor. IF that is gone, Solarbotics makes an installable H-Bridge that fits inside the servo as another option.

    Hacks are quite fun and empowering. I've got my eye on a Wall-E bot at the Disney site for a hackable package as it is only $49 USD when other robot platforms are so much more.

    But, be advised - NOT all servos are hackable. Some don't have complete circular gears for full rotation and others may be constructed in ways that make a changeover quite difficult.

    Hacking is fun and certainly has its place in learning and creativity, but at times one can hit a brick wall. Parallax sells specially made Futaba servos with an adjustment screw to set zero rotation. Having done the hack, I find these are as good or better. And of course, once you hack the servo - it is no longer of any use for its original task. I have an R/C airplane that needs traditional servos.

    It's on sale right now for $39! :)
  • RavenkallenRavenkallen Posts: 1,057
    edited 2010-12-27 14:55
    @Loopy... I am planning on powering the robot off of 12 volts, so a voltage drop is not to much of a concern. I have tip120's laying around so i thought i would put them to use!! I am just worried about burning them or something.
  • RavenkallenRavenkallen Posts: 1,057
    edited 2010-12-28 15:54
    @Loopy....Ah, i see what you mean now. I feel kinda sheepish now, but until about five minutes ago, i forgot that transistors are voltage controlled. By that i mean that if you apply 3 volts to the base of the transistor, the emitter will output a voltage that is 0.6 volts(Depending on transistor) less than the base voltage, Regardless of the collector voltage. If you apply 2 volts to the base and you have 5 volts on the collector, you will only output 1.5 volts or so..As you can imagine the Propeller only outputs 3.3 volts and if you put that through a darlington, it will drop to like a volt and a half. My whole H-bridge circuit works, but not with the low voltage prop output. Is there some kind of workaround? How do commercial IC's do it? We should rename the thread "Hacking servos and building h-bridges" :)
  • ercoerco Posts: 20,260
    edited 2010-12-28 19:23
    Yeah, i am going to use a homemade H-Bridge...I understand it would be easier to use the on-board control electronics, but i never do anything easy :)...I am using these on a new robot i am making(Think snow plow).

    Cheapest & quickest option is to dig your discarded servo control electronics out of the trash can. It's hard to second-guess the manufacturer!
  • RavenkallenRavenkallen Posts: 1,057
    edited 2010-12-28 20:21
    @Erco... I kept all the control boards, but that is not it. I still want to make my own H-Bridge, even if only for the learning aspect of it, but if i can't make any progress, than i will consider reinstalling the electronics.. Also, i want to run the motors at a slightly higher voltage than is recommend for the servo electronics
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2010-12-29 08:29
    The BEAM H-bridges are created for minimal voltages, but just about any transistor can go up to 30 or so volts. One option is to have the H-bridge driven by ain intermediate logic chip that boosts the Propellers 3.3v up to 5v or maybe more. BEAM has examples of such H-bridges.

    Generally servo motors don't do well with voltages much higher than 7 volts, but that limitation may be because of the internal control boards failing. The motor itself and in stand alone use might handle 9-12volts. Much depends on the quality of the brushes. Of course, it is also possible to melt the copper wire windings if you put enough power through the motor as well.
  • ercoerco Posts: 20,260
    edited 2010-12-29 08:50
    Besides the electronics, the motor & plastic gears will have a shorter life at higher voltages. Nothing worse than getting an electromechanical project all buttoned up & dialed in and then stripping the gears.
  • RavenkallenRavenkallen Posts: 1,057
    edited 2010-12-29 09:31
    @Loopy... Exactly. The servos only have a rating of like 7 volts. I want to run 12 volts through them. My robot would be painfully slow at 6 volts:)... I looked on the beam robot's wiki and saw some interesting things, but i didn't see anything about boosting voltages. Maybe i missed something? I was reading on Wikipedia about boost converters. Something like that might work, but it would add more bulk and expense to my project...Plus, it would take more time to figure out the proper configuration of the inductors and capacitors....I don't know. Maybe i am in over my head. What would you do? I considering using relays, but don't you need transistors to drive them anyway?
  • RavenkallenRavenkallen Posts: 1,057
    edited 2010-12-29 09:36
    @Erco... Yeah, that could be a problem to. The servos gears are nothing special. I have tested the robot at 12 volts and so far it seems like it is okay, but anything can happen..
  • ercoerco Posts: 20,260
    edited 2010-12-29 09:39
    Solarbotics (and others) sell gearmotors with a wide variety of gear reductions; you can select one with the appropriate speed for your project.

    http://www.solarbotics.com/motors_accessories/gear_motors/
  • RavenkallenRavenkallen Posts: 1,057
    edited 2010-12-29 09:45
    @Erco....Yeah, it is kinda to late for that now. I already "attached" my motors to the robot chassis. I am stuck with these ones for now, but the solarbotics people seem to have useful stuff. Maybe for my next robot:)
  • ercoerco Posts: 20,260
    edited 2010-12-29 11:29
    Superglue is forever! Not recommended for those with "fear of commitment"...
  • RavenkallenRavenkallen Posts: 1,057
    edited 2010-12-29 12:47
    Well, actually it has screws holding it together, but i already drilled a bunch of holes in the chassis and i attached beams to strengthen the assembly. Taking it apart would be doable, it would just be hard:)
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2010-12-29 22:42
    We are getting into apples versus oranges. I didn't mention boosting voltages - that is a specialized regulator's task. What I was trying to say is that a 2n2222 transistor is rated in 3 ways - the maximum millamps, the maximum voltage, and the maximum amount of heat (in terms of watts) that it can accumulate. So if there isn't too much heat involved, you should be able to use the same H-bridge for 12volts that you might use for much less.

    The control inputs are amplified to increase power. I've doubts that 12volts will seriously wear out the motors with the internal electronics removed.

    Regarding boosting voltages, Pololu seems to be filling that niche in the market place with a wide range of tiny regulator boards that fit a range of needs.
  • RavenkallenRavenkallen Posts: 1,057
    edited 2010-12-30 07:27
    @Loopy... My main problem now seems to be boosting the voltage of the base pin somehow. I have seen those boosting boards you have mentioned, but i was wondering if there was a easier way? I might just decide to buy a ic instead. Sparkfun sells the L298N and a cool breakout board to accompany it.
Sign In or Register to comment.