|
@@ -740,24 +740,29 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
|
740
|
740
|
|
741
|
741
|
long de = target[E_AXIS] - position[E_AXIS];
|
742
|
742
|
|
|
743
|
+ const float e_factor = volumetric_multiplier[extruder] * flow_percentage[extruder] * 0.01;
|
|
744
|
+
|
743
|
745
|
#if ENABLED(LIN_ADVANCE)
|
744
|
|
- float de_float = e - position_float[E_AXIS];
|
|
746
|
+ float de_float = e - position_float[E_AXIS]; // Should this include e_factor?
|
745
|
747
|
#endif
|
746
|
748
|
|
747
|
|
- #if ENABLED(PREVENT_COLD_EXTRUSION)
|
|
749
|
+ #if ENABLED(PREVENT_COLD_EXTRUSION) || ENABLED(PREVENT_LENGTHY_EXTRUDE)
|
748
|
750
|
if (de) {
|
749
|
|
- if (thermalManager.tooColdToExtrude(extruder)) {
|
750
|
|
- position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part
|
751
|
|
- de = 0; // no difference
|
752
|
|
- #if ENABLED(LIN_ADVANCE)
|
753
|
|
- position_float[E_AXIS] = e;
|
754
|
|
- de_float = 0;
|
755
|
|
- #endif
|
756
|
|
- SERIAL_ECHO_START();
|
757
|
|
- SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP);
|
758
|
|
- }
|
|
751
|
+ #if ENABLED(PREVENT_COLD_EXTRUSION)
|
|
752
|
+ if (thermalManager.tooColdToExtrude(extruder)) {
|
|
753
|
+ position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part
|
|
754
|
+ de = 0; // no difference
|
|
755
|
+ #if ENABLED(LIN_ADVANCE)
|
|
756
|
+ position_float[E_AXIS] = e;
|
|
757
|
+ de_float = 0;
|
|
758
|
+ #endif
|
|
759
|
+ SERIAL_ECHO_START();
|
|
760
|
+ SERIAL_ECHOLNPGM(MSG_ERR_COLD_EXTRUDE_STOP);
|
|
761
|
+ }
|
|
762
|
+ #endif // PREVENT_COLD_EXTRUSION
|
759
|
763
|
#if ENABLED(PREVENT_LENGTHY_EXTRUDE)
|
760
|
|
- if (labs(de) > (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
|
|
764
|
+ const int32_t de_mm = labs(de * e_factor);
|
|
765
|
+ if (de_mm > (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
|
761
|
766
|
position[E_AXIS] = target[E_AXIS]; // Behave as if the move really took place, but ignore E part
|
762
|
767
|
de = 0; // no difference
|
763
|
768
|
#if ENABLED(LIN_ADVANCE)
|
|
@@ -767,9 +772,9 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
|
767
|
772
|
SERIAL_ECHO_START();
|
768
|
773
|
SERIAL_ECHOLNPGM(MSG_ERR_LONG_EXTRUDE_STOP);
|
769
|
774
|
}
|
770
|
|
- #endif
|
|
775
|
+ #endif // PREVENT_LENGTHY_EXTRUDE
|
771
|
776
|
}
|
772
|
|
- #endif
|
|
777
|
+ #endif // PREVENT_COLD_EXTRUSION || PREVENT_LENGTHY_EXTRUDE
|
773
|
778
|
|
774
|
779
|
// Compute direction bit-mask for this block
|
775
|
780
|
uint8_t dm = 0;
|
|
@@ -798,7 +803,7 @@ void Planner::_buffer_line(const float &a, const float &b, const float &c, const
|
798
|
803
|
#endif
|
799
|
804
|
if (de < 0) SBI(dm, E_AXIS);
|
800
|
805
|
|
801
|
|
- const float esteps_float = de * volumetric_multiplier[extruder] * flow_percentage[extruder] * 0.01;
|
|
806
|
+ const float esteps_float = de * e_factor;
|
802
|
807
|
const int32_t esteps = abs(esteps_float) + 0.5;
|
803
|
808
|
|
804
|
809
|
// Calculate the buffer head after we push this byte
|