# Switchable kinematics (switchkins) examples

07 Jun 2021 09:02 - 08 Jun 2021 07:15 #211407
by Aciera

*Switchable kinematics (switchkins) examples*was created by

*Aciera*

I open this thread as a place to showcase the use of switchable kinematics or 'switchkins' and I would like to invite anybody using it to share their application. While I'm aware that this is likely to be used on more unusual machines I still think that this is opens up a lot of possibilities for the future.

Anybody wondering what I'm on about please see the documentation:

github.com/LinuxCNC/linuxcnc/blob/dgarr/...otion/switchkins.txt

or, if you feel like giving something back to the community, test the current branch and give us your feedback:

forum.linuxcnc.org/38-general-linuxcnc-q...witchable-kinematics

I'll start off with my industrial robot where being able to switch between cartesian and joint kinematics is essential. Without it Linuxcnc is useless for serial manipulators because of limitations in the inverse kinematic :

user-images.githubusercontent.com/460672...e1a-eaa703d26b18.mp4

Anybody wondering what I'm on about please see the documentation:

github.com/LinuxCNC/linuxcnc/blob/dgarr/...otion/switchkins.txt

or, if you feel like giving something back to the community, test the current branch and give us your feedback:

forum.linuxcnc.org/38-general-linuxcnc-q...witchable-kinematics

I'll start off with my industrial robot where being able to switch between cartesian and joint kinematics is essential. Without it Linuxcnc is useless for serial manipulators because of limitations in the inverse kinematic :

user-images.githubusercontent.com/460672...e1a-eaa703d26b18.mp4

Last edit: 08 Jun 2021 07:15 by Aciera. Reason: Add information and links, fix expired link to documentation

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

07 Jun 2021 09:16 - 07 Jun 2021 09:23 #211408
by Aciera

Replied by

*Aciera*on topic*Switchable kinematics (switchkins) examples*
Here is a simulation of a mill-turn application that I hope to implement on my mill in the future.

While it's possible to create separate configs for milling and turning it is not easily possible to use both inside the same gcode. With switchable kinematics its as easy as inserting an M code.

Please forgive the crudity of the tool visualization in vismach as it is somewhat limited.

user-images.githubusercontent.com/460672...7e5-3feea53609ca.mp4

Example Gcode used:

This kinematic has been created using the recently added userkins template:

linuxcnc.org/docs/html/man/man9/userkins.9.html

This template can be used to create switchable and non-switchable kinematics and can be installed like any other component using halcompile.

The kinematic used in the simulation is attached below.

While it's possible to create separate configs for milling and turning it is not easily possible to use both inside the same gcode. With switchable kinematics its as easy as inserting an M code.

Please forgive the crudity of the tool visualization in vismach as it is somewhat limited.

user-images.githubusercontent.com/460672...7e5-3feea53609ca.mp4

Example Gcode used:

Warning: Spoiler!

G21

G64

M429 (Turning)

G18 G8

G54

T01 M6 G43

G00 X20 Z10

G00 X13.5 Z1.0 S1000 M3

Z0.488

G94 G01 X-1.0 F500.0

Z0.975

G00 X0.383 Z1.269

X13.5

Z0.0

G01 X-1.0

Z0.488

G00 X0.383 Z0.782

X13.5

Z1.0

Z2.0

X11.237

G01 Z-34.973 F500.0

X12.2 Z-35.95

Z-37.95

X12.625

G00 X13.625 Z-36.95

Z2.0

X9.849

G01 Z-19.832

G00 X10.849 Z-18.832

Z2.0

X8.461

G01 Z-19.832

X9.849

G00 X10.849 Z-18.832

Z2.0

X7.073

G01 Z-10.296

G00 X8.073 Z-9.296

Z2.0

X5.685

G01 Z-8.784

G03 X7.073 Z-10.296 I-0.98513 K-2.29772

G00 X8.073 Z-9.296

Z2.0

X4.297

G01 Z-8.582

X4.7

G03 X5.685 Z-8.784 I-0.0 K-2.5

G00 X6.685 Z-7.784

Z2.0

X2.909

G01 Z-0.559

G00 X3.909 Z0.441

Z2.0

X1.521

G01 Z0.829

X2.909 Z-0.559

G00 X4.909 Z1.441

Z0.441

X2.909

G01 Z-0.559

X3.2 Z-0.85

Z-4.15

X2.909 Z-4.654

Z-8.11

G02 X4.2 Z-8.582 I1.29082 K1.52767

G01 X4.297

G00 X5.297 Z-7.582

Z-4.654

X3.909

G01 X2.909

X2.468 Z-5.418

G02 X2.2 Z-6.418 I1.73205 K-1.0

G01 Z-6.582

G02 X2.909 Z-8.11 I2.0 K0.0

G00 X3.909 Z-7.11

X7.073

Z-9.296

G01 Z-10.296

G03 X7.2 Z-11.082 I-2.3731 K-0.78638

G01 Z-11.382

G03 X7.073 Z-12.168 I-2.5 K0.0

G01 Z-19.832

X8.461

G00 X9.461 Z-18.832

Z-12.168

X8.073

G01 X7.073

G03 X6.485 Z-13.132 I-2.3731 K0.78638

G02 X5.685 Z-14.204 I3.57071 K-3.5

G01 Z-18.76

G02 X6.485 Z-19.832 I4.37094 K2.42793

G01 X7.073

G00 X8.073 Z-18.832

Z-14.204

X6.685

G01 X5.685

G02 X5.058 Z-16.482 I4.37075 K-2.42793

G02 X5.685 Z-18.76 I4.99775 K0.15

G00 X6.685 Z-17.76

X9.849

Z-18.832

G01 Z-19.832

X10.2

Z-20.132

X9.849 Z-20.74

Z-24.42

G00 X10.849 Z-23.42

Z-20.74

G01 X9.849

X8.787 Z-22.58

X9.849 Z-24.42

G00 X10.849 Z-23.42

X9.849

G01 Z-24.42

X10.2 Z-25.028

Z-27.328

G02 X9.849 Z-28.029 I5.70735 K-3.29514

G01 Z-32.917

G02 X11.214 Z-34.95 I6.0583 K2.594

G01 X11.237 Z-34.973

G00 X12.237 Z-33.973

Z-28.029

X10.849

G01 X9.849

G02 X9.319 Z-30.473 I6.05858 K-2.594

G02 X9.849 Z-32.917 I6.58858 K0.15

G00 X10.849 Z-31.917

Z-29.029

X11.237

Z2.0

X0.534 Z3.241

G01 X0.202 Z3.041 F150.0

G02 X1.081 Z0.919 I3.0 K0.0

G01 X3.0 Z-1.0

Z-4.0

X2.268 Z-5.268

G02 X2.0 Z-6.268 I1.73205 K-1.0

G01 Z-6.732

G02 X4.0 Z-8.732 I2.0 K0.0

G01 X4.5

G03 X6.285 Z-12.982 I-0.0 K-2.5

G02 Z-19.982 I3.57071 K-3.5

G01 X10.0

X8.5 Z-22.58

X10.0 Z-25.178

Z-27.178

G02 X11.014 Z-35.1 I5.70735 K-3.29514

G01 X12.0 Z-36.1

Z-38.1

G00 X15.0

Z10.0

(Milling)

M428

g55

T2 m6 G43

g21 g17 g64 g90

s3400 m3

g0 z10

g0 x5 y0

g2 x-5 y0 i-5 j0 z-1 f240

g2 x5 y0 i5 j0 z-2

g2 x-5 y0 i-5 j0 z-3

g2 x5 y0 i5 j0 z-4

g2 x-5 y0 i-5 j0 z-4

g0 z10

g0 a90

g0 x5 y0

g2 x-5 y0 i-5 j0 z-1 f240

g2 x5 y0 i5 j0 z-2

g2 x-5 y0 i-5 j0 z-3

g2 x5 y0 i5 j0 z-4

g2 x-5 y0 i-5 j0 z-4

g0 z10

g0 a180

g0 x5 y0

g2 x-5 y0 i-5 j0 z-1 f240

g2 x5 y0 i5 j0 z-2

g2 x-5 y0 i-5 j0 z-3

g2 x5 y0 i5 j0 z-4

g2 x-5 y0 i-5 j0 z-4

g0 z10

g0 a270

g0 x5 y0

g2 x-5 y0 i-5 j0 z-1 f240

g2 x5 y0 i5 j0 z-2

g2 x-5 y0 i-5 j0 z-3

g2 x5 y0 i5 j0 z-4

g2 x-5 y0 i-5 j0 z-4

g0 z10

g0 a360

g0 z100 x100

M2

%

G64

M429 (Turning)

G18 G8

G54

T01 M6 G43

G00 X20 Z10

G00 X13.5 Z1.0 S1000 M3

Z0.488

G94 G01 X-1.0 F500.0

Z0.975

G00 X0.383 Z1.269

X13.5

Z0.0

G01 X-1.0

Z0.488

G00 X0.383 Z0.782

X13.5

Z1.0

Z2.0

X11.237

G01 Z-34.973 F500.0

X12.2 Z-35.95

Z-37.95

X12.625

G00 X13.625 Z-36.95

Z2.0

X9.849

G01 Z-19.832

G00 X10.849 Z-18.832

Z2.0

X8.461

G01 Z-19.832

X9.849

G00 X10.849 Z-18.832

Z2.0

X7.073

G01 Z-10.296

G00 X8.073 Z-9.296

Z2.0

X5.685

G01 Z-8.784

G03 X7.073 Z-10.296 I-0.98513 K-2.29772

G00 X8.073 Z-9.296

Z2.0

X4.297

G01 Z-8.582

X4.7

G03 X5.685 Z-8.784 I-0.0 K-2.5

G00 X6.685 Z-7.784

Z2.0

X2.909

G01 Z-0.559

G00 X3.909 Z0.441

Z2.0

X1.521

G01 Z0.829

X2.909 Z-0.559

G00 X4.909 Z1.441

Z0.441

X2.909

G01 Z-0.559

X3.2 Z-0.85

Z-4.15

X2.909 Z-4.654

Z-8.11

G02 X4.2 Z-8.582 I1.29082 K1.52767

G01 X4.297

G00 X5.297 Z-7.582

Z-4.654

X3.909

G01 X2.909

X2.468 Z-5.418

G02 X2.2 Z-6.418 I1.73205 K-1.0

G01 Z-6.582

G02 X2.909 Z-8.11 I2.0 K0.0

G00 X3.909 Z-7.11

X7.073

Z-9.296

G01 Z-10.296

G03 X7.2 Z-11.082 I-2.3731 K-0.78638

G01 Z-11.382

G03 X7.073 Z-12.168 I-2.5 K0.0

G01 Z-19.832

X8.461

G00 X9.461 Z-18.832

Z-12.168

X8.073

G01 X7.073

G03 X6.485 Z-13.132 I-2.3731 K0.78638

G02 X5.685 Z-14.204 I3.57071 K-3.5

G01 Z-18.76

G02 X6.485 Z-19.832 I4.37094 K2.42793

G01 X7.073

G00 X8.073 Z-18.832

Z-14.204

X6.685

G01 X5.685

G02 X5.058 Z-16.482 I4.37075 K-2.42793

G02 X5.685 Z-18.76 I4.99775 K0.15

G00 X6.685 Z-17.76

X9.849

Z-18.832

G01 Z-19.832

X10.2

Z-20.132

X9.849 Z-20.74

Z-24.42

G00 X10.849 Z-23.42

Z-20.74

G01 X9.849

X8.787 Z-22.58

X9.849 Z-24.42

G00 X10.849 Z-23.42

X9.849

G01 Z-24.42

X10.2 Z-25.028

Z-27.328

G02 X9.849 Z-28.029 I5.70735 K-3.29514

G01 Z-32.917

G02 X11.214 Z-34.95 I6.0583 K2.594

G01 X11.237 Z-34.973

G00 X12.237 Z-33.973

Z-28.029

X10.849

G01 X9.849

G02 X9.319 Z-30.473 I6.05858 K-2.594

G02 X9.849 Z-32.917 I6.58858 K0.15

G00 X10.849 Z-31.917

Z-29.029

X11.237

Z2.0

X0.534 Z3.241

G01 X0.202 Z3.041 F150.0

G02 X1.081 Z0.919 I3.0 K0.0

G01 X3.0 Z-1.0

Z-4.0

X2.268 Z-5.268

G02 X2.0 Z-6.268 I1.73205 K-1.0

G01 Z-6.732

G02 X4.0 Z-8.732 I2.0 K0.0

G01 X4.5

G03 X6.285 Z-12.982 I-0.0 K-2.5

G02 Z-19.982 I3.57071 K-3.5

G01 X10.0

X8.5 Z-22.58

X10.0 Z-25.178

Z-27.178

G02 X11.014 Z-35.1 I5.70735 K-3.29514

G01 X12.0 Z-36.1

Z-38.1

G00 X15.0

Z10.0

(Milling)

M428

g55

T2 m6 G43

g21 g17 g64 g90

s3400 m3

g0 z10

g0 x5 y0

g2 x-5 y0 i-5 j0 z-1 f240

g2 x5 y0 i5 j0 z-2

g2 x-5 y0 i-5 j0 z-3

g2 x5 y0 i5 j0 z-4

g2 x-5 y0 i-5 j0 z-4

g0 z10

g0 a90

g0 x5 y0

g2 x-5 y0 i-5 j0 z-1 f240

g2 x5 y0 i5 j0 z-2

g2 x-5 y0 i-5 j0 z-3

g2 x5 y0 i5 j0 z-4

g2 x-5 y0 i-5 j0 z-4

g0 z10

g0 a180

g0 x5 y0

g2 x-5 y0 i-5 j0 z-1 f240

g2 x5 y0 i5 j0 z-2

g2 x-5 y0 i-5 j0 z-3

g2 x5 y0 i5 j0 z-4

g2 x-5 y0 i-5 j0 z-4

g0 z10

g0 a270

g0 x5 y0

g2 x-5 y0 i-5 j0 z-1 f240

g2 x5 y0 i5 j0 z-2

g2 x-5 y0 i-5 j0 z-3

g2 x5 y0 i5 j0 z-4

g2 x-5 y0 i-5 j0 z-4

g0 z10

g0 a360

g0 z100 x100

M2

%

This kinematic has been created using the recently added userkins template:

linuxcnc.org/docs/html/man/man9/userkins.9.html

This template can be used to create switchable and non-switchable kinematics and can be installed like any other component using halcompile.

The kinematic used in the simulation is attached below.

##### Attachments:

Last edit: 07 Jun 2021 09:23 by Aciera. Reason: Note about kinematics component

The following user(s) said Thank You: phillc54, tommylight

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

14 Jul 2021 06:04 #214677
by Becksvill

Replied by

*Becksvill*on topic*Switchable kinematics (switchkins) examples*
This looks so cool!.

I got a 6.2 metre travel cnc router I would like to turn into a 5 axis machine and glad to see the kinematics is getting some work

I got a 6.2 metre travel cnc router I would like to turn into a 5 axis machine and glad to see the kinematics is getting some work

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

14 Jul 2021 06:13 - 14 Jul 2021 06:16 #214678
by Aciera

Replied by

*Aciera*on topic*Switchable kinematics (switchkins) examples*
Is that a Biesse?

[edit]

Does is already have a B-axis spindle?

[edit]

Does is already have a B-axis spindle?

Last edit: 14 Jul 2021 06:16 by Aciera.

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

14 Jul 2021 07:48 #214683
by Becksvill

Replied by

*Becksvill*on topic*Switchable kinematics (switchkins) examples*
I don't think it has a B axis.

Its a biesse 24xt machine made in 2002

And currently has like 10 spindles I'll strip out.

Its a biesse 24xt machine made in 2002

And currently has like 10 spindles I'll strip out.

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

16 Jul 2021 12:14 #215030
by andypugh

github.com/LinuxCNC/linuxcnc/blob/2e75b0...tion/emcmotcfg.h#L33

Replied by

*andypugh*on topic*Switchable kinematics (switchkins) examples*LinuxCNC supports up to 8 spindles, and it can be increased by a compile-time constant.And currently has like 10 spindles I'll strip out.

github.com/LinuxCNC/linuxcnc/blob/2e75b0...tion/emcmotcfg.h#L33

The following user(s) said Thank You: Aciera

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

Time to create page: 0.131 seconds