z_level_compensation
23 Apr 2024 09:04 #298898
by KlausB
z_level_compensation was created by KlausB
Hello,
I posted this in the german forum befor. Maybe it is better to post this internationaly.
I like to try the z_level_compensation modul with QtDragon_hd for graving.
My computer has the actual LinuxCNC Image with Debian 12 and LinuxCNC 2.9.2.
A "probe_points.txt" was created with "g-code-ripper".
I adopted the HAL configuration for z_level_compensation from the LinuxCNC Documentation and wrote it into a postgui HAL file.
As far as I understand, xpos-cmd, ypos-cmd, and zpos-cmd contain the coordinates of my coordinate system. In axis.x.pos-cmd and so on, the machine coordinates are located. The original lines from the documentation can only be exemplary, as the input pin can only receive one single value.
So I changed the HAL File, that z_level_compensation.x-pos and so on get the values of my coordinatge system:
net xpos-cmd z_level_compensation.x-pos
net ypos-cmd z_level_compensation.y-pos
net zpos-cmd z_level_compensation.z-pos
That seems to work (from HAL SHOW):
Component Pins:
Owner Type Dir Value Name
75 bit IN FALSE z_level_compensation.clear <== eoffset-clr2
75 s32 OUT 0 z_level_compensation.counts ==> eoffset-zlevel-count
75 bit IN FALSE z_level_compensation.enable-in <== z_compensation_on
75 float IN 0 z_level_compensation.fade-height
75 s32 IN 1 z_level_compensation.method
75 float OUT 0 z_level_compensation.scale
75 float IN -1.76964 z_level_compensation.x-pos <== xpos-cmd
75 float IN -3.283469 z_level_compensation.y-pos <== ypos-cmd
75 float IN 0.7778383 z_level_compensation.z-pos <== zpos-cmd
When pressing the "ENABLE Z COMP" in the gui, the folling message is shown in the console (when I start LinuxCNC with my configuration in the commandline console):
Traceback (most recent call last):
File "/usr/bin/z_level_compensation", line 204, in <module>
comp.run()
File "/usr/bin/z_level_compensation", line 179, in run
compensation = self.compensate()
^^^^^^^^^^^^^^^^^
File "/usr/bin/z_level_compensation", line 105, in compensate
compensation = int(zo / self.scale)
^^^^^^^^^^^^^^^^^^^^
ValueError: cannot convert float NaN to integer
After that, the PINs for z_level_compensation are away from the HAL, so I guess the module is unloaded with the error.
Does anyone got that working and/or can tell me whats wrong in my config?
The zip file in the attachment contails my complete configuration.
Thank You very much
Regards
Klaus
I posted this in the german forum befor. Maybe it is better to post this internationaly.
I like to try the z_level_compensation modul with QtDragon_hd for graving.
My computer has the actual LinuxCNC Image with Debian 12 and LinuxCNC 2.9.2.
A "probe_points.txt" was created with "g-code-ripper".
I adopted the HAL configuration for z_level_compensation from the LinuxCNC Documentation and wrote it into a postgui HAL file.
As far as I understand, xpos-cmd, ypos-cmd, and zpos-cmd contain the coordinates of my coordinate system. In axis.x.pos-cmd and so on, the machine coordinates are located. The original lines from the documentation can only be exemplary, as the input pin can only receive one single value.
So I changed the HAL File, that z_level_compensation.x-pos and so on get the values of my coordinatge system:
net xpos-cmd z_level_compensation.x-pos
net ypos-cmd z_level_compensation.y-pos
net zpos-cmd z_level_compensation.z-pos
That seems to work (from HAL SHOW):
Component Pins:
Owner Type Dir Value Name
75 bit IN FALSE z_level_compensation.clear <== eoffset-clr2
75 s32 OUT 0 z_level_compensation.counts ==> eoffset-zlevel-count
75 bit IN FALSE z_level_compensation.enable-in <== z_compensation_on
75 float IN 0 z_level_compensation.fade-height
75 s32 IN 1 z_level_compensation.method
75 float OUT 0 z_level_compensation.scale
75 float IN -1.76964 z_level_compensation.x-pos <== xpos-cmd
75 float IN -3.283469 z_level_compensation.y-pos <== ypos-cmd
75 float IN 0.7778383 z_level_compensation.z-pos <== zpos-cmd
When pressing the "ENABLE Z COMP" in the gui, the folling message is shown in the console (when I start LinuxCNC with my configuration in the commandline console):
Traceback (most recent call last):
File "/usr/bin/z_level_compensation", line 204, in <module>
comp.run()
File "/usr/bin/z_level_compensation", line 179, in run
compensation = self.compensate()
^^^^^^^^^^^^^^^^^
File "/usr/bin/z_level_compensation", line 105, in compensate
compensation = int(zo / self.scale)
^^^^^^^^^^^^^^^^^^^^
ValueError: cannot convert float NaN to integer
After that, the PINs for z_level_compensation are away from the HAL, so I guess the module is unloaded with the error.
Does anyone got that working and/or can tell me whats wrong in my config?
The zip file in the attachment contails my complete configuration.
Thank You very much
Regards
Klaus
Attachments:
Please Log in or Create an account to join the conversation.
23 Apr 2024 13:31 #298906
by cmorley
This is no good. Why did you comment out the end?
Replied by cmorley on topic z_level_compensation
net xpos-cmd z_level_compensation.x-pos # <= axis.x.pos-cmd
net ypos-cmd z_level_compensation.y-pos # <= axis.y.pos-cmd
net zpos-cmd z_level_compensation.z-pos # <= axis.z.pos-cmd
This is no good. Why did you comment out the end?
Please Log in or Create an account to join the conversation.
23 Apr 2024 15:00 #298917
by KlausB
Replied by KlausB on topic z_level_compensation
Thank you for replying,
If I do not comment out the end of the line, I get en error, that xpos-cmd, ypos-cmd and so on already have an Input (in my AXIS.hal).
I do not know, what values z_level_compensation.x-pos, z_level_compensation.y-pos . . . should get. Possibly the value of xpos-cmd, ypos-cmd and so on or axis.x.pos-cmd . . .?
I decided to use the values of my coordinate system, not the machine coordinate system, like the values in the "probe_points.txt".
May be it's wrong?
If I do not comment out the end of the line, I get en error, that xpos-cmd, ypos-cmd and so on already have an Input (in my AXIS.hal).
I do not know, what values z_level_compensation.x-pos, z_level_compensation.y-pos . . . should get. Possibly the value of xpos-cmd, ypos-cmd and so on or axis.x.pos-cmd . . .?
I decided to use the values of my coordinate system, not the machine coordinate system, like the values in the "probe_points.txt".
May be it's wrong?
Please Log in or Create an account to join the conversation.
23 Apr 2024 15:37 #298920
by KlausB
Replied by KlausB on topic z_level_compensation
This is the error I get without the comments:
Z-Compensation.hal:36: Signal 'xpos-cmd' can not add OUT pin 'axis.x.pos-cmd', it already has OUT pin 'joint.0.motor-pos-cmd'
Z-Compensation.hal:36: Signal 'xpos-cmd' can not add OUT pin 'axis.x.pos-cmd', it already has OUT pin 'joint.0.motor-pos-cmd'
Please Log in or Create an account to join the conversation.
23 Apr 2024 22:33 #298945
by cmorley
Replied by cmorley on topic z_level_compensation
It means xpos-cmd was already used for something else.
Change all the xpos-cmd to something else like xpos-cmd-axis
Change all the xpos-cmd to something else like xpos-cmd-axis
net xpos-cmd-axis z_level_compensation.x-pos <= axis.x.pos-cmd
net ypos-cmd-axis z_level_compensation.y-pos <= axis.y.pos-cmd
net zpos-cmd-axis z_level_compensation.z-pos <= axis.z.pos-cmd
Please Log in or Create an account to join the conversation.
24 Apr 2024 05:29 #298966
by KlausB
Replied by KlausB on topic z_level_compensation
Tank you for your remark.
I tried this before. The different is, that z_level_compensation.x-pos and so on gets the values from axis.x.pos-cmd . . .. These are the maschine coordinates for x, y, z. See the Component Pins in my initial Post.
But it does not change the error I get when ENABLE Z COMP:
Traceback (most recent call last):
File "/usr/bin/z_level_compensation", line 204, in <module>
comp.run()
File "/usr/bin/z_level_compensation", line 179, in run
compensation = self.compensate()
^^^^^^^^^^^^^^^^^
File "/usr/bin/z_level_compensation", line 105, in compensate
compensation = int(zo / self.scale)
^^^^^^^^^^^^^^^^^^^^
ValueError: cannot convert float NaN to integer
The z_level_compensation modul crashes and ist no longer loaded until I start LinuxCNC again.
I am using a simple milling mashine with parallel port and an old Computer. Is it possible, that the computer is to slow? I would expect a nother behave if so.
I tried this before. The different is, that z_level_compensation.x-pos and so on gets the values from axis.x.pos-cmd . . .. These are the maschine coordinates for x, y, z. See the Component Pins in my initial Post.
But it does not change the error I get when ENABLE Z COMP:
Traceback (most recent call last):
File "/usr/bin/z_level_compensation", line 204, in <module>
comp.run()
File "/usr/bin/z_level_compensation", line 179, in run
compensation = self.compensate()
^^^^^^^^^^^^^^^^^
File "/usr/bin/z_level_compensation", line 105, in compensate
compensation = int(zo / self.scale)
^^^^^^^^^^^^^^^^^^^^
ValueError: cannot convert float NaN to integer
The z_level_compensation modul crashes and ist no longer loaded until I start LinuxCNC again.
I am using a simple milling mashine with parallel port and an old Computer. Is it possible, that the computer is to slow? I would expect a nother behave if so.
Please Log in or Create an account to join the conversation.
24 Apr 2024 05:40 #298968
by cmorley
Replied by cmorley on topic z_level_compensation
Can you post the file /usr/bin/z_level_compensation?
Please Log in or Create an account to join the conversation.
24 Apr 2024 08:20 #298976
by KlausB
Replied by KlausB on topic z_level_compensation
Attachments:
Please Log in or Create an account to join the conversation.
24 Apr 2024 13:16 #298996
by cmorley
Replied by cmorley on topic z_level_compensation
Ok that looks fine. Can you post your probe_points.txt file.
Please Log in or Create an account to join the conversation.
24 Apr 2024 13:26 #298998
by cmorley
Replied by cmorley on topic z_level_compensation
Ok it has to do with the probe_points file (I found yours and tried it here)
I don't have enough experience to give suggestions other then redoing the gcode ripper part.
I don't have enough experience to give suggestions other then redoing the gcode ripper part.
Please Log in or Create an account to join the conversation.
Moderators: cmorley
Time to create page: 0.098 seconds