G28 ; home M851 ; display current setting M851 Z0 ; set offset to zero G28 ; home G1 Z0 ; move the nozzle to height 0 M851 Z-1.7 ; the new value ; increase if the first layer is too sick, 1.7 for example ; decrease if the first layer is too thin/the nozzle scratch or hit the bed, 1.5 for example M500 ; store the new configuration