[2.0.x] Add endstop noise filter (#10796)

2.0.x
Scott Lahteine 7 years ago committed by GitHub
parent 65a004564c
commit 4b2f6e3b2b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -554,6 +554,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 ============================
//=============================================================================

@ -554,6 +554,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 ============================
//=============================================================================

@ -573,6 +573,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 ============================
//=============================================================================

@ -553,6 +553,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 ============================
//=============================================================================

@ -573,6 +573,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 ============================
//=============================================================================

@ -560,6 +560,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 ============================
//=============================================================================

@ -553,6 +553,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 ============================
//=============================================================================

@ -553,6 +553,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 ============================
//=============================================================================

@ -553,6 +553,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 ============================
//=============================================================================

@ -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 ============================
//=============================================================================

@ -554,6 +554,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 ============================
//=============================================================================

@ -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 ============================
//=============================================================================

@ -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 ============================
//=============================================================================

@ -563,6 +563,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 ============================
//=============================================================================

@ -553,6 +553,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 ============================
//=============================================================================

@ -572,6 +572,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 ============================
//=============================================================================

@ -563,6 +563,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 ============================
//=============================================================================

@ -557,6 +557,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 ============================
//=============================================================================

@ -557,6 +557,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 ============================
//=============================================================================

@ -563,6 +563,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 ============================
//=============================================================================

@ -534,6 +534,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 ============================
//=============================================================================

@ -534,6 +534,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 ============================
//=============================================================================

@ -558,6 +558,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 ============================
//=============================================================================

@ -568,6 +568,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 ============================
//=============================================================================

@ -553,6 +553,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 ============================
//=============================================================================

@ -568,6 +568,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 ============================
//=============================================================================

@ -568,6 +568,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 ============================
//=============================================================================

@ -553,6 +553,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 ============================
//=============================================================================

@ -553,6 +553,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 ============================
//=============================================================================

@ -557,6 +557,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 ============================
//=============================================================================

@ -565,6 +565,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 ============================
//=============================================================================

@ -573,6 +573,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 ============================
//=============================================================================

@ -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 ============================
//=============================================================================

@ -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 ============================
//=============================================================================

@ -553,6 +553,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 ============================
//=============================================================================

@ -553,6 +553,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 ============================
//=============================================================================

@ -553,6 +553,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 ============================
//=============================================================================

@ -553,6 +553,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 ============================
//=============================================================================

@ -553,6 +553,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 ============================
//=============================================================================

@ -549,6 +549,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 ============================
//=============================================================================

@ -566,6 +566,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 ============================
//=============================================================================

@ -555,6 +555,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 ============================
//=============================================================================

@ -553,6 +553,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 ============================
//=============================================================================

@ -553,6 +553,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 ============================
//=============================================================================

@ -553,6 +553,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 ============================
//=============================================================================

@ -604,6 +604,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 ============================
//=============================================================================

@ -553,6 +553,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 ============================
//=============================================================================

@ -553,6 +553,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 ============================
//=============================================================================

@ -564,6 +564,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 ============================
//=============================================================================

@ -553,6 +553,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 ============================
//=============================================================================

@ -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 ============================
//=============================================================================

@ -553,6 +553,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 ============================
//=============================================================================

@ -553,6 +553,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 ============================
//=============================================================================

@ -563,6 +563,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 ============================
//=============================================================================

@ -553,6 +553,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 ============================
//=============================================================================

@ -626,6 +626,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 ============================
//=============================================================================

@ -626,6 +626,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 ============================
//=============================================================================

@ -626,6 +626,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 ============================
//=============================================================================

@ -631,6 +631,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 ============================
//=============================================================================

@ -616,6 +616,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 ============================
//=============================================================================

@ -616,6 +616,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 ============================
//=============================================================================

@ -602,6 +602,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 ============================
//=============================================================================

@ -620,6 +620,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 ============================
//=============================================================================

@ -566,6 +566,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 ============================
//=============================================================================

@ -556,6 +556,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 ============================
//=============================================================================

@ -555,6 +555,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 ============================
//=============================================================================

@ -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 ============================
//=============================================================================

@ -558,6 +558,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 ============================
//=============================================================================

@ -267,7 +267,7 @@ bool home_delta() {
// 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);

@ -36,9 +36,6 @@
#include HAL_PATH(../HAL, endstop_interrupts.h)
#endif
// TEST_ENDSTOP: test the current status of an endstop
#define TEST_ENDSTOP(ENDSTOP) (TEST(current_endstop_bits, ENDSTOP))
#if HAS_BED_PROBE
#define ENDSTOPS_ENABLED (endstops.enabled || endstops.z_probe_enabled)
#else
@ -50,9 +47,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;
@ -230,7 +232,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
}
@ -264,7 +266,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
@ -293,7 +295,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)
@ -306,7 +308,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')
@ -321,7 +323,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();
@ -397,69 +399,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
// 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))
// Check endstops - Could be called from ISR!
void Endstops::update() {
#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
@ -553,11 +509,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
}
@ -568,11 +523,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
}
@ -586,11 +540,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
}
@ -601,11 +554,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
}
@ -619,14 +571,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
@ -634,8 +585,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
}
@ -647,13 +597,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
}
@ -676,96 +762,96 @@ void Endstops::update() {
*/
void Endstops::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_X2_MIN
if (READ(X2_MIN_PIN)) SBI(current_endstop_bits_local, X2_MIN);
if (READ(X2_MIN_PIN)) SBI(live_state_local, X2_MIN);
#endif
#if HAS_X2_MAX
if (READ(X2_MAX_PIN)) SBI(current_endstop_bits_local, X2_MAX);
if (READ(X2_MAX_PIN)) SBI(live_state_local, X2_MAX);
#endif
#if HAS_Y2_MIN
if (READ(Y2_MIN_PIN)) SBI(current_endstop_bits_local, Y2_MIN);
if (READ(Y2_MIN_PIN)) SBI(live_state_local, Y2_MIN);
#endif
#if HAS_Y2_MAX
if (READ(Y2_MAX_PIN)) SBI(current_endstop_bits_local, Y2_MAX);
if (READ(Y2_MAX_PIN)) SBI(live_state_local, Y2_MAX);
#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_X2_MIN
if (TEST(endstop_change, X2_MIN)) SERIAL_PROTOCOLPAIR(" X2_MIN:", TEST(current_endstop_bits_local, X2_MIN));
if (TEST(endstop_change, X2_MIN)) SERIAL_PROTOCOLPAIR(" X2_MIN:", TEST(live_state_local, X2_MIN));
#endif
#if HAS_X2_MAX
if (TEST(endstop_change, X2_MAX)) SERIAL_PROTOCOLPAIR(" X2_MAX:", TEST(current_endstop_bits_local, X2_MAX));
if (TEST(endstop_change, X2_MAX)) SERIAL_PROTOCOLPAIR(" X2_MAX:", TEST(live_state_local, X2_MAX));
#endif
#if HAS_Y2_MIN
if (TEST(endstop_change, Y2_MIN)) SERIAL_PROTOCOLPAIR(" Y2_MIN:", TEST(current_endstop_bits_local, Y2_MIN));
if (TEST(endstop_change, Y2_MIN)) SERIAL_PROTOCOLPAIR(" Y2_MIN:", TEST(live_state_local, Y2_MIN));
#endif
#if HAS_Y2_MAX
if (TEST(endstop_change, Y2_MAX)) SERIAL_PROTOCOLPAIR(" Y2_MAX:", TEST(current_endstop_bits_local, Y2_MAX));
if (TEST(endstop_change, Y2_MAX)) SERIAL_PROTOCOLPAIR(" Y2_MAX:", TEST(live_state_local, Y2_MAX));
#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;
}
}

@ -51,7 +51,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;
@ -65,11 +64,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() {};
/**
@ -93,6 +100,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.
*/
@ -127,18 +144,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;

@ -515,7 +515,7 @@ static bool do_probe_move(const float z, const float fr_mm_s) {
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

@ -184,12 +184,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 { \

Loading…
Cancel
Save