# Servo spinning problem

Hi , I have a problem with my microservo . Im making a little car controlled with an Arduino Uno board. The problem here is that when the board receives a positive angle of spin the servo works very slow , otherwise when it receives a negative angle or cero it works perfectly. I cant put them both to work at 0 because they'd spin in the same direction and the car wouldn't work so I'd aprecciate any kind of help.

Thank you

Hi rock,

I'm not an expert and still pretty new in using Arduinos, but I recently worked with a servo motor. May I ask if you have a Continuous rotation servo (since you said you were making a car)? or what kind of servo do you have?

That is because if you have a continuous rotation servo, what you input is not an angle, but the speed servo.write (speed) and depending on your reference point (stop speed) it would determine what is fast/slow. i.e. if my reference point is 90 and I put 91 would be slow in one direction and 89 would be slow in the other direction. The farther away(eg. 180) from the reference point the faster it is in that specific direction.

I hope that somewhat helps, if not I'm sorry :(

Perhaps you can show your code and explain positive and negative angles. Also, how is the servo powered and wired to the arduino?

Im using a normal servo , but modified to rotate 360 degrees. The problem here is that when I put an especified value in the program (lets say a positive one) it rotates clockwise and slow , If I put a negative one or 0 it rotates counterclockwise and fast (not really fast , but the speed Im looking for) . Im just starting with arduino and I'm kinda a noob so pls help me :D.

int VelMotorLeft = 0; // Speed of the left engine int VelMotorRight = 0; // Speed of the right Engine VelMotorLeft=90-SMotorLeft*30*Marcha; VelMotorRight=90+SMotorRight*30*Marcha; (What I mean with negative or positive value is here)

So , you are saying that I have to make a difference between my "stop speed" and my "forward speed" in the program??

Thanks

Servo test code below you can use to check your DIY continuous rotation servo. Note that the stopped control value depends on the current pot/resistor setup in the servo. These types of modified standard servos usually have a control band of ± 100us from the stopped value (if 1500us is the stopped value, full speed one direction would be 1600us and full speed the other direction would be 1400us).

``````// zoomkat 10-22-11 serial servo test
// type servo position 0 to 180 in serial monitor
// or for writeMicroseconds, use a value like 1500
// for IDE 0022 and later
// Powering a servo from the arduino usually *DOES NOT WORK*.

#include <Servo.h>
Servo myservo;  // create servo object to control a servo

void setup() {
Serial.begin(9600);
myservo.writeMicroseconds(1500); //set initial servo position if desired
myservo.attach(7, 500, 2500);  //the pin for the servo control, and range if desired
Serial.println("servo-test-22-dual-input"); // so I can keep track of what is loaded
}

void loop() {
while (Serial.available()) {
char c = Serial.read();  //gets one byte from serial buffer
delay(2);  //slow looping to allow buffer to fill with next character
}

Serial.println(readString);  //so you can see the captured string

// auto select appropriate value, copied from someone elses code.
if(n >= 500)
{
Serial.print("writing Microseconds: ");
Serial.println(n);
myservo.writeMicroseconds(n);
}
else
{
Serial.print("writing Angle: ");
Serial.println(n);
myservo.write(n);
}