Skip to content

Commit e80d24a

Browse files
committed
Improve taring of probe by taring before and after leveling to prevent unwanted triggering. Also decrease the speed to move to the bed.
1 parent a33eec4 commit e80d24a

File tree

3 files changed

+25
-9
lines changed

3 files changed

+25
-9
lines changed

Marlin/Configuration.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -1005,10 +1005,10 @@
10051005
#define XY_PROBE_SPEED (133*60)
10061006

10071007
// Feedrate (mm/min) for the first approach when double-probing (MULTIPLE_PROBING == 2)
1008-
#define Z_PROBE_SPEED_FAST HOMING_FEEDRATE_Z
1008+
#define Z_PROBE_SPEED_FAST (HOMING_FEEDRATE_Z / 2)
10091009

10101010
// Feedrate (mm/min) for the "accurate" probe of each point
1011-
#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 4)
1011+
#define Z_PROBE_SPEED_SLOW (Z_PROBE_SPEED_FAST / 2)
10121012

10131013
/**
10141014
* Multiple Probing

Marlin/Configuration_adv.h

+2-2
Original file line numberDiff line numberDiff line change
@@ -3563,12 +3563,12 @@
35633563
//
35643564
// M42 - Set pin states
35653565
//
3566-
//#define DIRECT_PIN_CONTROL
3566+
#define DIRECT_PIN_CONTROL
35673567

35683568
//
35693569
// M43 - display pin status, toggle pins, watch pins, watch endstops & toggle LED, test servo probe
35703570
//
3571-
//#define PINS_DEBUGGING
3571+
#define PINS_DEBUGGING
35723572

35733573
// Enable Marlin dev mode which adds some special commands
35743574
//#define MARLIN_DEV_MODE

Marlin/src/module/probe.cpp

+21-5
Original file line numberDiff line numberDiff line change
@@ -504,9 +504,9 @@ bool Probe::probe_down_to_z(const float z, const feedRate_t fr_mm_s) {
504504
float Probe::run_z_probe(const bool sanity_check/*=true*/) {
505505
DEBUG_SECTION(log_probe, "Probe::run_z_probe", DEBUGGING(LEVELING));
506506

507-
auto try_to_probe = [&](PGM_P const plbl, const float &z_probe_low_point, const feedRate_t fr_mm_s, const bool scheck, const float clearance) {
508-
#if ENABLED(FIX_MOUNTED_PROBE)
509-
if((0 == READ(OPTO_SWITCH_PIN)))
507+
auto tare_probe= [](bool force) {
508+
#if ENABLED(FIX_MOUNTED_PROBE) && PIN_EXISTS(OPTO_SWITCH)
509+
if((0 == READ(OPTO_SWITCH_PIN)) || force)
510510
{
511511
SERIAL_ECHOLN("FIX_MOUNTED_PROBE: Taring the probe");
512512
WRITE(COM_PIN, HIGH);
@@ -515,6 +515,10 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) {
515515
delay(200);
516516
}
517517
#endif
518+
};
519+
520+
auto try_to_probe = [&](PGM_P const plbl, const float &z_probe_low_point, const feedRate_t fr_mm_s, const bool scheck, const float clearance) {
521+
tare_probe(/*force: */ false);
518522

519523
// Do a first probe at the fast speed
520524
const bool probe_fail = probe_down_to_z(z_probe_low_point, fr_mm_s), // No probe trigger?
@@ -551,15 +555,21 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) {
551555
// Raise to give the probe clearance
552556
do_blocking_move_to_z(current_position.z + Z_CLEARANCE_MULTI_PROBE, MMM_TO_MMS(Z_PROBE_SPEED_FAST));
553557

558+
// Tare probe to reset
559+
tare_probe(/*force: */ true);
554560
#elif Z_PROBE_SPEED_FAST != Z_PROBE_SPEED_SLOW
555561

556562
// If the nozzle is well over the travel height then
557563
// move down quickly before doing the slow probe
558564
const float z = Z_CLEARANCE_DEPLOY_PROBE + 5.0 + (offset.z < 0 ? -offset.z : 0);
559565
if (current_position.z > z) {
560566
// Probe down fast. If the probe never triggered, raise for probe clearance
561-
if (!probe_down_to_z(z, MMM_TO_MMS(Z_PROBE_SPEED_FAST)))
567+
if (!probe_down_to_z(z, MMM_TO_MMS(Z_PROBE_SPEED_FAST))) {
562568
do_blocking_move_to_z(current_position.z + Z_CLEARANCE_BETWEEN_PROBES, MMM_TO_MMS(Z_PROBE_SPEED_FAST));
569+
570+
// Tare probe to reset
571+
tare_probe(/*force: */ true);
572+
}
563573
}
564574
#endif
565575

@@ -579,6 +589,8 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) {
579589
#endif
580590
{
581591
// Probe downward slowly to find the bed
592+
tare_probe(/*force: */ false);
593+
582594
if (try_to_probe(PSTR("SLOW"), z_probe_low_point, MMM_TO_MMS(Z_PROBE_SPEED_SLOW),
583595
sanity_check, Z_CLEARANCE_MULTI_PROBE) ) return NAN;
584596

@@ -607,7 +619,11 @@ float Probe::run_z_probe(const bool sanity_check/*=true*/) {
607619
#if EXTRA_PROBING > 0
608620
< TOTAL_PROBING - 1
609621
#endif
610-
) do_blocking_move_to_z(z + Z_CLEARANCE_MULTI_PROBE, MMM_TO_MMS(Z_PROBE_SPEED_FAST));
622+
) {
623+
do_blocking_move_to_z(z + Z_CLEARANCE_MULTI_PROBE, MMM_TO_MMS(Z_PROBE_SPEED_FAST));
624+
625+
tare_probe(/*force: */ true);
626+
}
611627
#endif
612628
}
613629

0 commit comments

Comments
 (0)