Move Volumetric methods to Planner
This commit is contained in:
@@ -105,6 +105,10 @@ float Planner::max_feedrate_mm_s[XYZE_N], // Max speeds in mm per second
|
||||
|
||||
int16_t Planner::flow_percentage[EXTRUDERS] = ARRAY_BY_EXTRUDERS1(100); // Extrusion factor for each extruder
|
||||
|
||||
// Initialized by settings.load()
|
||||
float Planner::filament_size[EXTRUDERS], // As a baseline for the multiplier, filament diameter
|
||||
Planner::volumetric_multiplier[EXTRUDERS]; // May be auto-adjusted by a filament width sensor
|
||||
|
||||
uint32_t Planner::max_acceleration_steps_per_s2[XYZE_N],
|
||||
Planner::max_acceleration_mm_per_s2[XYZE_N]; // Use M201 to override by software
|
||||
|
||||
@@ -539,6 +543,16 @@ void Planner::check_axes_activity() {
|
||||
#endif
|
||||
}
|
||||
|
||||
inline float calculate_volumetric_multiplier(const float &diameter) {
|
||||
if (!parser.volumetric_enabled || diameter == 0) return 1.0;
|
||||
return 1.0 / CIRCLE_AREA(diameter * 0.5);
|
||||
}
|
||||
|
||||
void Planner::calculate_volumetric_multipliers() {
|
||||
for (uint8_t i = 0; i < COUNT(filament_size); i++)
|
||||
volumetric_multiplier[i] = calculate_volumetric_multiplier(filament_size[i]);
|
||||
}
|
||||
|
||||
#if PLANNER_LEVELING
|
||||
/**
|
||||
* lx, ly, lz - logical (cartesian, not delta) positions in mm
|
||||
|
Reference in New Issue
Block a user