One thing I’ve noticed… you are using an early version amongst the macros I posted. After writing this one I tidied things up and made things more robust in macro: PRB.xyz FL with z
This probes Z first, sets Z-zero, then probes X and zeros it, then probes Y and zeros it.
A significant difference is that I call the Machine Position (mpos) in addition to the Probe position (params.prb) when calculating Work Coordinate offsets… it sounds awfully close by subject to the issues you are seeing - I should perhaps have deleted that earlier macro before posting my collection!
Repeated here, complete with the extra fault finding steps discussed above added. Note in this later macro version that I have used G38.2 then G38.4 for the probing (to and away, respectively) as it is faster and more elegant as a solution than probing to, moving back and then probing to again.
Macro code:
(Probe FRONT LEFT TOP with PRB. Position probe up to 15mm inland and above corner)
;*** Set user-defined variables
%PROBE_LAG = 0.20 ; Lag from touch to trigger
%PROBE_TIP_DIA = 2.00 ; Measured tip dia in mm
%PROBE_PROBE_RANGE = 10.0 ; Range that G38.x will use
%PROBE_CLOSE_RANGE = 1.0 ; Distance to retreat before slow probe
%PROBE_PROBE_SLOW = 50.0 ; Slow probe rate for G38.x
%PROBE_PROBE_FAST = 150.0 ; Fast probe rate for G38.x
%PROBE_DROP_BY = 5.0 ; Distance Z drops before probing JO: was 7 now 5
%PROBE_WITHDRAW = 3.0 ; Distance axes pull back after probing
; *** Would be good if BLOCK dimensions could be pulled from gSender setup
%PROBE_BLOCK_X = 0 ; Probe/puck thickness, X
%PROBE_BLOCK_Y = 0 ; Probe/puck thickness, Y
%PROBE_BLOCK_Z = 0 ; Probe/puck thickness, Z
; *** Wait until the planner queue is empty
%wait
; Keep a backup of current system status
%WCS = modal.wcs
%PLANE = modal.plane
%UNITS = modal.units
%DISTANCE = modal.distance
%FEEDRATE = modal.feedrate
%SPINDLE = modal.spindle
%COOLANT = modal.coolant
; *** Ensure we are in the right mode
G21 ; Make sure we’re in mm
M5 ; Just to be sure, ensure spindle is stopped
G91; Incremental mode
$# ; JO: debug command
(X:[mposx], Y:[mposy], Z:[mposz]) ; JO: debug command
; *** Z Probe *** Downwards is -ve *** Find Z then zero Z ***
G38.2 Z[-PROBE_PROBE_RANGE] F[PROBE_PROBE_FAST] ; Probe down quickly find Z
G38.4 Z[PROBE_PROBE_RANGE] F[PROBE_PROBE_SLOW] ; Probe back up slowly for Z
%wait
%PROBE_Z = params.PRB.z ; Retrieve Z from PRB
%MPZ = mposz ; Get machine resting absolute position to compare PRB to
%ADJZ = MPZ - PROBE_Z
; *** Set Z-Zero to accurate PRB.z position
G10 L20 P1 Z[ADJZ +PROBE_BLOCK_Z] ; Set Z0 with PRB & Puck compensation
G0 Z[PROBE_WITHDRAW - ADJZ] ; Pull up Z to clear puck/workpiece, if G38.4
; *** X Probe *** Rightwards is +ve
G0 X[-PROBE_PROBE_RANGE] ; Move left
G0 Z[-PROBE_DROP_BY] ; Drop Z below top of puck/workpiece
G38.2 X[PROBE_PROBE_RANGE] F[PROBE_PROBE_FAST] ; Probe TO X to right quickly
G38.4 X[-PROBE_PROBE_RANGE] F[PROBE_PROBE_SLOW] ; Slow AWAY probe
%wait
%PROBE_X = params.PRB.x ; Retrieve X from PRB
%MPX=mposx
%ADJX = MPX - PROBE_X - PROBE_LAG ; *** CHECK ORIENTATION ********
; Print to console the ADJ calculation
(MPX - PROBE_X - PROBE_LAG is: [MPX] - [PROBE_X] - [PROBE_LAG] = [ADJX])
; *** Set X0 to accurate PRB.x position
G10 L20 P1 X[ADJX -(PROBE_TIP_DIA/2.0) +PROBE_BLOCK_X] ; Set X0 with comps
$# ; JO: debug command
(X:[mposx], Y:[mposy], Z:[mposz]) ; JO: debug command
G0 X[-PROBE_WITHDRAW] ; Move left by retract distance to clear block
G0 Z[PROBE_DROP_BY] ; Raise Z to avoid conflict when moving
; *** Y Probe *** Backwards is +ve
G0 X[PROBE_PROBE_RANGE] Y[-PROBE_PROBE_RANGE] ; Move frontward and right
G0 Z[-PROBE_DROP_BY] ; Drop Z below top of puck/workpiece
G38.2 Y[PROBE_PROBE_RANGE] F[PROBE_PROBE_FAST] ; Probe TO Y rearwards quickly
G38.4 Y[-PROBE_PROBE_RANGE] F[PROBE_PROBE_SLOW] ; Probe AWAY Y to the front slowly
%wait
%PROBE_Y = params.PRB.y ; Retrieve Y from PRB
%MPY=mposy
%ADJY = MPY - PROBE_Y - PROBE_LAG ; *** CHECK ORIENTATION ********
; Print to console the ADJ calculation
(MPY - PROBE_Y - PROBE_LAG is: [MPY] - [PROBE_Y] - [PROBE_LAG] = [ADJY])
; *** Set Y0 to accurate PRB.y position
G10 L20 P1 Y[ADJY -PROBE_TIP_DIA/2.0 -PROBE_BLOCK_Y ] ; Set Y0 with comps
$# ; JO: debug command
(X:[mposx], Y:[mposy], Z:[mposz]) ; JO: debug command
G0 Y[-PROBE_WITHDRAW] ; Move forward to clear puck/workpiece
G0 Z[PROBE_DROP_BY] ; Raise Z to avoid conflict when moving
; *** Wrap-up, position to above newly found X0Y0
G90 ; Back into Absolute mode
G0 X0 Y0 ; Go to this new X0Y0
; All done, Restore modal state
[WCS] [PLANE] [UNITS] [DISTANCE] [FEEDRATE] [SPINDLE] [COOLANT]