diff --git a/config.default.h b/config.default.h index 0fd13ad..421c24e 100644 --- a/config.default.h +++ b/config.default.h @@ -80,6 +80,12 @@ #define SEARCH_FEEDRATE_Z 50 // 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 #define E_STARTSTOP_STEPS 20 diff --git a/config.gen3.h b/config.gen3.h index 6f77cb1..4ea1230 100644 --- a/config.gen3.h +++ b/config.gen3.h @@ -81,6 +81,12 @@ #define SEARCH_FEEDRATE_Z 50 // 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 #define E_STARTSTOP_STEPS 20 diff --git a/config.gen6.h b/config.gen6.h index d3a46ba..5010312 100644 --- a/config.gen6.h +++ b/config.gen6.h @@ -81,6 +81,12 @@ #define SEARCH_FEEDRATE_Z 50 // 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 #define E_STARTSTOP_STEPS 20 diff --git a/config.gen7.h b/config.gen7.h index 28a8b0f..eadf3a0 100644 --- a/config.gen7.h +++ b/config.gen7.h @@ -85,6 +85,12 @@ #define SEARCH_FEEDRATE_Z 50 // 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 #define E_STARTSTOP_STEPS 289 diff --git a/config.ramps-v1.2.h b/config.ramps-v1.2.h index 9f29d60..b5de929 100644 --- a/config.ramps-v1.2.h +++ b/config.ramps-v1.2.h @@ -86,6 +86,12 @@ #define SEARCH_FEEDRATE_Z 1 // 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 #define E_STARTSTOP_STEPS 0 diff --git a/config.ramps-v1.3.h b/config.ramps-v1.3.h index 75b898c..64266c1 100644 --- a/config.ramps-v1.3.h +++ b/config.ramps-v1.3.h @@ -86,6 +86,12 @@ #define SEARCH_FEEDRATE_Z 1 // 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 #define E_STARTSTOP_STEPS 0 diff --git a/config.sanguinololu-v1.1.h b/config.sanguinololu-v1.1.h index e484f0b..0381190 100644 --- a/config.sanguinololu-v1.1.h +++ b/config.sanguinololu-v1.1.h @@ -84,6 +84,12 @@ #define SEARCH_FEEDRATE_Z 50 // 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 #define E_STARTSTOP_STEPS 20 diff --git a/config.sanguinololu-v1.2.h b/config.sanguinololu-v1.2.h index 4c81a61..d3e0319 100644 --- a/config.sanguinololu-v1.2.h +++ b/config.sanguinololu-v1.2.h @@ -84,6 +84,12 @@ #define SEARCH_FEEDRATE_Z 50 // 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 #define E_STARTSTOP_STEPS 20 diff --git a/home.c b/home.c index 82a1914..1c15528 100644 --- a/home.c +++ b/home.c @@ -35,15 +35,22 @@ void home_x_negative() { #if defined X_MIN_PIN TARGET t = {0, current_position.Y, current_position.Z}; - // hit home hard 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); - // back off slowly - t.X = +1000*STEPS_PER_MM_X; - t.F = SEARCH_FEEDRATE_X; - enqueue_home(&t, 0x1, 0); + #ifndef SLOW_HOMING + // back off slowly + t.X = +1000*STEPS_PER_MM_X; + t.F = SEARCH_FEEDRATE_X; + enqueue_home(&t, 0x1, 0); + #endif // set X home #ifdef X_MIN @@ -59,15 +66,22 @@ void home_x_positive() { #if defined X_MAX_PIN TARGET t = {0, current_position.Y, current_position.Z}; - // hit home hard 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); - // back off slowly - t.X = -1000*STEPS_PER_MM_X; - t.F = SEARCH_FEEDRATE_X; - enqueue_home(t, 0x1, 0); + #ifndef SLOW_HOMING + // back off slowly + t.X = -1000*STEPS_PER_MM_X; + t.F = SEARCH_FEEDRATE_X; + enqueue_home(t, 0x1, 0); + #endif // set X home // set position to MAX @@ -84,15 +98,22 @@ void home_y_negative() { #if defined Y_MIN_PIN TARGET t = {0, current_position.Y, current_position.Z}; - // hit home hard 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); - // back off slowly - t.Y = +1000*STEPS_PER_MM_Y; - t.F = SEARCH_FEEDRATE_Y; - enqueue_home(&t, 0x2, 0); + #ifndef SLOW_HOMING + // back off slowly + t.Y = +1000*STEPS_PER_MM_Y; + t.F = SEARCH_FEEDRATE_Y; + enqueue_home(&t, 0x2, 0); + #endif // set Y home #ifdef Y_MIN @@ -108,15 +129,22 @@ void home_y_positive() { #if defined Y_MAX_PIN TARGET t = {0, current_position.Y, current_position.Z}; - // hit home hard 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); - // back off slowly - t.X = -1000*STEPS_PER_MM_Y; - t.F = SEARCH_FEEDRATE_Y; - enqueue_home(&t, 0x2, 0); + #ifndef SLOW_HOMING + // back off slowly + t.X = -1000*STEPS_PER_MM_Y; + t.F = SEARCH_FEEDRATE_Y; + enqueue_home(&t, 0x2, 0); + #endif // set Y home // set position to MAX @@ -133,15 +161,22 @@ void home_z_negative() { #if defined Z_MIN_PIN TARGET t = {current_position.X, current_position.Y, 0}; - // hit home hard 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); - // back off slowly - t.Z = +1000*STEPS_PER_MM_Z; - t.F = SEARCH_FEEDRATE_Z; - enqueue_home(&t, 0x4, 0); + #ifndef SLOW_HOMING + // back off slowly + t.Z = +1000*STEPS_PER_MM_Z; + t.F = SEARCH_FEEDRATE_Z; + enqueue_home(&t, 0x4, 0); + #endif // set Z home #ifdef Z_MIN @@ -158,15 +193,22 @@ void home_z_positive() { #if defined Z_MAX_PIN TARGET t = {current_position.X, current_position.Y, 0}; - // hit home hard 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); - // back off slowly - t.Z = -1000*STEPS_PER_MM_Z; - t.F = SEARCH_FEEDRATE_Z; - enqueue_home(&t, 0x4, 0); + #ifndef SLOW_HOMING + // back off slowly + t.Z = -1000*STEPS_PER_MM_Z; + t.F = SEARCH_FEEDRATE_Z; + enqueue_home(&t, 0x4, 0); + #endif // set Z home // set position to MAX