I have 2 SpringRC SM-S4306R servos, these are continuous rotation servos with plastic gears. You can find them for less then 10$, I got mine on Ebay. These servos come with a bag of attachments, I got no less then 6 different plastic attachments. The difference with a standard servo is that these will continue to rotate while a standard servo will just go to a certain position and then hold that position. So these servos can be used to drive a wheel of a robot. They have the same 3 wire connector as a standard servo, VCC, GND and one wire to control the servo. On the side of these servos there is a screw, by turning this screw you can setup the “zero” position of the servo. This is important to accurately control the servo. When you do servo.write(90) the servo should be at standstill.
Both of my servos needed some finetuning so they would stop at the 90 degree position. To do that I just made a simple sketch with servo.write(90) in it. Then I adjusted the screw so that the servo didn’t move any more. Continuous servos work with the same servo library that comes with the Arduino IDE as standard servos, you don’t need any special libraries. To rotate the servo you just write a value to it, 90 is stop, a value lower then 90 is counterclockwise a value bigger then 90 is clockwise. I checked how much current these servos draw, at full speed they draw 120mA @ 6V.
When starting or when quickly changing the direction they draw a lot more current, I’ve seen peaks of almost 400mA. So you need an adequate power supply to power them, do not power them straight of an Arduino.
I’ve seen some posts on the Arduino forum from people that try to run servos of a 9V (6LR61) battery, these batteries can not supply enough current to power these servos. And you could potentially damage them because most servos are made for voltages between 4 and 6V. Compared to standard DC motors servos have the benefit that they don’t need any electronics or gearboxes to use them, servos have all these things onboard making them very easy to use. The downside is that it is difficult to find cheap wheels that mount directly to a servo. But you can find continuous servos with a wheel already attached to them, Arduino-direct sells them.
Here is a sketch that will let a continuous rotation servo turn in both directions at full speed and at a very slow speed:
// http://www.bajdi.com // Rotating a continuous servo (tested with a SpringRC SM-S4306R) #include <Servo.h> Servo myservo; // create servo object to control a servo void setup() { myservo.attach(9); // attaches the servo on pin 9 to the servo object } void loop() { myservo.write(45); // rotate counterclockwise full speed delay(2000); myservo.write(90); // stop delay(100); myservo.write(135); // rotate clockwise full speed delay(2000); myservo.write(90); // stop delay(100); myservo.write(80); // rotate very slowly counterclockwise delay(2000); myservo.write(90); // stop delay(100); myservo.write(100); // rotate very slowly clockwise delay(2000); }
can i use these types of sketch to control a esc
Yes you can use the Arduino servo library to control an ESC.
Hi, I’m trying to use this way to control my esc but I’m having problems. I’m using the traxxas velineon vxl-3s esc and brushless motor. The problem is that the esc just blinks a green light. Do I have to manipulate the code in anyway? I’m using an arduino uno
Hi,
I’m having problems connecting 2 continuous rotation servos to the arduino board. I can manage to rotate only one and if I try to stop it continues moving.
I’m using this diagram to connect everything
http://www.robotoid.com/appnotes/arduino-operating-two-servos.html
would be really useful if you can help me
thank you in advance 😉
Hi Camila
I have just started trying out continuous rotation servos for a buggy and have found the Uno not capable of providing the power for the two servos. Hence I ended up with this info you have and it did not work at all until I remembered the point about ensuring the external battery -ve was connected to the Uno ground. It then worked.
I hope your problem is the same.
Byeeeee
Robert
Do your servos have a screw to adjust the stop position?
Thanks for the information, I’ve learned a lot from this. I have the same servo, and, as a noob, I didn’t know how this motors worked untill now. I have to keep track of the current, because I was working with the servo directly connected to the Arduino for the tests, I did noticed that when it was working the “on” light was dimming a little.
what did you use supply power to servos??
2S Lipo battery, and a voltage regulator to drop the voltage to 5V.
I need to operate continous servo at differnet agnle 0,90,180,270,360. is it possible to stop at these postions. pplz help me with any demo code if you have
@anil, sorry, but continuous “servos” don’t have positional feedback. A better name for “continuous servo” would be simply a geared motor. If you need continuous motion and angle feedback you’ll need to provide some external position feedback.
how to control servo for specific number of rotations like 3,5,10 etc….??
Great write-up. Suggestion is to first put in one line of code
myservo.write(90) and a delay. then calibrate it with the adjustment as discussed so it stops. Makes everything else a lot easier.