Go Down

Topic: LS 3006 servo (Read 6098 times) previous topic - next topic


I'm very new to the joys of arduino, and have a question about servos.  I have an LS 3006, and a Tower Pro micro servo 9g. 

If I run the example Servo Sweep code that is included with the Arduino IDE (shown below), the 9g performs as expected, sweeping to the appropriate angle and then back again.  The LS 3006 however, makes several complete rotations before pausing and then making several more complete rotations.  I can't quite seem to get it to function within a proper angle.  If I reduce the position range shown below to anything below 180, it doesn't sweep at all, but instead does a continuous rotation.

The only thing I can think of, is the power.  I have it running through the Arduino now, so it's getting 5v, but on the spec sheet, I only see specifications for 4.8v or 6v. I'd assumed running at a voltage between the two would simply equate to a speed/torque between the two.  Could it be the cause of this problem? 

Code: [Select]
// Sweep
// by BARRAGAN <http://barraganstudio.com>
// This example code is in the public domain.

#include <Servo.h>

Servo myservo;  // create servo object to control a servo
                // a maximum of eight servo objects can be created

int pos = 0;    // variable to store the servo position

void setup()
  myservo.attach(3);  // attaches the servo on pin 9 to the servo object

void loop()
  for(pos = 0; pos < 180; pos += 1)  // goes from 0 degrees to 180 degrees
  {                                  // in steps of 1 degree
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position
  for(pos = 180; pos>=1; pos-=1)     // goes from 180 degrees to 0 degrees
    myservo.write(pos);              // tell servo to go to position in variable 'pos'
    delay(15);                       // waits 15ms for the servo to reach the position


Sounds like the LS 3006 is a continous rotation servo.
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


Thanks.  I guess in my n00bness I assumed that a continuous rotation servo would still function the same way, only with the potential for continuous rotation.


Most likely if you are driving this from your Arduino, the current draw of the servo is more than the Arduino can handle.  You will probably want to drive it with an external device such as a power transistor or something like this http://www.adafruit.com/products/976.



You don't need a transistor to drive a servo.  Just connect the positive supply (red) wire to an external supply, 4.8 to 6V,(not Arduino 5V).  Be sure the ground wire of the servo is connected to Arduino ground.  A continuous servo should stop with a value of 90, reverse at less than 90 and forward more than 90.  Speed will increase the farther from 90 you go (up to about 0 or 180).


Thanks, I should have went to bed instead of typing  :smiley-roll-sweat:.  I had the servo knock my Arduino out because I mis-wired it.


I got around this by using servo library and some methods like this. Hope this helps!

void servoTurnLeft(){
  servo.writeMicroseconds(1300);           //full speed clockwise rotation
  delay(400);                                                 //rougly 45 degrees, play with this value
  servo.writeMicroseconds(1500);           //pulse width that tells servo to stop turning

void servoTurnRight){
  servo.writeMicroseconds(1700);            //full speed counter clockwise rotation

Go Up