home.c: introduce SLOW_HOMING

This commit is contained in:
Markus Hitter 2011-10-06 01:06:32 +02:00
parent df693c0113
commit 129bdc64bc
9 changed files with 126 additions and 36 deletions

View File

@ -80,6 +80,12 @@
#define SEARCH_FEEDRATE_Z 50 #define SEARCH_FEEDRATE_Z 50
// no SEARCH_FEEDRATE_E, as E can't be searched // no SEARCH_FEEDRATE_E, as E can't be searched
/** \def SLOW_HOMING
wether to search the home point slowly
With some endstop configurations, like when probing for the surface of a PCB, you can't deal with overrunning the endstop. In such a case, uncomment this definition.
*/
// #define SLOW_HOMING
/// this is how many steps to suck back the filament by when we stop. set to zero to disable /// this is how many steps to suck back the filament by when we stop. set to zero to disable
#define E_STARTSTOP_STEPS 20 #define E_STARTSTOP_STEPS 20

View File

@ -81,6 +81,12 @@
#define SEARCH_FEEDRATE_Z 50 #define SEARCH_FEEDRATE_Z 50
// no SEARCH_FEEDRATE_E, as E can't be searched // no SEARCH_FEEDRATE_E, as E can't be searched
/** \def SLOW_HOMING
wether to search the home point slowly
With some endstop configurations, like when probing for the surface of a PCB, you can't deal with overrunning the endstop. In such a case, uncomment this definition.
*/
// #define SLOW_HOMING
/// this is how many steps to suck back the filament by when we stop. set to zero to disable /// this is how many steps to suck back the filament by when we stop. set to zero to disable
#define E_STARTSTOP_STEPS 20 #define E_STARTSTOP_STEPS 20

View File

@ -81,6 +81,12 @@
#define SEARCH_FEEDRATE_Z 50 #define SEARCH_FEEDRATE_Z 50
// no SEARCH_FEEDRATE_E, as E can't be searched // no SEARCH_FEEDRATE_E, as E can't be searched
/** \def SLOW_HOMING
wether to search the home point slowly
With some endstop configurations, like when probing for the surface of a PCB, you can't deal with overrunning the endstop. In such a case, uncomment this definition.
*/
// #define SLOW_HOMING
/// this is how many steps to suck back the filament by when we stop. set to zero to disable /// this is how many steps to suck back the filament by when we stop. set to zero to disable
#define E_STARTSTOP_STEPS 20 #define E_STARTSTOP_STEPS 20

View File

@ -85,6 +85,12 @@
#define SEARCH_FEEDRATE_Z 50 #define SEARCH_FEEDRATE_Z 50
// no SEARCH_FEEDRATE_E, as E can't be searched // no SEARCH_FEEDRATE_E, as E can't be searched
/** \def SLOW_HOMING
wether to search the home point slowly
With some endstop configurations, like when probing for the surface of a PCB, you can't deal with overrunning the endstop. In such a case, uncomment this definition.
*/
// #define SLOW_HOMING
/// this is how many steps to suck back the filament by when we stop. set to zero to disable /// this is how many steps to suck back the filament by when we stop. set to zero to disable
#define E_STARTSTOP_STEPS 289 #define E_STARTSTOP_STEPS 289

View File

@ -86,6 +86,12 @@
#define SEARCH_FEEDRATE_Z 1 #define SEARCH_FEEDRATE_Z 1
// no SEARCH_FEEDRATE_E, as E can't be searched // no SEARCH_FEEDRATE_E, as E can't be searched
/** \def SLOW_HOMING
wether to search the home point slowly
With some endstop configurations, like when probing for the surface of a PCB, you can't deal with overrunning the endstop. In such a case, uncomment this definition.
*/
// #define SLOW_HOMING
/// this is how many steps to suck back the filament by when we stop. set to zero to disable /// this is how many steps to suck back the filament by when we stop. set to zero to disable
#define E_STARTSTOP_STEPS 0 #define E_STARTSTOP_STEPS 0

View File

@ -86,6 +86,12 @@
#define SEARCH_FEEDRATE_Z 1 #define SEARCH_FEEDRATE_Z 1
// no SEARCH_FEEDRATE_E, as E can't be searched // no SEARCH_FEEDRATE_E, as E can't be searched
/** \def SLOW_HOMING
wether to search the home point slowly
With some endstop configurations, like when probing for the surface of a PCB, you can't deal with overrunning the endstop. In such a case, uncomment this definition.
*/
// #define SLOW_HOMING
/// this is how many steps to suck back the filament by when we stop. set to zero to disable /// this is how many steps to suck back the filament by when we stop. set to zero to disable
#define E_STARTSTOP_STEPS 0 #define E_STARTSTOP_STEPS 0

View File

@ -84,6 +84,12 @@
#define SEARCH_FEEDRATE_Z 50 #define SEARCH_FEEDRATE_Z 50
// no SEARCH_FEEDRATE_E, as E can't be searched // no SEARCH_FEEDRATE_E, as E can't be searched
/** \def SLOW_HOMING
wether to search the home point slowly
With some endstop configurations, like when probing for the surface of a PCB, you can't deal with overrunning the endstop. In such a case, uncomment this definition.
*/
// #define SLOW_HOMING
/// this is how many steps to suck back the filament by when we stop. set to zero to disable /// this is how many steps to suck back the filament by when we stop. set to zero to disable
#define E_STARTSTOP_STEPS 20 #define E_STARTSTOP_STEPS 20

View File

@ -84,6 +84,12 @@
#define SEARCH_FEEDRATE_Z 50 #define SEARCH_FEEDRATE_Z 50
// no SEARCH_FEEDRATE_E, as E can't be searched // no SEARCH_FEEDRATE_E, as E can't be searched
/** \def SLOW_HOMING
wether to search the home point slowly
With some endstop configurations, like when probing for the surface of a PCB, you can't deal with overrunning the endstop. In such a case, uncomment this definition.
*/
// #define SLOW_HOMING
/// this is how many steps to suck back the filament by when we stop. set to zero to disable /// this is how many steps to suck back the filament by when we stop. set to zero to disable
#define E_STARTSTOP_STEPS 20 #define E_STARTSTOP_STEPS 20

114
home.c
View File

@ -35,15 +35,22 @@ void home_x_negative() {
#if defined X_MIN_PIN #if defined X_MIN_PIN
TARGET t = {0, current_position.Y, current_position.Z}; TARGET t = {0, current_position.Y, current_position.Z};
// hit home hard
t.X = -1000*STEPS_PER_MM_X; t.X = -1000*STEPS_PER_MM_X;
t.F = MAXIMUM_FEEDRATE_X; #ifdef SLOW_HOMING
// hit home soft
t.F = SEARCH_FEEDRATE_X;
#else
// hit home hard
t.F = MAXIMUM_FEEDRATE_X;
#endif
enqueue_home(&t, 0x1, 1); enqueue_home(&t, 0x1, 1);
// back off slowly #ifndef SLOW_HOMING
t.X = +1000*STEPS_PER_MM_X; // back off slowly
t.F = SEARCH_FEEDRATE_X; t.X = +1000*STEPS_PER_MM_X;
enqueue_home(&t, 0x1, 0); t.F = SEARCH_FEEDRATE_X;
enqueue_home(&t, 0x1, 0);
#endif
// set X home // set X home
#ifdef X_MIN #ifdef X_MIN
@ -59,15 +66,22 @@ void home_x_positive() {
#if defined X_MAX_PIN #if defined X_MAX_PIN
TARGET t = {0, current_position.Y, current_position.Z}; TARGET t = {0, current_position.Y, current_position.Z};
// hit home hard
t.X = +1000*STEPS_PER_MM_X; t.X = +1000*STEPS_PER_MM_X;
t.F = MAXIMUM_FEEDRATE_X; #ifdef SLOW_HOMING
// hit home soft
t.F = SEARCH_FEEDRATE_X;
#else
// hit home hard
t.F = MAXIMUM_FEEDRATE_X;
#endif
enqueue_home(t, 0x1, 1); enqueue_home(t, 0x1, 1);
// back off slowly #ifndef SLOW_HOMING
t.X = -1000*STEPS_PER_MM_X; // back off slowly
t.F = SEARCH_FEEDRATE_X; t.X = -1000*STEPS_PER_MM_X;
enqueue_home(t, 0x1, 0); t.F = SEARCH_FEEDRATE_X;
enqueue_home(t, 0x1, 0);
#endif
// set X home // set X home
// set position to MAX // set position to MAX
@ -84,15 +98,22 @@ void home_y_negative() {
#if defined Y_MIN_PIN #if defined Y_MIN_PIN
TARGET t = {0, current_position.Y, current_position.Z}; TARGET t = {0, current_position.Y, current_position.Z};
// hit home hard
t.Y = -1000*STEPS_PER_MM_Y; t.Y = -1000*STEPS_PER_MM_Y;
t.F = MAXIMUM_FEEDRATE_Y; #ifdef SLOW_HOMING
// hit home soft
t.F = SEARCH_FEEDRATE_Y;
#else
// hit home hard
t.F = MAXIMUM_FEEDRATE_Y;
#endif
enqueue_home(&t, 0x2, 1); enqueue_home(&t, 0x2, 1);
// back off slowly #ifndef SLOW_HOMING
t.Y = +1000*STEPS_PER_MM_Y; // back off slowly
t.F = SEARCH_FEEDRATE_Y; t.Y = +1000*STEPS_PER_MM_Y;
enqueue_home(&t, 0x2, 0); t.F = SEARCH_FEEDRATE_Y;
enqueue_home(&t, 0x2, 0);
#endif
// set Y home // set Y home
#ifdef Y_MIN #ifdef Y_MIN
@ -108,15 +129,22 @@ void home_y_positive() {
#if defined Y_MAX_PIN #if defined Y_MAX_PIN
TARGET t = {0, current_position.Y, current_position.Z}; TARGET t = {0, current_position.Y, current_position.Z};
// hit home hard
t.Y = +1000*STEPS_PER_MM_Y; t.Y = +1000*STEPS_PER_MM_Y;
t.F = MAXIMUM_FEEDRATE_Y; #ifdef SLOW_HOMING
// hit home soft
t.F = SEARCH_FEEDRATE_Y;
#else
// hit home hard
t.F = MAXIMUM_FEEDRATE_Y;
#endif
enqueue_home(&t, 0x2, 1); enqueue_home(&t, 0x2, 1);
// back off slowly #ifndef SLOW_HOMING
t.X = -1000*STEPS_PER_MM_Y; // back off slowly
t.F = SEARCH_FEEDRATE_Y; t.X = -1000*STEPS_PER_MM_Y;
enqueue_home(&t, 0x2, 0); t.F = SEARCH_FEEDRATE_Y;
enqueue_home(&t, 0x2, 0);
#endif
// set Y home // set Y home
// set position to MAX // set position to MAX
@ -133,15 +161,22 @@ void home_z_negative() {
#if defined Z_MIN_PIN #if defined Z_MIN_PIN
TARGET t = {current_position.X, current_position.Y, 0}; TARGET t = {current_position.X, current_position.Y, 0};
// hit home hard
t.Z = -1000*STEPS_PER_MM_Z; t.Z = -1000*STEPS_PER_MM_Z;
t.F = MAXIMUM_FEEDRATE_Z; #ifdef SLOW_HOMING
// hit home soft
t.F = SEARCH_FEEDRATE_Z;
#else
// hit home hard
t.F = MAXIMUM_FEEDRATE_Z;
#endif
enqueue_home(&t, 0x4, 1); enqueue_home(&t, 0x4, 1);
// back off slowly #ifndef SLOW_HOMING
t.Z = +1000*STEPS_PER_MM_Z; // back off slowly
t.F = SEARCH_FEEDRATE_Z; t.Z = +1000*STEPS_PER_MM_Z;
enqueue_home(&t, 0x4, 0); t.F = SEARCH_FEEDRATE_Z;
enqueue_home(&t, 0x4, 0);
#endif
// set Z home // set Z home
#ifdef Z_MIN #ifdef Z_MIN
@ -158,15 +193,22 @@ void home_z_positive() {
#if defined Z_MAX_PIN #if defined Z_MAX_PIN
TARGET t = {current_position.X, current_position.Y, 0}; TARGET t = {current_position.X, current_position.Y, 0};
// hit home hard
t.Z = +1000*STEPS_PER_MM_Z; t.Z = +1000*STEPS_PER_MM_Z;
t.F = MAXIMUM_FEEDRATE_Z; #ifdef SLOW_HOMING
// hit home soft
t.F = SEARCH_FEEDRATE_Z;
#else
// hit home hard
t.F = MAXIMUM_FEEDRATE_Z;
#endif
enqueue_home(&t, 0x4, 1); enqueue_home(&t, 0x4, 1);
// back off slowly #ifndef SLOW_HOMING
t.Z = -1000*STEPS_PER_MM_Z; // back off slowly
t.F = SEARCH_FEEDRATE_Z; t.Z = -1000*STEPS_PER_MM_Z;
enqueue_home(&t, 0x4, 0); t.F = SEARCH_FEEDRATE_Z;
enqueue_home(&t, 0x4, 0);
#endif
// set Z home // set Z home
// set position to MAX // set position to MAX