strange servo behavier
- This topic is empty.
2013-05-15 at 13:27 #5928AnonymousInactive
I recently have time to set up my stewart platform, I center all the servo and put on the servo horn.
the servos are connected from D7~D2 from the front left servo in counter clock direction.
the center program looks fine, the test one looks fine as well.
But when I try to input g code with the RSP program, the servo behave strangely.
1. G00 X0 Y0 Z0 A0 B0 C0;
this one works correctly, it goes to center.
2. G00 Z5;
all servos move correctly at start, but they goes to complete different extreme position.
3. G00 Z-5;
same as previous one, it moves correctly at beginning, but goes to extreme position at the end.
I put a video FYI
If I center it again, it will goes back to center.
what did I do wrong?2013-05-16 at 16:05 #6401AnonymousInactive
Interesting. I will test on my stewart platform and see what happens.2013-05-17 at 18:25 #6402AnonymousInactive
I tried it and immediately regretted it. G00 Z5 will try to move 5 centimeters up. The range of motion is *maybe* +/-10mm. Try G00 Z0.5 instead.
Now I have to reassemble my machine, it just twisted itself apart.
A good goal would be to test in firmware if a point is even possible before trying to move the servos.2013-05-23 at 00:28 #6403AnonymousInactive
Sorry for your demage…. 😮
I tried G00 Z0.5 it works fine, as well as up to 1.2cm..
How can we know the limit? once we know the limit, it should not be difficult to limit the input.
I would do that if I know how to calculate the limit. Or we can only try and error?2013-05-23 at 21:05 #6404AnonymousInactive
for now is only try and error. if i had forward kinematics I could calculate limits easily and prevent impossible moves.
I don’t understand FK yet so I haven’t been able to write code. Maybe someone else can solve the mystery.2013-05-30 at 03:00 #6405AnonymousInactive
I tried to test the limit of each direction, but it seems the limits are related. If we simply move Z direction, it can go between +1.9cm and -1.2cm. But if we add movement in X, it would go over the limit pretty soon.
One thing I have noticed is the return message from arduino, it start with a time and followed by arm.angle. if one axis goes over it’s limit, it appears as 0.00, and servos of that axis goes to it’s limit.
I was thinking we can prevent this by limiting the angle when it’s not correct.
Looking into to code, I believe you have done that by doing this:
arm.angle=atan2(-y,x) * RAD2DEG;
if(arm.angle> 90) arm.angle= 90;
I wish to prevent this over drive of servo, do you have any hint for me?
- You must be logged in to reply to this topic.