Electronic – Servo does not stop in a stable position

servo

I am currently playing with the HS-485HB servo, and I noticed that very frequently the servo will not stop in a "rest" position after it stops moving, even when external forces applied to it are tiny. Instead it stops in a roughly correct position and continues to "buzz", while drawing more current than it should (~30mA). If I gently tap the servo horn with my finger, it settles into the rest position, the noise stops and the current goes down to about 7mA, which is what I am looking for.

Here's a video that demonstrates the problem:
https://www.youtube.com/watch?v=GSLFnIpSqXw

What are the possible reasons for this behaviour?

EDIT: I acted on a hunch and added a 570uF capacitor in parallel with GND and +5V of the servo. This appears to have solved the problem! And it had to be that large too. For example, using just a 470uF helped the servo park properly only half the time.

I still don't know why that worked, so an explanation would be appreciated.

Best Answer

The reason that adding a capacitor helps is because when the DC motor which actually drives the servo is starts or stops, it injects some noise into your power supply (+5V). This causes the sensor part of your servo to read a slightly different value for the position of the actuator, since the sensor is just a potentiometer wired between +5 and GND with the wiper in the middle which sets a voltage due to voltage divison.

Consider for example that you want the servo to be oriented "half way". If the voltage exactly corresponds to to position of the servo, the servo electronics compare the actual voltage to the halfway between +5 and GND (2.5V), turning the motor to reduce the voltage and therefore positional difference between the actual and target positions/voltages. However, suppose that in turning the motor on, the voltage of the +5V power droops slightly. Thus, the voltage being read is slightly lower than it should be given the position of the actuator. This causes (for example) the motor to turn off prematurely. However, when it does so, the voltage rises back up to +5V, and therefore the servo surmises that it is not close enough, and turns the motor back on, but this reduces the voltage of the power, so the cycle continues. This creates an internal feedback path that causes the servo jittering or buzzing.

Adding a capacitor close to the servo creates a low pass filter which reduces this noise on the power rail, which allows it to remain at a constant voltage irrespective of the motor turning on and off.