2013/01/26

Hacking a servo: Part I

Motivation

Servos are probably the most popular actuator in DIY robotics today. Cheap, easy to use and easy to control, they are almost everything you want for your little robot. However, they're also quite limited, since they don't provide any feedback, or any information about how they're performing. This makes servos open loop systems, resulting in robots showing typical open loop issues.
Basically, your robot tells its servos to move to some position, and hopes they do it. Never knows whether servos have come to its target or they are stuck in the middle. Even when a servo doesn't get stuck, it's hard to predict where it actually is due to varying loads and initial conditions.
Most of the time, this is solved using an external sensor, like a potentiometer.
But some times there is no room for extra sensors in your robot, and even if there is, why bother when the servo has its own potentiometer inside?


In this tutorial, we are going to see how to access the internal potentiometer of a servo by means of a simple modification. This allows us to use the servo in advanced aplications, like closed loop control, without the need for extra sensors. Some of this uses we'll see in a later post.

So to start, lets take a look at a standard servo:

 It is basically a DC motor and a potentiometer, embedded in a plastic frame with some electronics.
It tipically has three wires: Ground, Vcc and Pulse (usually black, red, white; In this case brown, red, orange).
Our intention is to access an internal 4th wire, the potentiometer's signal, which will tell us the excact position of the servo as an analog voltage.



 So the first step is unscrew the bottom cap of the servo and remove it. This will reveal the electronics. Now we have to carefully extract the board, which is probably soldered to the DC motor. Once you do that, you will see the internal potentiometer, conected by three wires to the main board.
 Now, using a multimeter, locate the signal wire (whose measured resistance will vary as you rotate the head of the servo).
Take a look at where this wire connects to the main board, because that's the spot where we are soldering the extra wire.
Now that you have located this tin point, put the electronics (with the motor) back to its place, and plug the soldering iron.
 Before you solder anything, make sure you have selected the right spot by checking resistance again with the multimeter. You can double check it by connecting the servo to a power source and measuring voltage instead of resistance. If voltage varies as you manually rotate the servo, you've got the right spot.
Finnaly, in order to accomodate the extra wire in the plastic frame, make a small hole into it.
I'm not good at making holes and cutting things, so once I had finished, I decided to seal the hole with some glue and tie it to the other three wires to prevent forces around the soldering point that could eventually break it.




With this simple trick, we have hacked a standard servo into a complete actuator with position feedback. In the second part of this tutorial, we will see how to use this extra wire to characterise a mathematical model of the servo using an arduino board.

No comments:

Post a Comment