Loading...
Pages: [1]   Go Down
Author Topic: Continuous rotation Servo  (Read 528 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

Hi,

I have a continuous rotation bidirectional servo and I am actually able to make it run, then stop at its neutral point (96)and start again when a condition is fulfill. My problem is that I would like it to rotate in the other way (counter clockwise) and do exactly the same. I am new with the Arduino code.

Thanks
Logged

Left Coast, CA (USA)
Offline Offline
Brattain Member
*****
Karma: 283
Posts: 15443
Measurement changes behavior
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

I have a continuous rotation bidirectional servo and I am actually able to make it run, then stop at its neutral point (96)and start again when a condition is fulfill. My problem is that I would like it to rotate in the other way (counter clockwise) and do exactly the same. I am new with the Arduino code.

Thanks

Should be straight forward as you are working OK in one direction. Can you post your code? Stop as you stated for your servo is a 96 degree value, 180 should be full speed in one direction and 0 should be full speed in the other direction.

Lefty

Logged

Castlegar , B.C. , CANADA
Offline Offline
Newbie
*
Karma: 0
Posts: 13
An old dog learning new tricks !
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Lefty :

 Check out the POLOLU website for their servo controllers . I'm using one of their 8 channel model with a couple of these servos on a small bot platform and it works great !

 Continuous rotation servos will operate in both directions ; with " proportional speed control " about the center OFF point .  I beleive that they are using the lower 100mSec pulse width limit as FULL  SPEED clockwise , 150mSec ( center pulse width ) as OFF , and 200mSec upper pulse width limit as FULL SPEED counter-clockwise .

 Their GUI is kinda cool as one can play around with setting custom " end points " , ramp up/dn traversing times between 2 set points and such like .  This board also allows " drag and drop " instructions to be stored on-board in about 8K of NVRAM . Program it for testing , plug it in the bot ; and execute . Reprogram from your laptop via USB . 

 Pretty cool little board .

Hope this helps a bit at least .

Regards :   Rick
Logged

0
Offline Offline
Tesla Member
***
Karma: 58
Posts: 6780
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Most continous rotation servos move at max speed when the max or min control values are used, and stop when the center of those two is used. No code or info on your servo doesn't leave much for suggestions.

Logged

Why I like my 2005 rio yellow Honda S2000 with the top down, and more!
GOOGLE ADVANCED FORUM SEARCH BELOW!  
Go to:  http://www.google.com/advanced_search?hl=en
put in key search words,
use site or domain:  http://arduino.cc/forum
or in a google search box put key words site:http://arduino.cc/forum

Topsham, Vermont USA
Offline Offline
Edison Member
*
Karma: 16
Posts: 1470
... in The Woods In Vermont
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi, Here's the test code I use to find the values when the servo stops. Then you can use those values in later code...

Quote

/* YourDuino TapeBot Test 11/12/11
 Steps through motor speeds, displays on monitor
 -- Find the values that stop the servo
 -- Pick the speed range and directions you want to use.
 
 terry@yourduino.com */

/*-----( Import needed libraries )-----*/
#include <Servo.h>

/*-----( Declare Constants )-----*/
#define MOTOR_LEFT 9  /*-(servo for Left wheel)-*/
#define MOTOR_RIGHT 10 /*-(servo for Left wheel)-*/

#define LEFT_ZERO_TRIM  0;  
#define RIGHT_ZERO_TRIM 2;  


/*-----( Declare objects )-----*/
Servo  LeftMotor;
Servo  RightMotor;

/*-----( Declare Variables )-----*/
int  LeftSpeed;
int  RightSpeed;
int  pos;


void setup() /*----( SETUP: RUNS ONCE )----*/
{
  /*-(start serial port, Init servos)-*/
  Serial.begin(9600);
  delay(1000);
  Serial.println("YourDuino TapeBot Test Program");
  LeftMotor.attach(MOTOR_LEFT);
  RightMotor.attach(MOTOR_RIGHT);
  delay(1000);
}  /*--(end setup )---*/


void loop() /*----( LOOP: RUNS CONSTANTLY )----*/
{
  Serial.println("Bot Test: Motor Speed Range"); 
  LeftMotor.write(90); // STOP Motor
  delay(1000);
  for(pos = 60; pos<=120; pos+=1)     // goes from 60 degrees to 120 degrees
  {                                
    LeftMotor.write(pos);              // tell motor to go to speed in variable 'pos'
    Serial.print("Data=");   
    Serial.println(pos,DEC);   
    delay(1000);      // waits for the motor speed to be seen/heard
  }

  delay(2000);
  Serial.println();


}/* --(end main loop )-- */

/* ( THE END ) */


Logged

Regards, Terry King terry@yourduino.com  - Check great prices, devices and Arduino-related boards at http://YourDuino.com
HOW-TO: http://ArduinoInfo.Info

Pages: [1]   Go Up
Print
 
Jump to: