look-ahead: move jerk definitions into config.h templates.

This commit is contained in:
Markus Hitter 2013-10-31 20:05:55 +01:00
parent b2063e1182
commit ed9f56a9d8
14 changed files with 328 additions and 178 deletions

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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

View File

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