How can I move a lot of servos a the same time and reducing the drive range?

Hi all,

i want control a lot of servo drives. They should movie at the same time and I control the positions with a c# HMI over serial. All in all its runs near ok.
But if I connect the Arduino Board with the power supply, the drives moves to an unknown positions an then to the default position.
This is a problem, because I have drives who can move online a few degree.

My drive controlling part:

for(pos = 0; pos <= 180; pos += 1)
{
if (ServoSollPos[1]>ServoIstPos[1])
{
ServoIstPos[1]=ServoIstPos[1]+1;
ServoObj[1].write(ServoIstPos[1]);

}
else if (ServoSollPos[1]<ServoIstPos[1])
{
ServoIstPos[1]=ServoIstPos[1]-1;
ServoObj[1].write(ServoIstPos[1]);
}
if (ServoSollPos[2]>ServoIstPos[2])
{
ServoIstPos[2]=ServoIstPos[2]+1;
ServoObj[2].write(ServoIstPos[2]);

}
else if (ServoSollPos[2]<ServoIstPos[2])
{
ServoIstPos[2]=ServoIstPos[2]-1;
ServoObj[2].write(ServoIstPos[2]);
}
delay(15)

So I have a few Questions:

  1. Startposition? I think my program has the problem, that I dont know the startposition. And how can I drive in a special degree area, if I dont know the Startposition? How can I insure that i drove online in a difine range?
    2)Velocity? I want to drive a lot of servos with an own velocity. I my program, i use the function deplay vor all drives. If the delay function the right choice? And how can I use different deplays/velocity?

thanks for help,

jamhacker

http://arduino.cc/en/Tutorial/BlinkWithoutDelay

How are all your servos being powered? Changing the Arduino's power source should not affect the behaviour.

Do you mean that the process of changing from a connection to the PC to the power supply causes the problem?

After the confusion when you first connect to the power supply do things work properly?

What happens if you disconnect from the PC and reconnect to it?

Do you know (so that you could make a list) what is the desired starting position for each servo?

...R