@ -1687,7 +1687,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
}
}
# endif // PREVENT_COLD_EXTRUSION
# endif // PREVENT_COLD_EXTRUSION
# if ENABLED(PREVENT_LENGTHY_EXTRUDE)
# if ENABLED(PREVENT_LENGTHY_EXTRUDE)
if ( ABS ( de * e_factor [ extruder ] ) > ( int32_t ) axis_steps_per_mm [ E_AXIS_N ] * ( EXTRUDE_MAXLENGTH ) ) { // It's not important to get max. extrusion length in a precision < 1mm, so save some cycles and cast to int
if ( ABS ( de * e_factor [ extruder ] ) > ( int32_t ) axis_steps_per_mm [ E_AXIS_N ( extruder ) ] * ( EXTRUDE_MAXLENGTH ) ) { // It's not important to get max. extrusion length in a precision < 1mm, so save some cycles and cast to int
position [ E_AXIS ] = target [ E_AXIS ] ; // Behave as if the move really took place, but ignore E part
position [ E_AXIS ] = target [ E_AXIS ] ; // Behave as if the move really took place, but ignore E part
# if HAS_POSITION_FLOAT
# if HAS_POSITION_FLOAT
position_float [ E_AXIS ] = target_float [ E_AXIS ] ;
position_float [ E_AXIS ] = target_float [ E_AXIS ] ;
@ -1985,7 +1985,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
delta_mm [ B_AXIS ] = db * steps_to_mm [ B_AXIS ] ;
delta_mm [ B_AXIS ] = db * steps_to_mm [ B_AXIS ] ;
delta_mm [ C_AXIS ] = dc * steps_to_mm [ C_AXIS ] ;
delta_mm [ C_AXIS ] = dc * steps_to_mm [ C_AXIS ] ;
# endif
# endif
delta_mm [ E_AXIS ] = esteps_float * steps_to_mm [ E_AXIS_N ] ;
delta_mm [ E_AXIS ] = esteps_float * steps_to_mm [ E_AXIS_N ( extruder ) ] ;
if ( block - > steps [ A_AXIS ] < MIN_STEPS_PER_SEGMENT & & block - > steps [ B_AXIS ] < MIN_STEPS_PER_SEGMENT & & block - > steps [ C_AXIS ] < MIN_STEPS_PER_SEGMENT ) {
if ( block - > steps [ A_AXIS ] < MIN_STEPS_PER_SEGMENT & & block - > steps [ B_AXIS ] < MIN_STEPS_PER_SEGMENT & & block - > steps [ C_AXIS ] < MIN_STEPS_PER_SEGMENT ) {
block - > millimeters = ABS ( delta_mm [ E_AXIS ] ) ;
block - > millimeters = ABS ( delta_mm [ E_AXIS ] ) ;
@ -2254,7 +2254,7 @@ bool Planner::_populate_block(block_t * const block, bool split_move,
# endif
# endif
# if ENABLED(LIN_ADVANCE)
# if ENABLED(LIN_ADVANCE)
if ( block - > use_advance_lead ) {
if ( block - > use_advance_lead ) {
block - > advance_speed = ( STEPPER_TIMER_RATE ) / ( extruder_advance_K [ active_extruder ] * block - > e_D_ratio * block - > acceleration * axis_steps_per_mm [ E_AXIS_N ] ) ;
block - > advance_speed = ( STEPPER_TIMER_RATE ) / ( extruder_advance_K [ active_extruder ] * block - > e_D_ratio * block - > acceleration * axis_steps_per_mm [ E_AXIS_N ( extruder ) ] ) ;
# if ENABLED(LA_DEBUG)
# if ENABLED(LA_DEBUG)
if ( extruder_advance_K [ active_extruder ] * block - > e_D_ratio * block - > acceleration * 2 < SQRT ( block - > nominal_speed_sqr ) * block - > e_D_ratio )
if ( extruder_advance_K [ active_extruder ] * block - > e_D_ratio * block - > acceleration * 2 < SQRT ( block - > nominal_speed_sqr ) * block - > e_D_ratio )
SERIAL_ECHOLNPGM ( " More than 2 steps per eISR loop executed. " ) ;
SERIAL_ECHOLNPGM ( " More than 2 steps per eISR loop executed. " ) ;
@ -2566,8 +2566,8 @@ bool Planner::buffer_segment(const float &a, const float &b, const float &c, con
// When changing extruders recalculate steps corresponding to the E position
// When changing extruders recalculate steps corresponding to the E position
# if ENABLED(DISTINCT_E_FACTORS)
# if ENABLED(DISTINCT_E_FACTORS)
if ( last_extruder ! = extruder & & axis_steps_per_mm [ E_AXIS_N ] ! = axis_steps_per_mm [ E_AXIS + last_extruder ] ) {
if ( last_extruder ! = extruder & & axis_steps_per_mm [ E_AXIS_N ( extruder ) ] ! = axis_steps_per_mm [ E_AXIS + last_extruder ] ) {
position [ E_AXIS ] = LROUND ( position [ E_AXIS ] * axis_steps_per_mm [ E_AXIS_N ] * steps_to_mm [ E_AXIS + last_extruder ] ) ;
position [ E_AXIS ] = LROUND ( position [ E_AXIS ] * axis_steps_per_mm [ E_AXIS_N ( extruder ) ] * steps_to_mm [ E_AXIS + last_extruder ] ) ;
last_extruder = extruder ;
last_extruder = extruder ;
}
}
# endif
# endif
@ -2578,7 +2578,7 @@ bool Planner::buffer_segment(const float &a, const float &b, const float &c, con
LROUND ( a * axis_steps_per_mm [ A_AXIS ] ) ,
LROUND ( a * axis_steps_per_mm [ A_AXIS ] ) ,
LROUND ( b * axis_steps_per_mm [ B_AXIS ] ) ,
LROUND ( b * axis_steps_per_mm [ B_AXIS ] ) ,
LROUND ( c * axis_steps_per_mm [ C_AXIS ] ) ,
LROUND ( c * axis_steps_per_mm [ C_AXIS ] ) ,
LROUND ( e * axis_steps_per_mm [ E_AXIS_N ] )
LROUND ( e * axis_steps_per_mm [ E_AXIS_N ( extruder ) ] )
} ;
} ;
# if HAS_POSITION_FLOAT
# if HAS_POSITION_FLOAT