diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h index 7d0efcc303..4587c9f0d3 100644 --- a/Marlin/Configuration.h +++ b/Marlin/Configuration.h @@ -527,6 +527,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/Marlin_main.cpp b/Marlin/Marlin_main.cpp index 2fac62ab39..762f5fc7e7 100644 --- a/Marlin/Marlin_main.cpp +++ b/Marlin/Marlin_main.cpp @@ -2224,7 +2224,7 @@ void clean_up_after_endstop_or_probe_move() { do_blocking_move_to_z(z, fr_mm_s); // Check to see if the probe was triggered - const bool probe_triggered = TEST(Endstops::endstop_hit_bits, + const bool probe_triggered = TEST(endstops.trigger_state(), #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) Z_MIN #else @@ -3893,7 +3893,7 @@ inline void gcode_G4() { // If an endstop was not hit, then damage can occur if homing is continued. // This can occur if the delta height not set correctly. - if (!(Endstops::endstop_hit_bits & (_BV(X_MAX) | _BV(Y_MAX) | _BV(Z_MAX)))) { + if (!(endstops.trigger_state() & (_BV(X_MAX) | _BV(Y_MAX) | _BV(Z_MAX)))) { LCD_MESSAGEPGM(MSG_ERR_HOMING_FAILED); SERIAL_ERROR_START(); SERIAL_ERRORLNPGM(MSG_ERR_HOMING_FAILED); diff --git a/Marlin/endstops.cpp b/Marlin/endstops.cpp index 734dcecfa8..bea2a3fd8f 100644 --- a/Marlin/endstops.cpp +++ b/Marlin/endstops.cpp @@ -36,7 +36,7 @@ #endif // TEST_ENDSTOP: test the current status of an endstop -#define TEST_ENDSTOP(ENDSTOP) (TEST(current_endstop_bits, ENDSTOP)) +#define TEST_ENDSTOP(ENDSTOP) (TEST(live_state, ENDSTOP)) #if HAS_BED_PROBE #define ENDSTOPS_ENABLED (endstops.enabled || endstops.z_probe_enabled) @@ -49,9 +49,14 @@ Endstops endstops; // public: bool Endstops::enabled, Endstops::enabled_globally; // Initialized by settings.load() -volatile uint8_t Endstops::endstop_hit_bits; // use X_MIN, Y_MIN, Z_MIN and Z_MIN_PROBE as BIT value +volatile uint8_t Endstops::hit_state; -Endstops::esbits_t Endstops::current_endstop_bits = 0; +Endstops::esbits_t Endstops::live_state = 0; +#if ENABLED(ENDSTOP_NOISE_FILTER) + Endstops::esbits_t Endstops::old_live_state, + Endstops::validated_live_state; + uint8_t Endstops::endstop_poll_count; +#endif #if HAS_BED_PROBE volatile bool Endstops::z_probe_enabled = false; @@ -203,7 +208,7 @@ void Endstops::poll() { endstops.run_monitor(); // report changes in endstop status #endif - #if DISABLED(ENDSTOP_INTERRUPTS_FEATURE) + #if DISABLED(ENDSTOP_INTERRUPTS_FEATURE) || ENABLED(ENDSTOP_NOISE_FILTER) if (ENDSTOPS_ENABLED) endstops.update(); #endif } @@ -237,7 +242,7 @@ void Endstops::not_homing() { // Clear endstops (i.e., they were hit intentionally) to suppress the report void Endstops::hit_on_purpose() { - endstop_hit_bits = 0; + hit_state = 0; #if ENABLED(ENDSTOP_INTERRUPTS_FEATURE) if (enabled) endstops.update(); // If enabling, update state now @@ -266,7 +271,7 @@ void Endstops::hit_on_purpose() { #endif void Endstops::report_state() { - if (endstop_hit_bits) { + if (hit_state) { #if ENABLED(ULTRA_LCD) char chrX = ' ', chrY = ' ', chrZ = ' ', chrP = ' '; #define _SET_STOP_CHAR(A,C) (chr## A = C) @@ -279,7 +284,7 @@ void Endstops::report_state() { _SET_STOP_CHAR(A,C); }while(0) #define _ENDSTOP_HIT_TEST(A,C) \ - if (TEST(endstop_hit_bits, A ##_MIN) || TEST(endstop_hit_bits, A ##_MAX)) \ + if (TEST(hit_state, A ##_MIN) || TEST(hit_state, A ##_MAX)) \ _ENDSTOP_HIT_ECHO(A,C) #define ENDSTOP_HIT_TEST_X() _ENDSTOP_HIT_TEST(X,'X') @@ -294,7 +299,7 @@ void Endstops::report_state() { #if ENABLED(Z_MIN_PROBE_ENDSTOP) #define P_AXIS Z_AXIS - if (TEST(endstop_hit_bits, Z_MIN_PROBE)) _ENDSTOP_HIT_ECHO(P, 'P'); + if (TEST(hit_state, Z_MIN_PROBE)) _ENDSTOP_HIT_ECHO(P, 'P'); #endif SERIAL_EOL(); @@ -370,69 +375,23 @@ void Endstops::M119() { // The following routines are called from an ISR context. It could be the temperature ISR, the // endstop ISR or the Stepper ISR. -#if ENABLED(X_DUAL_ENDSTOPS) - void Endstops::test_dual_x_endstops(const EndstopEnum es1, const EndstopEnum es2) { - const byte x_test = TEST_ENDSTOP(es1) | (TEST_ENDSTOP(es2) << 1); // bit 0 for X, bit 1 for X2 - if (x_test && stepper.movement_non_null(X_AXIS)) { - SBI(endstop_hit_bits, X_MIN); - if (!stepper.performing_homing || (x_test == 0x3)) //if not performing home or if both endstops were trigged during homing... - stepper.quick_stop(); - } - } -#endif -#if ENABLED(Y_DUAL_ENDSTOPS) - void Endstops::test_dual_y_endstops(const EndstopEnum es1, const EndstopEnum es2) { - const byte y_test = TEST_ENDSTOP(es1) | (TEST_ENDSTOP(es2) << 1); // bit 0 for Y, bit 1 for Y2 - if (y_test && stepper.movement_non_null(Y_AXIS)) { - SBI(endstop_hit_bits, Y_MIN); - if (!stepper.performing_homing || (y_test == 0x3)) //if not performing home or if both endstops were trigged during homing... - stepper.quick_stop(); - } - } -#endif -#if ENABLED(Z_DUAL_ENDSTOPS) - void Endstops::test_dual_z_endstops(const EndstopEnum es1, const EndstopEnum es2) { - const byte z_test = TEST_ENDSTOP(es1) | (TEST_ENDSTOP(es2) << 1); // bit 0 for Z, bit 1 for Z2 - if (z_test && stepper.movement_non_null(Z_AXIS)) { - SBI(endstop_hit_bits, Z_MIN); - if (!stepper.performing_homing || (z_test == 0x3)) //if not performing home or if both endstops were trigged during homing... - stepper.quick_stop(); - } - } -#endif +#define _ENDSTOP(AXIS, MINMAX) AXIS ##_## MINMAX +#define _ENDSTOP_PIN(AXIS, MINMAX) AXIS ##_## MINMAX ##_PIN +#define _ENDSTOP_INVERTING(AXIS, MINMAX) AXIS ##_## MINMAX ##_ENDSTOP_INVERTING // Check endstops - Could be called from ISR! void Endstops::update() { - #define _ENDSTOP(AXIS, MINMAX) AXIS ##_## MINMAX - #define _ENDSTOP_PIN(AXIS, MINMAX) AXIS ##_## MINMAX ##_PIN - #define _ENDSTOP_INVERTING(AXIS, MINMAX) AXIS ##_## MINMAX ##_ENDSTOP_INVERTING - #define _ENDSTOP_HIT(AXIS, MINMAX) SBI(endstop_hit_bits, _ENDSTOP(AXIS, MINMAX)) - #define SET_BIT(N,B,TF) do{ if (TF) SBI(N,B); else CBI(N,B); }while(0) // UPDATE_ENDSTOP_BIT: set the current endstop bits for an endstop to its status - #define UPDATE_ENDSTOP_BIT(AXIS, MINMAX) SET_BIT(current_endstop_bits, _ENDSTOP(AXIS, MINMAX), (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX))) + #define UPDATE_ENDSTOP_BIT(AXIS, MINMAX) SET_BIT(live_state, _ENDSTOP(AXIS, MINMAX), (READ(_ENDSTOP_PIN(AXIS, MINMAX)) != _ENDSTOP_INVERTING(AXIS, MINMAX))) // COPY_BIT: copy the value of SRC_BIT to DST_BIT in DST #define COPY_BIT(DST, SRC_BIT, DST_BIT) SET_BIT(DST, DST_BIT, TEST(DST, SRC_BIT)) - #define UPDATE_ENDSTOP(AXIS,MINMAX) do { \ - UPDATE_ENDSTOP_BIT(AXIS, MINMAX); \ - if (TEST_ENDSTOP(_ENDSTOP(AXIS, MINMAX))) { \ - _ENDSTOP_HIT(AXIS, MINMAX); \ - planner.endstop_triggered(_AXIS(AXIS)); \ - } \ - }while(0) - #if ENABLED(G38_PROBE_TARGET) && PIN_EXISTS(Z_MIN_PROBE) && !(CORE_IS_XY || CORE_IS_XZ) // If G38 command is active check Z_MIN_PROBE for ALL movement if (G38_move) { UPDATE_ENDSTOP_BIT(Z, MIN_PROBE); - if (TEST_ENDSTOP(_ENDSTOP(Z, MIN_PROBE))) { - if (stepper.movement_non_null(_AXIS(X))) { _ENDSTOP_HIT(X, MIN); planner.endstop_triggered(_AXIS(X)); } - else if (stepper.movement_non_null(_AXIS(Y))) { _ENDSTOP_HIT(Y, MIN); planner.endstop_triggered(_AXIS(Y)); } - else if (stepper.movement_non_null(_AXIS(Z))) { _ENDSTOP_HIT(Z, MIN); planner.endstop_triggered(_AXIS(Z)); } - G38_endstop_hit = true; - } } #endif @@ -526,11 +485,10 @@ void Endstops::update() { #if HAS_X2_MIN UPDATE_ENDSTOP_BIT(X2, MIN); #else - COPY_BIT(current_endstop_bits, X_MIN, X2_MIN); + COPY_BIT(live_state, X_MIN, X2_MIN); #endif - test_dual_x_endstops(X_MIN, X2_MIN); #else - if (X_MIN_TEST) UPDATE_ENDSTOP(X, MIN); + if (X_MIN_TEST) UPDATE_ENDSTOP_BIT(X, MIN); #endif #endif } @@ -541,11 +499,10 @@ void Endstops::update() { #if HAS_X2_MAX UPDATE_ENDSTOP_BIT(X2, MAX); #else - COPY_BIT(current_endstop_bits, X_MAX, X2_MAX); + COPY_BIT(live_state, X_MAX, X2_MAX); #endif - test_dual_x_endstops(X_MAX, X2_MAX); #else - if (X_MAX_TEST) UPDATE_ENDSTOP(X, MAX); + if (X_MAX_TEST) UPDATE_ENDSTOP_BIT(X, MAX); #endif #endif } @@ -559,11 +516,10 @@ void Endstops::update() { #if HAS_Y2_MIN UPDATE_ENDSTOP_BIT(Y2, MIN); #else - COPY_BIT(current_endstop_bits, Y_MIN, Y2_MIN); + COPY_BIT(live_state, Y_MIN, Y2_MIN); #endif - test_dual_y_endstops(Y_MIN, Y2_MIN); #else - UPDATE_ENDSTOP(Y, MIN); + UPDATE_ENDSTOP_BIT(Y, MIN); #endif #endif } @@ -574,11 +530,10 @@ void Endstops::update() { #if HAS_Y2_MAX UPDATE_ENDSTOP_BIT(Y2, MAX); #else - COPY_BIT(current_endstop_bits, Y_MAX, Y2_MAX); + COPY_BIT(live_state, Y_MAX, Y2_MAX); #endif - test_dual_y_endstops(Y_MAX, Y2_MAX); #else - UPDATE_ENDSTOP(Y, MAX); + UPDATE_ENDSTOP_BIT(Y, MAX); #endif #endif } @@ -592,14 +547,13 @@ void Endstops::update() { #if HAS_Z2_MIN UPDATE_ENDSTOP_BIT(Z2, MIN); #else - COPY_BIT(current_endstop_bits, Z_MIN, Z2_MIN); + COPY_BIT(live_state, Z_MIN, Z2_MIN); #endif - test_dual_z_endstops(Z_MIN, Z2_MIN); #else #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) - if (z_probe_enabled) UPDATE_ENDSTOP(Z, MIN); + if (z_probe_enabled) UPDATE_ENDSTOP_BIT(Z, MIN); #else - UPDATE_ENDSTOP(Z, MIN); + UPDATE_ENDSTOP_BIT(Z, MIN); #endif #endif #endif @@ -607,8 +561,7 @@ void Endstops::update() { // When closing the gap check the enabled probe #if ENABLED(Z_MIN_PROBE_ENDSTOP) if (z_probe_enabled) { - UPDATE_ENDSTOP(Z, MIN_PROBE); - if (TEST_ENDSTOP(Z_MIN_PROBE)) SBI(endstop_hit_bits, Z_MIN_PROBE); + UPDATE_ENDSTOP_BIT(Z, MIN_PROBE); } #endif } @@ -620,13 +573,149 @@ void Endstops::update() { #if HAS_Z2_MAX UPDATE_ENDSTOP_BIT(Z2, MAX); #else - COPY_BIT(current_endstop_bits, Z_MAX, Z2_MAX); + COPY_BIT(live_state, Z_MAX, Z2_MAX); #endif - test_dual_z_endstops(Z_MAX, Z2_MAX); // If this pin is not hijacked for the bed probe // then it belongs to the Z endstop #elif DISABLED(Z_MIN_PROBE_ENDSTOP) || Z_MAX_PIN != Z_MIN_PROBE_PIN - UPDATE_ENDSTOP(Z, MAX); + UPDATE_ENDSTOP_BIT(Z, MAX); + #endif + #endif + } + } + + // All endstops were updated. + #if ENABLED(ENDSTOP_NOISE_FILTER) + if (old_live_state != live_state) { // We detected a change. Reinit the timeout + /** + * Filtering out noise on endstops requires a delayed decision. Let's assume, due to noise, + * that 50% of endstop signal samples are good and 50% are bad (assuming normal distribution + * of random noise). Then the first sample has a 50% chance to be good or bad. The 2nd sample + * also has a 50% chance to be good or bad. The chances of 2 samples both being bad becomes + * 50% of 50%, or 25%. That was the previous implementation of Marlin endstop handling. It + * reduces chances of bad readings in half, at the cost of 1 extra sample period, but chances + * still exist. The only way to reduce them further is to increase the number of samples. + * To reduce the chance to 1% (1/128th) requires 7 samples (adding 7ms of delay). + */ + endstop_poll_count = 7; + old_live_state = live_state; + } + else if (endstop_poll_count && !--endstop_poll_count) + validated_live_state = live_state; + + #else + + // Lets accept the new endstop values as valid - We assume hardware filtering of lines + esbits_t validated_live_state = live_state; + + #endif + + // Endstop readings are validated in validated_live_state + + // Test the current status of an endstop + #define TEST_ENDSTOP(ENDSTOP) (TEST(validated_live_state, ENDSTOP)) + + // Record endstop was hit + #define _ENDSTOP_HIT(AXIS, MINMAX) SBI(hit_state, _ENDSTOP(AXIS, MINMAX)) + + // Call the endstop triggered routine for single endstops + #define PROCESS_ENDSTOP(AXIS,MINMAX) do { \ + if (TEST_ENDSTOP(_ENDSTOP(AXIS, MINMAX))) { \ + _ENDSTOP_HIT(AXIS, MINMAX); \ + planner.endstop_triggered(_AXIS(AXIS)); \ + } \ + }while(0) + + // Call the endstop triggered routine for single endstops + #define PROCESS_DUAL_ENDSTOP(AXIS1, AXIS2, MINMAX) do { \ + if (TEST_ENDSTOP(_ENDSTOP(AXIS1, MINMAX)) || TEST_ENDSTOP(_ENDSTOP(AXIS2, MINMAX))) { \ + _ENDSTOP_HIT(AXIS1, MINMAX); \ + planner.endstop_triggered(_AXIS(AXIS1)); \ + } \ + }while(0) + + #if ENABLED(G38_PROBE_TARGET) && PIN_EXISTS(Z_MIN_PROBE) && !(CORE_IS_XY || CORE_IS_XZ) + // If G38 command is active check Z_MIN_PROBE for ALL movement + if (G38_move) { + if (TEST_ENDSTOP(_ENDSTOP(Z, MIN_PROBE))) { + if (stepper.movement_non_null(_AXIS(X))) { _ENDSTOP_HIT(X, MIN); planner.endstop_triggered(_AXIS(X)); } + else if (stepper.movement_non_null(_AXIS(Y))) { _ENDSTOP_HIT(Y, MIN); planner.endstop_triggered(_AXIS(Y)); } + else if (stepper.movement_non_null(_AXIS(Z))) { _ENDSTOP_HIT(Z, MIN); planner.endstop_triggered(_AXIS(Z)); } + G38_endstop_hit = true; + } + } + #endif + + // Now, we must signal, after validation, if an endstop limit is pressed or not + if (X_MOVE_TEST) { + if (stepper.motor_direction(X_AXIS_HEAD)) { // -direction + #if HAS_X_MIN + #if ENABLED(X_DUAL_ENDSTOPS) + PROCESS_DUAL_ENDSTOP(X, X2, MIN); + #else + if (X_MIN_TEST) PROCESS_ENDSTOP(X, MIN); + #endif + #endif + } + else { // +direction + #if HAS_X_MAX + #if ENABLED(X_DUAL_ENDSTOPS) + PROCESS_DUAL_ENDSTOP(X, X2, MAX); + #else + if (X_MAX_TEST) PROCESS_ENDSTOP(X, MAX); + #endif + #endif + } + } + + if (Y_MOVE_TEST) { + if (stepper.motor_direction(Y_AXIS_HEAD)) { // -direction + #if HAS_Y_MIN + #if ENABLED(Y_DUAL_ENDSTOPS) + PROCESS_DUAL_ENDSTOP(Y, Y2, MIN); + #else + PROCESS_ENDSTOP(Y, MIN); + #endif + #endif + } + else { // +direction + #if HAS_Y_MAX + #if ENABLED(Y_DUAL_ENDSTOPS) + PROCESS_DUAL_ENDSTOP(Y, Y2, MAX); + #else + PROCESS_ENDSTOP(Y, MAX); + #endif + #endif + } + } + + if (Z_MOVE_TEST) { + if (stepper.motor_direction(Z_AXIS_HEAD)) { // Z -direction. Gantry down, bed up. + #if HAS_Z_MIN + #if ENABLED(Z_DUAL_ENDSTOPS) + PROCESS_DUAL_ENDSTOP(Z, Z2, MIN); + #else + #if ENABLED(Z_MIN_PROBE_USES_Z_MIN_ENDSTOP_PIN) + if (z_probe_enabled) PROCESS_ENDSTOP(Z, MIN); + #else + PROCESS_ENDSTOP(Z, MIN); + #endif + #endif + #endif + + // When closing the gap check the enabled probe + #if ENABLED(Z_MIN_PROBE_ENDSTOP) + if (z_probe_enabled) PROCESS_ENDSTOP(Z, MIN_PROBE); + #endif + } + else { // Z +direction. Gantry up, bed down. + #if HAS_Z_MAX + #if ENABLED(Z_DUAL_ENDSTOPS) + PROCESS_DUAL_ENDSTOP(Z, Z2, MAX); + #elif DISABLED(Z_MIN_PROBE_ENDSTOP) || Z_MAX_PIN != Z_MIN_PROBE_PIN + // If this pin is not hijacked for the bed probe + // then it belongs to the Z endstop + PROCESS_ENDSTOP(Z, MAX); #endif #endif } diff --git a/Marlin/endstops.h b/Marlin/endstops.h index 903a407cdf..9ba7d28810 100644 --- a/Marlin/endstops.h +++ b/Marlin/endstops.h @@ -50,7 +50,6 @@ class Endstops { public: static bool enabled, enabled_globally; - static volatile uint8_t endstop_hit_bits; // use X_MIN, Y_MIN, Z_MIN and Z_MIN_PROBE as BIT value #if ENABLED(X_DUAL_ENDSTOPS) || ENABLED(Y_DUAL_ENDSTOPS) || ENABLED(Z_DUAL_ENDSTOPS) typedef uint16_t esbits_t; @@ -64,11 +63,19 @@ class Endstops { static float z_endstop_adj; #endif #else - typedef byte esbits_t; + typedef uint8_t esbits_t; #endif - static esbits_t current_endstop_bits; + private: + static esbits_t live_state; + static volatile uint8_t hit_state; // Use X_MIN, Y_MIN, Z_MIN and Z_MIN_PROBE as BIT index + #if ENABLED(ENDSTOP_NOISE_FILTER) + static esbits_t old_live_state, // Old endstop value for debouncing and denoising + validated_live_state; // The validated (accepted as true) endstop bits + static uint8_t endstop_poll_count; // Countdown from threshold for polling + #endif + public: Endstops() {}; /** @@ -92,6 +99,16 @@ class Endstops { */ static void update(); + /** + * Get Endstop hit state. + */ + FORCE_INLINE static uint8_t trigger_state() { return hit_state; } + + /** + * Get current endstops state + */ + FORCE_INLINE static esbits_t state() { return live_state; } + /** * Print an error message reporting the position when the endstops were last hit. */ @@ -126,18 +143,6 @@ class Endstops { static void monitor(); static void run_monitor(); #endif - - private: - - #if ENABLED(X_DUAL_ENDSTOPS) - static void test_dual_x_endstops(const EndstopEnum es1, const EndstopEnum es2); - #endif - #if ENABLED(Y_DUAL_ENDSTOPS) - static void test_dual_y_endstops(const EndstopEnum es1, const EndstopEnum es2); - #endif - #if ENABLED(Z_DUAL_ENDSTOPS) - static void test_dual_z_endstops(const EndstopEnum es1, const EndstopEnum es2); - #endif }; extern Endstops endstops; diff --git a/Marlin/example_configurations/AlephObjects/TAZ4/Configuration.h b/Marlin/example_configurations/AlephObjects/TAZ4/Configuration.h index 3ef04273bb..18729fd2c9 100644 --- a/Marlin/example_configurations/AlephObjects/TAZ4/Configuration.h +++ b/Marlin/example_configurations/AlephObjects/TAZ4/Configuration.h @@ -552,6 +552,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/AliExpress/CL-260/Configuration.h b/Marlin/example_configurations/AliExpress/CL-260/Configuration.h index c4304e8603..fd17e2ffac 100644 --- a/Marlin/example_configurations/AliExpress/CL-260/Configuration.h +++ b/Marlin/example_configurations/AliExpress/CL-260/Configuration.h @@ -532,6 +532,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/Anet/A6/Configuration.h b/Marlin/example_configurations/Anet/A6/Configuration.h index 8ca908e84a..e81ec89bc9 100644 --- a/Marlin/example_configurations/Anet/A6/Configuration.h +++ b/Marlin/example_configurations/Anet/A6/Configuration.h @@ -552,6 +552,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. #define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/Anet/A8/Configuration.h b/Marlin/example_configurations/Anet/A8/Configuration.h index d1bd652912..c0b422b613 100644 --- a/Marlin/example_configurations/Anet/A8/Configuration.h +++ b/Marlin/example_configurations/Anet/A8/Configuration.h @@ -539,6 +539,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. #define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/BIBO/TouchX/Cyclops/Configuration.h b/Marlin/example_configurations/BIBO/TouchX/Cyclops/Configuration.h index d30c9694bb..742631b7c0 100644 --- a/Marlin/example_configurations/BIBO/TouchX/Cyclops/Configuration.h +++ b/Marlin/example_configurations/BIBO/TouchX/Cyclops/Configuration.h @@ -532,6 +532,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/BIBO/TouchX/default/Configuration.h b/Marlin/example_configurations/BIBO/TouchX/default/Configuration.h index f5581ec7bd..5ceb56c0b9 100644 --- a/Marlin/example_configurations/BIBO/TouchX/default/Configuration.h +++ b/Marlin/example_configurations/BIBO/TouchX/default/Configuration.h @@ -532,6 +532,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/BQ/Hephestos/Configuration.h b/Marlin/example_configurations/BQ/Hephestos/Configuration.h index ee17625b66..db662bb792 100644 --- a/Marlin/example_configurations/BQ/Hephestos/Configuration.h +++ b/Marlin/example_configurations/BQ/Hephestos/Configuration.h @@ -520,6 +520,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/BQ/Hephestos_2/Configuration.h b/Marlin/example_configurations/BQ/Hephestos_2/Configuration.h index 944e6c4d45..a67943202e 100644 --- a/Marlin/example_configurations/BQ/Hephestos_2/Configuration.h +++ b/Marlin/example_configurations/BQ/Hephestos_2/Configuration.h @@ -533,6 +533,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. #define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/BQ/WITBOX/Configuration.h b/Marlin/example_configurations/BQ/WITBOX/Configuration.h index 9d2478c35a..f23163ede4 100644 --- a/Marlin/example_configurations/BQ/WITBOX/Configuration.h +++ b/Marlin/example_configurations/BQ/WITBOX/Configuration.h @@ -520,6 +520,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/Cartesio/Configuration.h b/Marlin/example_configurations/Cartesio/Configuration.h index aea0c13597..7cee7aa043 100644 --- a/Marlin/example_configurations/Cartesio/Configuration.h +++ b/Marlin/example_configurations/Cartesio/Configuration.h @@ -531,6 +531,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/Creality/CR-10/Configuration.h b/Marlin/example_configurations/Creality/CR-10/Configuration.h index 832a1b07c4..459c51b59a 100755 --- a/Marlin/example_configurations/Creality/CR-10/Configuration.h +++ b/Marlin/example_configurations/Creality/CR-10/Configuration.h @@ -542,6 +542,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/Creality/CR-10S/Configuration.h b/Marlin/example_configurations/Creality/CR-10S/Configuration.h index 53764e6cb6..46a1428c5c 100644 --- a/Marlin/example_configurations/Creality/CR-10S/Configuration.h +++ b/Marlin/example_configurations/Creality/CR-10S/Configuration.h @@ -532,6 +532,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/Creality/CR-10mini/Configuration.h b/Marlin/example_configurations/Creality/CR-10mini/Configuration.h index 7b9a896bd9..267b21ac26 100644 --- a/Marlin/example_configurations/Creality/CR-10mini/Configuration.h +++ b/Marlin/example_configurations/Creality/CR-10mini/Configuration.h @@ -551,6 +551,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/Creality/CR-8/Configuration.h b/Marlin/example_configurations/Creality/CR-8/Configuration.h index c2334b9ab9..fa0df48493 100644 --- a/Marlin/example_configurations/Creality/CR-8/Configuration.h +++ b/Marlin/example_configurations/Creality/CR-8/Configuration.h @@ -542,6 +542,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/Creality/Ender-2/Configuration.h b/Marlin/example_configurations/Creality/Ender-2/Configuration.h index 86e716df36..cfc3637fe6 100644 --- a/Marlin/example_configurations/Creality/Ender-2/Configuration.h +++ b/Marlin/example_configurations/Creality/Ender-2/Configuration.h @@ -536,6 +536,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/Creality/Ender-3/Configuration.h b/Marlin/example_configurations/Creality/Ender-3/Configuration.h index 30c33a3dd7..3ea4069e91 100644 --- a/Marlin/example_configurations/Creality/Ender-3/Configuration.h +++ b/Marlin/example_configurations/Creality/Ender-3/Configuration.h @@ -536,6 +536,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/Creality/Ender-4/Configuration.h b/Marlin/example_configurations/Creality/Ender-4/Configuration.h index 974e5e3302..3a86ee1e6a 100644 --- a/Marlin/example_configurations/Creality/Ender-4/Configuration.h +++ b/Marlin/example_configurations/Creality/Ender-4/Configuration.h @@ -542,6 +542,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/Felix/Configuration.h b/Marlin/example_configurations/Felix/Configuration.h index 4376d96308..465935f739 100644 --- a/Marlin/example_configurations/Felix/Configuration.h +++ b/Marlin/example_configurations/Felix/Configuration.h @@ -513,6 +513,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/Felix/DUAL/Configuration.h b/Marlin/example_configurations/Felix/DUAL/Configuration.h index 6c9ad5e637..46240434bd 100644 --- a/Marlin/example_configurations/Felix/DUAL/Configuration.h +++ b/Marlin/example_configurations/Felix/DUAL/Configuration.h @@ -513,6 +513,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/FolgerTech/i3-2020/Configuration.h b/Marlin/example_configurations/FolgerTech/i3-2020/Configuration.h index 816b72a072..9be0e33546 100644 --- a/Marlin/example_configurations/FolgerTech/i3-2020/Configuration.h +++ b/Marlin/example_configurations/FolgerTech/i3-2020/Configuration.h @@ -537,6 +537,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/Geeetech/GT2560/Configuration.h b/Marlin/example_configurations/Geeetech/GT2560/Configuration.h index cee6cbcc1b..d0399e2456 100644 --- a/Marlin/example_configurations/Geeetech/GT2560/Configuration.h +++ b/Marlin/example_configurations/Geeetech/GT2560/Configuration.h @@ -547,6 +547,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/Geeetech/I3_Pro_X-GT2560/Configuration.h b/Marlin/example_configurations/Geeetech/I3_Pro_X-GT2560/Configuration.h index 5df6b7c089..53930797d3 100644 --- a/Marlin/example_configurations/Geeetech/I3_Pro_X-GT2560/Configuration.h +++ b/Marlin/example_configurations/Geeetech/I3_Pro_X-GT2560/Configuration.h @@ -532,6 +532,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h b/Marlin/example_configurations/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h index c5f9bf6f48..493df31189 100644 --- a/Marlin/example_configurations/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h +++ b/Marlin/example_configurations/Geeetech/Prusa i3 Pro B/bltouch/Configuration.h @@ -547,6 +547,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h b/Marlin/example_configurations/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h index 0e4549e33d..098a18568a 100644 --- a/Marlin/example_configurations/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h +++ b/Marlin/example_configurations/Geeetech/Prusa i3 Pro B/noprobe/Configuration.h @@ -547,6 +547,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/Geeetech/Prusa i3 Pro C/Configuration.h b/Marlin/example_configurations/Geeetech/Prusa i3 Pro C/Configuration.h index d92d4a4fc1..5ee85ad1af 100644 --- a/Marlin/example_configurations/Geeetech/Prusa i3 Pro C/Configuration.h +++ b/Marlin/example_configurations/Geeetech/Prusa i3 Pro C/Configuration.h @@ -532,6 +532,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/Geeetech/Prusa i3 Pro W/Configuration.h b/Marlin/example_configurations/Geeetech/Prusa i3 Pro W/Configuration.h index a900af3bd7..02daf4c4c6 100644 --- a/Marlin/example_configurations/Geeetech/Prusa i3 Pro W/Configuration.h +++ b/Marlin/example_configurations/Geeetech/Prusa i3 Pro W/Configuration.h @@ -532,6 +532,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/Infitary/i3-M508/Configuration.h b/Marlin/example_configurations/Infitary/i3-M508/Configuration.h index e6c4396b97..c1c0223dcf 100644 --- a/Marlin/example_configurations/Infitary/i3-M508/Configuration.h +++ b/Marlin/example_configurations/Infitary/i3-M508/Configuration.h @@ -536,6 +536,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/JGAurora/A5/Configuration.h b/Marlin/example_configurations/JGAurora/A5/Configuration.h index f071345f35..b4f67bf81c 100644 --- a/Marlin/example_configurations/JGAurora/A5/Configuration.h +++ b/Marlin/example_configurations/JGAurora/A5/Configuration.h @@ -544,6 +544,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/Malyan/M150/Configuration.h b/Marlin/example_configurations/Malyan/M150/Configuration.h index 2376cf9c8e..23258d79da 100644 --- a/Marlin/example_configurations/Malyan/M150/Configuration.h +++ b/Marlin/example_configurations/Malyan/M150/Configuration.h @@ -541,6 +541,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/Micromake/C1/basic/Configuration.h b/Marlin/example_configurations/Micromake/C1/basic/Configuration.h index 28d7e823aa..f1371be996 100644 --- a/Marlin/example_configurations/Micromake/C1/basic/Configuration.h +++ b/Marlin/example_configurations/Micromake/C1/basic/Configuration.h @@ -532,6 +532,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/Micromake/C1/enhanced/Configuration.h b/Marlin/example_configurations/Micromake/C1/enhanced/Configuration.h index 47ee178f64..90c40a9053 100644 --- a/Marlin/example_configurations/Micromake/C1/enhanced/Configuration.h +++ b/Marlin/example_configurations/Micromake/C1/enhanced/Configuration.h @@ -532,6 +532,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/RepRapPro/Huxley/Configuration.h b/Marlin/example_configurations/RepRapPro/Huxley/Configuration.h index e6877d0b1b..e4e293fe7d 100644 --- a/Marlin/example_configurations/RepRapPro/Huxley/Configuration.h +++ b/Marlin/example_configurations/RepRapPro/Huxley/Configuration.h @@ -532,6 +532,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h index c7b6e9e5d0..d44a1d513b 100644 --- a/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h +++ b/Marlin/example_configurations/RepRapWorld/Megatronics/Configuration.h @@ -532,6 +532,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/RigidBot/Configuration.h b/Marlin/example_configurations/RigidBot/Configuration.h index 97e9aff1f2..d99c3853c4 100644 --- a/Marlin/example_configurations/RigidBot/Configuration.h +++ b/Marlin/example_configurations/RigidBot/Configuration.h @@ -528,6 +528,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h index ef928d5e0d..b3de00bd03 100644 --- a/Marlin/example_configurations/SCARA/Configuration.h +++ b/Marlin/example_configurations/SCARA/Configuration.h @@ -545,6 +545,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/Sanguinololu/Configuration.h b/Marlin/example_configurations/Sanguinololu/Configuration.h index cd049b519d..66c76c5850 100644 --- a/Marlin/example_configurations/Sanguinololu/Configuration.h +++ b/Marlin/example_configurations/Sanguinololu/Configuration.h @@ -532,6 +532,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/TinyBoy2/Configuration.h b/Marlin/example_configurations/TinyBoy2/Configuration.h index 80c8224024..d0a62d99f4 100644 --- a/Marlin/example_configurations/TinyBoy2/Configuration.h +++ b/Marlin/example_configurations/TinyBoy2/Configuration.h @@ -583,6 +583,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. #define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/Tronxy/X1/Configuration.h b/Marlin/example_configurations/Tronxy/X1/Configuration.h index 727a3e2f14..adf35d4d94 100644 --- a/Marlin/example_configurations/Tronxy/X1/Configuration.h +++ b/Marlin/example_configurations/Tronxy/X1/Configuration.h @@ -532,6 +532,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/Tronxy/X5S/Configuration.h b/Marlin/example_configurations/Tronxy/X5S/Configuration.h index 967acbf777..ae9dd4c05f 100644 --- a/Marlin/example_configurations/Tronxy/X5S/Configuration.h +++ b/Marlin/example_configurations/Tronxy/X5S/Configuration.h @@ -532,6 +532,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/Tronxy/XY100/Configuration.h b/Marlin/example_configurations/Tronxy/XY100/Configuration.h index a709790530..8ee882ec1f 100644 --- a/Marlin/example_configurations/Tronxy/XY100/Configuration.h +++ b/Marlin/example_configurations/Tronxy/XY100/Configuration.h @@ -543,6 +543,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/Velleman/K8200/Configuration.h b/Marlin/example_configurations/Velleman/K8200/Configuration.h index 3a0d92b0ef..ec3e9763c6 100644 --- a/Marlin/example_configurations/Velleman/K8200/Configuration.h +++ b/Marlin/example_configurations/Velleman/K8200/Configuration.h @@ -562,6 +562,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/Velleman/K8400/Configuration.h b/Marlin/example_configurations/Velleman/K8400/Configuration.h index c6bedf5b59..1bc1cb09dc 100644 --- a/Marlin/example_configurations/Velleman/K8400/Configuration.h +++ b/Marlin/example_configurations/Velleman/K8400/Configuration.h @@ -532,6 +532,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/Velleman/K8400/Dual-head/Configuration.h b/Marlin/example_configurations/Velleman/K8400/Dual-head/Configuration.h index 4d27d1c95b..55a1d4a500 100644 --- a/Marlin/example_configurations/Velleman/K8400/Dual-head/Configuration.h +++ b/Marlin/example_configurations/Velleman/K8400/Dual-head/Configuration.h @@ -532,6 +532,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/Wanhao/Duplicator 6/Configuration.h b/Marlin/example_configurations/Wanhao/Duplicator 6/Configuration.h index d303b6a1ff..c34eb0c438 100644 --- a/Marlin/example_configurations/Wanhao/Duplicator 6/Configuration.h +++ b/Marlin/example_configurations/Wanhao/Duplicator 6/Configuration.h @@ -542,6 +542,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/adafruit/ST7565/Configuration.h b/Marlin/example_configurations/adafruit/ST7565/Configuration.h index c5f5d9accb..275f1349ac 100644 --- a/Marlin/example_configurations/adafruit/ST7565/Configuration.h +++ b/Marlin/example_configurations/adafruit/ST7565/Configuration.h @@ -532,6 +532,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h b/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h index bb07ef2684..cf81ea1b2d 100644 --- a/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h +++ b/Marlin/example_configurations/delta/FLSUN/auto_calibrate/Configuration.h @@ -605,6 +605,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/delta/FLSUN/kossel/Configuration.h b/Marlin/example_configurations/delta/FLSUN/kossel/Configuration.h index 4a56054fb5..1c3522c32b 100644 --- a/Marlin/example_configurations/delta/FLSUN/kossel/Configuration.h +++ b/Marlin/example_configurations/delta/FLSUN/kossel/Configuration.h @@ -605,6 +605,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h index 44f009277c..cc371b5c8f 100644 --- a/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/FLSUN/kossel_mini/Configuration.h @@ -605,6 +605,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/delta/Hatchbox_Alpha/Configuration.h b/Marlin/example_configurations/delta/Hatchbox_Alpha/Configuration.h index 0c99fb7e2e..7a8c0f3b0a 100644 --- a/Marlin/example_configurations/delta/Hatchbox_Alpha/Configuration.h +++ b/Marlin/example_configurations/delta/Hatchbox_Alpha/Configuration.h @@ -610,6 +610,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/delta/generic/Configuration.h b/Marlin/example_configurations/delta/generic/Configuration.h index 59e7c20405..3ecc23c8d9 100644 --- a/Marlin/example_configurations/delta/generic/Configuration.h +++ b/Marlin/example_configurations/delta/generic/Configuration.h @@ -595,6 +595,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/delta/kossel_mini/Configuration.h b/Marlin/example_configurations/delta/kossel_mini/Configuration.h index c776ab15b2..5fc9f83904 100644 --- a/Marlin/example_configurations/delta/kossel_mini/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_mini/Configuration.h @@ -595,6 +595,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/delta/kossel_pro/Configuration.h b/Marlin/example_configurations/delta/kossel_pro/Configuration.h index bb02926bdf..ef16a5fab2 100644 --- a/Marlin/example_configurations/delta/kossel_pro/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_pro/Configuration.h @@ -581,6 +581,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/delta/kossel_xl/Configuration.h b/Marlin/example_configurations/delta/kossel_xl/Configuration.h index 0ab445f901..2ca8b621cc 100644 --- a/Marlin/example_configurations/delta/kossel_xl/Configuration.h +++ b/Marlin/example_configurations/delta/kossel_xl/Configuration.h @@ -599,6 +599,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/gCreate/gMax1.5+/Configuration.h b/Marlin/example_configurations/gCreate/gMax1.5+/Configuration.h index 16daa74bd6..fdf8b200a1 100644 --- a/Marlin/example_configurations/gCreate/gMax1.5+/Configuration.h +++ b/Marlin/example_configurations/gCreate/gMax1.5+/Configuration.h @@ -545,6 +545,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. #define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h index 80c33873d7..46a5feb34a 100644 --- a/Marlin/example_configurations/makibox/Configuration.h +++ b/Marlin/example_configurations/makibox/Configuration.h @@ -535,6 +535,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h index bff076d74c..89be3802a1 100644 --- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h +++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h @@ -521,6 +521,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/example_configurations/wt150/Configuration.h b/Marlin/example_configurations/wt150/Configuration.h index e2b840d3cd..91b1bf8ad6 100644 --- a/Marlin/example_configurations/wt150/Configuration.h +++ b/Marlin/example_configurations/wt150/Configuration.h @@ -537,6 +537,23 @@ // This will remove the need to poll the interrupt pins, saving many CPU cycles. //#define ENDSTOP_INTERRUPTS_FEATURE +/** + * Endstop Noise Filter + * + * Enable this option if endstops falsely trigger due to noise. + * NOTE: Enabling this feature means adds an error of +/-0.2mm, so homing + * will end up at a slightly different position on each G28. This will also + * reduce accuracy of some bed probes. + * For mechanical switches, the better approach to reduce noise is to install + * a 100 nanofarads ceramic capacitor in parallel with the switch, making it + * essentially noise-proof without sacrificing accuracy. + * This option also increases MCU load when endstops or the probe are enabled. + * So this is not recommended. USE AT YOUR OWN RISK. + * (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 + //============================================================================= //============================== Movement Settings ============================ //============================================================================= diff --git a/Marlin/stepper.cpp b/Marlin/stepper.cpp index 071e6e89b2..89a50beae1 100644 --- a/Marlin/stepper.cpp +++ b/Marlin/stepper.cpp @@ -171,12 +171,12 @@ volatile int32_t Stepper::endstops_trigsteps[XYZ]; #define DUAL_ENDSTOP_APPLY_STEP(A,V) \ if (performing_homing) { \ if (A##_HOME_DIR < 0) { \ - if (!(TEST(endstops.current_endstop_bits, A##_MIN) && count_direction[_AXIS(A)] < 0) && !LOCKED_##A##_MOTOR) A##_STEP_WRITE(V); \ - if (!(TEST(endstops.current_endstop_bits, A##2_MIN) && count_direction[_AXIS(A)] < 0) && !LOCKED_##A##2_MOTOR) A##2_STEP_WRITE(V); \ + if (!(TEST(endstops.state(), A##_MIN) && count_direction[_AXIS(A)] < 0) && !LOCKED_##A##_MOTOR) A##_STEP_WRITE(V); \ + if (!(TEST(endstops.state(), A##2_MIN) && count_direction[_AXIS(A)] < 0) && !LOCKED_##A##2_MOTOR) A##2_STEP_WRITE(V); \ } \ else { \ - if (!(TEST(endstops.current_endstop_bits, A##_MAX) && count_direction[_AXIS(A)] > 0) && !LOCKED_##A##_MOTOR) A##_STEP_WRITE(V); \ - if (!(TEST(endstops.current_endstop_bits, A##2_MAX) && count_direction[_AXIS(A)] > 0) && !LOCKED_##A##2_MOTOR) A##2_STEP_WRITE(V); \ + if (!(TEST(endstops.state(), A##_MAX) && count_direction[_AXIS(A)] > 0) && !LOCKED_##A##_MOTOR) A##_STEP_WRITE(V); \ + if (!(TEST(endstops.state(), A##2_MAX) && count_direction[_AXIS(A)] > 0) && !LOCKED_##A##2_MOTOR) A##2_STEP_WRITE(V); \ } \ } \ else { \ diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp index f2bdfab9c6..814cdeea11 100644 --- a/Marlin/temperature.cpp +++ b/Marlin/temperature.cpp @@ -1695,71 +1695,71 @@ void Temperature::set_current_temp_raw() { * */ void endstop_monitor() { - static uint16_t old_endstop_bits_local = 0; + static uint16_t old_live_state_local = 0; static uint8_t local_LED_status = 0; - uint16_t current_endstop_bits_local = 0; + uint16_t live_state_local = 0; #if HAS_X_MIN - if (READ(X_MIN_PIN)) SBI(current_endstop_bits_local, X_MIN); + if (READ(X_MIN_PIN)) SBI(live_state_local, X_MIN); #endif #if HAS_X_MAX - if (READ(X_MAX_PIN)) SBI(current_endstop_bits_local, X_MAX); + if (READ(X_MAX_PIN)) SBI(live_state_local, X_MAX); #endif #if HAS_Y_MIN - if (READ(Y_MIN_PIN)) SBI(current_endstop_bits_local, Y_MIN); + if (READ(Y_MIN_PIN)) SBI(live_state_local, Y_MIN); #endif #if HAS_Y_MAX - if (READ(Y_MAX_PIN)) SBI(current_endstop_bits_local, Y_MAX); + if (READ(Y_MAX_PIN)) SBI(live_state_local, Y_MAX); #endif #if HAS_Z_MIN - if (READ(Z_MIN_PIN)) SBI(current_endstop_bits_local, Z_MIN); + if (READ(Z_MIN_PIN)) SBI(live_state_local, Z_MIN); #endif #if HAS_Z_MAX - if (READ(Z_MAX_PIN)) SBI(current_endstop_bits_local, Z_MAX); + if (READ(Z_MAX_PIN)) SBI(live_state_local, Z_MAX); #endif #if HAS_Z_MIN_PROBE_PIN - if (READ(Z_MIN_PROBE_PIN)) SBI(current_endstop_bits_local, Z_MIN_PROBE); + if (READ(Z_MIN_PROBE_PIN)) SBI(live_state_local, Z_MIN_PROBE); #endif #if HAS_Z2_MIN - if (READ(Z2_MIN_PIN)) SBI(current_endstop_bits_local, Z2_MIN); + if (READ(Z2_MIN_PIN)) SBI(live_state_local, Z2_MIN); #endif #if HAS_Z2_MAX - if (READ(Z2_MAX_PIN)) SBI(current_endstop_bits_local, Z2_MAX); + if (READ(Z2_MAX_PIN)) SBI(live_state_local, Z2_MAX); #endif - uint16_t endstop_change = current_endstop_bits_local ^ old_endstop_bits_local; + uint16_t endstop_change = live_state_local ^ old_live_state_local; if (endstop_change) { #if HAS_X_MIN - if (TEST(endstop_change, X_MIN)) SERIAL_PROTOCOLPAIR(" X_MIN:", !!TEST(current_endstop_bits_local, X_MIN)); + if (TEST(endstop_change, X_MIN)) SERIAL_PROTOCOLPAIR(" X_MIN:", !!TEST(live_state_local, X_MIN)); #endif #if HAS_X_MAX - if (TEST(endstop_change, X_MAX)) SERIAL_PROTOCOLPAIR(" X_MAX:", !!TEST(current_endstop_bits_local, X_MAX)); + if (TEST(endstop_change, X_MAX)) SERIAL_PROTOCOLPAIR(" X_MAX:", !!TEST(live_state_local, X_MAX)); #endif #if HAS_Y_MIN - if (TEST(endstop_change, Y_MIN)) SERIAL_PROTOCOLPAIR(" Y_MIN:", !!TEST(current_endstop_bits_local, Y_MIN)); + if (TEST(endstop_change, Y_MIN)) SERIAL_PROTOCOLPAIR(" Y_MIN:", !!TEST(live_state_local, Y_MIN)); #endif #if HAS_Y_MAX - if (TEST(endstop_change, Y_MAX)) SERIAL_PROTOCOLPAIR(" Y_MAX:", !!TEST(current_endstop_bits_local, Y_MAX)); + if (TEST(endstop_change, Y_MAX)) SERIAL_PROTOCOLPAIR(" Y_MAX:", !!TEST(live_state_local, Y_MAX)); #endif #if HAS_Z_MIN - if (TEST(endstop_change, Z_MIN)) SERIAL_PROTOCOLPAIR(" Z_MIN:", !!TEST(current_endstop_bits_local, Z_MIN)); + if (TEST(endstop_change, Z_MIN)) SERIAL_PROTOCOLPAIR(" Z_MIN:", !!TEST(live_state_local, Z_MIN)); #endif #if HAS_Z_MAX - if (TEST(endstop_change, Z_MAX)) SERIAL_PROTOCOLPAIR(" Z_MAX:", !!TEST(current_endstop_bits_local, Z_MAX)); + if (TEST(endstop_change, Z_MAX)) SERIAL_PROTOCOLPAIR(" Z_MAX:", !!TEST(live_state_local, Z_MAX)); #endif #if HAS_Z_MIN_PROBE_PIN - if (TEST(endstop_change, Z_MIN_PROBE)) SERIAL_PROTOCOLPAIR(" PROBE:", !!TEST(current_endstop_bits_local, Z_MIN_PROBE)); + if (TEST(endstop_change, Z_MIN_PROBE)) SERIAL_PROTOCOLPAIR(" PROBE:", !!TEST(live_state_local, Z_MIN_PROBE)); #endif #if HAS_Z2_MIN - if (TEST(endstop_change, Z2_MIN)) SERIAL_PROTOCOLPAIR(" Z2_MIN:", !!TEST(current_endstop_bits_local, Z2_MIN)); + if (TEST(endstop_change, Z2_MIN)) SERIAL_PROTOCOLPAIR(" Z2_MIN:", !!TEST(live_state_local, Z2_MIN)); #endif #if HAS_Z2_MAX - if (TEST(endstop_change, Z2_MAX)) SERIAL_PROTOCOLPAIR(" Z2_MAX:", !!TEST(current_endstop_bits_local, Z2_MAX)); + if (TEST(endstop_change, Z2_MAX)) SERIAL_PROTOCOLPAIR(" Z2_MAX:", !!TEST(live_state_local, Z2_MAX)); #endif SERIAL_PROTOCOLPGM("\n\n"); analogWrite(LED_PIN, local_LED_status); local_LED_status ^= 255; - old_endstop_bits_local = current_endstop_bits_local; + old_live_state_local = live_state_local; } } #endif // PINS_DEBUGGING