Go Down

Topic: Servo jitter - me too (Read 2239 times) previous topic - next topic

SHAtoday

Jun 19, 2015, 08:34 am Last Edit: Jul 07, 2015, 10:31 pm by SHAtoday
Well, I saw another post about this, with no real solutions.

My servo, jitters and shakes the robot (steering servo).
Sometimes the throttle control does the same thing.  Well, it causes the robot to jump forward and back...

I think it is because of these thin wires, and bad connections on the data wires.
I have no idea.  I am contemplating a screw terminal module, like this one

http://www.bing.com/images/search?q=arduino%ee%80%81+screw+%ee%80%80shield&id=56DE3D10F379C8466BB8E5984C8B52AFAFFD3888&FORM=IQFRBA


Code: [Select]

const int Strait = 90;//      
const int Left = 65;//  
const int Right = 115;//


Next is in setup();

Code: [Select]

//ATTACH AND ALIGN STEERING  
  steeringPin.attach(7);
  steeringPin.write(90);
    delay(1000);  


then I call for a change later

Code: [Select]

  steeringPin.write(Left);


very simple, and yet, it shakes and jitters.
How do I fix this? I have tried several different delays after the steeringPin.write(Left);
With or without the delay, it shakes and fails to work correctly.
The power to the servo is 5V, from a separate power supply than the Arduino.

zoomkat

Simple servo test code you can try to see if the servo jitters with this code.

Code: [Select]

//zoomkat 7-30-10 serial servo test
//type servo position 0 to 180 in serial monitor
// 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);
  Serial.println("servo-test"); // so I can keep track of what is loaded
}

void loop() {

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

  if (readString.length() >0) {
    Serial.println(readString);  //so you can see the captured String
    int n = readString.toInt();  //convert readString into a number
    Serial.println(n); //so you can see the integer
    myservo.write(n);
    readString="";
  }
}

Google forum search: Use Google Search box in upper right side of this page.
Why I like my 2005 Rio Yellow Honda S2000  https://www.youtube.com/watch?v=pWjMvrkUqX0

Grumpy_Mike

If your code is putting out a constant value and the servo is jittering then there is something wrong with your wiring.

Quote
There is always about a 30% error rate with these products.
What products? Link please.

ShadowGaming

What products? Link please.
I think he means the screw terminal shield
-Robot builder
Current project: W.A.R.P

Walk Alike Robotic Project

Grumpy_Mike

He said:-
Quote
I am contemplating a screw terminal module,
Which means he hasn't got one yet. His post is poorly worded and it is not clear what products this screw terminal module or indeed screw terminal shield actually is. A link would clear it up.

Grumpy_Mike

Quote
I you have higher voltage servos and a higher voltage power source, do not share the ground.
No that is wrong. If you think it improved things then you are misunderstanding something.

Quote
Use diodes where needed to restrict the flow of electricity (one way energy flow).
No idea what that means but it sounds wrong in this context. You probably need supply decoupling rather than diodes.

Grumpy_Mike

Quote
I suspected bad distance reads where due to power surges on the one battery system
You don't get any power surges on a battery, so I don't know what you mean.

Supply decoupling and common grounds are vital, reading these links might help you:-

http://www.thebox.myzen.co.uk/Tutorial/De-coupling.html

http://www.thebox.myzen.co.uk/Tutorial/Power_Supplies.html

DavidGascon

I had one of my motors connected to a 3.3V power supply, and it jittered extremely bad. I asked a hobbyist and he said it wasn't getting enough power. I connected mine to a 6V power supply and no jitters!

Grumpy_Mike

Quote
So, to help, regardless of what others think, separate your power.
That is not a help regardless of what you might think. It is a propagation of miss information.

Quote
because sometimes people don't pay attention and ground more than one power supply together
ALL power supplies must have their grounds connected together did you not read the link.

Using the proper words is important. Doctor I have cut off my leg, sorry I should have said hair.

This forum is where you get good solid advice not poor badly thought out superstition like you are giving. If you are seeing an effect when doing an experiment that runs counter to logic then there is something wrong with the experiment. You can not reinvent the laws of physics just because you don't understand them.


Quote
To quote the decoupling article, ......
Did you spot I wrote that artical?

SHAtoday

#9
Jul 07, 2015, 10:28 pm Last Edit: Jul 07, 2015, 10:32 pm by SHAtoday
Ok, well, I'm going to remove my posts, so others don't get confused
...


Anyone looking here for help, check your power connections and read the referenced articles above.

AWOL

#10
Jul 29, 2015, 09:49 pm Last Edit: Jul 29, 2015, 09:49 pm by AWOL
Ok, well, I'm going to remove my posts, so others don't get confused
. . . which makes a complete nonsense of other peoples' replies.

Well done.

Go Up