Pārlūkot izejas kodu

Display filwidth ratio in terms of E mm

Scott Lahteine 7 gadus atpakaļ
vecāks
revīzija
60adc6ff02

+ 1
- 0
Marlin/src/gcode/feature/filwidth/M404-M407.cpp Parādīt failu

36
 void GcodeSuite::M404() {
36
 void GcodeSuite::M404() {
37
   if (parser.seen('W')) {
37
   if (parser.seen('W')) {
38
     filament_width_nominal = parser.value_linear_units();
38
     filament_width_nominal = parser.value_linear_units();
39
+    planner.volumetric_area_nominal = CIRCLE_AREA(filament_width_nominal * 0.5);
39
   }
40
   }
40
   else {
41
   else {
41
     SERIAL_PROTOCOLPGM("Filament dia (nominal mm):");
42
     SERIAL_PROTOCOLPGM("Filament dia (nominal mm):");

+ 1
- 4
Marlin/src/lcd/ultralcd_impl_DOGM.h Parādīt failu

655
     #if ENABLED(FILAMENT_LCD_DISPLAY)
655
     #if ENABLED(FILAMENT_LCD_DISPLAY)
656
       strcpy(wstring, ftostr12ns(filament_width_meas));
656
       strcpy(wstring, ftostr12ns(filament_width_meas));
657
       if (parser.volumetric_enabled)
657
       if (parser.volumetric_enabled)
658
-        strcpy(mstring, itostr3(100.0 * filament_width_meas / filament_width_nominal));
658
+        strcpy(mstring, itostr3(100.0 * planner.volumetric_area_nominal / planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]));
659
       else
659
       else
660
         strcpy_P(mstring, PSTR("---"));
660
         strcpy_P(mstring, PSTR("---"));
661
-      // Alternatively, show the ratio between cross-sectional areas:
662
-      //strcpy(mstring, itostr3(100.0 / CIRCLE_AREA(filament_width_nominal * 0.5)
663
-      //                              / planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]));
664
     #endif
661
     #endif
665
   }
662
   }
666
 
663
 

+ 1
- 1
Marlin/src/lcd/ultralcd_impl_HD44780.h Parādīt failu

861
       lcd.print(ftostr12ns(filament_width_meas));
861
       lcd.print(ftostr12ns(filament_width_meas));
862
       lcd_printPGM(PSTR(" V"));
862
       lcd_printPGM(PSTR(" V"));
863
       if (parser.volumetric_enabled) {
863
       if (parser.volumetric_enabled) {
864
-        lcd.print(itostr3(100.0 * filament_width_meas / filament_width_nominal));
864
+        lcd.print(itostr3(100.0 * planner.volumetric_area_nominal / planner.volumetric_multiplier[FILAMENT_SENSOR_EXTRUDER_NUM]));
865
         lcd.write('%');
865
         lcd.write('%');
866
       }
866
       }
867
       else
867
       else

+ 1
- 0
Marlin/src/module/planner.cpp Parādīt failu

108
 // Initialized by settings.load()
108
 // Initialized by settings.load()
109
 float Planner::e_factor[EXTRUDERS],              // The flow percentage and volumetric multiplier combine to scale E movement
109
 float Planner::e_factor[EXTRUDERS],              // The flow percentage and volumetric multiplier combine to scale E movement
110
       Planner::filament_size[EXTRUDERS],         // As a baseline for the multiplier, filament diameter
110
       Planner::filament_size[EXTRUDERS],         // As a baseline for the multiplier, filament diameter
111
+      Planner::volumetric_area_nominal = CIRCLE_AREA((DEFAULT_NOMINAL_FILAMENT_DIA) * 0.5), // Nominal cross-sectional area
111
       Planner::volumetric_multiplier[EXTRUDERS]; // May be auto-adjusted by a filament width sensor
112
       Planner::volumetric_multiplier[EXTRUDERS]; // May be auto-adjusted by a filament width sensor
112
 
113
 
113
 uint32_t Planner::max_acceleration_steps_per_s2[XYZE_N],
114
 uint32_t Planner::max_acceleration_steps_per_s2[XYZE_N],

+ 1
- 0
Marlin/src/module/planner.h Parādīt failu

148
 
148
 
149
     static float e_factor[EXTRUDERS],               // The flow percentage and volumetric multiplier combine to scale E movement
149
     static float e_factor[EXTRUDERS],               // The flow percentage and volumetric multiplier combine to scale E movement
150
                  filament_size[EXTRUDERS],          // diameter of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder
150
                  filament_size[EXTRUDERS],          // diameter of filament (in millimeters), typically around 1.75 or 2.85, 0 disables the volumetric calculations for the extruder
151
+                 volumetric_area_nominal,           // Nominal cross-sectional area
151
                  volumetric_multiplier[EXTRUDERS];  // Reciprocal of cross-sectional area of filament (in mm^2). Pre-calculated to reduce computation in the planner
152
                  volumetric_multiplier[EXTRUDERS];  // Reciprocal of cross-sectional area of filament (in mm^2). Pre-calculated to reduce computation in the planner
152
                                                     // May be auto-adjusted by a filament width sensor
153
                                                     // May be auto-adjusted by a filament width sensor
153
 
154
 

Notiek ielāde…
Atcelt
Saglabāt