zprobe_offset => probe_offset

This commit is contained in:
Scott Lahteine
2019-09-24 23:35:49 -05:00
parent 3819f79945
commit 4e8d9fe59b
20 changed files with 79 additions and 79 deletions

View File

@ -176,7 +176,7 @@ typedef struct SettingsDataStruct {
// HAS_BED_PROBE
//
float zprobe_offset[XYZ];
float probe_offset[XYZ];
//
// ABL_PLANAR
@ -613,8 +613,8 @@ void MarlinSettings::postprocess() {
// Probe Z Offset
//
{
_FIELD_TEST(zprobe_offset[Z_AXIS]);
EEPROM_WRITE(zprobe_offset);
_FIELD_TEST(probe_offset[Z_AXIS]);
EEPROM_WRITE(probe_offset);
}
//
@ -1415,10 +1415,10 @@ void MarlinSettings::postprocess() {
// Probe Z Offset
//
{
_FIELD_TEST(zprobe_offset[Z_AXIS]);
_FIELD_TEST(probe_offset[Z_AXIS]);
#if HAS_BED_PROBE
float (&zpo)[XYZ] = zprobe_offset;
float (&zpo)[XYZ] = probe_offset;
#else
float zpo[XYZ];
#endif
@ -2322,7 +2322,7 @@ void MarlinSettings::reset() {
#endif
constexpr float dpo[XYZ] = NOZZLE_TO_PROBE_OFFSET;
static_assert(COUNT(dpo) == 3, "NOZZLE_TO_PROBE_OFFSET must contain offsets for X, Y, and Z.");
LOOP_XYZ(a) zprobe_offset[a] = dpo[a];
LOOP_XYZ(a) probe_offset[a] = dpo[a];
#endif
//
@ -3071,9 +3071,9 @@ void MarlinSettings::reset() {
say_units(true);
}
CONFIG_ECHO_START();
SERIAL_ECHOLNPAIR(" M851 X", LINEAR_UNIT(zprobe_offset[X_AXIS]),
" Y", LINEAR_UNIT(zprobe_offset[Y_AXIS]),
" Z", LINEAR_UNIT(zprobe_offset[Z_AXIS]));
SERIAL_ECHOLNPAIR(" M851 X", LINEAR_UNIT(probe_offset[X_AXIS]),
" Y", LINEAR_UNIT(probe_offset[Y_AXIS]),
" Z", LINEAR_UNIT(probe_offset[Z_AXIS]));
#endif
/**

View File

@ -233,7 +233,7 @@ void home_delta() {
// Move all carriages together linearly until an endstop is hit.
destination[Z_AXIS] = (delta_height
#if HAS_BED_PROBE
- zprobe_offset[Z_AXIS]
- probe_offset[Z_AXIS]
#endif
+ 10);
buffer_line_to_destination(homing_feedrate(X_AXIS));

View File

@ -505,7 +505,7 @@ void restore_feedrate_and_scaling() {
soft_endstop[axis].min = base_min_pos(axis);
soft_endstop[axis].max = (axis == Z_AXIS ? delta_height
#if HAS_BED_PROBE
- zprobe_offset[Z_AXIS]
- probe_offset[Z_AXIS]
#endif
: base_max_pos(axis));
@ -1340,7 +1340,7 @@ void set_axis_is_at_home(const AxisEnum axis) {
#elif ENABLED(DELTA)
current_position[axis] = (axis == Z_AXIS ? delta_height
#if HAS_BED_PROBE
- zprobe_offset[Z_AXIS]
- probe_offset[Z_AXIS]
#endif
: base_home_pos(axis));
#else
@ -1354,9 +1354,9 @@ void set_axis_is_at_home(const AxisEnum axis) {
if (axis == Z_AXIS) {
#if HOMING_Z_WITH_PROBE
current_position[Z_AXIS] -= zprobe_offset[Z_AXIS];
current_position[Z_AXIS] -= probe_offset[Z_AXIS];
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("*** Z HOMED WITH PROBE (Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) ***\n> zprobe_offset[Z_AXIS] = ", zprobe_offset[Z_AXIS]);
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("*** Z HOMED WITH PROBE (Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) ***\n> probe_offset[Z_AXIS] = ", probe_offset[Z_AXIS]);
#else

View File

@ -284,7 +284,7 @@ void homeaxis(const AxisEnum axis);
// Return true if the both nozzle and the probe can reach the given point.
// Note: This won't work on SCARA since the probe offset rotates with the arm.
inline bool position_is_reachable_by_probe(const float &rx, const float &ry) {
return position_is_reachable(rx - zprobe_offset[X_AXIS], ry - zprobe_offset[Y_AXIS])
return position_is_reachable(rx - probe_offset[X_AXIS], ry - probe_offset[Y_AXIS])
&& position_is_reachable(rx, ry, ABS(MIN_PROBE_EDGE));
}
#endif
@ -313,7 +313,7 @@ void homeaxis(const AxisEnum axis);
* nozzle must be be able to reach +10,-10.
*/
inline bool position_is_reachable_by_probe(const float &rx, const float &ry) {
return position_is_reachable(rx - zprobe_offset[X_AXIS], ry - zprobe_offset[Y_AXIS])
return position_is_reachable(rx - probe_offset[X_AXIS], ry - probe_offset[Y_AXIS])
&& WITHIN(rx, probe_min_x() - slop, probe_max_x() + slop)
&& WITHIN(ry, probe_min_y() - slop, probe_max_y() + slop);
}

View File

@ -56,7 +56,7 @@
#include "../feature/backlash.h"
#endif
float zprobe_offset[XYZ]; // Initialized by settings.load()
float probe_offset[XYZ]; // Initialized by settings.load()
#if ENABLED(BLTOUCH)
#include "../feature/bltouch.h"
@ -91,7 +91,7 @@ float probe_min_x() {
#if ENABLED(DELTA) || IS_SCARA
PROBE_X_MIN, MESH_MIN_X
#else
(X_MIN_BED) + (MIN_PROBE_EDGE), (X_MIN_POS) + zprobe_offset[X_AXIS]
(X_MIN_BED) + (MIN_PROBE_EDGE), (X_MIN_POS) + probe_offset[X_AXIS]
#endif
);
}
@ -100,7 +100,7 @@ float probe_max_x() {
#if ENABLED(DELTA) || IS_SCARA
PROBE_X_MAX, MESH_MAX_X
#else
(X_MAX_BED) - (MIN_PROBE_EDGE), (X_MAX_POS) + zprobe_offset[X_AXIS]
(X_MAX_BED) - (MIN_PROBE_EDGE), (X_MAX_POS) + probe_offset[X_AXIS]
#endif
);
}
@ -109,7 +109,7 @@ float probe_min_y() {
#if ENABLED(DELTA) || IS_SCARA
PROBE_Y_MIN, MESH_MIN_Y
#else
(Y_MIN_BED) + (MIN_PROBE_EDGE), (Y_MIN_POS) + zprobe_offset[Y_AXIS]
(Y_MIN_BED) + (MIN_PROBE_EDGE), (Y_MIN_POS) + probe_offset[Y_AXIS]
#endif
);
}
@ -118,7 +118,7 @@ float probe_max_y() {
#if ENABLED(DELTA) || IS_SCARA
PROBE_Y_MAX, MESH_MAX_Y
#else
(Y_MAX_BED) - (MIN_PROBE_EDGE), (Y_MAX_POS) + zprobe_offset[Y_AXIS]
(Y_MAX_BED) - (MIN_PROBE_EDGE), (Y_MAX_POS) + probe_offset[Y_AXIS]
#endif
);
}
@ -300,7 +300,7 @@ inline void do_probe_raise(const float z_raise) {
if (DEBUGGING(LEVELING)) DEBUG_ECHOLNPAIR("do_probe_raise(", z_raise, ")");
float z_dest = z_raise;
if (zprobe_offset[Z_AXIS] < 0) z_dest -= zprobe_offset[Z_AXIS];
if (probe_offset[Z_AXIS] < 0) z_dest -= probe_offset[Z_AXIS];
NOMORE(z_dest, Z_MAX_POS);
@ -580,7 +580,7 @@ static float run_z_probe() {
// Stop the probe before it goes too low to prevent damage.
// If Z isn't known then probe to -10mm.
const float z_probe_low_point = TEST(axis_known_position, Z_AXIS) ? -zprobe_offset[Z_AXIS] + Z_PROBE_LOW_POINT : -10.0;
const float z_probe_low_point = TEST(axis_known_position, Z_AXIS) ? -probe_offset[Z_AXIS] + Z_PROBE_LOW_POINT : -10.0;
// Double-probing does a fast probe followed by a slow probe
#if TOTAL_PROBING == 2
@ -605,7 +605,7 @@ static float run_z_probe() {
// If the nozzle is well over the travel height then
// move down quickly before doing the slow probe
const float z = Z_CLEARANCE_DEPLOY_PROBE + 5.0 + (zprobe_offset[Z_AXIS] < 0 ? -zprobe_offset[Z_AXIS] : 0);
const float z = Z_CLEARANCE_DEPLOY_PROBE + 5.0 + (probe_offset[Z_AXIS] < 0 ? -probe_offset[Z_AXIS] : 0);
if (current_position[Z_AXIS] > z) {
// Probe down fast. If the probe never triggered, raise for probe clearance
if (!do_probe_move(z, MMM_TO_MMS(Z_PROBE_SPEED_FAST)))
@ -735,8 +735,8 @@ float probe_at_point(const float &rx, const float &ry, const ProbePtRaise raise_
float nx = rx, ny = ry;
if (probe_relative) {
if (!position_is_reachable_by_probe(rx, ry)) return NAN; // The given position is in terms of the probe
nx -= zprobe_offset[X_AXIS]; // Get the nozzle position
ny -= zprobe_offset[Y_AXIS];
nx -= probe_offset[X_AXIS]; // Get the nozzle position
ny -= probe_offset[Y_AXIS];
}
else if (!position_is_reachable(nx, ny)) return NAN; // The given position is in terms of the nozzle
@ -757,7 +757,7 @@ float probe_at_point(const float &rx, const float &ry, const ProbePtRaise raise_
float measured_z = NAN;
if (!DEPLOY_PROBE()) {
measured_z = run_z_probe() + zprobe_offset[Z_AXIS];
measured_z = run_z_probe() + probe_offset[Z_AXIS];
const bool big_raise = raise_after == PROBE_PT_BIG_RAISE;
if (big_raise || raise_after == PROBE_PT_RAISE)

View File

@ -29,7 +29,7 @@
#if HAS_BED_PROBE
extern float zprobe_offset[XYZ];
extern float probe_offset[XYZ];
bool set_probe_deployed(const bool deploy);
#ifdef Z_AFTER_PROBING
void move_z_after_probing();
@ -51,7 +51,7 @@
#else
constexpr float zprobe_offset[XYZ] = { 0 };
constexpr float probe_offset[XYZ] = { 0 };
#define DEPLOY_PROBE()
#define STOW_PROBE()