servo inaccurate positioning
Posted: Wed Feb 20, 2019 11:24 am
Hi,
my 1066_1B controller with a 180 degr travel servomotor is not positioning very accurately. What I would like to achieve is to move an arm attached to the servo 180 degrees, and then back. When I run the app the 1st time, the 180 is more or less accurate, but even the second time of running the app, the 180 is no longer there, it is either more or less, sometimes as far as 30 degrees difference. The more times I run the app, the bigger the deviation from 180 degrees is.
Attached is some of my code.
At the moment I try to achieve two repositionings, both 180 degrees, in the same directions, once I achieve the accuracy, the next step will be to reverse the second repositioning (return the bar to it's starting position).
Any help in achieving accuracy in positioning would be appreciated. Thank you.
...and the event handlers
my 1066_1B controller with a 180 degr travel servomotor is not positioning very accurately. What I would like to achieve is to move an arm attached to the servo 180 degrees, and then back. When I run the app the 1st time, the 180 is more or less accurate, but even the second time of running the app, the 180 is no longer there, it is either more or less, sometimes as far as 30 degrees difference. The more times I run the app, the bigger the deviation from 180 degrees is.
Attached is some of my code.
At the moment I try to achieve two repositionings, both 180 degrees, in the same directions, once I achieve the accuracy, the next step will be to reverse the second repositioning (return the bar to it's starting position).
Any help in achieving accuracy in positioning would be appreciated. Thank you.
Code: Select all
servo.Acceleration = 280.00;
servo.VelocityLimit = 120.00;
servo.TargetPosition = 180.00;
servo.Engaged = true;
servo.TargetPosition = 177.00;
Thread.Sleep(1400);
servo.Engaged = true;
servo.TargetPosition = 174.00;
Console.Write("Position: ");
Console.WriteLine(servo.Position);
Thread.Sleep(1000);
servo.TargetPosition = 0.00;
double targetposition = servo.TargetPosition;
Console.Write("Target Position: ");
Console.WriteLine(targetposition);
Code: Select all
void Servo_PositionChange(Object sender, RCServoPositionChangeEventArgs e)
{
string positionEvent = e.Position.ToString("F0");
Console.WriteLine("Position changed to:...{0}", positionEvent);
}
void Servo_VelocityChange(Object sender, RCServoVelocityChangeEventArgs e)
{
Console.WriteLine("Velocity is changing...");
}
void Servo_TargetPositionReached(Object sender, RCServoTargetPositionReachedEventArgs e)
{
servo.Engaged = false;
Console.WriteLine("Position reached!");
}