I wanted an adjustable Z-axis endstop for my BIQU Thunder to allow me to use a PEI coated spring steel bed surface with both the mechanical endstop and the included auto-level sensor. This was based on a CR-10 endstop by sfandersen but redesigned to fit the BIQU Thunder.
1 - M4 Nyloc nut
1 - M4 bolt ~30mm long
Here is my starting gcode to make sure the nozzle moves up high enough to clear the bed first, then prints a purge line.
G28 ; home all axes
G1 Z0.2 F750 ; move Z up
G1 X0 Y0 F9000 ; move to front of bed
G92 E0 ; zero extruded length
G1 X60.0 E9 F500.0 ; start purge line
G1 X100.0 E12.5 F500.0 ; finish purge line