Pages: [1]   Go Down
Author Topic: LS 3006 servo  (Read 2212 times)
0 Members and 1 Guest are viewing this topic.
Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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:
// 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
  }
}
Logged

0
Offline Offline
Tesla Member
***
Karma: 141
Posts: 9541
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Sounds like the LS 3006 is a continous rotation servo.
Logged

Consider the daffodil. And while you're doing that, I'll be over here, looking through your stuff.   smiley-cool

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.

-Dan
Logged

BCC AZ USA
Offline Offline
Edison Member
*
Karma: 35
Posts: 1213
It gets hot so it must be working
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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).
Logged

Offline Offline
Newbie
*
Karma: 0
Posts: 2
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Pages: [1]   Go Up
Jump to: