Browse Source

Allow weird probe values in G33

pull/1/head
Scott Lahteine 5 years ago
parent
commit
cf597e2bb1
  1. 2
      Marlin/src/gcode/calibrate/G33.cpp
  2. 10
      Marlin/src/module/probe.cpp
  3. 6
      Marlin/src/module/probe.h

2
Marlin/src/gcode/calibrate/G33.cpp

@ -190,7 +190,7 @@ static float std_dev_points(float z_pt[NPP + 1], const bool _0p_cal, const bool
*/
static float calibration_probe(const xy_pos_t &xy, const bool stow) {
#if HAS_BED_PROBE
return probe.probe_at_point(xy, stow ? PROBE_PT_STOW : PROBE_PT_RAISE, 0, true);
return probe.probe_at_point(xy, stow ? PROBE_PT_STOW : PROBE_PT_RAISE, 0, true, false);
#else
UNUSED(stow);
return lcd_probe_pt(xy);

10
Marlin/src/module/probe.cpp

@ -559,7 +559,7 @@ bool Probe::probe_down_to_z(const float z, const feedRate_t fr_mm_s) {
*
* @return The Z position of the bed at the current XY or NAN on error.
*/
float Probe::run_z_probe() {
float Probe::run_z_probe(const bool sanity_check/*=true*/) {
if (DEBUGGING(LEVELING)) DEBUG_POS(">>> Probe::run_z_probe", current_position);
@ -572,7 +572,7 @@ float Probe::run_z_probe() {
// Do a first probe at the fast speed
if (probe_down_to_z(z_probe_low_point, MMM_TO_MMS(Z_PROBE_SPEED_FAST)) // No probe trigger?
|| current_position.z > -offset.z + _MAX(Z_CLEARANCE_BETWEEN_PROBES, 4) / 2 // Probe triggered too high?
|| (sanity_check && current_position.z > -offset.z + _MAX(Z_CLEARANCE_BETWEEN_PROBES, 4) / 2) // Probe triggered too high?
) {
if (DEBUGGING(LEVELING)) {
DEBUG_ECHOLNPGM("FAST Probe fail!");
@ -617,7 +617,7 @@ float Probe::run_z_probe() {
{
// Probe downward slowly to find the bed
if (probe_down_to_z(z_probe_low_point, MMM_TO_MMS(Z_PROBE_SPEED_SLOW)) // No probe trigger?
|| current_position.z > -offset.z + _MAX(Z_CLEARANCE_MULTI_PROBE, 4) / 2 // Probe triggered too high?
|| (sanity_check && current_position.z > -offset.z + _MAX(Z_CLEARANCE_MULTI_PROBE, 4) / 2) // Probe triggered too high?
) {
if (DEBUGGING(LEVELING)) {
DEBUG_ECHOLNPGM("SLOW Probe fail!");
@ -709,7 +709,7 @@ float Probe::run_z_probe() {
* - Raise to the BETWEEN height
* - Return the probed Z position
*/
float Probe::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*/) {
float Probe::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*/, const bool sanity_check/*=true*/) {
if (DEBUGGING(LEVELING)) {
DEBUG_ECHOLNPAIR(
">>> Probe::probe_at_point(", LOGICAL_X_POSITION(rx), ", ", LOGICAL_Y_POSITION(ry),
@ -751,7 +751,7 @@ float Probe::probe_at_point(const float &rx, const float &ry, const ProbePtRaise
do_blocking_move_to(npos);
float measured_z = NAN;
if (!deploy()) measured_z = run_z_probe() + offset.z;
if (!deploy()) measured_z = run_z_probe(sanity_check) + offset.z;
if (!isnan(measured_z)) {
const bool big_raise = raise_after == PROBE_PT_BIG_RAISE;
if (big_raise || raise_after == PROBE_PT_RAISE)

6
Marlin/src/module/probe.h

@ -48,8 +48,8 @@ public:
#ifdef Z_AFTER_PROBING
static void move_z_after_probing();
#endif
static 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);
static inline float probe_at_point(const xy_pos_t &pos, const ProbePtRaise raise_after=PROBE_PT_NONE, const uint8_t verbose_level=0, const bool probe_relative=true) {
static 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, const bool sanity_check=true);
static inline float probe_at_point(const xy_pos_t &pos, const ProbePtRaise raise_after=PROBE_PT_NONE, const uint8_t verbose_level=0, const bool probe_relative=true, const bool sanity_check=true) {
return probe_at_point(pos.x, pos.y, raise_after, verbose_level, probe_relative);
}
#if HAS_HEATED_BED && ENABLED(WAIT_FOR_BED_HEATER)
@ -164,7 +164,7 @@ public:
private:
static bool probe_down_to_z(const float z, const feedRate_t fr_mm_s);
static void do_z_raise(const float z_raise);
static float run_z_probe();
static float run_z_probe(const bool sanity_check=true);
};
extern Probe probe;

Loading…
Cancel
Save