Hello all, huge newbie here... I'm trying to tackle a remote-controlled droid at the moment and can really use some assistance...
The main issue I am having is both servo's not spinning forward/backwards in sync...
I'm trying to figure out how to calibrate the 2 Continuous running servos (FS5103R) being controlled by a UNO using an Adafruit 16-Channel 12-bit PWM/Servo Driver... The issue I am having is how to find the proper high and low values under the "map" function in the code. I feel completely lost finding the idea "tick" values for both continuous running servos as most tutorials I find only cover 0-180 rotational servos for calibration.
I've zero'ed out both at 1500 using the Pot on the servo's itself but not much luck... On a side note, the FS5103R are marked as Wheel1 and Wheel2 and I am running the servo's at 6.5V.
In times past I've used the below to setup continuous rotation servos. I would send 1500 or 90 to to the servo, adjust the pot as best possible until the pot is centered in the bounds of no movement, used a little dab of hot glue or similar on the pot shaft to keep it from moving. Then I would send slightly higher and lower values to determine the center value for no movement. As the servos are non precision hobby components, you may have to recalibrate from time to time.
// zoomkat 7-30-10 serial servo test
// type servo position 0 to 180 in serial monitor
// for writeMicroseconds, use a value like 1500
// Powering a servo from the arduino usually *DOES NOT WORK*.
String readString;
#include <Servo.h>
Servo myservo; // create servo object to control a servo
void setup() {
Serial.begin(9600);
myservo.attach(9);
}
void loop() {
while (Serial.available()) {
if (Serial.available() >0) {
char c = Serial.read(); //gets one byte from serial buffer
readString += c; //makes the string readString
delay(3);
}
}
if (readString.length() >0) {
Serial.println(readString);
int n = readString.toInt();
Serial.println(n);
myservo.writeMicroseconds(n);
//myservo.write(n);
readString="";
}
}
Update, for a continuous rotation servo, if it stops turning after a speed command, you may need to comment out the "readString="";" so the last command will continue to be sent in the loop until a new command arrives.