Browse Source

Patch probe offset name, defines

pull/1/head
Scott Lahteine 5 years ago
parent
commit
5288c399ce
  1. 19
      Marlin/src/gcode/bedlevel/abl/G29.cpp
  2. 4
      Marlin/src/gcode/calibrate/G28.cpp
  3. 41
      Marlin/src/module/probe.cpp
  4. 42
      Marlin/src/module/probe.h

19
Marlin/src/gcode/bedlevel/abl/G29.cpp

@ -391,18 +391,21 @@ G29_TYPE GcodeSuite::G29() {
xy_probe_feedrate_mm_s = MMM_TO_MMS(parser.linearval('S', XY_PROBE_SPEED));
const float x_min = probe_min_x(), x_max = probe_max_x(),
y_min = probe_min_y(), y_max = probe_max_y();
if (parser.seen('H')) {
const int16_t size = (int16_t)parser.value_linear_units();
left_probe_bed_position = _MAX(X_CENTER - size / 2, probe_min_x());
right_probe_bed_position = _MIN(left_probe_bed_position + size, probe_max_x());
front_probe_bed_position = _MAX(Y_CENTER - size / 2, probe_min_y());
back_probe_bed_position = _MIN(front_probe_bed_position + size, probe_max_y());
left_probe_bed_position = _MAX(X_CENTER - size / 2, x_min);
right_probe_bed_position = _MIN(left_probe_bed_position + size, x_max);
front_probe_bed_position = _MAX(Y_CENTER - size / 2, y_min);
back_probe_bed_position = _MIN(front_probe_bed_position + size, y_max);
}
else {
left_probe_bed_position = parser.seenval('L') ? (int)RAW_X_POSITION(parser.value_linear_units()) : _MAX(X_CENTER - X_BED_SIZE / 2, probe_min_x());
right_probe_bed_position = parser.seenval('R') ? (int)RAW_X_POSITION(parser.value_linear_units()) : _MIN(left_probe_bed_position + X_BED_SIZE, probe_max_x());
front_probe_bed_position = parser.seenval('F') ? (int)RAW_Y_POSITION(parser.value_linear_units()) : _MAX(Y_CENTER - Y_BED_SIZE / 2, probe_min_y());
back_probe_bed_position = parser.seenval('B') ? (int)RAW_Y_POSITION(parser.value_linear_units()) : _MIN(front_probe_bed_position + Y_BED_SIZE, probe_max_y());
left_probe_bed_position = parser.seenval('L') ? (int)RAW_X_POSITION(parser.value_linear_units()) : _MAX(X_CENTER - X_BED_SIZE / 2, x_min);
right_probe_bed_position = parser.seenval('R') ? (int)RAW_X_POSITION(parser.value_linear_units()) : _MIN(left_probe_bed_position + X_BED_SIZE, x_max);
front_probe_bed_position = parser.seenval('F') ? (int)RAW_Y_POSITION(parser.value_linear_units()) : _MAX(Y_CENTER - Y_BED_SIZE / 2, y_min);
back_probe_bed_position = parser.seenval('B') ? (int)RAW_Y_POSITION(parser.value_linear_units()) : _MIN(front_probe_bed_position + Y_BED_SIZE, y_max);
}
if (

4
Marlin/src/gcode/calibrate/G28.cpp

@ -39,9 +39,7 @@
#include "../../feature/tmc_util.h"
#endif
#if HOMING_Z_WITH_PROBE || ENABLED(BLTOUCH)
#include "../../module/probe.h"
#endif
#include "../../module/probe.h"
#if ENABLED(BLTOUCH)
#include "../../feature/bltouch.h"

41
Marlin/src/module/probe.cpp

@ -28,9 +28,9 @@
#if HAS_BED_PROBE
#include "../libs/buzzer.h"
#include "probe.h"
#include "../libs/buzzer.h"
#include "motion.h"
#include "temperature.h"
#include "endstops.h"
@ -86,43 +86,6 @@ float probe_offset[XYZ]; // Initialized by settings.load()
#define DEBUG_OUT ENABLED(DEBUG_LEVELING_FEATURE)
#include "../core/debug_out.h"
float probe_min_x() {
return _MAX(
#if ENABLED(DELTA) || IS_SCARA
PROBE_X_MIN, MESH_MIN_X
#else
(X_MIN_BED) + (MIN_PROBE_EDGE), (X_MIN_POS) + probe_offset[X_AXIS]
#endif
);
}
float probe_max_x() {
return _MIN(
#if ENABLED(DELTA) || IS_SCARA
PROBE_X_MAX, MESH_MAX_X
#else
(X_MAX_BED) - (MIN_PROBE_EDGE), (X_MAX_POS) + probe_offset[X_AXIS]
#endif
);
}
float probe_min_y() {
return _MAX(
#if ENABLED(DELTA) || IS_SCARA
PROBE_Y_MIN, MESH_MIN_Y
#else
(Y_MIN_BED) + (MIN_PROBE_EDGE), (Y_MIN_POS) + probe_offset[Y_AXIS]
#endif
);
}
float probe_max_y() {
return _MIN(
#if ENABLED(DELTA) || IS_SCARA
PROBE_Y_MAX, MESH_MAX_Y
#else
(Y_MAX_BED) - (MIN_PROBE_EDGE), (Y_MAX_POS) + probe_offset[Y_AXIS]
#endif
);
}
#if ENABLED(Z_PROBE_SLED)
#ifndef SLED_DOCKING_OFFSET

42
Marlin/src/module/probe.h

@ -47,7 +47,42 @@
extern const char msg_wait_for_bed_heating[25];
#endif
float probe_min_x(), probe_max_x(), probe_min_y(), probe_max_y();
inline float probe_min_x() {
return _MAX(
#if ENABLED(DELTA) || IS_SCARA
PROBE_X_MIN, MESH_MIN_X
#else
(X_MIN_BED) + (MIN_PROBE_EDGE), (X_MIN_POS) + probe_offset[X_AXIS]
#endif
);
}
inline float probe_max_x() {
return _MIN(
#if ENABLED(DELTA) || IS_SCARA
PROBE_X_MAX, MESH_MAX_X
#else
(X_MAX_BED) - (MIN_PROBE_EDGE), (X_MAX_POS) + probe_offset[X_AXIS]
#endif
);
}
inline float probe_min_y() {
return _MAX(
#if ENABLED(DELTA) || IS_SCARA
PROBE_Y_MIN, MESH_MIN_Y
#else
(Y_MIN_BED) + (MIN_PROBE_EDGE), (Y_MIN_POS) + probe_offset[Y_AXIS]
#endif
);
}
inline float probe_max_y() {
return _MIN(
#if ENABLED(DELTA) || IS_SCARA
PROBE_Y_MAX, MESH_MAX_Y
#else
(Y_MAX_BED) - (MIN_PROBE_EDGE), (Y_MAX_POS) + probe_offset[Y_AXIS]
#endif
);
}
#else
@ -55,6 +90,11 @@
#define DEPLOY_PROBE()
#define STOW_PROBE()
inline float probe_min_x() { return 0; };
inline float probe_max_x() { return 0; };
inline float probe_min_y() { return 0; };
inline float probe_max_y() { return 0; };
#endif
#if HAS_Z_SERVO_PROBE

Loading…
Cancel
Save