diff --git a/config.default.h b/config.default.h index 69458b4..0fd13ad 100644 --- a/config.default.h +++ b/config.default.h @@ -426,6 +426,12 @@ PWM value for 'off' /// this is the scaling of internally stored PID values. 1024L is a good value #define PID_SCALE 1024L +/** \def ENDSTOP_STEPS + number of steps to run into the endstops intentionally + As Endstops trigger false alarm sometimes, Teacup debounces them by counting a number of consecutive positives. Valid range is 1...255. Use 4 or less for reliable endstops, 8 or even more for flaky ones. +*/ +#define ENDSTOP_STEPS 4 + /***************************************************************************\ diff --git a/config.gen3.h b/config.gen3.h index 93c6cf7..6f77cb1 100644 --- a/config.gen3.h +++ b/config.gen3.h @@ -437,6 +437,12 @@ DEFINE_TEMP_SENSOR(bed, TT_INTERCOM, 1, 0) /// this is the scaling of internally stored PID values. 1024L is a good value #define PID_SCALE 1024L +/** \def ENDSTOP_STEPS + number of steps to run into the endstops intentionally + As Endstops trigger false alarm sometimes, Teacup debounces them by counting a number of consecutive positives. Valid range is 1...255. Use 4 or less for reliable endstops, 8 or even more for flaky ones. +*/ +#define ENDSTOP_STEPS 4 + /***************************************************************************\ diff --git a/config.gen6.h b/config.gen6.h index 57c6062..d3a46ba 100644 --- a/config.gen6.h +++ b/config.gen6.h @@ -419,6 +419,12 @@ PWM value for 'off' // this is the scaling of internally stored PID values. 1024L is a good value #define PID_SCALE 1024L +/** \def ENDSTOP_STEPS + number of steps to run into the endstops intentionally + As Endstops trigger false alarm sometimes, Teacup debounces them by counting a number of consecutive positives. Valid range is 1...255. Use 4 or less for reliable endstops, 8 or even more for flaky ones. +*/ +#define ENDSTOP_STEPS 4 + /***************************************************************************\ diff --git a/config.gen7.h b/config.gen7.h index 83998f5..28a8b0f 100644 --- a/config.gen7.h +++ b/config.gen7.h @@ -432,6 +432,12 @@ PWM value for 'off' /// this is the scaling of internally stored PID values. 1024L is a good value #define PID_SCALE 1024L +/** \def ENDSTOP_STEPS + number of steps to run into the endstops intentionally + As Endstops trigger false alarm sometimes, Teacup debounces them by counting a number of consecutive positives. Valid range is 1...255. Use 4 or less for reliable endstops, 8 or even more for flaky ones. +*/ +#define ENDSTOP_STEPS 4 + /***************************************************************************\ diff --git a/config.ramps-v1.2.h b/config.ramps-v1.2.h index 99473db..9f29d60 100644 --- a/config.ramps-v1.2.h +++ b/config.ramps-v1.2.h @@ -430,6 +430,12 @@ PWM value for 'off' /// this is the scaling of internally stored PID values. 1024L is a good value #define PID_SCALE 1024L +/** \def ENDSTOP_STEPS + number of steps to run into the endstops intentionally + As Endstops trigger false alarm sometimes, Teacup debounces them by counting a number of consecutive positives. Valid range is 1...255. Use 4 or less for reliable endstops, 8 or even more for flaky ones. +*/ +#define ENDSTOP_STEPS 4 + /***************************************************************************\ diff --git a/config.ramps-v1.3.h b/config.ramps-v1.3.h index 9b073c3..75b898c 100644 --- a/config.ramps-v1.3.h +++ b/config.ramps-v1.3.h @@ -435,6 +435,12 @@ PWM value for 'off' /// this is the scaling of internally stored PID values. 1024L is a good value #define PID_SCALE 1024L +/** \def ENDSTOP_STEPS + number of steps to run into the endstops intentionally + As Endstops trigger false alarm sometimes, Teacup debounces them by counting a number of consecutive positives. Valid range is 1...255. Use 4 or less for reliable endstops, 8 or even more for flaky ones. +*/ +#define ENDSTOP_STEPS 4 + /***************************************************************************\ diff --git a/config.sanguinololu-v1.1.h b/config.sanguinololu-v1.1.h index f2b96b5..e484f0b 100644 --- a/config.sanguinololu-v1.1.h +++ b/config.sanguinololu-v1.1.h @@ -433,6 +433,12 @@ PWM value for 'off' /// this is the scaling of internally stored PID values. 1024L is a good value #define PID_SCALE 1024L +/** \def ENDSTOP_STEPS + number of steps to run into the endstops intentionally + As Endstops trigger false alarm sometimes, Teacup debounces them by counting a number of consecutive positives. Valid range is 1...255. Use 4 or less for reliable endstops, 8 or even more for flaky ones. +*/ +#define ENDSTOP_STEPS 4 + /***************************************************************************\ diff --git a/config.sanguinololu-v1.2.h b/config.sanguinololu-v1.2.h index 2df2d78..4c81a61 100644 --- a/config.sanguinololu-v1.2.h +++ b/config.sanguinololu-v1.2.h @@ -433,6 +433,12 @@ PWM value for 'off' /// this is the scaling of internally stored PID values. 1024L is a good value #define PID_SCALE 1024L +/** \def ENDSTOP_STEPS + number of steps to run into the endstops intentionally + As Endstops trigger false alarm sometimes, Teacup debounces them by counting a number of consecutive positives. Valid range is 1...255. Use 4 or less for reliable endstops, 8 or even more for flaky ones. +*/ +#define ENDSTOP_STEPS 4 + /***************************************************************************\ diff --git a/dda.c b/dda.c index 7977a3f..827521b 100644 --- a/dda.c +++ b/dda.c @@ -470,7 +470,8 @@ void dda_step(DDA *dda) { move_state.debounce_count_xmax = 0; #endif - endstop_stop = move_state.debounce_count_xmin >= 8 || move_state.debounce_count_xmax >= 8; + endstop_stop = move_state.debounce_count_xmin >= ENDSTOP_STEPS || + move_state.debounce_count_xmax >= ENDSTOP_STEPS; if (!endstop_stop) endstop_not_done |= 0x1; } else @@ -503,7 +504,8 @@ void dda_step(DDA *dda) { move_state.debounce_count_ymax = 0; #endif - endstop_stop = move_state.debounce_count_ymin >= 8 || move_state.debounce_count_ymax >= 8; + endstop_stop = move_state.debounce_count_ymin >= ENDSTOP_STEPS || + move_state.debounce_count_ymax >= ENDSTOP_STEPS; if (!endstop_stop) endstop_not_done |= 0x2; } else @@ -536,7 +538,8 @@ void dda_step(DDA *dda) { move_state.debounce_count_zmax = 0; #endif - endstop_stop = move_state.debounce_count_zmin >= 8 || move_state.debounce_count_zmax >= 8; + endstop_stop = move_state.debounce_count_zmin >= ENDSTOP_STEPS || + move_state.debounce_count_zmax >= ENDSTOP_STEPS; if (!endstop_stop) endstop_not_done |= 0x4; } else