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:
- 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