Merge pull request #5056 from thinkyhead/rc_lin_adv_opt
LIN_ADVANCE optimizations
This commit is contained in:
commit
627f9d5285
19 changed files with 253 additions and 55 deletions
|
@ -501,9 +501,20 @@
|
|||
#define D_FILAMENT 2.85
|
||||
#endif
|
||||
|
||||
// Implementation of a linear pressure control
|
||||
// Assumption: advance = k * (delta velocity)
|
||||
// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
|
||||
/**
|
||||
* Implementation of linear pressure control
|
||||
*
|
||||
* Assumption: advance = k * (delta velocity)
|
||||
* K=0 means advance disabled.
|
||||
* To get a rough start value for calibration, measure your "free filament length"
|
||||
* between the hobbed bolt and the nozzle (in cm). Use the formula below that fits
|
||||
* your setup, where L is the "free filament length":
|
||||
*
|
||||
* Filament diameter | 1.75mm | 3.0mm |
|
||||
* ----------------------------|-----------|------------|
|
||||
* Stiff filament (PLA) | K=47*L/10 | K=139*L/10 |
|
||||
* Softer filament (ABS, nGen) | K=88*L/10 | K=260*L/10 |
|
||||
*/
|
||||
//#define LIN_ADVANCE
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
|
|
|
@ -501,9 +501,20 @@
|
|||
#define D_FILAMENT 2.85
|
||||
#endif
|
||||
|
||||
// Implementation of a linear pressure control
|
||||
// Assumption: advance = k * (delta velocity)
|
||||
// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
|
||||
/**
|
||||
* Implementation of linear pressure control
|
||||
*
|
||||
* Assumption: advance = k * (delta velocity)
|
||||
* K=0 means advance disabled.
|
||||
* To get a rough start value for calibration, measure your "free filament length"
|
||||
* between the hobbed bolt and the nozzle (in cm). Use the formula below that fits
|
||||
* your setup, where L is the "free filament length":
|
||||
*
|
||||
* Filament diameter | 1.75mm | 3.0mm |
|
||||
* ----------------------------|-----------|------------|
|
||||
* Stiff filament (PLA) | K=47*L/10 | K=139*L/10 |
|
||||
* Softer filament (ABS, nGen) | K=88*L/10 | K=260*L/10 |
|
||||
*/
|
||||
//#define LIN_ADVANCE
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
|
|
|
@ -501,9 +501,20 @@
|
|||
#define D_FILAMENT 2.85
|
||||
#endif
|
||||
|
||||
// Implementation of a linear pressure control
|
||||
// Assumption: advance = k * (delta velocity)
|
||||
// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
|
||||
/**
|
||||
* Implementation of linear pressure control
|
||||
*
|
||||
* Assumption: advance = k * (delta velocity)
|
||||
* K=0 means advance disabled.
|
||||
* To get a rough start value for calibration, measure your "free filament length"
|
||||
* between the hobbed bolt and the nozzle (in cm). Use the formula below that fits
|
||||
* your setup, where L is the "free filament length":
|
||||
*
|
||||
* Filament diameter | 1.75mm | 3.0mm |
|
||||
* ----------------------------|-----------|------------|
|
||||
* Stiff filament (PLA) | K=47*L/10 | K=139*L/10 |
|
||||
* Softer filament (ABS, nGen) | K=88*L/10 | K=260*L/10 |
|
||||
*/
|
||||
//#define LIN_ADVANCE
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
|
|
|
@ -501,9 +501,20 @@
|
|||
#define D_FILAMENT 1.75
|
||||
#endif
|
||||
|
||||
// Implementation of a linear pressure control
|
||||
// Assumption: advance = k * (delta velocity)
|
||||
// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
|
||||
/**
|
||||
* Implementation of linear pressure control
|
||||
*
|
||||
* Assumption: advance = k * (delta velocity)
|
||||
* K=0 means advance disabled.
|
||||
* To get a rough start value for calibration, measure your "free filament length"
|
||||
* between the hobbed bolt and the nozzle (in cm). Use the formula below that fits
|
||||
* your setup, where L is the "free filament length":
|
||||
*
|
||||
* Filament diameter | 1.75mm | 3.0mm |
|
||||
* ----------------------------|-----------|------------|
|
||||
* Stiff filament (PLA) | K=47*L/10 | K=139*L/10 |
|
||||
* Softer filament (ABS, nGen) | K=88*L/10 | K=260*L/10 |
|
||||
*/
|
||||
//#define LIN_ADVANCE
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
|
|
|
@ -501,9 +501,20 @@
|
|||
#define D_FILAMENT 2.85
|
||||
#endif
|
||||
|
||||
// Implementation of a linear pressure control
|
||||
// Assumption: advance = k * (delta velocity)
|
||||
// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
|
||||
/**
|
||||
* Implementation of linear pressure control
|
||||
*
|
||||
* Assumption: advance = k * (delta velocity)
|
||||
* K=0 means advance disabled.
|
||||
* To get a rough start value for calibration, measure your "free filament length"
|
||||
* between the hobbed bolt and the nozzle (in cm). Use the formula below that fits
|
||||
* your setup, where L is the "free filament length":
|
||||
*
|
||||
* Filament diameter | 1.75mm | 3.0mm |
|
||||
* ----------------------------|-----------|------------|
|
||||
* Stiff filament (PLA) | K=47*L/10 | K=139*L/10 |
|
||||
* Softer filament (ABS, nGen) | K=88*L/10 | K=260*L/10 |
|
||||
*/
|
||||
//#define LIN_ADVANCE
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
|
|
|
@ -507,9 +507,20 @@
|
|||
#define D_FILAMENT 2.85
|
||||
#endif
|
||||
|
||||
// Implementation of a linear pressure control
|
||||
// Assumption: advance = k * (delta velocity)
|
||||
// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
|
||||
/**
|
||||
* Implementation of linear pressure control
|
||||
*
|
||||
* Assumption: advance = k * (delta velocity)
|
||||
* K=0 means advance disabled.
|
||||
* To get a rough start value for calibration, measure your "free filament length"
|
||||
* between the hobbed bolt and the nozzle (in cm). Use the formula below that fits
|
||||
* your setup, where L is the "free filament length":
|
||||
*
|
||||
* Filament diameter | 1.75mm | 3.0mm |
|
||||
* ----------------------------|-----------|------------|
|
||||
* Stiff filament (PLA) | K=47*L/10 | K=139*L/10 |
|
||||
* Softer filament (ABS, nGen) | K=88*L/10 | K=260*L/10 |
|
||||
*/
|
||||
//#define LIN_ADVANCE
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
|
|
|
@ -501,9 +501,20 @@
|
|||
#define D_FILAMENT 2.85
|
||||
#endif
|
||||
|
||||
// Implementation of a linear pressure control
|
||||
// Assumption: advance = k * (delta velocity)
|
||||
// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
|
||||
/**
|
||||
* Implementation of linear pressure control
|
||||
*
|
||||
* Assumption: advance = k * (delta velocity)
|
||||
* K=0 means advance disabled.
|
||||
* To get a rough start value for calibration, measure your "free filament length"
|
||||
* between the hobbed bolt and the nozzle (in cm). Use the formula below that fits
|
||||
* your setup, where L is the "free filament length":
|
||||
*
|
||||
* Filament diameter | 1.75mm | 3.0mm |
|
||||
* ----------------------------|-----------|------------|
|
||||
* Stiff filament (PLA) | K=47*L/10 | K=139*L/10 |
|
||||
* Softer filament (ABS, nGen) | K=88*L/10 | K=260*L/10 |
|
||||
*/
|
||||
//#define LIN_ADVANCE
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
|
|
|
@ -501,9 +501,20 @@
|
|||
#define D_FILAMENT 1.75
|
||||
#endif
|
||||
|
||||
// Implementation of a linear pressure control
|
||||
// Assumption: advance = k * (delta velocity)
|
||||
// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
|
||||
/**
|
||||
* Implementation of linear pressure control
|
||||
*
|
||||
* Assumption: advance = k * (delta velocity)
|
||||
* K=0 means advance disabled.
|
||||
* To get a rough start value for calibration, measure your "free filament length"
|
||||
* between the hobbed bolt and the nozzle (in cm). Use the formula below that fits
|
||||
* your setup, where L is the "free filament length":
|
||||
*
|
||||
* Filament diameter | 1.75mm | 3.0mm |
|
||||
* ----------------------------|-----------|------------|
|
||||
* Stiff filament (PLA) | K=47*L/10 | K=139*L/10 |
|
||||
* Softer filament (ABS, nGen) | K=88*L/10 | K=260*L/10 |
|
||||
*/
|
||||
//#define LIN_ADVANCE
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
|
|
|
@ -501,9 +501,20 @@
|
|||
#define D_FILAMENT 1.75
|
||||
#endif
|
||||
|
||||
// Implementation of a linear pressure control
|
||||
// Assumption: advance = k * (delta velocity)
|
||||
// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
|
||||
/**
|
||||
* Implementation of linear pressure control
|
||||
*
|
||||
* Assumption: advance = k * (delta velocity)
|
||||
* K=0 means advance disabled.
|
||||
* To get a rough start value for calibration, measure your "free filament length"
|
||||
* between the hobbed bolt and the nozzle (in cm). Use the formula below that fits
|
||||
* your setup, where L is the "free filament length":
|
||||
*
|
||||
* Filament diameter | 1.75mm | 3.0mm |
|
||||
* ----------------------------|-----------|------------|
|
||||
* Stiff filament (PLA) | K=47*L/10 | K=139*L/10 |
|
||||
* Softer filament (ABS, nGen) | K=88*L/10 | K=260*L/10 |
|
||||
*/
|
||||
//#define LIN_ADVANCE
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
|
|
|
@ -509,9 +509,20 @@
|
|||
#define D_FILAMENT 2.85
|
||||
#endif
|
||||
|
||||
// Implementation of a linear pressure control
|
||||
// Assumption: advance = k * (delta velocity)
|
||||
// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
|
||||
/**
|
||||
* Implementation of linear pressure control
|
||||
*
|
||||
* Assumption: advance = k * (delta velocity)
|
||||
* K=0 means advance disabled.
|
||||
* To get a rough start value for calibration, measure your "free filament length"
|
||||
* between the hobbed bolt and the nozzle (in cm). Use the formula below that fits
|
||||
* your setup, where L is the "free filament length":
|
||||
*
|
||||
* Filament diameter | 1.75mm | 3.0mm |
|
||||
* ----------------------------|-----------|------------|
|
||||
* Stiff filament (PLA) | K=47*L/10 | K=139*L/10 |
|
||||
* Softer filament (ABS, nGen) | K=88*L/10 | K=260*L/10 |
|
||||
*/
|
||||
//#define LIN_ADVANCE
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
|
|
|
@ -501,9 +501,20 @@
|
|||
#define D_FILAMENT 1.75
|
||||
#endif
|
||||
|
||||
// Implementation of a linear pressure control
|
||||
// Assumption: advance = k * (delta velocity)
|
||||
// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
|
||||
/**
|
||||
* Implementation of linear pressure control
|
||||
*
|
||||
* Assumption: advance = k * (delta velocity)
|
||||
* K=0 means advance disabled.
|
||||
* To get a rough start value for calibration, measure your "free filament length"
|
||||
* between the hobbed bolt and the nozzle (in cm). Use the formula below that fits
|
||||
* your setup, where L is the "free filament length":
|
||||
*
|
||||
* Filament diameter | 1.75mm | 3.0mm |
|
||||
* ----------------------------|-----------|------------|
|
||||
* Stiff filament (PLA) | K=47*L/10 | K=139*L/10 |
|
||||
* Softer filament (ABS, nGen) | K=88*L/10 | K=260*L/10 |
|
||||
*/
|
||||
//#define LIN_ADVANCE
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
|
|
|
@ -503,9 +503,20 @@
|
|||
#define D_FILAMENT 2.85
|
||||
#endif
|
||||
|
||||
// Implementation of a linear pressure control
|
||||
// Assumption: advance = k * (delta velocity)
|
||||
// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
|
||||
/**
|
||||
* Implementation of linear pressure control
|
||||
*
|
||||
* Assumption: advance = k * (delta velocity)
|
||||
* K=0 means advance disabled.
|
||||
* To get a rough start value for calibration, measure your "free filament length"
|
||||
* between the hobbed bolt and the nozzle (in cm). Use the formula below that fits
|
||||
* your setup, where L is the "free filament length":
|
||||
*
|
||||
* Filament diameter | 1.75mm | 3.0mm |
|
||||
* ----------------------------|-----------|------------|
|
||||
* Stiff filament (PLA) | K=47*L/10 | K=139*L/10 |
|
||||
* Softer filament (ABS, nGen) | K=88*L/10 | K=260*L/10 |
|
||||
*/
|
||||
//#define LIN_ADVANCE
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
|
|
|
@ -503,9 +503,20 @@
|
|||
#define D_FILAMENT 2.85
|
||||
#endif
|
||||
|
||||
// Implementation of a linear pressure control
|
||||
// Assumption: advance = k * (delta velocity)
|
||||
// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
|
||||
/**
|
||||
* Implementation of linear pressure control
|
||||
*
|
||||
* Assumption: advance = k * (delta velocity)
|
||||
* K=0 means advance disabled.
|
||||
* To get a rough start value for calibration, measure your "free filament length"
|
||||
* between the hobbed bolt and the nozzle (in cm). Use the formula below that fits
|
||||
* your setup, where L is the "free filament length":
|
||||
*
|
||||
* Filament diameter | 1.75mm | 3.0mm |
|
||||
* ----------------------------|-----------|------------|
|
||||
* Stiff filament (PLA) | K=47*L/10 | K=139*L/10 |
|
||||
* Softer filament (ABS, nGen) | K=88*L/10 | K=260*L/10 |
|
||||
*/
|
||||
//#define LIN_ADVANCE
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
|
|
|
@ -503,9 +503,20 @@
|
|||
#define D_FILAMENT 2.85
|
||||
#endif
|
||||
|
||||
// Implementation of a linear pressure control
|
||||
// Assumption: advance = k * (delta velocity)
|
||||
// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
|
||||
/**
|
||||
* Implementation of linear pressure control
|
||||
*
|
||||
* Assumption: advance = k * (delta velocity)
|
||||
* K=0 means advance disabled.
|
||||
* To get a rough start value for calibration, measure your "free filament length"
|
||||
* between the hobbed bolt and the nozzle (in cm). Use the formula below that fits
|
||||
* your setup, where L is the "free filament length":
|
||||
*
|
||||
* Filament diameter | 1.75mm | 3.0mm |
|
||||
* ----------------------------|-----------|------------|
|
||||
* Stiff filament (PLA) | K=47*L/10 | K=139*L/10 |
|
||||
* Softer filament (ABS, nGen) | K=88*L/10 | K=260*L/10 |
|
||||
*/
|
||||
//#define LIN_ADVANCE
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
|
|
|
@ -508,9 +508,20 @@
|
|||
#define D_FILAMENT 2.85
|
||||
#endif
|
||||
|
||||
// Implementation of a linear pressure control
|
||||
// Assumption: advance = k * (delta velocity)
|
||||
// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
|
||||
/**
|
||||
* Implementation of linear pressure control
|
||||
*
|
||||
* Assumption: advance = k * (delta velocity)
|
||||
* K=0 means advance disabled.
|
||||
* To get a rough start value for calibration, measure your "free filament length"
|
||||
* between the hobbed bolt and the nozzle (in cm). Use the formula below that fits
|
||||
* your setup, where L is the "free filament length":
|
||||
*
|
||||
* Filament diameter | 1.75mm | 3.0mm |
|
||||
* ----------------------------|-----------|------------|
|
||||
* Stiff filament (PLA) | K=47*L/10 | K=139*L/10 |
|
||||
* Softer filament (ABS, nGen) | K=88*L/10 | K=260*L/10 |
|
||||
*/
|
||||
//#define LIN_ADVANCE
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
|
|
|
@ -503,9 +503,20 @@
|
|||
#define D_FILAMENT 2.85
|
||||
#endif
|
||||
|
||||
// Implementation of a linear pressure control
|
||||
// Assumption: advance = k * (delta velocity)
|
||||
// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
|
||||
/**
|
||||
* Implementation of linear pressure control
|
||||
*
|
||||
* Assumption: advance = k * (delta velocity)
|
||||
* K=0 means advance disabled.
|
||||
* To get a rough start value for calibration, measure your "free filament length"
|
||||
* between the hobbed bolt and the nozzle (in cm). Use the formula below that fits
|
||||
* your setup, where L is the "free filament length":
|
||||
*
|
||||
* Filament diameter | 1.75mm | 3.0mm |
|
||||
* ----------------------------|-----------|------------|
|
||||
* Stiff filament (PLA) | K=47*L/10 | K=139*L/10 |
|
||||
* Softer filament (ABS, nGen) | K=88*L/10 | K=260*L/10 |
|
||||
*/
|
||||
//#define LIN_ADVANCE
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
|
|
|
@ -501,9 +501,20 @@
|
|||
#define D_FILAMENT 2.85
|
||||
#endif
|
||||
|
||||
// Implementation of a linear pressure control
|
||||
// Assumption: advance = k * (delta velocity)
|
||||
// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
|
||||
/**
|
||||
* Implementation of linear pressure control
|
||||
*
|
||||
* Assumption: advance = k * (delta velocity)
|
||||
* K=0 means advance disabled.
|
||||
* To get a rough start value for calibration, measure your "free filament length"
|
||||
* between the hobbed bolt and the nozzle (in cm). Use the formula below that fits
|
||||
* your setup, where L is the "free filament length":
|
||||
*
|
||||
* Filament diameter | 1.75mm | 3.0mm |
|
||||
* ----------------------------|-----------|------------|
|
||||
* Stiff filament (PLA) | K=47*L/10 | K=139*L/10 |
|
||||
* Softer filament (ABS, nGen) | K=88*L/10 | K=260*L/10 |
|
||||
*/
|
||||
//#define LIN_ADVANCE
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
|
|
|
@ -501,9 +501,20 @@
|
|||
#define D_FILAMENT 2.85
|
||||
#endif
|
||||
|
||||
// Implementation of a linear pressure control
|
||||
// Assumption: advance = k * (delta velocity)
|
||||
// K=0 means advance disabled. A good value for a gregs wade extruder will be around K=75
|
||||
/**
|
||||
* Implementation of linear pressure control
|
||||
*
|
||||
* Assumption: advance = k * (delta velocity)
|
||||
* K=0 means advance disabled.
|
||||
* To get a rough start value for calibration, measure your "free filament length"
|
||||
* between the hobbed bolt and the nozzle (in cm). Use the formula below that fits
|
||||
* your setup, where L is the "free filament length":
|
||||
*
|
||||
* Filament diameter | 1.75mm | 3.0mm |
|
||||
* ----------------------------|-----------|------------|
|
||||
* Stiff filament (PLA) | K=47*L/10 | K=139*L/10 |
|
||||
* Softer filament (ABS, nGen) | K=88*L/10 | K=260*L/10 |
|
||||
*/
|
||||
//#define LIN_ADVANCE
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
|
|
|
@ -1206,7 +1206,7 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
|
|||
// This leads to an enormous number of advance steps due to a huge e_acceleration.
|
||||
// The math is correct, but you don't want a retract move done with advance!
|
||||
// So this situation is filtered out here.
|
||||
if (!block->steps[E_AXIS] || (!block->steps[X_AXIS] && !block->steps[Y_AXIS] && !block->steps[Z_AXIS]) || stepper.get_advance_k() == 0 || (uint32_t) block->steps[E_AXIS] == block->step_event_count) {
|
||||
if (!block->steps[E_AXIS] || (!block->steps[X_AXIS] && !block->steps[Y_AXIS]) || stepper.get_advance_k() == 0 || (uint32_t) block->steps[E_AXIS] == block->step_event_count) {
|
||||
block->use_advance_lead = false;
|
||||
}
|
||||
else {
|
||||
|
|
Reference in a new issue