config.h/dda.c: make endstop debouncing steps configurable.
This commit is contained in:
parent
b7cd9859c4
commit
df693c0113
|
|
@ -426,6 +426,12 @@ PWM value for 'off'
|
||||||
/// this is the scaling of internally stored PID values. 1024L is a good value
|
/// this is the scaling of internally stored PID values. 1024L is a good value
|
||||||
#define PID_SCALE 1024L
|
#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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************\
|
/***************************************************************************\
|
||||||
|
|
|
||||||
|
|
@ -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
|
/// this is the scaling of internally stored PID values. 1024L is a good value
|
||||||
#define PID_SCALE 1024L
|
#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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************\
|
/***************************************************************************\
|
||||||
|
|
|
||||||
|
|
@ -419,6 +419,12 @@ PWM value for 'off'
|
||||||
// this is the scaling of internally stored PID values. 1024L is a good value
|
// this is the scaling of internally stored PID values. 1024L is a good value
|
||||||
#define PID_SCALE 1024L
|
#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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************\
|
/***************************************************************************\
|
||||||
|
|
|
||||||
|
|
@ -432,6 +432,12 @@ PWM value for 'off'
|
||||||
/// this is the scaling of internally stored PID values. 1024L is a good value
|
/// this is the scaling of internally stored PID values. 1024L is a good value
|
||||||
#define PID_SCALE 1024L
|
#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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************\
|
/***************************************************************************\
|
||||||
|
|
|
||||||
|
|
@ -430,6 +430,12 @@ PWM value for 'off'
|
||||||
/// this is the scaling of internally stored PID values. 1024L is a good value
|
/// this is the scaling of internally stored PID values. 1024L is a good value
|
||||||
#define PID_SCALE 1024L
|
#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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************\
|
/***************************************************************************\
|
||||||
|
|
|
||||||
|
|
@ -435,6 +435,12 @@ PWM value for 'off'
|
||||||
/// this is the scaling of internally stored PID values. 1024L is a good value
|
/// this is the scaling of internally stored PID values. 1024L is a good value
|
||||||
#define PID_SCALE 1024L
|
#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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************\
|
/***************************************************************************\
|
||||||
|
|
|
||||||
|
|
@ -433,6 +433,12 @@ PWM value for 'off'
|
||||||
/// this is the scaling of internally stored PID values. 1024L is a good value
|
/// this is the scaling of internally stored PID values. 1024L is a good value
|
||||||
#define PID_SCALE 1024L
|
#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
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
/***************************************************************************\
|
/***************************************************************************\
|
||||||
|
|
|
||||||
|
|
@ -433,6 +433,12 @@ PWM value for 'off'
|
||||||
/// this is the scaling of internally stored PID values. 1024L is a good value
|
/// this is the scaling of internally stored PID values. 1024L is a good value
|
||||||
#define PID_SCALE 1024L
|
#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
9
dda.c
|
|
@ -470,7 +470,8 @@ void dda_step(DDA *dda) {
|
||||||
move_state.debounce_count_xmax = 0;
|
move_state.debounce_count_xmax = 0;
|
||||||
#endif
|
#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)
|
if (!endstop_stop)
|
||||||
endstop_not_done |= 0x1;
|
endstop_not_done |= 0x1;
|
||||||
} else
|
} else
|
||||||
|
|
@ -503,7 +504,8 @@ void dda_step(DDA *dda) {
|
||||||
move_state.debounce_count_ymax = 0;
|
move_state.debounce_count_ymax = 0;
|
||||||
#endif
|
#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)
|
if (!endstop_stop)
|
||||||
endstop_not_done |= 0x2;
|
endstop_not_done |= 0x2;
|
||||||
} else
|
} else
|
||||||
|
|
@ -536,7 +538,8 @@ void dda_step(DDA *dda) {
|
||||||
move_state.debounce_count_zmax = 0;
|
move_state.debounce_count_zmax = 0;
|
||||||
#endif
|
#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)
|
if (!endstop_stop)
|
||||||
endstop_not_done |= 0x4;
|
endstop_not_done |= 0x4;
|
||||||
} else
|
} else
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue