This would go better if you posted your code? The Arduino can run one instruction at a time but do it in very fast succession. Less seeing your code and knowing exactly what each servo is doing it's about impossible;e to answer your question.
Ron
#include <Servo.h>
Servo myservo1; // create servo object to rotate the head
Servo myservo2; // create servo object to tilt the head
Servo myservo3; // create servo object for opening and closing jaw
int pos = 90; // variable to store the servo position
void setup() {
myservo1.attach(9); // attaches the horizontal rotating servo on pin 9 to the servo object
myservo2.attach(10); // attaches the tilt servo on pin 10 to the servo object
myservo3.attach(11); // attaches the vertical rotating servo on pin 11 to the servo object
}
void loop() {
for (pos = 0; pos <= 50; pos += 1) { // goes from 0 degrees to 50 degrees
// in steps of 1 degree
myservo1.write(pos); // tell servo to go to position in variable 'pos'
delay(50); // waits 100ms for the servo to reach the position
}
for (pos = 50; pos >= 0; pos -= 1) { // goes from 50 degrees to 0 degrees
myservo1.write(pos); // tell servo to go to position in variable 'pos'
delay(50); // waits 100ms for the servo to reach the position
}
for (pos = 0; pos <= 90; pos += 1) { // goes from 0 degrees to 90 degrees
// in steps of 1 degree
myservo2.write(pos); // tell servo to go to position in variable 'pos'
delay(50); // waits 100ms for the servo to reach the position
}
for (pos = 90; pos >= 0; pos -= 1) { // goes from 90 degrees to 0 degrees
myservo2.write(pos); // tell servo to go to position in variable 'pos'
delay(50); // waits 100ms for the servo to reach the position
}
for (pos = 0; pos <= 50; pos += 1) { // goes from 0 degrees to 50 degrees
// in steps of 1 degree
myservo1.write(pos); // tell servo to go to position in variable 'pos'
delay(50); // waits 100ms for the servo to reach the position
}
for (pos = 50; pos >= 0; pos -= 1) { // goes from 50 degrees to 0 degrees
myservo1.write(pos); // tell servo to go to position in variable 'pos'
delay(50); // waits 100ms for the servo to reach the position
}
for (pos = 0; pos <= 90; pos += 1) { // goes from 0 degrees to 90 degrees
// in steps of 1 degree
myservo2.write(pos); // tell servo to go to position in variable 'pos'
delay(50); // waits 100ms for the servo to reach the position
}
for (pos = 0; pos >= 50; pos += 1) { // goes from 0 degrees to 50 degrees
myservo1.write(pos); // tell servo to go to position in variable 'pos'
delay(50); // waits 100ms for the servo to reach the position
}
for (pos = 0; pos <= 80; pos += 1) { // goes from 0 degrees to 80 degrees
// in steps of 1 degree
myservo3.write(pos); // tell servo to go to position in variable 'pos'
delay(10); // waits 100ms for the servo to reach the position
}
for (pos = 60; pos >= 0; pos -= 1) { // goes from 60 degrees to 0 degrees
myservo3.write(pos); // tell servo to go to position in variable 'pos'
delay(10); // waits 100ms for the servo to reach the position
}
for (pos = 90; pos <= 50; pos += 1) { // goes from 0 degrees to 50 degrees
// in steps of 1 degree
myservo2.write(pos); // tell servo to go to position in variable 'pos'
delay(30); // waits 100ms for the servo to reach the position
}
for (pos = 50; pos >= 0; pos -= 1) { // goes from 50 degrees to 0 degrees
myservo2.write(pos); // tell servo to go to position in variable 'pos'
delay(30); // waits 100ms for the servo to reach the position
}
for (pos = 0; pos <= 30; pos += 1) { // goes from 0 degrees to 30 degrees
// in steps of 1 degree
myservo1.write(pos); // tell servo to go to position in variable 'pos'
delay(50); // waits 100ms for the servo to reach the position
}
for (pos = 0; pos <= 60; pos += 1) { // goes from 0 degrees to 60 degrees
// in steps of 1 degree
myservo3.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 100ms for the servo to reach the position
}
for (pos = 80; pos >= 0; pos -= 1) { // goes from 80 degrees to 0 degrees
myservo3.write(pos); // tell servo to go to position in variable 'pos'
delay(15); // waits 100ms for the servo to reach the position
}
for (pos = 30; pos >= 0; pos -= 1) { // goes from 30 degrees to 0 degrees
myservo1.write(pos); // tell servo to go to position in variable 'pos'
delay(65); // waits 100ms for the servo to reach the position
}
for (pos = 0; pos >= 60; pos += 1) { // goes from 0 degrees to 60 degrees
myservo2.write(pos); // tell servo to go to position in variable 'pos'
delay(40); // waits 100ms for the servo to reach the position
}
for (pos = 60; pos <= 0; pos -= 1) { // goes from 60 degrees to 0 degrees
// in steps of 1 degree
myservo2.write(pos); // tell servo to go to position in variable 'pos'
delay(30); // waits 100ms for the servo to reach the position
}
for (pos = 0; pos <= 30; pos += 1) { // goes from 0 degrees to 30 degrees
// in steps of 1 degree
myservo1.write(pos); // tell servo to go to position in variable 'pos'
delay(75); // waits 100ms for the servo to reach the position
}
for (pos = 30; pos >= 0; pos -= 1) { // goes from 30 degrees to 0 degrees
myservo1.write(pos); // tell servo to go to position in variable 'pos'
delay(50); // waits 100ms for the servo to reach the position
}
}
#include <Servo.h>
Servo myservo1; // create servo objects to control servos
Servo myservo2;
Servo myservo3;
// twelve servo objects can be created on most boards
int pos = 0; // variable to store the servo positions
void setup() {
myservo1.attach(9); // attaches servo1 on pin 9 to the servo object
myservo2.attach(10); // attaches servo1 on pin 10 to the servo object
myservo3.attach(11); // attaches servo1 on pin 11 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
myservo1.write(pos); // tell servos to go to position in variable 'pos'
myservo2.write(pos);
myservo3.write(pos);
delay(15); // waits 15ms for the servo to reach the position
}
for (pos = 180; pos >= 0; pos -= 1) { // goes from 180 degrees to 0 degrees
myservo1.write(pos); // tell servo to go to position in variable 'pos'
myservo2.write(pos);
myservo3.write(pos);
delay(15); // waits 15ms for the servo to reach the position
}
}
Yes, Propeller would be one solution - https://www.parallax.com/microcontrollers/propellerI appreciate the feedback. Thanks.
It sounds like I wasn’t being clear in my original question. The speed of the servos wasn’t a concern. I’m just wondering if I can command the 3 servos to run at the same time. So far it sounds like I can only have one servo move at a time. Then have the next one move and then the 3rd servo move. I was hoping to see all 3 move simultaneously. If my arduino can’t do that, Or the programming language can’t, is there a microprocessor out there that can?

thanks Dana. A lot of that went right over my head but I appreciate the informationYes, Propeller would be one solution - https://www.parallax.com/microcontrollers/propeller
Another would be PSOC. Use an ISR, on one edge of PWM cycle to do the update to the 3
DC (Duty Cycle) registers. That would be close to ideal for a servo period as the time to do that
is a tiny fraction of period.
Alternatively one can use the counter and compare logic components and make a PWM internally
from scratch. And double buffer internally using registers the DC register so that writes occur then
an enable to all 3 buffer registers dumps into the respective DC register and they all update simultaneously.
Or use PSOC verilog capability and do the design that way. In any event this is all a one chip design.
View attachment 205196
You can see in right hand window most of the other resources onchip were not used, could be used for other tasks.
Regards, Dana.
Yes, you can. First you need to understand how RC servos work:Got a arduino Uno and I have it operating 3 servos. Just wondering if I can program the board to run all 3 simultaneously.
So far all I’ve been able to do is get them to run one at a time.
thanks!
OK, You can manually control each using pots (potentiometers) as Keith outlined. The code would look like this using and the servo library:I want to be able to command all 3 servos to run at the same time but still be able to individually control the time and degrees of rotation to each one.
#include <Servo.h>
Servo myservo1; // create a servo object
Servo myservo2;
Servo myservo3;
int potpin1 = 0; // analog potentiometer input pins
int potpin2 = 1;
int potpin3 = 2;
int val1; // read values from the analog input pins
int val2;
int val3;
void setup() {
Serial.begin (9600);
myservo1.attach(9); // attached servo pins
myservo2.attach(10);
myservo3.attach(11);
}
void loop() {
val1 = analogRead(potpin1);
val1 = map(val1, 0, 1023, 0, 180);
myservo1.write(val1);
delay(20);
val2 = analogRead(potpin2);
val2 = map(val2, 0, 1023, 0, 180);
myservo2.write(val2);
delay(20);
val3 = analogRead(potpin3);
val3 = map(val3, 0, 1023, 0, 180);
myservo3.write(val3);
delay(20);
// Print the data to serial monitor, can be omitted along with last delay.
Serial.print("Servo 1 Position ");
Serial.print(val1);
Serial.println(" Degrees");
Serial.print("Servo 2 Position ");
Serial.print(val2);
Serial.println(" Degrees");
Serial.print("Servo 3 Position ");
Serial.print(val3);
Serial.println(" Degrees");
Serial.println();
delay(1000);
}