Hello,
I have a servo Vigor VTS-08B http://www.vigorprecision.com.hk/uploadfile/20120530/20120530173655378.pdf.
I am using the following code to command the servo via serial monitor move to a specific angle.
/*
Servo Test Code
Bascially user inputs no. between 0-180 from the serial monitor
Arduino turns the servo to that position
*/
#include <Servo.h>
Servo myservo; // create servo object to control a servo
void setup()
{
// Begin Serial library
Serial.begin(9600);
// attaches the servo on pin 6 to the servo object
myservo.attach(6);
}
void loop()
{
// Whenever there is some data input from serial monitor, i.e whenever user enters a number(position)
// command arduino to move to the postion
if(Serial.available())
{
// Move the servo to the postion as specified by user
myservo.write(Serial.parseInt());
// wait for some time
delay(1000);
}
}
Problem is that whenever i enter a number it moves to that angle (also not so accurately) and when it stops it constantly make a noise for a few seconds. And when I enter an angle again less than the previous angle I entered it moves reverse to 180 deg first than goes to the angle entered. Eg. First I move the servo to 135 deg by entering 135 in the serial. It moves to that angle but it still makes a constant sound for a few seconds than stops. And when I enter a smaller angle say 90 deg , ther servo first goes to 180 deg than to 90 deg.
I am using Arduino Uno with an external supply from an AC to DC adapter capable of providing 5.5V and 500mA. And Arduino UNO is being powered via my laptop's USB . No load is attached to Servo motor.
Also I have another motor V3003 (datasheet not available online) . It works perfect and does not give me the above problem. This Servo requires less power than above. So i think Code works fine.
Please help me. Any more queries are welcome.
Thanks in advance