Hi Guys, Why am I getting this speed up at the beginning of the cycle? I'm using the standard sweep Sketch from the IDE. The servos are the ones packed in the Maker Shed Ultimate Microcontroller pack.

Hi Guys, Why am I getting this speed up at the beginning of the cycle? I'm using the standard sweep Sketch from the IDE. The servos are the ones packed in the Maker Shed Ultimate Microcontroller pack.

Nobody?
I have tried the two servos that came in the kit, and they both do the same thing. It also does it on any of the PWM pins.
The sketch is the one that came in the sample of the Arduino software. It's the one in Examples, Servo, Sweep. I'm running it on an official Uno.
Nobody?
Maybe your title should reflect your question a bit better, might attract more people
It's a PITA having to download an MP4 - why not put it on youtube with a direct link?
I suspect your code is starting its sweep at a position that is a little beyond the servo's zero position. The end positions for servos aren't exact and you may need to experiment. Servo.writeMicroseconds() is generally more useful than using servo.write() which uses degrees.
...R
Servo powered from 5V pin. Not good.
These two videos shows what I mean. The one that runs up, and back is set at 166, the other is set at 168, and you can see it continue to spin, and you can hear it grinding at the end of it's travel. I just want to make sure the Arduino board itself is ok.
By The way it does the same thing running off a battery.
Servo powered from battery, Arduino from USB? Grounds commoned?
Could be duff battery, duff servo. All that sketch does is sweep the servo, so long
as the servo has enough power (assume 1A at least is required) it should sweep
smoothly (if not, the gears are probably jamming). The Arduino cannot supply 1A
on 5V, and asking it too is, as mentioned, not a good idea. Servos and motors can
put loads of noise onto the supply too, another reason to strictly segregate supplies.
You could move to a different Arduino pin just to double check there isn't a
problem with a damaged pin output driver (due to past abuse).
MarkT:
Servo powered from battery, Arduino from USB? Grounds commoned?Could be duff battery, duff servo. All that sketch does is sweep the servo, so long
as the servo has enough power (assume 1A at least is required) it should sweep
smoothly (if not, the gears are probably jamming). The Arduino cannot supply 1A
on 5V, and asking it too is, as mentioned, not a good idea. Servos and motors can
put loads of noise onto the supply too, another reason to strictly segregate supplies.You could move to a different Arduino pin just to double check there isn't a
problem with a damaged pin output driver (due to past abuse).
I powered the servo from my bench top power supply feeding it 5 volts, and set the amps to 1 amp. Hooked a common ground to the Arduino board, and fed the control signal from every PWM pin on the board, and still the same results.
Did you read Reply #3?
...R
Yes, but I'm new to Arduino, so it's a lot to digest. Don't know enough about writing code yet. Is there sample code using the Servo.writeMicroseconds() ?
Below is some servo test code for use with the serial monitor that you might to find the servo rotation end point values of your servos. I see your videos just fine just clicking on your links.
// zoomkat 12-25-13 serial servo test
// type servo position 0 to 180 in serial monitor
// or for writeMicroseconds, use a value like 1500
// Send an a to attach servo or d to detach servo
// for IDE 1.0.5 and later
// Powering a servo from the arduino usually *DOES NOT WORK*.
#include <Servo.h>
String readString; //String captured from serial port
Servo myservo; // create servo object to control a servo
int n; //value to write to 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 all-in-one test code 12-25-13"); // so I can keep track of what is loaded
Serial.println();
}
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
// attach or detach servo if desired
if (readString == "d") {
myservo.detach(); //detach servo
Serial.println("servo detached");
goto bailout; //jump over writing to servo
}
if (readString == "a") {
myservo.attach(7); //reattach servo to pin 7
Serial.println("servo attached");
goto bailout;
}
n = readString.toInt(); //convert readString into a number
// auto select appropriate value
if(n >= 500)
{
Serial.print("writing Microseconds: ");
Serial.println(n);
myservo.writeMicroseconds(n);
}
else
{
Serial.print("writing Angle: ");
Serial.println(n);
myservo.write(n);
}
bailout: //reenter code loop
Serial.print("Last servo command position: ");
Serial.println(myservo.read());
Serial.println();
readString=""; //empty for next input
}
}
zoomkat:
Below is some servo test code for use with the serial monitor that you might to find the servo rotation end point values of your servos. I see your videos just fine just clicking on your links.// zoomkat 12-25-13 serial servo test
// type servo position 0 to 180 in serial monitor
// or for writeMicroseconds, use a value like 1500
// Send an a to attach servo or d to detach servo
// for IDE 1.0.5 and later
// Powering a servo from the arduino usually DOES NOT WORK.
#include <Servo.h>
String readString; //String captured from serial port
Servo myservo; // create servo object to control a servo
int n; //value to write to 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 all-in-one test code 12-25-13"); // so I can keep track of what is loaded
Serial.println();
}
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
// attach or detach servo if desired
if (readString == "d") {
myservo.detach(); //detach servo
Serial.println("servo detached");
goto bailout; //jump over writing to servo
}
if (readString == "a") {
myservo.attach(7); //reattach servo to pin 7
Serial.println("servo attached");
goto bailout;
}
n = readString.toInt(); //convert readString into a number
// auto select appropriate value
if(n >= 500)
{
Serial.print("writing Microseconds: ");
Serial.println(n);
myservo.writeMicroseconds(n);
}
else
{
Serial.print("writing Angle: ");
Serial.println(n);
myservo.write(n);
}
bailout: //reenter code loop
Serial.print("Last servo command position: ");
Serial.println(myservo.read());
Serial.println();
readString=""; //empty for next input
}
}
Thanks a lot. I will try this tomorrow.
ok, I loaded the program, and the servo makes the first move, and stops. Am I missing something?
tony3d:
I powered the servo from my bench top power supply feeding it 5 volts, and set the amps to 1 amp. Hooked a common ground to the Arduino board, and fed the control signal from every PWM pin on the board, and still the same results.
But how many amps did the servo actually take? 1A per servo is a rough figure for
small servos. If the servo gets reliable supply and control signals and is still not
moving smoothly, its duff.
ok, I loaded the program, and the servo makes the first move, and stops. Am I missing something?
Maybe, in the code I posted the servo goes to the commanded position, at which point it stops (unless the servo has been modified for continuous rotation). What do you expect a servo to do?
A lot of servos won't actually turn as far as they should.
zoomkat:
ok, I loaded the program, and the servo makes the first move, and stops. Am I missing something?
Maybe, in the code I posted the servo goes to the commanded position, at which point it stops (unless the servo has been modified for continuous rotation). What do you expect a servo to do?
I'm new to this whole arduino thing, and my main concern was just to make sure my arduino was working correctly. I did hook up an LED to each PWM pin, and slowly faded them up, and down, and saw no unusual jumps in brightness, so I think everything is just fine. I got my scope the other day, and would like to watch whats happening with that, but i'm still getting familiar with it. guess I would just have to connect the alligator clip to any arduino ground, and the probe to any output pin I wanted to look at right?
guess I would just have to connect the alligator clip to any arduino ground, and the probe to any output pin I wanted to look at right?
Yes.
Hooked my scope up to pin 9 to actually see PWM in action. Very cool. I can see where a scope will come in very handy! I saw nothing I wasn't expecting to see, so I can only assume my board is just fine. I am a bit Leary about poking around with my scope, because I'm also fairly new to scopes, and don't want to accidentally blow the board, or worse yet damage my new scope. Any suggestions on safety monitoring my Arduino with my scope? I put jumpers in the headers to look at pins, because I'm scared I'll short pins if I probe them at the pins themselves.
I'm scared I'll short pins if I probe them at the pins themselves.
Yes that is a problem and something I think we have all done.
While the big picture is easy to see on a scope there are lots of subtle things you will learn to pick up as you get more experience.