markniu / Bed_Distance_sensor

Auto bed level with High resolution distance sensor
281 stars 28 forks source link

Marlin - G34 command does not account for probe range #179

Open F0mx opened 2 months ago

F0mx commented 2 months ago

As title says, when you use G34 on Marlin, it'll move the Z axis to account for any potential angle in the build plate using whatever value is specified for G34_MAX_GRADE in Configuration_adv.h, which by default is 5mm. But the probe will not move back down in Z to account for this 5mm, just probing in the air and throwing an out of range error.

This can be easily accounted for by adjusting G34_MAX_GRADE to be below approx 1.8mm (as it includes the 1mm Z axis offset applied after homing / G28) but this also does not guarantee you can be free from crashes if there is a significant angle in your build plate prior to running G34.

Ideally, it would move Z up by whatever value G34_MAX_GRADE is, and then probe Z as it would when homing.