2017-09-08 22:35:25 +02:00
|
|
|
/**
|
|
|
|
* Marlin 3D Printer Firmware
|
2019-06-28 06:57:50 +02:00
|
|
|
* Copyright (c) 2019 MarlinFirmware [https://github.com/MarlinFirmware/Marlin]
|
2017-09-08 22:35:25 +02:00
|
|
|
*
|
|
|
|
* Based on Sprinter and grbl.
|
2019-06-28 06:57:50 +02:00
|
|
|
* Copyright (c) 2011 Camiel Gubbels / Erik van der Zalm
|
2017-09-08 22:35:25 +02:00
|
|
|
*
|
|
|
|
* This program is free software: you can redistribute it and/or modify
|
|
|
|
* it under the terms of the GNU General Public License as published by
|
|
|
|
* the Free Software Foundation, either version 3 of the License, or
|
|
|
|
* (at your option) any later version.
|
|
|
|
*
|
|
|
|
* This program is distributed in the hope that it will be useful,
|
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
* GNU General Public License for more details.
|
|
|
|
*
|
|
|
|
* You should have received a copy of the GNU General Public License
|
|
|
|
* along with this program. If not, see <http://www.gnu.org/licenses/>.
|
|
|
|
*
|
|
|
|
*/
|
2018-11-04 09:25:55 +01:00
|
|
|
#pragma once
|
2017-09-08 22:35:25 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* probe.h - Move, deploy, enable, etc.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#include "../inc/MarlinConfig.h"
|
|
|
|
|
|
|
|
#if HAS_BED_PROBE
|
2019-09-25 04:29:21 +02:00
|
|
|
|
2019-09-25 15:58:27 +02:00
|
|
|
constexpr float nozzle_to_probe_offset[XYZ] = NOZZLE_TO_PROBE_OFFSET;
|
|
|
|
|
2019-09-25 06:35:49 +02:00
|
|
|
extern float probe_offset[XYZ];
|
2019-09-25 15:58:27 +02:00
|
|
|
|
2017-11-19 20:59:40 +01:00
|
|
|
bool set_probe_deployed(const bool deploy);
|
2018-04-30 10:25:47 +02:00
|
|
|
#ifdef Z_AFTER_PROBING
|
2018-03-11 19:07:55 +01:00
|
|
|
void move_z_after_probing();
|
|
|
|
#endif
|
2018-03-21 07:01:43 +01:00
|
|
|
enum ProbePtRaise : unsigned char {
|
|
|
|
PROBE_PT_NONE, // No raise or stow after run_z_probe
|
|
|
|
PROBE_PT_STOW, // Do a complete stow after run_z_probe
|
2018-04-12 04:14:48 +02:00
|
|
|
PROBE_PT_RAISE, // Raise to "between" clearance after run_z_probe
|
|
|
|
PROBE_PT_BIG_RAISE // Raise to big clearance after run_z_probe
|
2018-03-21 07:01:43 +01:00
|
|
|
};
|
2019-09-18 01:16:28 +02:00
|
|
|
float probe_at_point(const float &rx, const float &ry, const ProbePtRaise raise_after=PROBE_PT_NONE, const uint8_t verbose_level=0, const bool probe_relative=true);
|
2017-09-08 22:35:25 +02:00
|
|
|
#define DEPLOY_PROBE() set_probe_deployed(true)
|
|
|
|
#define STOW_PROBE() set_probe_deployed(false)
|
2018-04-24 00:13:01 +02:00
|
|
|
#if HAS_HEATED_BED && ENABLED(WAIT_FOR_BED_HEATER)
|
2018-04-21 22:43:21 +02:00
|
|
|
extern const char msg_wait_for_bed_heating[25];
|
|
|
|
#endif
|
2019-09-25 04:29:21 +02:00
|
|
|
|
2019-09-26 02:57:41 +02:00
|
|
|
#if HAS_LEVELING
|
|
|
|
|
|
|
|
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
|
|
|
|
);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|
2019-09-25 04:29:21 +02:00
|
|
|
|
2017-09-08 22:35:25 +02:00
|
|
|
#else
|
2019-09-25 04:29:21 +02:00
|
|
|
|
2019-09-25 06:35:49 +02:00
|
|
|
constexpr float probe_offset[XYZ] = { 0 };
|
2017-09-08 22:35:25 +02:00
|
|
|
#define DEPLOY_PROBE()
|
|
|
|
#define STOW_PROBE()
|
2019-09-25 04:29:21 +02:00
|
|
|
|
2019-09-25 06:34:07 +02:00
|
|
|
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; };
|
|
|
|
|
2017-09-08 22:35:25 +02:00
|
|
|
#endif
|
|
|
|
|
2018-04-02 06:54:12 +02:00
|
|
|
#if HAS_Z_SERVO_PROBE
|
2017-09-08 22:35:25 +02:00
|
|
|
void servo_probe_init();
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#if QUIET_PROBING
|
|
|
|
void probing_pause(const bool p);
|
|
|
|
#endif
|