I thought it was a power issue, so I hooked it up to a 7.5 V 3A converter (12v to 7.5v). I hooked the positive and negative right to it, then the control line into my arduino. Still no luck. I wired the little servo up the same way and it spun just fine.
I looked to see if there was some coding difference that I'm missing between the two servos, but can't seem to find anything.
Did you connect servo ground to Arduino ground? You need both battery and Arduino ground connected. Also, you aren't ever using the Arduino to power any servos, I hope. Even with small servos, it's not recommended.
Lastly, the page for that larger servo states that it has 270 degrees of rotation. There is another way to control them with Arduino but see where you are after the first recommendations.
that seems to help, but now the servo moves erratically. It will move then stop, then move again, then not move for a bit, then do what it is supposed to do for a cycle or two, then stop. When it is not moving it is making a clicking sound. So strange.
works great on the little servo, not so much on the big one. Just get a constant clicking and no movement. It doesn't even stop clicking. I get the led light up that it got the signal from the button I'm using, but just keeps on clicking.
Do you think it has something to do with the 270 degree of motion, or my movement positions (40, 90, 140)?
Found a line that says your pulse range is something like 640-2400uS. Let's widen the values but not all the way to prevent overdriving it. Neutral should be 1500uS. Don't use on normal range servo, you'll overdrive it.
#include <Servo.h>
Servo myservo1; // create servo object to control a servo
const byte goodPin = 7;
const byte badPin = 2;
const int servoPin = 3;
const byte outPin = 13;
bool goodBtnState;
bool badBtnState;
void setup() {
pinMode(13, OUTPUT);
pinMode(7, INPUT_PULLUP);
pinMode(2, INPUT_PULLUP);
myservo1.attach(servoPin);
goodBtnState = HIGH;
badBtnState = HIGH;
myservo1.writeMicroseconds(1500);//should be about 90 deg
delay(500);
}
void loop() {
goodBtnState = digitalRead(goodPin);
if (goodBtnState == LOW) {
delay(20);
goodBtnState = digitalRead(goodPin);// read it again, simple button debouncing
if (goodBtnState == LOW) {
digitalWrite(outPin, HIGH);
delay(100);
digitalWrite(outPin, LOW);
myservo1.writeMicroseconds(2200); //should be about 235 deg
delay(700); //wait
myservo1.writeMicroseconds(1500);//should be about 90 deg
}
}
badBtnState = digitalRead(badPin);
if (badBtnState == LOW) {
delay(20);
badBtnState = digitalRead(badPin);// read it again, simple button debouncing
if (badBtnState == LOW) {
digitalWrite(outPin, HIGH);
delay(100);
digitalWrite(outPin, LOW);
myservo1.writeMicroseconds(700); //should be about 0-10 deg
delay(700); //wait
myservo1.writeMicroseconds(1500);// should be about 90 deg
}
}
}
All servos work in microsecond (uS) pulses. They typically operate in the 1000-2000uS range but there are unique ones out there, such as yours.
Those pulse ranges work with RC ESCs, too, such as drone ESCs. I googled your servo and stumbled across the extended pulse range of yours. It's my preference to code myServo.writeMicroseconds(n);vs myServo.write(angle); since I have had the same issue you had in the past.
I think HiTec servos are a bit tricky, too.
Glad it worked out for you