v2.9 and not the perpendicularity of X and Y

More
16 Nov 2025 07:28 - 22 Nov 2025 10:11 #338496 by abs32
SOLVED  -
matrixkins is a standard technique for correcting the curvature of the portal in the LinuxCNC 2.10 kernel (and above). The issue of mutual correction of XYZ coordinates is resolved by specifying correction coefficients. However, this component is provided for single-engine machines, i.e. XYZ schemes. To use this software correction for LinuxCNC2.9 and possibly 2.8, you must manually compile and install the matrixkins module (create a text file matrixkins.comp and copy-paste text from github.com/LinuxCNC/linuxcnc/blob/master...ents/matrixkins.comp + sudo halcompile --install matrixkins.comp), and you must make changes to the ini machine configuration file. Hal file does not require correction. MAN does not give these examples. However, in the ini file 
instead of -
KINEMATICS = trivkins coordinates=XYZ
set -
KINEMATICS=matrixkins
then explicitly specify non-zero correction factors, for example -
halcmd setp matrixkins.C_yx -0.00252427184466  

You will find the coefficient values and the transformation matrix in MAN.
The halcmd setp matrixkins.C_yx correction command -0.00252427184466 can be executed in the terminal (not while the machine is moving!), i.e. the parameter can be changed on the fly.

In case you have a multi-engine XXYZ configuration, etc., you need to change the source code of the matrixkins component ( github.com/LinuxCNC/linuxcnc/blob/master...ents/matrixkins.comp ), similar to  www.forum.linuxcnc.org/38-general-linuxc...xyyz?start=20#338894

+ sudo halcompile --install matrixkins.comp
Last edit: 22 Nov 2025 10:11 by abs32.

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

More
16 Nov 2025 12:37 #338503 by Aciera
I'm not familiar with 'relkins' but it will likely need updating due to the addition of the switchable kinematic feature. Discussion:
forum.linuxcnc.org/49-basic-configuratio...-xyz?start=10#311322

However there is a hal component included in version 2.9 that should handle all kinds of skew corrections:
www.linuxcnc.org/docs/devel/html/man/man9/matrixkins.9.html

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

More
16 Nov 2025 12:48 #338505 by abs32
sounds really good, thanks for the answer.
Are there any configuration examples somewhere? that loadrt is clear.

The current version 2.8.4 I can -
1. enable
2. launch a geometry check program, which, based on the results of the Sonde of the first class square, will calculate and tell me the amount of deviation from the perpendicular
3. Without turning off the program, I can enter a command like - in the terminal -
halcmd setp relkins.adjX.Y1030 -1.82

and get the corrected geometry without restarting the program.


How to do this in version 2.9? are there any examples?

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

More
16 Nov 2025 13:11 - 16 Nov 2025 13:15 #338508 by abs32
From the description at the link I see the following alorhythm -

1. I know the amount of deviation
2. in the case of XU, I need to explicitly specify the parameter for the formula -
X_joint = C_xx * X_axis + C_xy * Y_axis + C_xz * Z_axis

Those. I know the coefficient from clause 1
C_xx = 1
C_xy = (deviation X divided by width Y)

But what are the rules of use, syntax, examples?

loadrt matrixkins count=0
C_xx = 1
C_xy = 0.03
or
C_xy = [3/100]

or otherwise?
how to change the C_xy parameter on the fly without rebooting the program?
if loading a component requires specifying the contact number count=N, then N is what, what are the options? And where should this count be specified in the C_xy job?

In general, we need examples of syntax and application
In man, the example section of the configuration file shines with emptiness
Attachments:
Last edit: 16 Nov 2025 13:15 by abs32.

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

More
16 Nov 2025 13:42 #338510 by Aciera
If you attach the code of your current 'relkins' component I can have a look at updating it to be used in version 2.9

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

More
16 Nov 2025 14:22 - 16 Nov 2025 14:26 #338511 by abs32
Thank you, however, this is not necessary. If you already have a Matrixkins component built into the LinuxCNC kernel, then you need to use it. According to the description, it is quite suitable. The main thing is to understand the configuration synatxis for hal.
According to the description, the component built into the kernel solves issues of three axes at once. Simple (linear), but closes.

I don’t have the realkins component itself. The forum where this component was published has already died. The module is here. That's exactly what's holding me up on version 2.8.4
Attachments:
Last edit: 16 Nov 2025 14:26 by abs32.

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

More
16 Nov 2025 15:37 #338520 by Aciera
That 'relkins.c' is a bit more effort than I'm willing to put into it.

Maybe have a look at the rather extensive comments in the source code for matrixkins, there are examples no how to set the parameters:
github.com/LinuxCNC/linuxcnc/blob/master...ents/matrixkins.comp

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

More
16 Nov 2025 16:42 #338526 by abs32
Thank you, the comments in the source code are much less detailed than in man (this is strange). It would be right to bring the man to the proper level. Thanks again. When I install 2.9.x I will publish detailed startup instructions.

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

More
20 Nov 2025 14:37 - 20 Nov 2025 15:04 #338800 by abs32
Colleagues,

I installed the kernel 5.4.290 + the linuxcnc 2.9.4 build that came with it
With the kinematics option KINEMATICS = trivkins coordinates=XXYYZ, everything starts and works.

We have a description here -
linuxcnc.org/docs/devel/html/man/man9/matrixkins.9.html
the example section of hal + ini files is empty.
We also have a description here -
github.com/LinuxCNC/linuxcnc/blob/master...ents/matrixkins.comp
where examples of specifying matrix elements are indicated.
However, there are no examples for hal + ini.
I tried to do the following by analogy with other methods -

HAL -

#2025-11-20 для версии 2.9.4
#loadrt [KINS]KINEMATICS

#программная коррекция
#https://linuxcnc.org/docs/devel/html/man/man9/matrixkins.9.html
#https://github.com/LinuxCNC/linuxcnc/blob/master/src/hal/components/matrixkins.comp
loadrt matrixkins
setp matrixkins.C_xy 0 # Skew Y axis towards X axis
setp matrixkins.C_xx 1 # X axis scale
setp matrixkins.C_xz 0 # Skew Z axis towards X axis
setp matrixkins.C_yx 0 # Skew X axis towards Y axis
setp matrixkins.C_yy 1 # Y axis scale
setp matrixkins.C_yz 0 # Skew Z axis towards Y axis
setp matrixkins.C_zx 0 # Skew X axis towards Z axis
setp matrixkins.C_zy 0 # Skew Y axis towards Z axis
setp matrixkins.C_zz 1 # Z axis scale


loadrt [EMCMOT]EMCMOT base_period_nsec=[EMCMOT]BASE_PERIOD servo_period_nsec=[EMCMOT]SERVO_PERIOD num_joints=[KINS]JOINTS
loadrt hal_parport cfg="0 out"
setp parport.0.reset-time 5000
loadrt stepgen step_type=0,0,0,0,0

INI -
[KINS]
JOINTS = 5

#2025-11-20 для 2.9.4
#KINEMATICS = trivkins coordinates=XXYYZ
KINEMATICS=matrixkins coordinates=XXYYZ

When you try to launch it, it drops and shows an error -
Debug file information:
./t.hal:16: Can't find module 'matrixkins' in /usr/realtime-5.4.290-rtai-amd64/modules/linuxcnc
1485
Stopping realtime threads
Unloading hal components

for kernel 5.4.254, the situation and error are exactly the same (with corresponding linuxcnc + linuxcnc-dev)

how to fix this?


I note an error in man - there is no [KINS] section in the HAL file, there is such a section in ini, st 149 -
 
Attachments:
Last edit: 20 Nov 2025 15:04 by abs32.

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

More
20 Nov 2025 16:11 #338802 by Aciera
1. Remove 'loadrt matrixkins' from your hal file
2. The KINEMATICS entry of the [KINS] section in your ini file needs to look like this (matrixkins does not support the 'coordinates' parameter):
KINEMATICS=matrixkins

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

Time to create page: 0.150 seconds
Powered by Kunena Forum