Show Posts
Pages: [1]
1  Using Arduino / Motors, Mechanics, and Power / Re: 3 Servos using 3 Potentiometers to Arduino Uno on: December 04, 2012, 10:07:37 pm
ok the old ones were 25k but i have some 10k pots I can try. Any suggestion on the delay value? I am using each servo to move about 90 degrees. they are lifting pieces of wood attached to a catapult so I need the most power I can get out of these.
Thanks again
2  Using Arduino / Motors, Mechanics, and Power / Re: 3 Servos using 3 Potentiometers to Arduino Uno on: December 04, 2012, 09:40:44 pm
Ok so my pots were rated for 25ohm so Im gonna try some 10 ohm. And what would you suggest changing the delay values to? I am very new to the arduino.
Thanks
3  Using Arduino / Motors, Mechanics, and Power / Re: 3 Servos using 3 Potentiometers to Arduino Uno on: December 04, 2012, 09:29:40 pm
I just tried a 5v 2 amp power supply. The servos were very jittery going back and forth very fast almost looked like everything attached was shaking. The potentiometers are also powered using the supply. Any suggestions?
Really appreciated Thanks!
4  Using Arduino / Motors, Mechanics, and Power / 3 Servos using 3 Potentiometers to Arduino Uno on: December 04, 2012, 08:43:28 pm
I have 3 servos connected to an arduino uno. I am controlling these using potentiometers. Looking at the program below I used the "pin" value as the wire from the potentiometer to the corresponding analog pin on the arduino. Plugging the servos yellow wire to the corresponding wire it is attached to on the digital side of the arduino. After controlling the servos they seem to sometimes respond and then go off rotating in their own pattern. When the potentiometer is responding and I get it to a position I need it to hold, it seems to make a clicking noise, like the gears are going back and forth very quickly. My program is attached below, let me know what you guys have in mind.

#include <Servo.h>
 
Servo arm;  // serevo that holds arm in fire ready position
Servo spring; // servo for spring tensioning
Servo angle;// servo for changing degree of the arm and reloading
 
int armpin = 0;  // analog pin used to connect the potentiometer for arm
int armval;    // variable to read the value from the analog pin for arm
int springpin = 2; //analog pin used to connect the potentiometer for spring
int springval;    // variable to read the value from the analog pin for spring
int anglepin = 4; // analog pin used to connect the potentiometer for angle
int angleval;  // variable to read the value from the analog pin for angle

void setup()
{
  arm.attach(9);  // attaches the servo on pin 9 to the servo object
  spring.attach(11); // attaches the servo on pin 11 to the servo object
  angle.attach(6); // attaches the servo on pin 6 to the servo object
}
 
void loop()
{
  armval = analogRead(armpin);            // reads the value of the potentiometer (value between 0 and 1023)
  armval = map(armval, 0, 1023, 0, 179);     // scale it to use it with the servo (value between 0 and 180)
  arm.write(armval);                  // sets the servo position according to the scaled value
  delay(15);                           // waits for the servo to get there
  springval = analogRead(springpin);            // reads the value of the potentiometer (value between 0 and 1023)
  springval = map(springval, 2, 1023, 2, 179);     // scale it to use it with the servo (value between 0 and 180)
  spring.write(springval);                  // sets the servo position according to the scaled value
  delay(15);                           // waits for the servo to get there
  angleval = analogRead(anglepin);            // reads the value of the potentiometer (value between 0 and 1023)
  angleval = map(angleval, 4, 1023, 4, 179);     // scale it to use it with the servo (value between 0 and 180)
  angle.write(angleval);                  // sets the servo position according to the scaled value
  delay(15);                           // waits for the servo to get there
}
5  Using Arduino / Motors, Mechanics, and Power / Control Servos with Potentiometers on: December 03, 2012, 04:32:02 pm
Hello,
I have used the code below to control a servo using a potentiometer. I need to now do the same but with multiple servos and potentiometers. I am using the ANALOG 0 and DIGITAL 9 PINS on the Arduino. I am very new to this and need help knowing what I need to and don't need to duplicate in the program. I need to do a total of 3 servos.

Thanks a lot!!
p.s. does anyone know how to power three servos separately from the arduino with a adapter they are rated 6v each. Let me know.



#include <Servo.h>
 
Servo arm;  // create servo object to control a servo
 
int armpin = 0;  // analog pin used to connect the potentiometer
int armval;    // variable to read the value from the analog pin
 
void setup()
{
  arm.attach(9);  // attaches the servo on pin 9 to the servo object
}
 
void loop()
{
  armval = analogRead(armpin);            // reads the value of the potentiometer (value between 0 and 1023)
  armval = map(armval, 0, 1023, 0, 179);     // scale it to use it with the servo (value between 0 and 180)
  arm.write(armval);                  // sets the servo position according to the scaled value
  delay(15);                           // waits for the servo to get there
}
6  Using Arduino / Motors, Mechanics, and Power / Re: Servos on Arduino Uno on: December 03, 2012, 01:03:55 pm
/*
Arduino Servo Test sketch
*/
#include <Servo.h>
Servo servoAngler; // Main brace angle servo
Servo servoStopper; // Arm Holding Servo
Servo servoTensioner; // Spring Tension Servo

void setup()
{
   servoAngler.attach(10); // servo on digital pin 10
   servoStopper.attach(6); // servo on digital pin 6
   servoTensioner.attach(3); //servo on digital pin 3
}

void loop()
{
   servoStopper.write(0);      // Turn Servo Left to 0 degrees
   servoAngler.write(90);      // Turn Servo to center position (90 degrees)
   servoTensioner.write(180);  // Turn Servo Right to 180 degrees
   servoStopper.write(90);     // Turn Servo back to center position (90 degrees)
   servoTensioner.write(0);    // Turn Servo Left to 0 degrees
   delay(5000);                // Wait 5 seconds
[/color]   servoAngler.write(0);       // Turn Servo Left to 0 degrees
}


This is how I have chosen to write the program without delays. Any suggestions, the servos are not moving full speed?
7  Using Arduino / Motors, Mechanics, and Power / Re: Servos on Arduino Uno on: December 02, 2012, 05:58:32 pm
Not understanding what you mean by tags? Anyway you can show me?! smiley-grin
8  Using Arduino / Motors, Mechanics, and Power / Re: Servos on Arduino Uno on: December 02, 2012, 05:48:35 pm
I was talking about the the stopper servo, sorry about that. But I did test the servo and it does seem faulty. Is there any way for me to make all of the servos go through the program except have one of the function wired to pushing a button and then have the rest of the program to continue. For ex:

#include <Servo.h>
Servo servoAngler; // Main brace angle servo
Servo servoStopper; // Arm Holding Servo
Servo servoTensioner; // Spring Tension Servo

void setup()
{
   servoAngler.attach(10); // servo on digital pin 10
   servoStopper.attach(6); // servo on digital pin 6
   servoTensioner.attach(3); //servo on digital pin 3
}

void loop()
{
   servoStopper.write(0);      // Turn Servo Left to 0 degrees
   delay(1000);                // Wait 1 second
   servoAngler.write(90);      // Turn Servo to center position (90 degrees)
   delay(1000);                // Wait 1 second
   servoTensioner.write(180);  // Turn Servo Right to 180 degrees
   delay(1000);                // Wait 1 second
   servoStopper.write(90);     // Turn Servo back to center position (90 degrees)    ----- I want this command to be wired on a push button.
   delay(1000);                // Wait 1 second
   servoTensioner.write(0);    // Turn Servo Left to 0 degrees
   delay(5000);                // Wait 5 second
   servoAngler.write(0);       // Turn Servo Left to 0 degrees
   delay(1000);                // Wait 1 Second   
}
9  Using Arduino / Motors, Mechanics, and Power / Servos on Arduino Uno on: December 02, 2012, 03:58:25 pm
I have to control 3 servos on an Arduino Uno. I have written the program and two of the motors seem to work but the third is not responding at all.
/*
Arduino Servo Test sketch
*/
#include <Servo.h>
Servo servoAngler; // Main brace angle servo
Servo servoStopper; // Arm Holding Servo
Servo servoTensioner; // Spring Tension Servo

void setup()
{
   servoAngler.attach(10); // servo on digital pin 10
   servoStopper.attach(6); // servo on digital pin 6
   servoTensioner.attach(3); //servo on digital pin 3
}

void loop()
{
   servoStopper.write(0);      // Turn Servo Left to 0 degrees
   delay(1000);                // Wait 1 second
   servoAngler.write(90);      // Turn Servo to center position (90 degrees)
   delay(1000);                // Wait 1 second
   servoTensioner.write(180);  // Turn Servo Right to 180 degrees
   delay(1000);                // Wait 1 second
   servoStopper.write(90);     // Turn Servo back to center position (90 degrees)
   delay(1000);                // Wait 1 second
   servoTensioner.write(0);    // Turn Servo Left to 0 degrees
   delay(5000);                // Wait 5 second
   servoAngler.write(0);       // Turn Servo Left to 0 degrees
   delay(1000);                // Wait 1 Second   
}

Any ideas as to why it wouldn't work? There is power going to the servo.

Anything Helps. This is my first time using this program
10  Using Arduino / Motors, Mechanics, and Power / 3 Servos on Arduino Uno on: December 01, 2012, 10:26:46 pm
Hi,
I am building a catapult that needs 3 servos to reload. I have an arduino uno and a arduino motor shield. I need each motor to run independently and be able to return to their original state. Does anyone have an ideas as to how the servos can be connected to switches and how the programming side of that would be? I would really appreciate any help, I'm way over my head in this project. Also very new to the Arduino products.
Thanks,
Hope to hear from you guys soon!
Pages: [1]