Continous Rotation servo

Post here about your Arduino projects, get help - for Adafruit customers!

Moderators: adafruit_support_bill, adafruit

Please be positive and constructive with your questions and comments.
Locked
redruff
 
Posts: 14
Joined: Wed Jan 18, 2012 3:23 pm

Continous Rotation servo

Post by redruff »

Hello,
I have a large high torque continous rotation servo.
this should be a no brainer but I'm pulling my hair it.
I simply want to turn the servo on and keep it rotating forever. I'm a noob hack and have messed with the SWEEP example. But at some point it starts reversing and runs backwards for a specific time.

Here is my sketch. This will sweep the servo back and forth....I've messed with the numbers and I can get it to run for a about 10 seconds...but it eventually stops.

// Sweep
// by BANNED <http://BANNED.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(9); // 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
}
}

User avatar
adafruit_support_bill
 
Posts: 88141
Joined: Sat Feb 07, 2009 10:11 am

Re: Continous Rotation servo

Post by adafruit_support_bill »

For a continuous rotation servo, the "pos" parameter really means speed. For values less than 90, it will run in reverse. For values greater than 90 it will run forward. If you just want to run at a constant speed, call "myservo.write(pos);" once in setup(). You don't need that "for" loop.

redruff
 
Posts: 14
Joined: Wed Jan 18, 2012 3:23 pm

Re: Continous Rotation servo

Post by redruff »

What am I missing? this turns on the servo to the right for a few seconds than stops.
the next time I download the sketch it won't start it. I'm guessing its at the position it stopped at.
// Sweep
// by BANNED <http://BANNED.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(9); // attaches the servo on pin 9 to the servo object

 
 
void loop()

  {    
pos=90+1;    // 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
 
  } 

User avatar
philba
 
Posts: 387
Joined: Mon Dec 19, 2011 6:59 pm

Re: Continous Rotation servo

Post by philba »

It sounds like the servo wasn't really modified for continuous rotation. Try powering down and moving the servo by hand. If it moves back to that position when you power up, then it wasn't properly modified (feedback pot is still in place?).

redruff
 
Posts: 14
Joined: Wed Jan 18, 2012 3:23 pm

Re: Continous Rotation servo

Post by redruff »

Hmmm you might have nailed it Philba




Vigor VSD-11AYMB HV Extra Large 360 Degree/Winch Servo 0.75sec / 50kg / 150g
Operating Voltage: 6.0v~7.2v
STD Direction: Counter Clockwise / Pulse Traveling 800 to 2200uSec
Stall Torque: ≧40 kgf.cm at 6.0V, ≧50 kgf.cm at 7.2V
Operating Speed: 0.85 sec/ 60 at no load at 6.0V, 0.75 sec/ 60 at no load at 7.2V
Weight: 150g
Running Current: 0.40A~0.50A
Motor: 3 Pole Heavy Duty
Output Angle: 2160 Degrees (6 Circles)
Bearing: 2BB
Gear: Metal Gear
Size: 60.0 x 29.1 x 54.3 mm
Lead: 250mm 22AWG, Univeral Plug
Special Feature: Water Resistance

redruff
 
Posts: 14
Joined: Wed Jan 18, 2012 3:23 pm

Re: Continous Rotation servo

Post by redruff »

Wow that was a lot of hair pulling...I just assumed..... :oops:

I hooked up a little Parallax continuous rotation and it runs forever....looks like I'm going in on the big boy!

redruff
 
Posts: 14
Joined: Wed Jan 18, 2012 3:23 pm

Re: Continous Rotation servo

Post by redruff »

Philba! You nailed it...it was big mechanical mistake on my part, I cracked it open and there is a circuit board in their that does position sensing!

So overall this made my project even easier...since I just need a motor, I cut out the board and wired a 6v wall wart into the motor and bingo, nice little geared motor for the project!
Thanks everyone for working me through this!

Bill

User avatar
philba
 
Posts: 387
Joined: Mon Dec 19, 2011 6:59 pm

Re: Continous Rotation servo

Post by philba »

I've done a number of continuous rotation conversions and all you really have to do is take the wiper off of the pot and maybe cut out a block of plastic on one of the gears. The advantage of not just ripping out the servo electronics is you can use the standard connectors and libraries. I used them for some sumobots and they kicked *ss.

Locked
Please be positive and constructive with your questions and comments.

Return to “Arduino”