Electronics > Electronics

servo with "parkinson"

(1/2) > >>

hi guys !  i built a robotic arm and at all it seems to be ok but the servo that rotates the whole system suffers from parkinson , you know what i mean when it stop rotating actually is going a lil bit rigth and left!   the problem has to do with the servo or with my code? i have conected it to a digital and analogue exit but nothing happens!  the servo is tower pro sg5010 ! 

Smells like the command pulse may be jittering a bit.
Do you have access to an oscilloscope to watch it?

Are you using http://www.arduino.cc/en/Reference/Servo or did you write your own code?

thanks for replying   :D  !! no i havent access!

the code isnt  100% by me , only changed some parameters!
i have to mention that the servo is cheap , also i have and a spring servo but everything works ok!
the bad thing is that the" parkinson" servo its difficult to replace it ! what do you suggest?
(sorry for my english )

int servoPin     =  2;   
int minPulse     =  600; 
int maxPulse     =  2400;
int turnRate     =  100;
int refreshTime  =  20;   

int centerServo;       
int pulseWidth;         
int moveServo;           
long lastPulse   = 0;   

void setup() {
  pinMode(servoPin, OUTPUT); 
  centerServo = maxPulse - ((maxPulse - minPulse)/2);
  pulseWidth = centerServo;   
  Serial.println("      Arduino Serial Servo Control");
  Serial.println("Press < or > to move, spacebar to center");

void loop() {
  if (Serial.available() > 0) {
    moveServo = Serial.read();

    if (moveServo == 44) { pulseWidth = pulseWidth - turnRate; }
    if (moveServo == 46) { pulseWidth = pulseWidth + turnRate; }
    if (moveServo == 32) { pulseWidth = centerServo; }

    if (pulseWidth > maxPulse) { pulseWidth = maxPulse; }
    if (pulseWidth < minPulse) { pulseWidth = minPulse; }


  if (millis() - lastPulse >= refreshTime) {
    digitalWrite(servoPin, HIGH);   
    digitalWrite(servoPin, LOW);   
    lastPulse = millis();         


--- Quote from: nanotechopolis_gr on June 18, 2013, 10:17:21 AM ---...   
int minPulse     =  600; 
int maxPulse     =  2400;
--- End quote ---
I thought that servos were designed to work in the range 1000-2000, with a margin allowing a wider range, such as 900-2100, or a little more. But 600-2400 looks too much. But, maybe the problem is elsewhere.

I have experienced a problem like that with a small servo. It was shaking when with some pulses, and not shaking with other pulses. Besides, when the servo was shaking, I was able to make it stand still with a little push of my hand. The problem was due to a weak servo, because, when I replaced it with another one, the problem did not occur again.

Moving servos may draw a lot of power. How strong is your battery or power source? It may be that, while it's moving, the voltage drops because the power source is not sufficient, and that causes the controller or servos to drop out.


[0] Message Index

[#] Next page

Go to full version