# Kinematics for XYZAB mill

31 Jan 2023 12:41 #263346
by automata

Replied by

*automata*on topic*Kinematics for XYZAB mill*
Hi Aceria,

These seems to be some problem with the kinematics when using the x-ioffset and z-offset and I am not able to pinpoint it and propose a solution.

I am the original author of switchkins and the idea behind switchable kinematics was that you could switch between machine kinematics without any physical motion of the machine.

Doing the following sequence of actions results in machine motion during kinematics switching

1. Start the xyzab-tdr config

2. x-offset = -20, z-offset= -10, rotation center point = (-50,-50,100)

3. home the machine and switch to MDI mode - still with identity kinematics

4. T2M6G43H2 - this will add a tool with length of 30mm to the Z axis

5. G0x20y20z20

6. G0a90

7. Switch the kniematics to XYZAB kins using the pyvcp button OR M428 and then switch back to identity and watch the machine go for a ride in the vismach window. This can also be observed in the machine coordinates

Now if the x-offset and z-offset are kept to 0, this movement does not happen.

In the forward kinematics, dz seems to be taken into account but dx does not seem to be.

While in the inverse kinematics, dx and dz both are taken into account.

Can you help me take dx and dz correctly into account in the formulas?

Regards,

automata

These seems to be some problem with the kinematics when using the x-ioffset and z-offset and I am not able to pinpoint it and propose a solution.

I am the original author of switchkins and the idea behind switchable kinematics was that you could switch between machine kinematics without any physical motion of the machine.

Doing the following sequence of actions results in machine motion during kinematics switching

1. Start the xyzab-tdr config

2. x-offset = -20, z-offset= -10, rotation center point = (-50,-50,100)

3. home the machine and switch to MDI mode - still with identity kinematics

4. T2M6G43H2 - this will add a tool with length of 30mm to the Z axis

5. G0x20y20z20

6. G0a90

7. Switch the kniematics to XYZAB kins using the pyvcp button OR M428 and then switch back to identity and watch the machine go for a ride in the vismach window. This can also be observed in the machine coordinates

Now if the x-offset and z-offset are kept to 0, this movement does not happen.

In the forward kinematics, dz seems to be taken into account but dx does not seem to be.

Warning: Spoiler!

px = j[0] - x_rot_point;

py = j[1] - y_rot_point;

pz = j[2] - z_rot_point - dt;

pos->tran.x = cb*px + sb*pz + x_rot_point;

pos->tran.y = sa*sb*px + ca*py - cb*sa*pz - sa*dz + y_rot_point;

pos->tran.z = - ca*sb*px + sa*py + ca*cb*pz - ca*dz+ z_rot_point + dz + dt;

pos->a = j[3];

pos->b = j[4];

pos->c = j[5];

py = j[1] - y_rot_point;

pz = j[2] - z_rot_point - dt;

pos->tran.x = cb*px + sb*pz + x_rot_point;

pos->tran.y = sa*sb*px + ca*py - cb*sa*pz - sa*dz + y_rot_point;

pos->tran.z = - ca*sb*px + sa*py + ca*cb*pz - ca*dz+ z_rot_point + dz + dt;

pos->a = j[3];

pos->b = j[4];

pos->c = j[5];

While in the inverse kinematics, dx and dz both are taken into account.

Can you help me take dx and dz correctly into account in the formulas?

Regards,

automata

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

31 Jan 2023 13:59 - 01 Feb 2023 17:59 #263360
by Aciera

Replied by

*Aciera*on topic*Kinematics for XYZAB mill*
Automata, thanks for reporting this!

I totally agree, looks like I got a bit overzealous when i cleaned up the math in the comp and just ran the demo code to test. I just quickly tested with an earlier version and it works fine there. I'm just headed out the door for a repair job but will be back later with the patch.

[edit2]

On closer inspection it seems that I only got a sign in the forward kinematic wrong when I manually cleaned up the math. The fix has just been committed to the source.

Thanks again for the report.

I totally agree, looks like I got a bit overzealous when i cleaned up the math in the comp and just ran the demo code to test. I just quickly tested with an earlier version and it works fine there. I'm just headed out the door for a repair job but will be back later with the patch.

[edit2]

On closer inspection it seems that I only got a sign in the forward kinematic wrong when I manually cleaned up the math. The fix has just been committed to the source.

Thanks again for the report.

##### Attachments:

Last edit: 01 Feb 2023 17:59 by Aciera.

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

31 Jan 2023 17:57 - 01 Feb 2023 07:06 #263379
by Aciera

Replied by

*Aciera*on topic*Kinematics for XYZAB mill*
@automata

As a side note:

Since you came up with the idea of switchable kinematics I was wondering if you had any experience with 5axis machining in general. I have created another sim config with a rotary/nutating head and I'm working on a G68.2 'tilted-work-plane' remap but I'm lacking the 5axis machining background.

See here: forum.linuxcnc.org/20-g-code/47984-tilted-working-plane#263422

As a side note:

Since you came up with the idea of switchable kinematics I was wondering if you had any experience with 5axis machining in general. I have created another sim config with a rotary/nutating head and I'm working on a G68.2 'tilted-work-plane' remap but I'm lacking the 5axis machining background.

See here: forum.linuxcnc.org/20-g-code/47984-tilted-working-plane#263422

Last edit: 01 Feb 2023 07:06 by Aciera.

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

02 Feb 2023 06:24 #263498
by automata

Replied by

*automata*on topic*Kinematics for XYZAB mill*
Hi Aciera,

Thanks for the prompt feedback and correction.

Can you help how you derived the math? Maybe something along the lines of this excercise linuxcnc.org/docs/html/motion/5-axis-kinematics.html

I am trying to make a general purpose template to derive any 5 axis kinematics.

I have explained homogenous transformations in this presentation (drive.google.com/file/d/13wTPaD_pGiWHewh...dYj/view?usp=sharing) and want to add to it how to work on 5 axis kinematics from that perspective.

1. Considered rotation point center in XYZ i.e., x-rot-center, y-rot-center, z-rot-center. Here we have also implicitly considered that A-rot-center =0 degrees and B-rot-center = 0 degrees

2. Now the G54 offsets are set such that the work coordinate system zero coincides the kinematics calculations zero point.

3. For forward kinematics what are the reference frames and transformations that are considered?

4. How would we derive the inverse kinematics?

Regards,

automata

Thanks for the prompt feedback and correction.

Can you help how you derived the math? Maybe something along the lines of this excercise linuxcnc.org/docs/html/motion/5-axis-kinematics.html

I am trying to make a general purpose template to derive any 5 axis kinematics.

I have explained homogenous transformations in this presentation (drive.google.com/file/d/13wTPaD_pGiWHewh...dYj/view?usp=sharing) and want to add to it how to work on 5 axis kinematics from that perspective.

1. Considered rotation point center in XYZ i.e., x-rot-center, y-rot-center, z-rot-center. Here we have also implicitly considered that A-rot-center =0 degrees and B-rot-center = 0 degrees

2. Now the G54 offsets are set such that the work coordinate system zero coincides the kinematics calculations zero point.

3. For forward kinematics what are the reference frames and transformations that are considered?

4. How would we derive the inverse kinematics?

Regards,

automata

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

02 Feb 2023 07:18 #263499
by automata

Replied by

*automata*on topic*Kinematics for XYZAB mill*
Hi Aciera, sorry I have no working knowledge of 5 axis machines. I am also learning as we move along.

The switchable kinematics was designed for an special purpose machine where I needed to change the axes nomenclature on-the-fly and then I expanded to be convenient to use for robots with joint planners and cartesian planners.

-automata

The switchable kinematics was designed for an special purpose machine where I needed to change the axes nomenclature on-the-fly and then I expanded to be convenient to use for robots with joint planners and cartesian planners.

-automata

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

02 Feb 2023 10:07 - 02 Feb 2023 10:12 #263509
by Aciera

Replied by

*Aciera*on topic*Kinematics for XYZAB mill*
Ah, I see you are somebody who doesn't shy away from the math. Very good, I do have a document that I was working on (basically an augmented jupyter notebook using sage) but it got pushed to the sidelines a bit, mostly because there seemed to be little interest from the community and the basics have been covered by the document by rudi dupreez you referenced above. My idea was to focus more on how to get the kinematic formulas to work properly with the linuxcnc interface when the machine reference point does not coincide with the center of the rotary assembly. I'll have to work on the document a bit an will post it here in a couple of days.

Coincidentally I have been thinking about a 'generic' 5 axis kinematic component as well. Something that the commercial controllers offer where the specific machine kinematic can be defined by parameters. For this I would think that the matrix manipulations would need to happen in the kinematics module. A symbolic solution (like in the 'trt' and my 'tdr' kins would become impossibly unwieldy). Maybe a nummerical approach would be the way to go? Also note that one can use the Jacobian matrix to calculate an approximation to the inverse kinematic which is what is used in the 'genserkins' model, I think.

Also I have found that this ties into my current project of tilted work planes as one needs to calculate the joint position of the particular machine at hand to orient the tool to the requested tool-orientation vector. Something that is usually done by the CAM. This is probably more of interest for machines with tool-side rotations like my head rotating/nutating example above.

Tracking the work-offset when switching between tool coordinates and machine coordinates is also something that needs to be considered.

Another question would be just how generic one could build a universal 5-axis kinematic. Do we assume the rotary joints to be perfectly perpendicular or would the rotation matrices be of the general form that can represent rotations around any vector in space?

Something I need to look at is if it would make more sense to use quaternions for all this rather than the transformation matrices.

Coincidentally I have been thinking about a 'generic' 5 axis kinematic component as well. Something that the commercial controllers offer where the specific machine kinematic can be defined by parameters. For this I would think that the matrix manipulations would need to happen in the kinematics module. A symbolic solution (like in the 'trt' and my 'tdr' kins would become impossibly unwieldy). Maybe a nummerical approach would be the way to go? Also note that one can use the Jacobian matrix to calculate an approximation to the inverse kinematic which is what is used in the 'genserkins' model, I think.

Also I have found that this ties into my current project of tilted work planes as one needs to calculate the joint position of the particular machine at hand to orient the tool to the requested tool-orientation vector. Something that is usually done by the CAM. This is probably more of interest for machines with tool-side rotations like my head rotating/nutating example above.

Tracking the work-offset when switching between tool coordinates and machine coordinates is also something that needs to be considered.

Another question would be just how generic one could build a universal 5-axis kinematic. Do we assume the rotary joints to be perfectly perpendicular or would the rotation matrices be of the general form that can represent rotations around any vector in space?

Something I need to look at is if it would make more sense to use quaternions for all this rather than the transformation matrices.

Last edit: 02 Feb 2023 10:12 by Aciera.

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

02 Feb 2023 13:08 #263519
by automata

Replied by

*automata*on topic*Kinematics for XYZAB mill*
Hi Aciera, I'm lookinag forward to your Sage notbook. I look forward to learning a lot from this.

Regards,

-automata

Regards,

-automata

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

02 Feb 2023 14:05 #263521
by automata

Replied by

*automata*on topic*Kinematics for XYZAB mill*
Hi,This paper describes *ALL the 12 different 5 axis configurtions possible. For general purpose Kinematics, we can have a simillar structure that will select the correct type of kinematics from the 12 different scenarios.

It is interesting how they describe cutter compensation implementation in the kinematics module.

Their system seems very close to LinuxCNC i.e., using NML and a very simillar architecture.

All-in-all it seems writing a generalized kinematics for (all) 12 different types of 5 axis machines is possible.

-automata

It is interesting how they describe cutter compensation implementation in the kinematics module.

Their system seems very close to LinuxCNC i.e., using NML and a very simillar architecture.

All-in-all it seems writing a generalized kinematics for (all) 12 different types of 5 axis machines is possible.

-automata

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

02 Feb 2023 14:08 #263522
by automata

Replied by

*automata*on topic*Kinematics for XYZAB mill*
Sorry the file size exceeds 1.6MB.

You can find the paper here: www.researchgate.net/publication/2602966...nction_in_CNC_system

-automata

You can find the paper here: www.researchgate.net/publication/2602966...nction_in_CNC_system

-automata

The following user(s) said Thank You: Aciera

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

04 Feb 2023 19:11 #263694
by Aciera

Replied by

*Aciera*on topic*Kinematics for XYZAB mill*
As promised the document to the XYZAB-TDR kinematics:

##### Attachments:

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

Time to create page: 0.349 seconds