I'm trying to use a continuous servo attached to a wheel but can't figure out what is the problem with the code. Why the motor works intermitent? If I want to make it go full speed in either direction, what should I do?
Thanks
[code
#include <Servo.h>
Servo myservo;
void setup()
{
myservo.attach(9);
}
void loop() {
myservo.writeMicroseconds(2000);
}
]
How is the servo powered? Can you better describe what the servo is doing?
It's powered from the arduino and is a microservo so I don't think power comsuption is a problem.
The servo spins around 10 deg and stops and so on. I tried another continuous servo and is the same what makes me think is not the servo.
jucasan:
It's powered from the arduino and is a microservo so I don't think power comsuption is a problem.
It is a problem. Even microservos draw 0.5-1A, the arduino and probably your USB port as well are are not designed to deliver that.
jucasan:
The servo spins around 10 deg and stops and so on.
What does that actually mean?- does it go 10 degree, stop, go another 10, stop, etc etc?
jucasan:
It's powered from the arduino and is a microservo so I don't think power comsuption is a problem.
Well it might be. I have successfully run a 5V continuous micro servo off an Uno 5V pin, but that doesn't mean it's a good idea. This page here says even a micro servo can draw over 700mA at stall, which is what it would draw at start up.
Have you tried values below 2000, which would be full speed?
Try detaching the wheel just for a test. The amount of load on a servo can greatly increase the power it needs. There's nothing wrong with the code so it's definitely the servo and it's connections that are at fault.
If it works with no wheel connected put it back on and try powering the servo from 4xAA batteries (just to humour us!).
Steve
One of the problems was the power supply. I connected servos to the arduino hundreds of times and no problem. With the continuous servo seems to be a problem.
Still having issues with the code. With one of the contimuous servos only spins one direction no matter if I write Microseconds 2000, 1500 or 1000. The another servo doesnt spin at all.
That doesn't sound like a code problem, it sounds like bad servos. Try them with the example Knob program from the IDE and 4 x AA batteries. If they still don't work correctly then I'd guess they were badly converted to continuous movement.
Steve
The #1 problem was the power supply. Not enough power from the arduino. The values for writeMicroseconds are:
0 turns ccw
2200 stops
4000 cw
No idea why but works.
Thank you guys!