Here are the results from debugging my G38.1
The test files used -
Main file:
Code:
G21 (Units: Metric)
F1 S1
G00 X0.000
o<Test.TouchOff> call
G00 Z3.8100
M03 S1
G01 Z3.8100 F3002
G04 P0.2
G01 Z1.5240 F3001.0
G01 X150.000 F4000.0
G01 X250.000 F2000.000
M05
G00 Z20.000
M05 M30
and subroutine:
Code:
o<test.touchoff> sub
G38.2 Z-100 F3001.0 (debug, probe result #5061)
G10 L20 P1 Z0.000
G00 Z9.900
G10 L20 P1 Z0.000
o<test.touchoff> endsub
M2
If I run as normal cycle, I get expected results. It rapids to X0.00 (if needed), Z moves straight down and resets to 0.00, Z moves up to 3.81mm, torch signalled to fire, Z moves straight down to 1.52mm, X moves to 150mm at 4000mm/m and then X continues from 150-250mm moving at 2000mm/m, Z moves straight up to 20mm, program end. Probe debug = 0.000000.
Complete program can be run multiple times with same results.
For this test, I let the program run to end and then started a run-from-line at G01 X150.000 F4000.0.
As expected, as Z moves down for the unwanted probe, I get X moving toward negative until the Z probe switch trips (X is now at ~193.557549)(not 150.000) and the machine moves X to 250.000 from 193.557549, Z moves up to 20mm. Probe debug = 0.000000. I can run-from-line multiple times with same, unwanted, results.
After running one or more run-from-line cycles and I am at the end of the program: If I start the cycle with a normal start, Z stays at 20mm, X moves from 250.000mm to 0.000mm, Z probes straight down, file runs as normal and probe debug 3051 = 193.557549 (and sometimes 193.662914) which is X position when run-from-line probe switch trips.
As said in an earlier post, this is happening with LinuxCNC v.2.7.3.