From dca0eb752a2fa8e68822ac83b6a710771517d3d4 Mon Sep 17 00:00:00 2001 From: David Ramiro Date: Fri, 4 Jan 2019 01:12:46 +0100 Subject: [PATCH] Mitigate false endstop triggering While adding ENDSTOP_NOISE_FILTER, I try to reduce the impact on accuracy as much as possible by reducing the endstop_poll_count to 2. Possible fix for #8. Thanks to @notching, @mensikv and @md66pt for the valuable feedback! --- Marlin/Configuration.h | 2 +- Marlin/endstops.cpp | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index c9810ae..1d5096d 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -587,7 +587,7 @@ * (This feature is not required for common micro-switches mounted on PCBs * based on the Makerbot design, since they already include the 100nF capacitor.) */ -//#define ENDSTOP_NOISE_FILTER +#define ENDSTOP_NOISE_FILTER //============================================================================= //============================== Movement Settings ============================ diff --git a/Marlin/endstops.cpp b/Marlin/endstops.cpp index 39fbc80..38662d8 100644 --- a/Marlin/endstops.cpp +++ b/Marlin/endstops.cpp @@ -537,7 +537,7 @@ void Endstops::update() { */ static esbits_t old_live_state; if (old_live_state != live_state) { - endstop_poll_count = 7; + endstop_poll_count = 2; old_live_state = live_state; } else if (endstop_poll_count && !--endstop_poll_count)