Add pre-calculated planner.e_factor

This commit is contained in:
Scott Lahteine 2017-11-10 02:38:53 -06:00
parent 24b302c001
commit 3293823642
11 changed files with 110 additions and 85 deletions

View file

@ -140,6 +140,13 @@ class Planner {
static uint8_t last_extruder; // Respond to extruder change
#endif
static int16_t flow_percentage[EXTRUDERS]; // Extrusion factor for each extruder
static float e_factor[EXTRUDERS], // The flow percentage and volumetric multiplier combine to scale E movement
filament_size[EXTRUDERS], // diameter of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder
volumetric_multiplier[EXTRUDERS]; // Reciprocal of cross-sectional area of filament (in mm^2). Pre-calculated to reduce computation in the planner
// May be auto-adjusted by a filament width sensor
static float max_feedrate_mm_s[XYZE_N], // Max speeds in mm per second
axis_steps_per_mm[XYZE_N],
steps_to_mm[XYZE_N];
@ -236,9 +243,15 @@ class Planner {
static void reset_acceleration_rates();
static void refresh_positioning();
FORCE_INLINE static void refresh_e_factor(const uint8_t e) {
e_factor[e] = volumetric_multiplier[e] * flow_percentage[e] * 0.01;
}
// Manage fans, paste pressure, etc.
static void check_axes_activity();
static void calculate_volumetric_multipliers();
/**
* Number of moves currently in the planner
*/