Issue with G38.5

More
20 Oct 2025 17:21 #336762 by christer
Issue with G38.5 was created by christer
Hi new here.

Using linuxcnc 2.8.4-1 and having issues with g38.5 commands.  The probe I am using is a magnetic encoder on a rail and spring system to measure distance.  My hal is setup so that a displacement of >0.005in will trigger the probe input.  The gcode starts with a g38.3 to probe the piece to get its location.  Then using g38.5 command to determine the edge of a part by moving in z until the probe falls off.  I've had issues with "probe tripped during non probe move" so I am controlling the activation of the probe input signal with a digital io pin.  I am still getting "probe tripped during non probe move" errors and confused as to why it is still happening.  

Hal config:
#Negate Encoder Position
setp mult2.2.in0 -1.0                    
setp comp.0.in0 0.005                   # Threshold value for encoder
net enable-probe    <=    motion.digital-out-03    =>    and2.1.in1

# Encoder position and comparator
net negated-encoder-out <= mult2.2.out
net negated-encoder-out comp.0.in1       # Connect to comparator input
net encoder-threshold-met    <=    comp.0.out   => and2.1.in0

# AND logic to trigger only during probing motion
net probe-trigger and2.1.out motion.probe-input

Gcode:

M64 P3    (enable probing) 
G38.3 F15 Y1.6  (probe vertically into the part)
G38.5 Z4 F25 (drag off edge) 
M65 P3    (disable probing) 
G4 P0.1 (dwell to make sure the signal was sent to disable probing)
 

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

More
20 Oct 2025 19:13 #336766 by Aciera
Replied by Aciera on topic Issue with G38.5
I believe this issue has been fixed in 2.9:
github.com/LinuxCNC/linuxcnc/pull/3537

Note that if you are considering to update the currently recommended version is 2.9.7pre:
forum.linuxcnc.org/21-axis/57364-axis-co...-9-6?start=10#336538

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

More
21 Oct 2025 13:58 #336833 by christer
Replied by christer on topic Issue with G38.5
Awesome thank you!

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

More
05 Nov 2025 18:56 #337899 by abs32
Replied by abs32 on topic Issue with G38.5
Colleague, please publish the entire part of the hal file for controlling the probe shutdown? Including the commands addf + loadrt + something like this net probepin parport.0.pin-13-in-not => and2.3.in0

vers 2.84.

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

More
20 Nov 2025 19:22 - 20 Nov 2025 19:29 #338822 by abs32
Replied by abs32 on topic Issue with G38.5
For real-time kernel5.4.254 or 5.4.290, there is only version 2.9.4. Apparently, this patch isn’t there?

As planned, I installed 2.9.4 with both 254 and 290 cores. The test result is bad - excellent jitter (less than 1000), but the same sensor response error (when performing G38.5, the sensor moves, the response stops, stops and flies out error The sensor was activated during working movement - but in the g-code program there are no commands of the form G1-G3 at all!). 
In addition, a completely new mistake for me is misalignment of axes (joints)! First, Joint0 (this is the first X motor), then Joint3 (the first Y motor) - XXYYZ circuit.
Last edit: 20 Nov 2025 19:29 by abs32.

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

More
28 Nov 2025 21:37 #339400 by andypugh
Replied by andypugh on topic Issue with G38.5
If you need an RTAI version of 2.9.7 I will try to build one.

But given your reported issues elsewhere it might be worth setting-up to build from source. It's not especially difficult, though there is a oe-time investment in installing all the build dependencies.

Get the basic tools:
sudo apt-get install git git-gui build-essential

Then get the LinuxCNC source code:
git clone https://github.com/LinuxCNC/linuxcnc.git linuxcnc-dev

Then enter the source directory and switch to the 2.9 branch
cd linuxcnc-dev
git checkout 2.9
git pull

Now you are going to need a whole bunch of packages, dpkg knows what you need: (you need to be in the linuxcnc-dev folder , where you can see the debian folder)
./debian/configure nodocs
dpkg-checkbuilddeps
[code]

This will give a while list of packages, that you can copy and paste after a sudo apt-get install command. 
Note that it might now be nodoc rather than nodocs. And the list of packages will contain a few alternatives and version numbers, so will need a bit of light editing. I am _fairly_ sure that this works still with RTAI, I know that dpkg-buildpackage doesn't (which is why RTAI debs  are a bit of effort to create) 

Then you can build linuxcnc. This takes about 10 minutes the first time. 
[code]cd src
./autohgen.sh
./configure --enable-build-documentation=none
make

The only complication here is that the build will be a run-in-place (can exist alongside a standard install) and to chose it you need to run a script.
. ~/linuxcnc-dev/scripts/rip-environment
(Yes, it really is dot-space at the beginning)

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

More
29 Nov 2025 07:48 - 29 Nov 2025 07:49 #339413 by abs32
Replied by abs32 on topic Issue with G38.5
I am quite proficient with build-install-clone commands and have the ability to simultaneously have and use all the versions under investigation on a single HDD. Currently installed and used alternately are
2.8.4 and 4.19. 195-rtai-amd64 - works almost flawlessly, except for a known (and already fixed in 2.9.7) bug (I easily ported it to 2.9.4, as well as matrixkin from 2.10 to 2.9.7 and 2.9.4), so I have to do without G38.5
2.9.4 with kernels 254 and 290 - they are unable to work due to a bug for multi-engine configurations, see forum.linuxcnc.org/9-installing-linuxcnc...-2-9?start=60#339123
2.9.7 - of course, I don't like userspace, but I am ready to use it for G38 tasks. It is unable to work due to this, forum.linuxcnc.org/38-general-linuxcnc-q...bing?start=10#338958, bug
Last edit: 29 Nov 2025 07:49 by abs32.

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

More
30 Nov 2025 17:11 #339507 by andypugh
Replied by andypugh on topic Issue with G38.5

I am quite proficient with build-install-clone commands and have the ability to simultaneously have and use all the versions


I realised that several posts later, and could have saved myself a great deal of typing.

It is unable to work due to this, forum.linuxcnc.org/38-general-linuxcnc-q...bing?start=10#338958, bug[/b][/b][/b]


I will try to look into this, probably with a simulated probe input for simplicity.

Have you tried inserting an explicit queue-buster between the successive probe moves? (I almost feel that we should have a specific code for that, maybe related to M70)
If you insert M66 P0 L0 between the probe moves then the queue might be cleared as a side effect.
Doing some offline research about this I found wiki.linuxcnc.org/cgi-bin/wiki.pl?QueuebustersRevisited which whilst not immediately relevant does discuss some of the issues around the motion queue.

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

More
30 Nov 2025 17:56 #339512 by abs32
Replied by abs32 on topic Issue with G38.5

If you insert M66 P0 L0 between the probe moves then the queue might be cleared as a side effect.

Great news, thanks for the idea. I'll check it out tomorrow with version 2.9.7 and let you know the results.

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

More
30 Nov 2025 18:11 #339514 by abs32

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

Time to create page: 0.116 seconds
Powered by Kunena Forum