Understanding Z probe offset height in config.g and homez.g

  • So I'm trying to make sure I'm doing this correctly because it seems redundant.

    In my config.g I'm specifying the Z probe offset height.
    G31 P500 X17 Y0 Z3.67

    Yet in my homez.g I still need to set the height manually.
    G92 Z3.67

    Am I doing something wrong? Why is the offset setting needed in config.g if I'm still specifying the Z offset height in my homez.g? Wouldn't setting it in homez.g take care of the offset?

  • You don't need to set the z position in homez if you're using a z probe and g30.

    Can you post your config and homing files?

  • Should I just be using something like "G30 P0 X150 Y150 Z-9999 S2" for my homez.g instead ?


    ; General preferences
    ;M929 P"eventlog.txt" S1 ; start logging to file eventlog.txt
    G90                                                          ; Send absolute coordinates...
    M83                                                          ; ...but relative extruder moves
    ; Network
    M550 P++ Duet WiFi ++					; Set machine name
    M552 S1                                                 ; Enable network
    M586 P0 S1                                              ; Enable HTTP
    M586 P1 S1                                              ; Enable FTP
    M586 P2 S1                                              ; Enable Telnet
    ; Drives
    M569 P0 S1                                                   ; Y Drive 0
    M569 P1 S1                                                   ; X Drive 1
    M569 P2 S0                                                   ; Z1 Drive 2
    M569 P3 S1                                                   ; E0 Drive 3
    M569 P4 S0                                                   ; Z2 Drive 4
    M584 X1 Y0 Z4:2 E3						;X on X, Y on Y, Z and Z2 on Z and E1, E0 on E0
    M671 X-25:335 Y150:150 S10                                    ; Z leadscrews are at
    M350 X16 Y16 Z16 E16 I1                                      ; Configure microstepping with interpolation
    M92 X160 Y160 Z800 E837                                        ; Set steps per mm
    M98 Pmotorspeeds.g                         ; motor currents and speeds in this file
    M84 S60                                                      ; Set idle timeout
    ; Axis Limits
    M208 X0 Y0 Z-5 S1                                             ; Set axis minima
    M208 X303 Y298 Z370 S0                                       ; Set axis maxima
    ; Endstops
    M574 X1 Y1 S3               ; Set endstops controlled by motor load detection
    ; Z-Probe
    M574 Z1 S2
    M558 P1 H7.5 F100 T8000 S0.01 A6 B0   ;X0 Y0 Z1 B1 F160
    G31 P500 X17 Y0 Z3.67                                ; Set Z probe trigger value, offset and trigger height
    M557 X20:280 Y20:280 S20                                       ; Define mesh grid
    G29 S1 Pheightmap.csv
    ; Heaters
    M305 P0 T100000 B3988 C0 R4700                               ; Set thermistor + ADC parameters for heater 0
    M143 H0 S160                                                 ; Set temperature limit for heater 0 to 160C
    M305 P1 T100000 B4725 C7.060000e-8 R4700                     ; Set thermistor + ADC parameters for heater 1
    M143 H1 S290                                                 ; Set temperature limit for heater 1 to 290C
    M307 H0 A181.8 C275.0 D3.8 S1.00 B0
    M307 H1 A735.2 C401.4 D5.4 S1.00 V24.3 B0
    ; Fans
    M106 P0 S0 I0 H-1 F60 B0.2                                   ; Part Fans
    M106 P1 H1 T55 F60 S0.8                                 ; Hotend fan
    ; Tools
    M563 P0 D0 H1                                                ; Define tool 0
    G10 P0 X0 Y0 Z0                                              ; Set tool 0 axis offsets
    G10 P0 R0 S0                                                 ; Set initial tool 0 active and standby temperatures to 0C
    M572 D0 S0.05  	;Pressure advance
    ;M591 D0 P1 C0	;Filament Sensor
    M911 S24.0 R24.1 P"M913 X0 Y0 G91 M83 G1 Z2 E-2 F7000" ; Set voltage thresholds and actions to run on power loss
    ;Report Stalls
    ;M915 X Y Z E R1 F0 S2


    G1 Z9 F6000 S2
    G1 X136 Y149 F6000 ; go to first probe point
    G91               ; relative positioning
    G1 Z-405 F800 S1 ; move Z down until the switch triggers
    G92 Z10
    G1 Z2.5
    G1 Z-5.5 F5 S1 
    G92 Z3.67          ; set Z position to trigger height
    G1 Z15 F5000

  • Your homez is currently configured to work as if you were using endstops.

    Try this

    G91 ; relative position
    G1 Z9 F6000 S2 ; raise z by 9
    G90 ; absolute position
    G1 X136 Y149 F6000 ; go to first probe point
    G30 ; probe the bed using z probe to find Z0
    G1 Z15 F5000 ; raise z to 15

  • @phaedrux Thanks, I'll give that a shot later (got another 8 hours left on a print).

  • I am assuming that you've measured your z offset using G30 S-1 already.

    You should probably also test G30 manually before using it in your script just to make sure things are behaving as you expect. Move the head to where you want to probe and send G30 from the console. Either trigger the probe by hand if you can to test if it's working, or be ready to kill the power incase something isn't right.

    For reference:



Looks like your connection to Duet3D was lost, please wait while we try to reconnect.