Go Down

Topic: Servo Twitching in an Arm (Read 2 times) previous topic - next topic

zoomkat

As you don't show all your code (are you using the servo library?), below is some simple servo test code you can try on the servos having issues to see if it could be your code.

Quote
With all other servos unplugged from the Arduino, and the only servos connected to power being the shoulders into the transformer, they still twitch.


So the servos having issues are powered via a "transformer" and the servos powered from the battery work ok? Have you tried powering the twitching servos from the battery to see if they still twitch?

Code: [Select]

// zoomkat 10-4-10 serial servo test
// type servo position 0 to 180 in serial monitor
// for writeMicroseconds, use a value like 1500
// for IDE 0019 and later
// 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.writeMicroseconds(2000); //set initial servo position if desired
  myservo.attach(7);  //the pin for the servo control
  Serial.println("servo-test-21"); // so I can keep track of what is loaded
}

void loop() {

  while (Serial.available()) {
    delay(1); 
    if (Serial.available() >0) {
      char c = Serial.read();  //gets one byte from serial buffer
      readString += c; //makes the string readString
    }
  }

  if (readString.length() >0) {
    Serial.println(readString);  //so you can see the captured string
    int n;
    char carray[6]; //converting string to number
    readString.toCharArray(carray, sizeof(carray));
    n = atoi(carray);
    myservo.writeMicroseconds(n); // for microseconds
    //myservo.write(n); //for degees 0-180
    readString="";
  }
}
Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   8)

chambo622

Thanks for the code, i'll try this shortly, the microseconds seem interesting. and Yes, I was using the servo library.

The "transformer" i referred to is the SAME battery powering the Arduino. on 3 of the servos (when they were plugged in, they aren't now), i plugged them in to 5v and ground on the arduino.

on the other 3, I took a small 12v --> 5v converter, and connected that to the same lead acid battery, but regardless of where I plug in the shoulder servos (arduino or transformer), they twitch.

A recent discovery I had though, was if I took an external power supply and connected them, I can power it from 4.7 all the way to about 5.2 and it will not twitch; at 5.2 and above it twitches. a lot. and increasingly so.

What would make these servos so shy of power?

btw. is transformer the right word?

Thanks

zoomkat

Quote
The "transformer" i referred to is the SAME battery powering the Arduino.


That really doesn't make any scense. Transformers are usually associated with AC power supplies and are not batterys.
Quote
I took a small 12v --> 5v converter


Can you give the technical details of this converter?

Quote
A recent discovery I had though, was if I took an external power supply and connected them, I can power it from 4.7 all the way to about 5.2 and it will not twitch; at 5.2 and above it twitches. a lot. and increasingly so.


Can you give the technical details of this power supply? What are the numbers refering to? You might want to do some reading at the below link.

http://www.lynxmotion.net/viewforum.php?f=6&sid=100db4e42267b9b2aa4c21c69fc22e31
Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   8)

retrolefty

Yes, you are not using good terminology to describe your power method. We will need either proper words, or drawings, or maybe even pictures. It sounds like you are having a power problem, but it's hard to determine what to tell you from your description of what you are using.

Lefty

chambo622

OK sorry, let me be insanely clear. I ripped this power downscaler from a USB car charger, and it gives off 5.1 volts when connected directly to the same 12v battery as the arduino.

Lynxmotion forum is irrelevant, they are hitec servos and all lynxmotion made was the arm pieces.

I figured out that one of my shoulder servos, and also the base, was a whimp. I replaced them in testing and its all good. The previous, lamesauce servo from the shoulder easily succumbs to pressure and twisting on the arm, causing it to twitch. I don't think its a gear slip, maybe a weak motor. Regardless, I've fixed the issue by replacing the servos. My only question now is how to avoid this deterioration of motors in the future.

Thanks both of you for your help, what's the proper term for what I used?

In terns of limiting strain on the motors, you can see in my code I won't let them go past 180, should that value be 175?

Thanks

Go Up