Z probe problem

When I use the Z probe with a Macro and I start the cut, it never start at the correct place on the Z axis.
The progam is telling me that the Z axis is at -3 but it’s always above the workpiece. I tried variations with the G90 and G91 gcode but the result is the same.
My Z axis at start is on 12 mm (10 mm + 2mm (probe))
What’s the problem?
Thx

My Macro is:

G21
G91
G38.2 Z-100 F100
G92 Z2.0000 X0 Y0
G90
G0 Z10
M30

The start off the gcode cutting is:
;Project 40-40
;Created by Estlcam version 12 build 12,068
;Machining time about 00:03:03 hours

G90
G00 X0.0000 Y0.0000 Z0.0000
G00 Z5.0000
;No. 1: Part 1
G00 X-0.1715 Y-3.4916 Z5.0000
G00 Z0.5000
G01 Z0.0000 F300 S24000
G01 X0.0000 Y-3.5000 Z-0.0625
G01 X8.0707 Z-3.0000

For starters, you will need to tell it the thickness of your probe.

If your probe is 2mm, this line needs to be

G38.2 Z-100 F100 P2.0

in order for Z0 to be set correctly

See here for command details.

Make sure you have accurately measured your probe, and that the probe is completely flat and try again.

I assume your probe is 2mm thick, because that is the thickness that is being compensated for in your G92. The only other thing that is a bit different than other probing code I’ve seen is the G91. You might try changing that to a G90 and using absolute coordinates.

Is the G92 gcode also not for telling that after the probe made contact that the Z is 2 mm above 0?
I’m a new to this.
I will try your G38.2 Z-100 F100 P2.0 later this week.
Thx

Not sure of your control board, but if it runs Marlin, there is no ‘P’ parameter for a G38.2. Your G92 does compensate for the thickness of the probe.

ah…good call… Sorry, I’ve been in FluidNC world… didn’t really consider Marlin

I have tried with and without the G91 but it keeps starting in the wrong place. The strange thing is that after the probe test it indicates that it is at 12 mm. The 2 mm from the probe and the 10 mm via the G0 Z10, which is correct. When I start the code of the program, it indicates that it is at -3 mm, which should be correct, but it is still above the work plane instead of 3 mm in the work plane.

Do I need to set anything in the settings of the controller (SKR Pro 1.2 with Marlin)?

I cannot think of anything that needs to be changed in Marlin, but sometimes your g-code sender can add extra g-code commands. What are you using to deliver the g-code to the board? If you are not already doing so, try running your code from an SD card and see if that makes a difference. If it does, you can then look to your g-code sender settings.

There’s a few possible issues at play here…

You are putting it into Relative Mode before your G38.2 and G92 commands. This seems suspect. I would put in into Absolute Mode at the very start, and leave it there.

After Homing the Z is at 200, and you typically have about 70mm of travel before the end mill hits the stock (depending on end mill stickout length, height of stock, etc.). The Z portion of the G38.2 command tells the selected axis to move until the probe circuit is completed, or until the specified travel distance is achieved (whichever comes first).

While your code should work, the typical code would read G38.2 Z0.

This is setting all three axis to 0. Normally you would set the X & Y axis to 0 using the Homing feature (as well as setting the Z axis to 200 using the same feature), then setting ONLY the Z axis to 0 after probing.

My workflow is:

G90 (never changes)
Home using LCD screen (can also use G28 command)
G38.2 Z0
G92 Z(probe thickness)

Start of CAD gcode

As mentioned above, your CAD or sender may be adding additional code. Try using TFT SD card only, and search the file for any extra commands that may affect the Z height.

I found my problem. The steps/mm (Z axis) was 100 and after some test it have to be ±360 steps/mm.

I stored the setting on the board and now it’s working.

That seems an unusual value but if it works it works I suppose.