diff --git a/config.default.h b/config.default.h index a2908be..5da1aa1 100644 --- a/config.default.h +++ b/config.default.h @@ -175,23 +175,36 @@ */ // #define LOOKAHEAD -/** \def LOOKAHEAD_MAX_JERK_XY +/** \def MAX_JERK_X + \def MAX_JERK_Y + \def MAX_JERK_Z + \def MAX_JERK_E + When performing look-ahead, we need to decide what an acceptable jerk to the - mechanics is when we (instantly) change direction. + mechanics is. Look-ahead attempts to instantly change direction at movement + crossings, which means instant changes in the speed of the axes participating + in the movement. Define here how big the speed bumps on each of the axes is + allowed to be. - Units: micrometers - Sane values: 5 to 200 + If you want a full stop before and after moving a specific axis, define + MAX_JERK of this axis to 0. This is often wanted for the Z axis. If you want + to ignore jerk on an axis, define it to twice the maximum feedrate of this + axis. + + Having these values too low results in more than neccessary slowdown at + movement crossings, but is otherwise harmless. Too high values can result + in stepper motors suddenly stalling. If angles between movements in your + G-code are small and your printer runs through entire curves full speed, + there's no point in raising the values. + + Units: mm/min + Sane values: 0 to 400 + Valid range: 0 to 65535 */ -#define LOOKAHEAD_MAX_JERK_XY 10 - -/** \def LOOKAHEAD_MAX_JERK_E - When joining moves with different extrusion rates, define the maximum jerk - for the extruder. - - Units: micrometers - Sane values: 5 to 200 -*/ -#define LOOKAHEAD_MAX_JERK_E 10 +#define MAX_JERK_X 20 +#define MAX_JERK_Y 20 +#define MAX_JERK_Z 0 +#define MAX_JERK_E 20 diff --git a/config.gen3.h b/config.gen3.h index e4dd4d4..c7a2320 100644 --- a/config.gen3.h +++ b/config.gen3.h @@ -177,23 +177,36 @@ */ // #define LOOKAHEAD -/** \def LOOKAHEAD_MAX_JERK_XY +/** \def MAX_JERK_X + \def MAX_JERK_Y + \def MAX_JERK_Z + \def MAX_JERK_E + When performing look-ahead, we need to decide what an acceptable jerk to the - mechanics is when we (instantly) change direction. + mechanics is. Look-ahead attempts to instantly change direction at movement + crossings, which means instant changes in the speed of the axes participating + in the movement. Define here how big the speed bumps on each of the axes is + allowed to be. - Units: micrometers - Sane values: 5 to 200 + If you want a full stop before and after moving a specific axis, define + MAX_JERK of this axis to 0. This is often wanted for the Z axis. If you want + to ignore jerk on an axis, define it to twice the maximum feedrate of this + axis. + + Having these values too low results in more than neccessary slowdown at + movement crossings, but is otherwise harmless. Too high values can result + in stepper motors suddenly stalling. If angles between movements in your + G-code are small and your printer runs through entire curves full speed, + there's no point in raising the values. + + Units: mm/min + Sane values: 0 to 400 + Valid range: 0 to 65535 */ -#define LOOKAHEAD_MAX_JERK_XY 10 - -/** \def LOOKAHEAD_MAX_JERK_E - When joining moves with different extrusion rates, define the maximum jerk - for the extruder. - - Units: micrometers - Sane values: 5 to 200 -*/ -#define LOOKAHEAD_MAX_JERK_E 10 +#define MAX_JERK_X 20 +#define MAX_JERK_Y 20 +#define MAX_JERK_Z 0 +#define MAX_JERK_E 20 diff --git a/config.gen6.h b/config.gen6.h index 6a7a753..94ec863 100644 --- a/config.gen6.h +++ b/config.gen6.h @@ -177,23 +177,36 @@ */ // #define LOOKAHEAD -/** \def LOOKAHEAD_MAX_JERK_XY +/** \def MAX_JERK_X + \def MAX_JERK_Y + \def MAX_JERK_Z + \def MAX_JERK_E + When performing look-ahead, we need to decide what an acceptable jerk to the - mechanics is when we (instantly) change direction. + mechanics is. Look-ahead attempts to instantly change direction at movement + crossings, which means instant changes in the speed of the axes participating + in the movement. Define here how big the speed bumps on each of the axes is + allowed to be. - Units: micrometers - Sane values: 5 to 200 + If you want a full stop before and after moving a specific axis, define + MAX_JERK of this axis to 0. This is often wanted for the Z axis. If you want + to ignore jerk on an axis, define it to twice the maximum feedrate of this + axis. + + Having these values too low results in more than neccessary slowdown at + movement crossings, but is otherwise harmless. Too high values can result + in stepper motors suddenly stalling. If angles between movements in your + G-code are small and your printer runs through entire curves full speed, + there's no point in raising the values. + + Units: mm/min + Sane values: 0 to 400 + Valid range: 0 to 65535 */ -#define LOOKAHEAD_MAX_JERK_XY 10 - -/** \def LOOKAHEAD_MAX_JERK_E - When joining moves with different extrusion rates, define the maximum jerk - for the extruder. - - Units: micrometers - Sane values: 5 to 200 -*/ -#define LOOKAHEAD_MAX_JERK_E 10 +#define MAX_JERK_X 20 +#define MAX_JERK_Y 20 +#define MAX_JERK_Z 0 +#define MAX_JERK_E 20 diff --git a/config.gen7-v1.1-v1.3.h b/config.gen7-v1.1-v1.3.h index 8a2e9d1..affbe7a 100644 --- a/config.gen7-v1.1-v1.3.h +++ b/config.gen7-v1.1-v1.3.h @@ -183,23 +183,36 @@ */ // #define LOOKAHEAD -/** \def LOOKAHEAD_MAX_JERK_XY +/** \def MAX_JERK_X + \def MAX_JERK_Y + \def MAX_JERK_Z + \def MAX_JERK_E + When performing look-ahead, we need to decide what an acceptable jerk to the - mechanics is when we (instantly) change direction. + mechanics is. Look-ahead attempts to instantly change direction at movement + crossings, which means instant changes in the speed of the axes participating + in the movement. Define here how big the speed bumps on each of the axes is + allowed to be. - Units: micrometers - Sane values: 5 to 200 + If you want a full stop before and after moving a specific axis, define + MAX_JERK of this axis to 0. This is often wanted for the Z axis. If you want + to ignore jerk on an axis, define it to twice the maximum feedrate of this + axis. + + Having these values too low results in more than neccessary slowdown at + movement crossings, but is otherwise harmless. Too high values can result + in stepper motors suddenly stalling. If angles between movements in your + G-code are small and your printer runs through entire curves full speed, + there's no point in raising the values. + + Units: mm/min + Sane values: 0 to 400 + Valid range: 0 to 65535 */ -#define LOOKAHEAD_MAX_JERK_XY 10 - -/** \def LOOKAHEAD_MAX_JERK_E - When joining moves with different extrusion rates, define the maximum jerk - for the extruder. - - Units: micrometers - Sane values: 5 to 200 -*/ -#define LOOKAHEAD_MAX_JERK_E 10 +#define MAX_JERK_X 20 +#define MAX_JERK_Y 20 +#define MAX_JERK_Z 0 +#define MAX_JERK_E 20 diff --git a/config.gen7-v1.4.h b/config.gen7-v1.4.h index 2e3b4bd..2e87e5f 100644 --- a/config.gen7-v1.4.h +++ b/config.gen7-v1.4.h @@ -183,23 +183,36 @@ */ // #define LOOKAHEAD -/** \def LOOKAHEAD_MAX_JERK_XY +/** \def MAX_JERK_X + \def MAX_JERK_Y + \def MAX_JERK_Z + \def MAX_JERK_E + When performing look-ahead, we need to decide what an acceptable jerk to the - mechanics is when we (instantly) change direction. + mechanics is. Look-ahead attempts to instantly change direction at movement + crossings, which means instant changes in the speed of the axes participating + in the movement. Define here how big the speed bumps on each of the axes is + allowed to be. - Units: micrometers - Sane values: 5 to 200 + If you want a full stop before and after moving a specific axis, define + MAX_JERK of this axis to 0. This is often wanted for the Z axis. If you want + to ignore jerk on an axis, define it to twice the maximum feedrate of this + axis. + + Having these values too low results in more than neccessary slowdown at + movement crossings, but is otherwise harmless. Too high values can result + in stepper motors suddenly stalling. If angles between movements in your + G-code are small and your printer runs through entire curves full speed, + there's no point in raising the values. + + Units: mm/min + Sane values: 0 to 400 + Valid range: 0 to 65535 */ -#define LOOKAHEAD_MAX_JERK_XY 10 - -/** \def LOOKAHEAD_MAX_JERK_E - When joining moves with different extrusion rates, define the maximum jerk - for the extruder. - - Units: micrometers - Sane values: 5 to 200 -*/ -#define LOOKAHEAD_MAX_JERK_E 10 +#define MAX_JERK_X 20 +#define MAX_JERK_Y 20 +#define MAX_JERK_Z 0 +#define MAX_JERK_E 20 diff --git a/config.ramps-v1.2.h b/config.ramps-v1.2.h index 0f9f47c..aa7f564 100644 --- a/config.ramps-v1.2.h +++ b/config.ramps-v1.2.h @@ -178,23 +178,36 @@ */ // #define LOOKAHEAD -/** \def LOOKAHEAD_MAX_JERK_XY +/** \def MAX_JERK_X + \def MAX_JERK_Y + \def MAX_JERK_Z + \def MAX_JERK_E + When performing look-ahead, we need to decide what an acceptable jerk to the - mechanics is when we (instantly) change direction. + mechanics is. Look-ahead attempts to instantly change direction at movement + crossings, which means instant changes in the speed of the axes participating + in the movement. Define here how big the speed bumps on each of the axes is + allowed to be. - Units: micrometers - Sane values: 5 to 200 + If you want a full stop before and after moving a specific axis, define + MAX_JERK of this axis to 0. This is often wanted for the Z axis. If you want + to ignore jerk on an axis, define it to twice the maximum feedrate of this + axis. + + Having these values too low results in more than neccessary slowdown at + movement crossings, but is otherwise harmless. Too high values can result + in stepper motors suddenly stalling. If angles between movements in your + G-code are small and your printer runs through entire curves full speed, + there's no point in raising the values. + + Units: mm/min + Sane values: 0 to 400 + Valid range: 0 to 65535 */ -#define LOOKAHEAD_MAX_JERK_XY 10 - -/** \def LOOKAHEAD_MAX_JERK_E - When joining moves with different extrusion rates, define the maximum jerk - for the extruder. - - Units: micrometers - Sane values: 5 to 200 -*/ -#define LOOKAHEAD_MAX_JERK_E 10 +#define MAX_JERK_X 20 +#define MAX_JERK_Y 20 +#define MAX_JERK_Z 0 +#define MAX_JERK_E 20 diff --git a/config.ramps-v1.3.h b/config.ramps-v1.3.h index dfcff5d..3cbb338 100644 --- a/config.ramps-v1.3.h +++ b/config.ramps-v1.3.h @@ -177,23 +177,36 @@ */ // #define LOOKAHEAD -/** \def LOOKAHEAD_MAX_JERK_XY +/** \def MAX_JERK_X + \def MAX_JERK_Y + \def MAX_JERK_Z + \def MAX_JERK_E + When performing look-ahead, we need to decide what an acceptable jerk to the - mechanics is when we (instantly) change direction. + mechanics is. Look-ahead attempts to instantly change direction at movement + crossings, which means instant changes in the speed of the axes participating + in the movement. Define here how big the speed bumps on each of the axes is + allowed to be. - Units: micrometers - Sane values: 5 to 200 + If you want a full stop before and after moving a specific axis, define + MAX_JERK of this axis to 0. This is often wanted for the Z axis. If you want + to ignore jerk on an axis, define it to twice the maximum feedrate of this + axis. + + Having these values too low results in more than neccessary slowdown at + movement crossings, but is otherwise harmless. Too high values can result + in stepper motors suddenly stalling. If angles between movements in your + G-code are small and your printer runs through entire curves full speed, + there's no point in raising the values. + + Units: mm/min + Sane values: 0 to 400 + Valid range: 0 to 65535 */ -#define LOOKAHEAD_MAX_JERK_XY 10 - -/** \def LOOKAHEAD_MAX_JERK_E - When joining moves with different extrusion rates, define the maximum jerk - for the extruder. - - Units: micrometers - Sane values: 5 to 200 -*/ -#define LOOKAHEAD_MAX_JERK_E 10 +#define MAX_JERK_X 20 +#define MAX_JERK_Y 20 +#define MAX_JERK_Z 0 +#define MAX_JERK_E 20 diff --git a/config.sanguinololu-v1.1.h b/config.sanguinololu-v1.1.h index 041835e..328aea8 100644 --- a/config.sanguinololu-v1.1.h +++ b/config.sanguinololu-v1.1.h @@ -177,23 +177,36 @@ */ // #define LOOKAHEAD -/** \def LOOKAHEAD_MAX_JERK_XY +/** \def MAX_JERK_X + \def MAX_JERK_Y + \def MAX_JERK_Z + \def MAX_JERK_E + When performing look-ahead, we need to decide what an acceptable jerk to the - mechanics is when we (instantly) change direction. + mechanics is. Look-ahead attempts to instantly change direction at movement + crossings, which means instant changes in the speed of the axes participating + in the movement. Define here how big the speed bumps on each of the axes is + allowed to be. - Units: micrometers - Sane values: 5 to 200 + If you want a full stop before and after moving a specific axis, define + MAX_JERK of this axis to 0. This is often wanted for the Z axis. If you want + to ignore jerk on an axis, define it to twice the maximum feedrate of this + axis. + + Having these values too low results in more than neccessary slowdown at + movement crossings, but is otherwise harmless. Too high values can result + in stepper motors suddenly stalling. If angles between movements in your + G-code are small and your printer runs through entire curves full speed, + there's no point in raising the values. + + Units: mm/min + Sane values: 0 to 400 + Valid range: 0 to 65535 */ -#define LOOKAHEAD_MAX_JERK_XY 10 - -/** \def LOOKAHEAD_MAX_JERK_E - When joining moves with different extrusion rates, define the maximum jerk - for the extruder. - - Units: micrometers - Sane values: 5 to 200 -*/ -#define LOOKAHEAD_MAX_JERK_E 10 +#define MAX_JERK_X 20 +#define MAX_JERK_Y 20 +#define MAX_JERK_Z 0 +#define MAX_JERK_E 20 diff --git a/config.sanguinololu-v1.2.h b/config.sanguinololu-v1.2.h index afbbe6a..0005e80 100644 --- a/config.sanguinololu-v1.2.h +++ b/config.sanguinololu-v1.2.h @@ -177,23 +177,36 @@ */ // #define LOOKAHEAD -/** \def LOOKAHEAD_MAX_JERK_XY +/** \def MAX_JERK_X + \def MAX_JERK_Y + \def MAX_JERK_Z + \def MAX_JERK_E + When performing look-ahead, we need to decide what an acceptable jerk to the - mechanics is when we (instantly) change direction. + mechanics is. Look-ahead attempts to instantly change direction at movement + crossings, which means instant changes in the speed of the axes participating + in the movement. Define here how big the speed bumps on each of the axes is + allowed to be. - Units: micrometers - Sane values: 5 to 200 + If you want a full stop before and after moving a specific axis, define + MAX_JERK of this axis to 0. This is often wanted for the Z axis. If you want + to ignore jerk on an axis, define it to twice the maximum feedrate of this + axis. + + Having these values too low results in more than neccessary slowdown at + movement crossings, but is otherwise harmless. Too high values can result + in stepper motors suddenly stalling. If angles between movements in your + G-code are small and your printer runs through entire curves full speed, + there's no point in raising the values. + + Units: mm/min + Sane values: 0 to 400 + Valid range: 0 to 65535 */ -#define LOOKAHEAD_MAX_JERK_XY 10 - -/** \def LOOKAHEAD_MAX_JERK_E - When joining moves with different extrusion rates, define the maximum jerk - for the extruder. - - Units: micrometers - Sane values: 5 to 200 -*/ -#define LOOKAHEAD_MAX_JERK_E 10 +#define MAX_JERK_X 20 +#define MAX_JERK_Y 20 +#define MAX_JERK_Z 0 +#define MAX_JERK_E 20 diff --git a/config.sanguish.h b/config.sanguish.h index ee4c97c..1aa9e99 100644 --- a/config.sanguish.h +++ b/config.sanguish.h @@ -183,23 +183,36 @@ */ // #define LOOKAHEAD -/** \def LOOKAHEAD_MAX_JERK_XY +/** \def MAX_JERK_X + \def MAX_JERK_Y + \def MAX_JERK_Z + \def MAX_JERK_E + When performing look-ahead, we need to decide what an acceptable jerk to the - mechanics is when we (instantly) change direction. + mechanics is. Look-ahead attempts to instantly change direction at movement + crossings, which means instant changes in the speed of the axes participating + in the movement. Define here how big the speed bumps on each of the axes is + allowed to be. - Units: micrometers - Sane values: 5 to 200 + If you want a full stop before and after moving a specific axis, define + MAX_JERK of this axis to 0. This is often wanted for the Z axis. If you want + to ignore jerk on an axis, define it to twice the maximum feedrate of this + axis. + + Having these values too low results in more than neccessary slowdown at + movement crossings, but is otherwise harmless. Too high values can result + in stepper motors suddenly stalling. If angles between movements in your + G-code are small and your printer runs through entire curves full speed, + there's no point in raising the values. + + Units: mm/min + Sane values: 0 to 400 + Valid range: 0 to 65535 */ -#define LOOKAHEAD_MAX_JERK_XY 10 - -/** \def LOOKAHEAD_MAX_JERK_E - When joining moves with different extrusion rates, define the maximum jerk - for the extruder. - - Units: micrometers - Sane values: 5 to 200 -*/ -#define LOOKAHEAD_MAX_JERK_E 10 +#define MAX_JERK_X 20 +#define MAX_JERK_Y 20 +#define MAX_JERK_Z 0 +#define MAX_JERK_E 20 diff --git a/config.teensy.h b/config.teensy.h index d5c36f6..c9b1c85 100644 --- a/config.teensy.h +++ b/config.teensy.h @@ -190,23 +190,36 @@ MXL 2.032 mm/tooth, 29 */ // #define LOOKAHEAD -/** \def LOOKAHEAD_MAX_JERK_XY +/** \def MAX_JERK_X + \def MAX_JERK_Y + \def MAX_JERK_Z + \def MAX_JERK_E + When performing look-ahead, we need to decide what an acceptable jerk to the - mechanics is when we (instantly) change direction. + mechanics is. Look-ahead attempts to instantly change direction at movement + crossings, which means instant changes in the speed of the axes participating + in the movement. Define here how big the speed bumps on each of the axes is + allowed to be. - Units: micrometers - Sane values: 5 to 200 + If you want a full stop before and after moving a specific axis, define + MAX_JERK of this axis to 0. This is often wanted for the Z axis. If you want + to ignore jerk on an axis, define it to twice the maximum feedrate of this + axis. + + Having these values too low results in more than neccessary slowdown at + movement crossings, but is otherwise harmless. Too high values can result + in stepper motors suddenly stalling. If angles between movements in your + G-code are small and your printer runs through entire curves full speed, + there's no point in raising the values. + + Units: mm/min + Sane values: 0 to 400 + Valid range: 0 to 65535 */ -#define LOOKAHEAD_MAX_JERK_XY 10 - -/** \def LOOKAHEAD_MAX_JERK_E - When joining moves with different extrusion rates, define the maximum jerk - for the extruder. - - Units: micrometers - Sane values: 5 to 200 -*/ -#define LOOKAHEAD_MAX_JERK_E 10 +#define MAX_JERK_X 20 +#define MAX_JERK_Y 20 +#define MAX_JERK_Z 0 +#define MAX_JERK_E 20 diff --git a/config.teensypp.h b/config.teensypp.h index a6af367..7d5f962 100644 --- a/config.teensypp.h +++ b/config.teensypp.h @@ -190,23 +190,36 @@ MXL 2.032 mm/tooth, 29 */ // #define LOOKAHEAD -/** \def LOOKAHEAD_MAX_JERK_XY +/** \def MAX_JERK_X + \def MAX_JERK_Y + \def MAX_JERK_Z + \def MAX_JERK_E + When performing look-ahead, we need to decide what an acceptable jerk to the - mechanics is when we (instantly) change direction. + mechanics is. Look-ahead attempts to instantly change direction at movement + crossings, which means instant changes in the speed of the axes participating + in the movement. Define here how big the speed bumps on each of the axes is + allowed to be. - Units: micrometers - Sane values: 5 to 200 + If you want a full stop before and after moving a specific axis, define + MAX_JERK of this axis to 0. This is often wanted for the Z axis. If you want + to ignore jerk on an axis, define it to twice the maximum feedrate of this + axis. + + Having these values too low results in more than neccessary slowdown at + movement crossings, but is otherwise harmless. Too high values can result + in stepper motors suddenly stalling. If angles between movements in your + G-code are small and your printer runs through entire curves full speed, + there's no point in raising the values. + + Units: mm/min + Sane values: 0 to 400 + Valid range: 0 to 65535 */ -#define LOOKAHEAD_MAX_JERK_XY 10 - -/** \def LOOKAHEAD_MAX_JERK_E - When joining moves with different extrusion rates, define the maximum jerk - for the extruder. - - Units: micrometers - Sane values: 5 to 200 -*/ -#define LOOKAHEAD_MAX_JERK_E 10 +#define MAX_JERK_X 20 +#define MAX_JERK_Y 20 +#define MAX_JERK_Z 0 +#define MAX_JERK_E 20 diff --git a/dda_lookahead.c b/dda_lookahead.c index 8a41d74..840657b 100644 --- a/dda_lookahead.c +++ b/dda_lookahead.c @@ -163,11 +163,6 @@ void dda_emergency_shutdown(PGM_P msg) { * * \return dda->crossF */ -// TODO: This should go into config.h. -#define MAX_JERK_X 20 -#define MAX_JERK_Y 20 -#define MAX_JERK_Z 0 -#define MAX_JERK_E 20 void dda_find_crossing_speed(DDA *prev, DDA *current) { uint32_t F, prev_distance, curr_distance; uint32_t dv, speed_factor, max_speed_factor; diff --git a/dda_lookahead.h b/dda_lookahead.h index 633a263..dd25927 100644 --- a/dda_lookahead.h +++ b/dda_lookahead.h @@ -13,11 +13,10 @@ #ifdef LOOKAHEAD // Sanity: make sure the defines are in place -#ifndef LOOKAHEAD_MAX_JERK_XY -#error Your config.h does not specify LOOKAHEAD_MAX_JERK_XY while LOOKAHEAD is enabled! -#endif -#ifndef LOOKAHEAD_MAX_JERK_E -#error Your config.h does not specify LOOKAHEAD_MAX_JERK_E while LOOKAHEAD is enabled! +#if ! defined MAX_JERK_X || ! defined MAX_JERK_Y || \ + ! defined MAX_JERK_Z || ! defined MAX_JERK_E +#error Your config.h does not specify one of MAX_JERK_X, +#error MAX_JERK_Y, MAX_JERK_Z or MAX_JERK_E while LOOKAHEAD is enabled! #endif // Sanity: the acceleration of Teacup is not implemented properly; as such we can only