I have a DIY 3D printer with Marlin firmware. I use an LJ12A3-4-Z/BY sensor for the Z probe. Recently I have had a ridiculous problem with Z homing.
In doing Z homing, it senses the bed, goes up, and stops, it doesn't go back to the bed...
In doing Bed leveling, it goes up without sensing the bed and in the next step goes even higher and higher.
If I ignore bed leveling, it starts printing in the air. If I still use bed leveling, the Z axis moves in long courses in every layer.
It looks like it is saving the wrong Z-axis position as home! These are some related settings that I think of:
#define Z_PROBE_OFFSET_FROM_EXTRUDER 0.25 // Z offset: -below +above [the nozzle]
and
// Travel limits (mm) after homing, corresponding to endstop positions.
#define X_MIN_POS -3
#define Y_MIN_POS -3
#define Z_MIN_POS 0
and
// For M851 give a range for adjusting the Z probe offset
#define Z_PROBE_OFFSET_RANGE_MIN -20
#define Z_PROBE_OFFSET_RANGE_MAX 20