Let's Make Robots!

How to modify a micro servo for continuous rotation

ndupont's picture
make a cheap servo rotate forever!
Time to build: 
1 hour

Here is how I've modified cheap e-bay servo for continuous rotation,

Thanks to Oddbot for his explanations :) 

 

Servo is a SG90 ,  equivalent to HXT900... and many others 

 

Tools you will need : A sharp knife, a PH0 screwdriver, some sandpaper, soldering iron (or glue)

+ Nice to have : A microcontroller that continuously sets the servo to its center position  ( 1.5 ms ,  position 150 on picaxe)

 

below : the package I recieved from Hong-Kong    (about a week after the order was placed)

servo1.jpg 

 

 

Step 1:  Cut the stickers and remove the 4 screws

servo2.jpg 

 

Step 2: Gently remove all the gears  (remind that you will have to put them back !!!)  and Pull the circuit away

servo3.jpg 

 

Step 3: Push the potentiometer out of its casing   (as you can see, the output shaft is the potentiometer itself)

servo4.jpg 

Step 4:

Connect the servo to your controller

The motor will rotate until you put the POT to its exact center position. 

When the motor stops, you have found the good position,  DO NOT disconnect the controller for the moment

servo5.jpg 

Step 5 : SOLDER (yes SOLDER!) the shaft of the POT, from the back

Oddbot recommends to use hot-glue

If you decide to use glue, you will have to remove the white plastic cover sheet of the shaft-side, then fill with some glue

servo6.jpg 

The shaft will never be able to move again,  try to make sure...  and power-off the controller if OK.

Then put the POT back to its casing 

servo7.jpg 

 

Step 6 : It's time to make the shaft thinner.   (the outer gear as to turn freely)

 I use sandpaper.

servo8.jpg 

 

Step 7 : Cut the "stop finger" of the output gear

servo9.jpg 

 

 

Step 8 : The finger is far away now,  identify the 'notch' that prevents the gears to turn around its shaft. 

servo10.jpg 

 

 

Step 9 : I've used one of the screws to drill the notch out,

Then I've used the same screw to drill the plastic gear  (Not sloppy on the shaft --> just be sure that it can turn with ease)  

servo11.jpg 

 

Step 10 : Put all the gears back to the shafts

servo12.jpg 

 

Step 11 : You can put everything back together

servo13.jpg

 

Step 12: Write some code to test... and enjoy ;)

(note that servo0 is used to center the POT ,  and servo1 is used to test turning forward then backward for 3 seconds) 

 main:

servo 0,150

servo 1,100

pause 3000


servo 0,150

servo 1,150

pause 1000



servo 0,150

servo 1,200

pause 3000


servo 0,150

servo 1,150

pause 1000



goto main

 

 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.
emuller's picture

I'm wondering - you use the driver to find where the centre position of the pot is - but is that the most accurate?

Is it not more accurate to use an ohmeter to measure the maximum possible, across the outside legs of the pot, then tweak the pot till the resistance across one of the outer legs and the inner leg becomes half of that? -Given the comments by BoA,  I'd have thought that an ohmeter would be the most accurate and best way to centre the pot.

 

BaseOverApex's picture

Nope. Couple of reasons:

1) you don't really want to find the middle of the pot, you want to find the servo's centre position and that may well depend on your controller. If there's a tiny innacuracy in your controller, then the middle of the pot might not be the servo centre. By adjusting the pot until the servos stops, you're matching it to the controller. My fixed potential divider only worked because I (typically) over-engineered my controller and it was uber-accurate. So accurate, in fact, that it could really only operate 3 or 4 servos at a time before it all fell over in a heap.

2) I haven't measured them, but the chances are the pots are logarithmic rather than linear. That is to say that the electrical middle is different from the mechanical middle.

iCon's picture
i wish i found this link before i ripped my servo apart lol
fritsl's picture
Hey  ndupont, I needed this info now, thanks a bunch for making this, very nice pictures and all, thanks!
jka's picture
instead of gluing or soldering the potmeter, I've chosen another way to do it. I took an SMD trim potmeter, which is very small and soldered the potmeter wires to it. That way, if the "stop" position doesn't match the pulsewidth I am using, I can always open the case and adjust.
BaseOverApex's picture

Good plan. You could even fit a horizontal one and drill a hole inthe side of the casing for live adjustment.

Did you not find it difficult to get two servos adjusted sot hey're going at identical speeds for a given PWM?

jka's picture

I'll tell you, when I have modified servo two :) I just got the idea yesterday, when I was looking at an old PCB with two smd trimpots. I'll modify no. 2 later today and maybe post a picture or two.

Good idea with the vertical mouted. I think it will work for normal sized servos, but I don't think there is room for it in the micro servos. But it would make it easier to sync two servos.

jka's picture
I'm afraid the answer is no. They are not in sync. I think the problem is the same as with all motors. They do not run at the same speed and they never will, unless there is some sort of feedback. But it was worth a try.
BaseOverApex's picture

Ha! How did I get horiz and vert mixed up? I'm an engineer, you know!

I would have another go at tuning them. The servo has its own PWM controller which is always trying to adjust the speed of the motor based on the resistance input. I honestly think the problem is that the two trimpots aren't matched.

....unless you're talking about when teh motors are both going flat out they still aren't matching?

jka's picture
I haven't had the time to experiment much. The difference in speed might have another reason. The shaft from the potmeter is holding the gear in place and since I was too lazy to find a small drill to expand the holes in the gearwheels a bit, so they would spin freely, I just hacked the potmeter to spin 360deg. There might be a difference in the resistance (physical resistance, like harder to turn) that makes one of the servos spin slower. I think I'll expand the hole to make the gearwheel spin freely and see if it doesn't help. Also, I have some other ideas, that I would like to test, when I get some time. But you know, too many projects, too little time :)
OddBot's picture

I've found that temperature can affect continuous rotation servos. SplatBot uses a servo driver board that allows larger motors to be driven like a servo. I replace the 10K pot with 2 x 5K metal film (1% tolerance) resistors. The off position drifted towards slow reverse when the temperature was cooler and slow forward when the temperature rose. I've had to increase the deadband to reduce this problem and ended up turning off the servo when I wanted it to stop. I suspect that under normal conditions when a feedback pot is used that this problem would self correct with only a minor change in centre position.

Because of this I think some form of speed feedback would be required. Perhaps a frequency to voltage converter taking pulses from an encoder with the analog output correcting the centre position voltage?

 

robologist's picture
I'd seen this same action, drifting one direction on a stop (1.5 ms) pulse width, then later drifting the other direction with the same width. But I'd attributed it to sagging battery voltage, NiMh batteries at full charge initially pushing 5.8 volts, then slowly draining down to 4.4 when ready to recharge. Think the same thing was doen, stop sending pulses to get them to stop completely.
OddBot's picture

I liked your use of the logo. I'll have to do something similar with my next walkthrough. Iam a bit confused by the code, why are you centering the servo on a different output pin to the pin used to control the servo?

Since servos vary greatly you will probably hear heaps of alternative methods like BOAs. I never considered solder although I'd be careful of a pots plastic housing. too much heat and your shaft could end up at an angle depending on the pot construction.

The Hextronic servos I used on Bot08M had a splined shaft instead of a slotted shaft like yours so the plastic gear was easier to drill but more work had to be done on the shaft to get it round.

BaseOverApex's picture
That's a good point about the slotted shaft, with respect to your earlier comment: Judging by the shape of ndupont's pot shaft, it can't have been providing much mechanical strength to the output! There's probably no reason he couldn't use the resistor bridge method.
ndupont's picture

the code has two functions :

port0  to keep everything centered while modding

port1 to test the final result

 

About the soldering, yes, it has to be done fairly quickly     (but the plastic is made to allow soldering the 3 pins of the pot')

For sure, don't try so solder any iron, aluminium or other non-solderable alloys

 

The guys from Parallax/Futaba also keep an externally adjustable pot to tweak their continuous rotation servos.

http://www.parallax.com/Portals/0/Downloads/docs/prod/motors/crservo.pdf

 

BaseOverApex's picture

Not too sure how well the solder is going to hold on the pot spindle, though. Mine are made of steel or aluminium, neither of which solders. I suppose if you've thinned it enough that there's absolutely no torque on it then the hardened flux might just be enough to stop it rotating.

 I've tried a couple of other approaches. With the pot centering technique described above, I could never get all my continuous servo mods centered at exacly the same pulse width. Consequently, most of my small bots can't go in a straight line.

One solution I tried was hacking the knob right off the pot (there was anough shroud let on the servo housing to be the load bearing of the main output shaft).

ServoModPot.jpg

The solution I ended up with was to desolder the pot altogether and replaced it with a pair of resistors in a fixed potential divider. They MUST be of a very low tolerance. If you use +/-5% pots, their resistances are too unpredictable and might be too substantially different. Try to get 0.5% or lower. They're more expensive (like 20 cents instead of 10!) and well worth it.

(Hahaha - I just realised after talking about ally and steel shafts (as in SOME of my servos) the ones in my picture have brass shafts. Brass, of course, solders particularly well!!- D'oh!)

I'll chuck in a few more pictures of my partially disassembled servos. This one might be useful if you can't rememeber the order the gears go back on:

 ServoModGears.jpg

 This one's got its knob cut off (TWSS). Note the slot I cut in the top to allow it to be tweaked with a screwdriver:

ServoModPotCut.jpg

 And this is the circumcised pot hidden back in the casing....

ServoModPotHidden.jpg

 

OddBot's picture
I take it that your output gear did not require the pot shaft to spin on? Has removing the pot shaft reduced the mechanical strength of the output?
BaseOverApex's picture

I don't think so. It may be a feature of my particular (Acoms) servos, but the main drive gear is a sort of flange on the drive shaft. The center of this "flange" sits over a shroud on the motor casing (the shroud can be seen on the reassembled gearbox). The pot was only attached by 3 gobs of solder and didn't fit particularly well in the middle of the shroud anyway, so I don't think it was affording much mechanical strength.

If your servos gain strength from the presence of the pot knob, I suppose an aluminium or plastic piece could be turned on your lathe (ha ha) to fit.