BugFix for incorrect E-speed calculation
The extrusion speed was wrong due to a not high enough precision of esteps to XY steps, therefore now the target float values are used to calculate the ratio between XY movement and extrusion speed. The e_speed_multiplier8 was replaced by an absolute multiplier called abs_adv_steps_multiplier8, therefore one multiplication and bitshift can be saved inside the stepper ISR. Due to this, also extruder_advance_k is better suited inside the planner and not the stepper files any more.
This commit is contained in:
@@ -95,7 +95,7 @@ typedef struct {
|
||||
// Advance extrusion
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
bool use_advance_lead;
|
||||
int16_t e_speed_multiplier8; // Factorised by 2^8 to avoid float
|
||||
uint32_t abs_adv_steps_multiplier8; // Factorised by 2^8 to avoid float
|
||||
#elif ENABLED(ADVANCE)
|
||||
int32_t advance_rate;
|
||||
volatile int32_t initial_advance;
|
||||
@@ -196,6 +196,11 @@ class Planner {
|
||||
// Segment times (in µs). Used for speed calculations
|
||||
static long axis_segment_time[2][3];
|
||||
#endif
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
static float position_float[NUM_AXIS];
|
||||
static float extruder_advance_k;
|
||||
#endif
|
||||
|
||||
public:
|
||||
|
||||
@@ -245,6 +250,10 @@ class Planner {
|
||||
#define ARG_Z const float &lz
|
||||
|
||||
#endif
|
||||
|
||||
#if ENABLED(LIN_ADVANCE)
|
||||
void advance_M905(const float &k);
|
||||
#endif
|
||||
|
||||
/**
|
||||
* Planner::_buffer_line
|
||||
|
Reference in New Issue
Block a user