How to include joint offsets in 5axiskins kinematics module?

More
29 Oct 2019 14:55 - 29 Oct 2019 15:41 #149055 by ross_dev
Hi there

I am trying to wrap my head around the IK code in 5axiskins (the module used in the sim 5axis XYZBC machine) so that I can introduce different joint offsets. As an experiment I tried just adding in an x-offset for the final joint in the vismach script for the 5axis XYZBC machine, and of course I now see the toolpath describe a circle when jogging axis C rather than rotating about a point. I would like to know how to include that offset (and later, multiple offsets for multiple joints in our own machine) in the 5axiskins module.

Forgive me as I am used to seeing long trigonometric monstrosities when looking at IK maths! The section that seems to handle the IK is this:
1 int kinematicsInverse(const EmcPose * pos, double *joints, const KINEMATICS_INVERSE_FLAGS * iflags, 
2 KINEMATICS_FORWARD_FLAGS * fflags)
3 {
4
5      PmCartesian r = s2r(*(haldata->pivot_length) + pos->w
6                       ,pos->c
7                       ,180.0 - pos->b);
8
9      joints[JOINT_0] = pos->tran.x - r.x;
10    joints[JOINT_1] = pos->tran.y - r.y;
11    joints[JOINT_2] = pos->tran.z - *(haldata->pivot_length) - r.z;
12
13    joints[JOINT_B] = pos->b;
14    joints[JOINT_C] = pos->c;
15    joints[JOINT_W] = pos->w;
16
17    return 0;
18    }

I understand that PmCartesian is a struct that holds an x, y and z position. A colleague of mine suggested that line 5 appears to transform the cartesian coords in r via a spherical coordinate transformation and lines 9, 10 and 11 subtract those new coords from the x / y / z position.
  1. Is the code for introducing built-in joint offsets contained elsewhere, and is this distinct from pivot offset (I will confess to not being able to understand the explanation of pivot offset in the Du Preez paper)? For example with the simulated XYZBC I would like to add my 5cm offset to the final joint to prove the principle to myself. Later on I need to add say x=5cm, y=7cm and z=15cm offsets between joint 0 and 1 in our machine, the x and y axes, and still others later. Can 5axiskins handle this?

  2. I noticed there is another kinematics module called xyzbc-trt-kins.c which looks more like the standard matrices I am used to seeing, with what appear to be offsets. Is the maths equivalent to 5axiskins? Further, is 5axiskins also derived from the paper by Rudy Du Preez, or is it just the xyzac-trt and xyzbc-trt modules?



Thanks again for your support!
Last edit: 29 Oct 2019 15:41 by ross_dev.

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

More
30 Oct 2019 07:15 #149120 by pl7i92
ik code is generated by the interpreter to the joint values
this is then ofseted by the kinetics so no need to do this

there are all nessesary ofsets in the kinetics modules available
as special as you use standard xyzbc mashine

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

More
30 Oct 2019 10:49 #149146 by ross_dev
Thanks for your reply!

So do you mean the kinematics somehow knows the denavit hartenberg link offsets etc? (such as in denavit hartenberg parameters that would be r and d). From one machine to the other they should vary. Imagine mounting your z axis with a large mounting plate for example, or offsetting your final C rotation axis by some margin so that its axis is no longer coincident with the B axis.

As a test, the latter is what I have done by modifying the vismach script for the 5axis XYZBC machine with an offset, and as a result the final joint now describes a circle rather than rotating around a point as with the stock setup, which indicates the kinematics have not adjusted to it.

This is separate to the "pivot length" variable I believe. This is using 5axiskins, where I do not see anywhere to add link lengths / offsets. Would it be better to use one of the Du Preez modules?

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

More
01 Nov 2019 13:36 #149357 by andypugh
I think that that 5axiskins might be a bit simplistic. I think it is for a simple XYZ + A cnfig on the table with a titling head, and does not actually perform any tool-point kinematics.

You might be better looking at the virtual config
sim/axis/vismach/5axis/table-rotary-tilting

This uses these kinematics: github.com/LinuxCNC/linuxcnc/blob/2.8/sr...ics/xyzac-trt-kins.c

(there is an xyzbc version too)

Why do you actually want joint offsets?

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

More
06 Nov 2019 11:04 #149690 by ross_dev
Hi Andy

The machine design as given to me is not completely orthogonal in all axes. For example, Joint 0 and Joint 1 look like the attached picture with an offset in the x, y and z axis. This means that the matrices for our machine will feature additional link offsets - the maths will look different to the maths in say the xyzbc-trt file because applying the Denavit Hartenberg convention results in additional offset parameters not found in the standard kinematics modules.

Perhaps I am misunderstanding - is it not usually the case that linuxcnc users build a 'standard' machine with orthogonal axes which match a given kinematics module, meaning that a standard module should work for those users?

At present I am calculating the transformation equations for our machine and intend to edit the xyzbc-trt file with the updated maths.

I cannot show the full machine unfortunately as this is a commercial application.
Attachments:

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

More
06 Nov 2019 11:48 #149696 by andypugh

the maths will look different to the maths in say the xyzbc-trt file because applying the Denavit Hartenberg convention results in additional offset parameters not found in the standard kinematics modules


Denavit Hartenberg is probably overkill for a cartesian or near-cartesian machine. It is only really necessary for multi-joint serial robots.
Your machine does appear to be technically serial, as are most, but it adds a lot of computatiobal overhead, and the risk of inverse solutions not being found. (the maths is just less stable)

Perhaps I am misunderstanding - is it not usually the case that linuxcnc users build a 'standard' machine with orthogonal axes which match a given kinematics module, meaning that a standard module should work for those users?

I would imagine that 99% of LinuxCNC installations use trivkins as most machines have simple orthogonal joints.


At present I am calculating the transformation equations for our machine and intend to edit the xyzbc-trt file with the updated maths.I cannot show the full machine unfortunately as this is a commercial application.

Looking at what you have shown us, I would be tempted to do the kins with school-level trigonometry. Denavit-Gartenberg and matrix inversions etc seems to be unnecessarily complicating the matter.

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

More
06 Nov 2019 12:46 - 06 Nov 2019 12:48 #149701 by ross_dev
Hi Andy

Certainly the way I was taught it, DH parameters are meant as a way to simplify creating the equations, and are taught for simple machines as well as complex ones. They make it easier when generating the algebra, but those equations should ultimately be the same as if you found it by other means.

I think the main issue here is whether our offsets will cause the stock kinematics to fail, and so need modifiying? I have no control over the mechanical design unfortunately.

Our machine features two rotary axes as well as the first three cartesian ones also, again with an offset. Imagine a regular 5 axis XYZBC gantry mill but the part holding the tool is offset to the side rather than being in line with the z axis rotation.

The reasons for the quirks is that we are not actually building a mill per se! :)
Last edit: 06 Nov 2019 12:48 by ross_dev.

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

More
06 Nov 2019 12:54 #149702 by andypugh

Certainly the way I was taught it, DH parameters are meant as a way to simplify creating the equations, and are taught for simple machines as well as complex ones. They make it easier when generating the algebra, but those equations should ultimately be the same as if you found it by other means.


They should give the same results. I am not sure that they would actually reduce to the same equations.

One further issue: I don't think that the LinuxCNC Genserkins module includes prismatic (sliding) joins.
The following user(s) said Thank You: ross_dev

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

More
06 Nov 2019 13:00 #149703 by ross_dev
That should be fine, genserkins was never an option. I have been looking at using xyzbc-trt-kins.c, which judging from the paper Randy du Preez published on it seems to be the best fit for our machine. That's really where this all started, trying to understand if Randy's file will work without modification, given our offsets.

Thanks for your ongoing support, it is appreciated!

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

More
06 Nov 2019 22:01 #149762 by andypugh
I think he is Rudy not Randy. :-)

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

Time to create page: 0.079 seconds
Powered by Kunena Forum