Merge pull request #1253 from lobermann/Development_AutoLevelOffset

Consider negative Z Offsets when auto bed leveling is active
This commit is contained in:
Bo Herrmannsen 2014-12-28 12:52:16 +01:00
commit 73b7b08f2c

View File

@ -3946,7 +3946,14 @@ void clamp_to_software_endstops(float target[3])
if (min_software_endstops) {
if (target[X_AXIS] < min_pos[X_AXIS]) target[X_AXIS] = min_pos[X_AXIS];
if (target[Y_AXIS] < min_pos[Y_AXIS]) target[Y_AXIS] = min_pos[Y_AXIS];
if (target[Z_AXIS] < min_pos[Z_AXIS]) target[Z_AXIS] = min_pos[Z_AXIS];
float negative_z_offset = 0;
#ifdef ENABLE_AUTO_BED_LEVELING
if (Z_PROBE_OFFSET_FROM_EXTRUDER < 0) negative_z_offset = negative_z_offset + Z_PROBE_OFFSET_FROM_EXTRUDER;
if (add_homing[Z_AXIS] < 0) negative_z_offset = negative_z_offset + add_homing[Z_AXIS];
#endif
if (target[Z_AXIS] < min_pos[Z_AXIS]+negative_z_offset) target[Z_AXIS] = min_pos[Z_AXIS]+negative_z_offset;
}
if (max_software_endstops) {