Probing macro: Cannot complete move after probe contact

More
12 Nov 2021 16:26 #226228 by stefan
I have a touch plate connected to a MESA pin to zero the Z axis. I initiate probing through a button on the probe, which runs the following macro:
o<touchprobe> sub

; Configuration
G21 (mm unit)
G91

; Probe Z at slow feed rate.
G38.2 Z-20 F50

; Set Z0 at point where probe triggers with known offset [this is the thickness of my touch plate]
G10 L20 P1 Z21.4

; Raise back up
G90
G0 Z[#5063+20]

o<touchprobe> endsub
M2

LinuxCNC correctly detects the probe contact and stops, but then the move to raise Z back up gets interrupted, and it only moves up by a fraction of a millimeter, instead of the 20mm. I'm pretty sure it's because the probe input in LinuxCNC goes from "touching" to "not touching" during that move, though I don't get any errors from LinuxCNC.

What am I doing wrong? Of course the touch probe will go from touching to not touching once you back away after the G38.2 command, right?

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

More
12 Nov 2021 19:54 #226243 by MaHa
You touch off with coordinate system 1
on trigger set coordinate system 1 to Z21.4
at this point #5063 is related to coordinate system 1 BEFORE set Z to Z21.4, not really usable

maybe you can try 38.4 Z1, probe away and then #5063 has the value of the release point and then G0 G90 Z[#5063+20] should work,
or if this fails,
G1 Z1
and probe again G38.2 Z-1.2 , then lift of as tried before

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

More
20 Nov 2021 04:35 #227050 by stefan
I've tried both of these suggestions, it's still not working for me. For instance, I've tried this:
G38.3 Z-20 F50
G4 P2
G38.5 Z10 F50
G4 P2
G10 L20 P1 Z21.4

The spindle moves down, detects the probe contact, then moves up until the probe releases, but then the program immediately aborts (never reaching the last two lines). Why could that be? Is there a way for me to debug this? I've tried running with `-d -v`, but no useful output is shown. The UI (I've tried qtdragon and gmoccupy) don't show any errors/warnings.

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

More
20 Nov 2021 05:17 #227051 by stefan
Interesting observation: the problem only happens when I use my home-made probe that's connecting an aluminium piece to the spindle (which is grounded). When I use a button-based touch probe from aliexpress, it works, so clearly the problem is with my probe.

I'm using a Mesa 7i76e, which expects inputs to be high/24V, so I'm using a pull-up resistor of 10k Ohm, which pulls the input pin low when the spindle/bit contacts my probe. Am I doing something wrong? I've seen the same setup in many other places.

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

More
20 Nov 2021 18:34 #227111 by stefan
Wow, this is embarrassing, but I'll say what the problem was on the remote chance this helps someone else: I was also setting up a control panel button to stop to program, and accidentally tied the probe input to halui.program.stop (instead of the button input). This means any time the probe released, halui.program.stop was triggered, stopping the probing macro. It all makes sense now :)
 

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

Time to create page: 0.249 seconds
Powered by Kunena Forum