Error at InverseKinematics Function

More
08 Mar 2016 14:53 #71226 by jstoquica
Hi Everyone,

Actually I am testing my kinematics file with the real robot, but until now I have some bugs to improve.

In my *.c file I have, at kinematicsInverse() function:
   joint[0] = th1 * 180 / PM_PI;
   joint[1] = th2 * 180 / PM_PI;
   joint[2] = th3 * 180 / PM_PI;
   joint[3] = th4 * 180 / PM_PI;
   joint[4] = th5 * 180 / PM_PI;

   *(haldata->th1) = th1_m * 180 / PM_PI;
   *(haldata->th2) = th2_m * 180 / PM_PI;
   *(haldata->th3) = th3_m * 180 / PM_PI;
   *(haldata->th4) = th4_m * 180 / PM_PI;
   *(haldata->th5) = th5_m * 180 / PM_PI;

where *(haldata->thx) are aux variables for vismach simulation.

With this configuration everything is ok, but I need to change for the following conf:
   joint[0] = th1_m * 180 / PM_PI;
   joint[1] = th2_m * 180 / PM_PI;
   joint[2] = th3_m * 180 / PM_PI;
   joint[3] = th4_m * 180 / PM_PI;
   joint[4] = th5_m * 180 / PM_PI;

   *(haldata->th1) = th1 * 180 / PM_PI;
   *(haldata->th2) = th2 * 180 / PM_PI;
   *(haldata->th3) = th3 * 180 / PM_PI;
   *(haldata->th4) = th4 * 180 / PM_PI;
   *(haldata->th5) = th5 * 180 / PM_PI;

And with that conf, something are wrong. When I want work in world mode or MDI mode (invoking kins functions), appeared "Joint 4 following error".

I don't understand why was it happen. The thx_m have operations with thx variables, like:
th1_m = th1 / K1;

Thanks a lot.
Attachments:

Please Log in or Create an account to join the conversation.

More
08 Mar 2016 15:08 #71229 by andypugh

And with that conf, something are wrong. When I want work in world mode or MDI mode (invoking kins functions), appeared "Joint 4 following error".


Have you checked that forwards and inverse kins come up with exactly the same answer?

I seem to recall that it is possible to call the kinematics functions from the command line, but haven't managed to find where I read that, so might be wrong.

Please Log in or Create an account to join the conversation.

More
08 Mar 2016 15:25 - 08 Mar 2016 15:37 #71231 by jstoquica
Hi Andy,

Only I modify the inverse kins function, therefore something wrong is in that function.

I dont understand, I only added operation to the theta angles, like:
th1_m = th1 + 30;

I seem to recall that it is possible to call the kinematics functions from the command line, but haven't managed to find where I read that, so might be wrong.


I don't understand you. Are My *.c file wrong? If it is, how can I fix it?

Thanks a lot.
Last edit: 08 Mar 2016 15:37 by jstoquica.

Please Log in or Create an account to join the conversation.

More
08 Mar 2016 15:44 #71234 by andypugh

Hi Andy,Only I modify the inverse kins function, therefore something wrong is in that function.


The inverse kins and forwards kins functions need to match exactly.

So, if you send an XYZ of (0,0,0) to the inverse kins and it comes up with J1,J2,J3 of (1,2,3) then passing (1,2,3) to the forwards kins should return exactly (0,0,0)

Please Log in or Create an account to join the conversation.

More
08 Mar 2016 18:05 #71242 by jstoquica
Andy,

I understand the problem. I have two kinematic configs. First one the normal manipulator kinematics, and second one the motor kinematics. The motors of the robot are placed outside of the origin coordinates system. Then, with the each DOF angle I have to calculate the quantity of movement of the actuator (motor).

My initial idea was to create auxiliary HAL variables for the inverse-kinematic() function. But, It's wrong because, the actuators has direct kinematic equation. Therefore, linuxcnc generated error, Joint 4 following error.

How can I integrate the robot kinematics and a relationship between motors?

Thanks.

Please Log in or Create an account to join the conversation.

More
09 Mar 2016 12:33 #71264 by andypugh
Sorry, I don't even understand the question, even less so do I understand the problem.

Are you saying that the kinematics _changes_ ? Under what circumstances?

Please Log in or Create an account to join the conversation.

More
09 Mar 2016 13:41 #71273 by jstoquica
Hi Andy,

I have the inverse and forward kinematics of my robot arm of 5 DOF. Simulation results are everything fine. Now, I am working with the real robot, but the motors are placed outside of the origin system coordinates, because It is a old manipulator.

Then, I need modify the output kinematics signal to the real motors, because the relationship between joint angles and motor turns isn't linear. Like:

5th DOF motor turns depends of theta 2, theta 3 and theta 4.
4th DOF motor turns depends of theta 4 and theta 5.

And When I tried to modify the kinematics file, linuxcnc generated error because the relationship between joint angles and motor turns only affects the inverse kinematics.

I thing that I should set the correct scale for the step generator to give the correct steps per degree, but with non linear relationship between joint angles and motor turns I don't know how can I do that...... or through the HAL motion component, but again I don know how.....

Did you understand? I wish you can help me, thanks a lot again Andy.

Please Log in or Create an account to join the conversation.

More
09 Mar 2016 13:53 #71275 by andypugh
You need a different kinematics then, one that includes the non-linearity.

The point is that any changes you include in the inverse kinematics also need to be mirrored in the forwards kinematics.

The kinematics converts motor rotations to cartesian coordinates and the reverse. The joint angles probably need to be calculated as an intermediate step, but they are neither an input nor an output of the kinematics in your case.

Please Log in or Create an account to join the conversation.

More
09 Mar 2016 14:23 - 09 Mar 2016 14:27 #71279 by jstoquica
Andy, thanks for your answer.

I think it, do a other kinematics, even I have the forward and inverse kinematics of the relationship between joint angles and motor turns. I did it in my original kinematics file, but it didn't run, I think because I have a error concept of the inputs and outputs kinematics parameters. I attached the file (irb.c).

Is It right ? In the same *.c file to have the relationship between motor turns and joint angles?

In the pic you can see the realtionship equations.



1. In the *.c file in the forward_kinematics() function I added the equations, where I took Joint like motor turns and I can calculate the joint angles (theta). With that I can calculate the forward kinematic parameters of the manipulator.

2. then, for inverse_kinematics() function I calculated the joint angles (theta) and after that I can calculate the motor turns and set joint values.

I don't know if it's right my logic, but when I want simulate, linuxcnc generates errors like "Joint 0 following error"....

I appreciate your help, thanks again.
Attachments:
Last edit: 09 Mar 2016 14:27 by jstoquica.

Please Log in or Create an account to join the conversation.

More
10 Mar 2016 13:33 #71332 by jstoquica
Hi everyone,

Any idea?

Thanks a lot.

Please Log in or Create an account to join the conversation.

Time to create page: 0.624 seconds
Powered by Kunena Forum