I'm using two FS5106B hobby servos with an Arduino Uno. They were both working fine except they would hum and vibrate continuously the moment I plugged them in. But they still rotated per the code.They both are connected to individual 6 volt battery packs for power. THe arduino has its own power supply. I would like to know what to do to get rid of the hum.
Recently though, one servo stopped rotating properly. I removed it from power and tried to rotate it by hand and its not moving properly even by hand. I am going to replace it with a different servo but I’m worried that what caused the hum is what is causing the servo to die and the same thing may happen to the new one as well.
Any suggestions on what might be happening will be really helpful.
The Arduino has power coming from a 9V battery connected through the barrel jack. The two servos have independent 4-pack AA batteries giving each of them power. The Arduino, battery packs and servos all share a common ground.
ashrobotics:
They were both working fine except they would hum and vibrate continuously the moment I plugged them in. But they still rotated per the code.
Do they hum all the time regardless of the position the servo arm is at?
CrossRoads:
"Do they hum all the time regardless of the position the servo arm is at?"
Only the ones that don't know the words 8)
Brings to mind a TV ad from way back ...
Two chimpanzees were bringing a piano downstairs and got in a heap at the bottom
The young one says "Dad, do know the piano's on my foot?"
The father said "You hum it son and I'll play it".
They do hum from the moment they are powered up (connected to the battery). I leave the battery disconnected for that reason till I'm ready to run it. I set the servo arms to 0 and 180 at setup. Not sure if that causes any issues.
I have read of 2 servos being powered off a single 6V battery pack - and I have two. Is that not enough power for the servo?
ashrobotics:
I set the servo arms to 0 and 180 at setup. Not sure if that causes any issues.
Many servos are not physically able to go all the way to 0 and 180 and the noise may be the servo pushing against its end stops. At least for testing set the limits to 20 and 160.
If you use servo.writeMicroseconds() you will have finer control of your servo and you can experiment to find how far in each direction it can actually move.
Here's a test sketch I found, you can see if your servos can go all the way to 0 and 180.
/*
Try this test sketch with the Servo library to see how your
servo responds to different settings, type a position
(0 to 180) or if you type a number greater than 200 it will be
interpreted as microseconds(544 to 2400), in the top of serial
monitor and hit [ENTER], start at 90 (or 1472) and work your
way toward zero (544) 5 degrees (or 50 micros) at a time, then
toward 180 (2400).
*/
#include <Servo.h>
Servo servo;
void setup() {
// initialize serial:
Serial.begin(9600); //set serial monitor baud rate to match
servo.write(90);
servo.attach(9);
prntIt();
}
void loop() {
// if there's any serial available, read it:
while (Serial.available() > 0) {
// look for the next valid integer in the incoming serial stream:
int pos = Serial.parseInt();
pos = constrain(pos, 0, 2400);
servo.write(pos);
prntIt();
}
}
void prntIt()
{
Serial.print(" degrees = ");
Serial.print(servo.read());
Serial.print("\t");
Serial.print("microseconds = ");
Serial.println(servo.readMicroseconds());
}