config.h/dda.c: make endstop debouncing steps configurable.

This commit is contained in:
Markus Hitter 2011-10-06 00:38:05 +02:00
parent b7cd9859c4
commit df693c0113
9 changed files with 54 additions and 3 deletions

View File

@ -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
/***************************************************************************\

View File

@ -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
/***************************************************************************\

View File

@ -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
/***************************************************************************\

View File

@ -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
/***************************************************************************\

View File

@ -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
/***************************************************************************\

View File

@ -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
/***************************************************************************\

View File

@ -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
/***************************************************************************\

View File

@ -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
/***************************************************************************\

9
dda.c
View File

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