Browse Source

PID_EXTRUSION_SCALING, disabled by default

Scott Lahteine 7 years ago
parent
commit
63fd1f49a6

+ 2
- 2
Marlin/Configuration_adv.h View File

@@ -113,8 +113,8 @@
113 113
 #if ENABLED(PIDTEMP)
114 114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
115 115
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
116
-  #define PID_ADD_EXTRUSION_RATE
117
-  #if ENABLED(PID_ADD_EXTRUSION_RATE)
116
+  //#define PID_EXTRUSION_SCALING
117
+  #if ENABLED(PID_EXTRUSION_SCALING)
118 118
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
119 119
     #define LPQ_MAX_LEN 50
120 120
   #endif

+ 1
- 1
Marlin/Marlin.h View File

@@ -352,7 +352,7 @@ float code_value_temp_diff();
352 352
   extern FilamentChangeMenuResponse filament_change_menu_response;
353 353
 #endif
354 354
 
355
-#if ENABLED(PID_ADD_EXTRUSION_RATE)
355
+#if ENABLED(PID_EXTRUSION_SCALING)
356 356
   extern int lpq_len;
357 357
 #endif
358 358
 

+ 4
- 4
Marlin/Marlin_main.cpp View File

@@ -531,7 +531,7 @@ static bool send_ok[BUFSIZE];
531 531
   boolean chdkActive = false;
532 532
 #endif
533 533
 
534
-#if ENABLED(PID_ADD_EXTRUSION_RATE)
534
+#if ENABLED(PID_EXTRUSION_SCALING)
535 535
   int lpq_len = 20;
536 536
 #endif
537 537
 
@@ -5667,7 +5667,7 @@ inline void gcode_M226() {
5667 5667
    *   I[float] Ki term (unscaled)
5668 5668
    *   D[float] Kd term (unscaled)
5669 5669
    *
5670
-   * With PID_ADD_EXTRUSION_RATE:
5670
+   * With PID_EXTRUSION_SCALING:
5671 5671
    *
5672 5672
    *   C[float] Kc term
5673 5673
    *   L[float] LPQ length
@@ -5682,7 +5682,7 @@ inline void gcode_M226() {
5682 5682
       if (code_seen('P')) PID_PARAM(Kp, e) = code_value_float();
5683 5683
       if (code_seen('I')) PID_PARAM(Ki, e) = scalePID_i(code_value_float());
5684 5684
       if (code_seen('D')) PID_PARAM(Kd, e) = scalePID_d(code_value_float());
5685
-      #if ENABLED(PID_ADD_EXTRUSION_RATE)
5685
+      #if ENABLED(PID_EXTRUSION_SCALING)
5686 5686
         if (code_seen('C')) PID_PARAM(Kc, e) = code_value_float();
5687 5687
         if (code_seen('L')) lpq_len = code_value_float();
5688 5688
         NOMORE(lpq_len, LPQ_MAX_LEN);
@@ -5700,7 +5700,7 @@ inline void gcode_M226() {
5700 5700
       SERIAL_ECHO(unscalePID_i(PID_PARAM(Ki, e)));
5701 5701
       SERIAL_ECHOPGM(" d:");
5702 5702
       SERIAL_ECHO(unscalePID_d(PID_PARAM(Kd, e)));
5703
-      #if ENABLED(PID_ADD_EXTRUSION_RATE)
5703
+      #if ENABLED(PID_EXTRUSION_SCALING)
5704 5704
         SERIAL_ECHOPGM(" c:");
5705 5705
         //Kc does not have scaling applied above, or in resetting defaults
5706 5706
         SERIAL_ECHO(PID_PARAM(Kc, e));

+ 2
- 0
Marlin/SanityCheck.h View File

@@ -730,4 +730,6 @@
730 730
   #error "HOMING_FEEDRATE is deprecated. Set individual rates with HOMING_FEEDRATE_(XY|Z|E) instead."
731 731
 #elif defined(MANUAL_HOME_POSITIONS)
732 732
   #error "MANUAL_HOME_POSITIONS is deprecated. Set MANUAL_[XYZ]_HOME_POS as-needed instead."
733
+#elif defined(PID_ADD_EXTRUSION_RATE)
734
+  #error "PID_ADD_EXTRUSION_RATE is now PID_EXTRUSION_SCALING and is DISABLED by default. Are you sure you want to use this option? Please update your configuration."
733 735
 #endif

+ 8
- 8
Marlin/configuration_store.cpp View File

@@ -290,7 +290,7 @@ void Config_StoreSettings()  {
290 290
         EEPROM_WRITE(PID_PARAM(Kp, e));
291 291
         EEPROM_WRITE(PID_PARAM(Ki, e));
292 292
         EEPROM_WRITE(PID_PARAM(Kd, e));
293
-        #if ENABLED(PID_ADD_EXTRUSION_RATE)
293
+        #if ENABLED(PID_EXTRUSION_SCALING)
294 294
           EEPROM_WRITE(PID_PARAM(Kc, e));
295 295
         #else
296 296
           dummy = 1.0f; // 1.0 = default kc
@@ -308,7 +308,7 @@ void Config_StoreSettings()  {
308 308
 
309 309
   } // Hotends Loop
310 310
 
311
-  #if DISABLED(PID_ADD_EXTRUSION_RATE)
311
+  #if DISABLED(PID_EXTRUSION_SCALING)
312 312
     int lpq_len = 20;
313 313
   #endif
314 314
   EEPROM_WRITE(lpq_len);
@@ -481,7 +481,7 @@ void Config_RetrieveSettings() {
481 481
           PID_PARAM(Kp, e) = dummy;
482 482
           EEPROM_READ(PID_PARAM(Ki, e));
483 483
           EEPROM_READ(PID_PARAM(Kd, e));
484
-          #if ENABLED(PID_ADD_EXTRUSION_RATE)
484
+          #if ENABLED(PID_EXTRUSION_SCALING)
485 485
             EEPROM_READ(PID_PARAM(Kc, e));
486 486
           #else
487 487
             EEPROM_READ(dummy);
@@ -496,7 +496,7 @@ void Config_RetrieveSettings() {
496 496
       for (uint8_t q = MAX_EXTRUDERS * 4; q--;) EEPROM_READ(dummy);  // Kp, Ki, Kd, Kc
497 497
     #endif // !PIDTEMP
498 498
 
499
-    #if DISABLED(PID_ADD_EXTRUSION_RATE)
499
+    #if DISABLED(PID_EXTRUSION_SCALING)
500 500
       int lpq_len;
501 501
     #endif
502 502
     EEPROM_READ(lpq_len);
@@ -641,11 +641,11 @@ void Config_ResetDefault() {
641 641
       PID_PARAM(Kp, e) = DEFAULT_Kp;
642 642
       PID_PARAM(Ki, e) = scalePID_i(DEFAULT_Ki);
643 643
       PID_PARAM(Kd, e) = scalePID_d(DEFAULT_Kd);
644
-      #if ENABLED(PID_ADD_EXTRUSION_RATE)
644
+      #if ENABLED(PID_EXTRUSION_SCALING)
645 645
         PID_PARAM(Kc, e) = DEFAULT_Kc;
646 646
       #endif
647 647
     }
648
-    #if ENABLED(PID_ADD_EXTRUSION_RATE)
648
+    #if ENABLED(PID_EXTRUSION_SCALING)
649 649
       lpq_len = 20; // default last-position-queue size
650 650
     #endif
651 651
   #endif // PIDTEMP
@@ -863,7 +863,7 @@ void Config_PrintSettings(bool forReplay) {
863 863
             SERIAL_ECHOPAIR(" P", PID_PARAM(Kp, e));
864 864
             SERIAL_ECHOPAIR(" I", unscalePID_i(PID_PARAM(Ki, e)));
865 865
             SERIAL_ECHOPAIR(" D", unscalePID_d(PID_PARAM(Kd, e)));
866
-            #if ENABLED(PID_ADD_EXTRUSION_RATE)
866
+            #if ENABLED(PID_EXTRUSION_SCALING)
867 867
               SERIAL_ECHOPAIR(" C", PID_PARAM(Kc, e));
868 868
               if (e == 0) SERIAL_ECHOPAIR(" L", lpq_len);
869 869
             #endif
@@ -878,7 +878,7 @@ void Config_PrintSettings(bool forReplay) {
878 878
         SERIAL_ECHOPAIR("  M301 P", PID_PARAM(Kp, 0)); // for compatibility with hosts, only echo values for E0
879 879
         SERIAL_ECHOPAIR(" I", unscalePID_i(PID_PARAM(Ki, 0)));
880 880
         SERIAL_ECHOPAIR(" D", unscalePID_d(PID_PARAM(Kd, 0)));
881
-        #if ENABLED(PID_ADD_EXTRUSION_RATE)
881
+        #if ENABLED(PID_EXTRUSION_SCALING)
882 882
           SERIAL_ECHOPAIR(" C", PID_PARAM(Kc, 0));
883 883
           SERIAL_ECHOPAIR(" L", lpq_len);
884 884
         #endif

+ 2
- 2
Marlin/example_configurations/Cartesio/Configuration_adv.h View File

@@ -113,8 +113,8 @@
113 113
 #if ENABLED(PIDTEMP)
114 114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
115 115
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
116
-  #define PID_ADD_EXTRUSION_RATE
117
-  #if ENABLED(PID_ADD_EXTRUSION_RATE)
116
+  //#define PID_EXTRUSION_SCALING
117
+  #if ENABLED(PID_EXTRUSION_SCALING)
118 118
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
119 119
     #define LPQ_MAX_LEN 50
120 120
   #endif

+ 2
- 2
Marlin/example_configurations/Felix/Configuration_adv.h View File

@@ -113,8 +113,8 @@
113 113
 #if ENABLED(PIDTEMP)
114 114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
115 115
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
116
-  #define PID_ADD_EXTRUSION_RATE
117
-  #if ENABLED(PID_ADD_EXTRUSION_RATE)
116
+  //#define PID_EXTRUSION_SCALING
117
+  #if ENABLED(PID_EXTRUSION_SCALING)
118 118
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
119 119
     #define LPQ_MAX_LEN 50
120 120
   #endif

+ 2
- 2
Marlin/example_configurations/Hephestos/Configuration_adv.h View File

@@ -113,8 +113,8 @@
113 113
 #if ENABLED(PIDTEMP)
114 114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
115 115
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
116
-  #define PID_ADD_EXTRUSION_RATE
117
-  #if ENABLED(PID_ADD_EXTRUSION_RATE)
116
+  //#define PID_EXTRUSION_SCALING
117
+  #if ENABLED(PID_EXTRUSION_SCALING)
118 118
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
119 119
     #define LPQ_MAX_LEN 50
120 120
   #endif

+ 2
- 2
Marlin/example_configurations/Hephestos_2/Configuration_adv.h View File

@@ -113,8 +113,8 @@
113 113
 #if ENABLED(PIDTEMP)
114 114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
115 115
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
116
-  #define PID_ADD_EXTRUSION_RATE
117
-  #if ENABLED(PID_ADD_EXTRUSION_RATE)
116
+  //#define PID_EXTRUSION_SCALING
117
+  #if ENABLED(PID_EXTRUSION_SCALING)
118 118
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
119 119
     #define LPQ_MAX_LEN 50
120 120
   #endif

+ 2
- 2
Marlin/example_configurations/K8200/Configuration_adv.h View File

@@ -119,8 +119,8 @@
119 119
 #if ENABLED(PIDTEMP)
120 120
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
121 121
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
122
-  #define PID_ADD_EXTRUSION_RATE
123
-  #if ENABLED(PID_ADD_EXTRUSION_RATE)
122
+  //#define PID_EXTRUSION_SCALING
123
+  #if ENABLED(PID_EXTRUSION_SCALING)
124 124
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
125 125
     #define LPQ_MAX_LEN 50
126 126
   #endif

+ 2
- 2
Marlin/example_configurations/K8400/Configuration_adv.h View File

@@ -113,8 +113,8 @@
113 113
 #if ENABLED(PIDTEMP)
114 114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
115 115
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
116
-  #define PID_ADD_EXTRUSION_RATE
117
-  #if ENABLED(PID_ADD_EXTRUSION_RATE)
116
+  //#define PID_EXTRUSION_SCALING
117
+  #if ENABLED(PID_EXTRUSION_SCALING)
118 118
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
119 119
     #define LPQ_MAX_LEN 50
120 120
   #endif

+ 2
- 2
Marlin/example_configurations/RigidBot/Configuration_adv.h View File

@@ -113,8 +113,8 @@
113 113
 #if ENABLED(PIDTEMP)
114 114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
115 115
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
116
-  #define PID_ADD_EXTRUSION_RATE
117
-  #if ENABLED(PID_ADD_EXTRUSION_RATE)
116
+  //#define PID_EXTRUSION_SCALING
117
+  #if ENABLED(PID_EXTRUSION_SCALING)
118 118
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
119 119
     #define LPQ_MAX_LEN 50
120 120
   #endif

+ 2
- 2
Marlin/example_configurations/SCARA/Configuration_adv.h View File

@@ -113,8 +113,8 @@
113 113
 #if ENABLED(PIDTEMP)
114 114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
115 115
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
116
-  #define PID_ADD_EXTRUSION_RATE
117
-  #if ENABLED(PID_ADD_EXTRUSION_RATE)
116
+  //#define PID_EXTRUSION_SCALING
117
+  #if ENABLED(PID_EXTRUSION_SCALING)
118 118
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
119 119
     #define LPQ_MAX_LEN 50
120 120
   #endif

+ 2
- 2
Marlin/example_configurations/TAZ4/Configuration_adv.h View File

@@ -113,8 +113,8 @@
113 113
 #if ENABLED(PIDTEMP)
114 114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
115 115
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
116
-  #define PID_ADD_EXTRUSION_RATE
117
-  #if ENABLED(PID_ADD_EXTRUSION_RATE)
116
+  //#define PID_EXTRUSION_SCALING
117
+  #if ENABLED(PID_EXTRUSION_SCALING)
118 118
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
119 119
     #define LPQ_MAX_LEN 50
120 120
   #endif

+ 2
- 2
Marlin/example_configurations/WITBOX/Configuration_adv.h View File

@@ -113,8 +113,8 @@
113 113
 #if ENABLED(PIDTEMP)
114 114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
115 115
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
116
-  #define PID_ADD_EXTRUSION_RATE
117
-  #if ENABLED(PID_ADD_EXTRUSION_RATE)
116
+  //#define PID_EXTRUSION_SCALING
117
+  #if ENABLED(PID_EXTRUSION_SCALING)
118 118
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
119 119
     #define LPQ_MAX_LEN 50
120 120
   #endif

+ 2
- 2
Marlin/example_configurations/delta/biv2.5/Configuration_adv.h View File

@@ -113,8 +113,8 @@
113 113
 #if ENABLED(PIDTEMP)
114 114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
115 115
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
116
-  #define PID_ADD_EXTRUSION_RATE
117
-  #if ENABLED(PID_ADD_EXTRUSION_RATE)
116
+  //#define PID_EXTRUSION_SCALING
117
+  #if ENABLED(PID_EXTRUSION_SCALING)
118 118
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
119 119
     #define LPQ_MAX_LEN 50
120 120
   #endif

+ 2
- 2
Marlin/example_configurations/delta/generic/Configuration_adv.h View File

@@ -113,8 +113,8 @@
113 113
 #if ENABLED(PIDTEMP)
114 114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
115 115
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
116
-  #define PID_ADD_EXTRUSION_RATE
117
-  #if ENABLED(PID_ADD_EXTRUSION_RATE)
116
+  //#define PID_EXTRUSION_SCALING
117
+  #if ENABLED(PID_EXTRUSION_SCALING)
118 118
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
119 119
     #define LPQ_MAX_LEN 50
120 120
   #endif

+ 2
- 2
Marlin/example_configurations/delta/kossel_mini/Configuration_adv.h View File

@@ -113,8 +113,8 @@
113 113
 #if ENABLED(PIDTEMP)
114 114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
115 115
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
116
-  #define PID_ADD_EXTRUSION_RATE
117
-  #if ENABLED(PID_ADD_EXTRUSION_RATE)
116
+  //#define PID_EXTRUSION_SCALING
117
+  #if ENABLED(PID_EXTRUSION_SCALING)
118 118
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
119 119
     #define LPQ_MAX_LEN 50
120 120
   #endif

+ 2
- 2
Marlin/example_configurations/delta/kossel_pro/Configuration_adv.h View File

@@ -118,8 +118,8 @@
118 118
 #if ENABLED(PIDTEMP)
119 119
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
120 120
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
121
-  #define PID_ADD_EXTRUSION_RATE
122
-  #if ENABLED(PID_ADD_EXTRUSION_RATE)
121
+  //#define PID_EXTRUSION_SCALING
122
+  #if ENABLED(PID_EXTRUSION_SCALING)
123 123
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
124 124
     #define LPQ_MAX_LEN 50
125 125
   #endif

+ 2
- 2
Marlin/example_configurations/delta/kossel_xl/Configuration_adv.h View File

@@ -113,8 +113,8 @@
113 113
 #if ENABLED(PIDTEMP)
114 114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
115 115
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
116
-  #define PID_ADD_EXTRUSION_RATE
117
-  #if ENABLED(PID_ADD_EXTRUSION_RATE)
116
+  //#define PID_EXTRUSION_SCALING
117
+  #if ENABLED(PID_EXTRUSION_SCALING)
118 118
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
119 119
     #define LPQ_MAX_LEN 50
120 120
   #endif

+ 2
- 2
Marlin/example_configurations/makibox/Configuration_adv.h View File

@@ -113,8 +113,8 @@
113 113
 #if ENABLED(PIDTEMP)
114 114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
115 115
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
116
-  #define PID_ADD_EXTRUSION_RATE
117
-  #if ENABLED(PID_ADD_EXTRUSION_RATE)
116
+  //#define PID_EXTRUSION_SCALING
117
+  #if ENABLED(PID_EXTRUSION_SCALING)
118 118
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
119 119
     #define LPQ_MAX_LEN 50
120 120
   #endif

+ 2
- 2
Marlin/example_configurations/tvrrug/Round2/Configuration_adv.h View File

@@ -113,8 +113,8 @@
113 113
 #if ENABLED(PIDTEMP)
114 114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
115 115
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
116
-  #define PID_ADD_EXTRUSION_RATE
117
-  #if ENABLED(PID_ADD_EXTRUSION_RATE)
116
+  //#define PID_EXTRUSION_SCALING
117
+  #if ENABLED(PID_EXTRUSION_SCALING)
118 118
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
119 119
     #define LPQ_MAX_LEN 50
120 120
   #endif

+ 9
- 9
Marlin/temperature.cpp View File

@@ -72,14 +72,14 @@ unsigned char Temperature::soft_pwm_bed;
72 72
     float Temperature::Kp[HOTENDS] = ARRAY_BY_HOTENDS1(DEFAULT_Kp),
73 73
           Temperature::Ki[HOTENDS] = ARRAY_BY_HOTENDS1((DEFAULT_Ki) * (PID_dT)),
74 74
           Temperature::Kd[HOTENDS] = ARRAY_BY_HOTENDS1((DEFAULT_Kd) / (PID_dT));
75
-    #if ENABLED(PID_ADD_EXTRUSION_RATE)
75
+    #if ENABLED(PID_EXTRUSION_SCALING)
76 76
       float Temperature::Kc[HOTENDS] = ARRAY_BY_HOTENDS1(DEFAULT_Kc);
77 77
     #endif
78 78
   #else
79 79
     float Temperature::Kp = DEFAULT_Kp,
80 80
           Temperature::Ki = (DEFAULT_Ki) * (PID_dT),
81 81
           Temperature::Kd = (DEFAULT_Kd) / (PID_dT);
82
-    #if ENABLED(PID_ADD_EXTRUSION_RATE)
82
+    #if ENABLED(PID_EXTRUSION_SCALING)
83 83
       float Temperature::Kc = DEFAULT_Kc;
84 84
     #endif
85 85
   #endif
@@ -126,7 +126,7 @@ volatile bool Temperature::temp_meas_ready = false;
126 126
         Temperature::iTerm[HOTENDS],
127 127
         Temperature::dTerm[HOTENDS];
128 128
 
129
-  #if ENABLED(PID_ADD_EXTRUSION_RATE)
129
+  #if ENABLED(PID_EXTRUSION_SCALING)
130 130
     float Temperature::cTerm[HOTENDS];
131 131
     long Temperature::last_e_position;
132 132
     long Temperature::lpq[LPQ_MAX_LEN];
@@ -444,7 +444,7 @@ Temperature::Temperature() { }
444 444
 
445 445
 void Temperature::updatePID() {
446 446
   #if ENABLED(PIDTEMP)
447
-    #if ENABLED(PID_ADD_EXTRUSION_RATE)
447
+    #if ENABLED(PID_EXTRUSION_SCALING)
448 448
       last_e_position = 0;
449 449
     #endif
450 450
     HOTEND_LOOP() {
@@ -560,7 +560,7 @@ float Temperature::get_pid_output(int e) {
560 560
 
561 561
         pid_output = pTerm[HOTEND_INDEX] + iTerm[HOTEND_INDEX] - dTerm[HOTEND_INDEX];
562 562
 
563
-        #if ENABLED(PID_ADD_EXTRUSION_RATE)
563
+        #if ENABLED(PID_EXTRUSION_SCALING)
564 564
           cTerm[HOTEND_INDEX] = 0;
565 565
           if (_HOTEND_TEST) {
566 566
             long e_position = stepper.position(E_AXIS);
@@ -575,7 +575,7 @@ float Temperature::get_pid_output(int e) {
575 575
             cTerm[HOTEND_INDEX] = (lpq[lpq_ptr] * planner.steps_to_mm[E_AXIS]) * PID_PARAM(Kc, HOTEND_INDEX);
576 576
             pid_output += cTerm[HOTEND_INDEX];
577 577
           }
578
-        #endif //PID_ADD_EXTRUSION_RATE
578
+        #endif // PID_EXTRUSION_SCALING
579 579
 
580 580
         if (pid_output > PID_MAX) {
581 581
           if (pid_error[HOTEND_INDEX] > 0) temp_iState[HOTEND_INDEX] -= pid_error[HOTEND_INDEX]; // conditional un-integration
@@ -598,7 +598,7 @@ float Temperature::get_pid_output(int e) {
598 598
       SERIAL_ECHOPAIR(MSG_PID_DEBUG_PTERM, pTerm[HOTEND_INDEX]);
599 599
       SERIAL_ECHOPAIR(MSG_PID_DEBUG_ITERM, iTerm[HOTEND_INDEX]);
600 600
       SERIAL_ECHOPAIR(MSG_PID_DEBUG_DTERM, dTerm[HOTEND_INDEX]);
601
-      #if ENABLED(PID_ADD_EXTRUSION_RATE)
601
+      #if ENABLED(PID_EXTRUSION_SCALING)
602 602
         SERIAL_ECHOPAIR(MSG_PID_DEBUG_CTERM, cTerm[HOTEND_INDEX]);
603 603
       #endif
604 604
       SERIAL_EOL;
@@ -949,7 +949,7 @@ void Temperature::init() {
949 949
     #if ENABLED(PIDTEMP)
950 950
       temp_iState_min[e] = 0.0;
951 951
       temp_iState_max[e] = (PID_INTEGRAL_DRIVE_MAX) / PID_PARAM(Ki, e);
952
-      #if ENABLED(PID_ADD_EXTRUSION_RATE)
952
+      #if ENABLED(PID_EXTRUSION_SCALING)
953 953
         last_e_position = 0;
954 954
       #endif
955 955
     #endif //PIDTEMP
@@ -959,7 +959,7 @@ void Temperature::init() {
959 959
     #endif //PIDTEMPBED
960 960
   }
961 961
 
962
-  #if ENABLED(PIDTEMP) && ENABLED(PID_ADD_EXTRUSION_RATE)
962
+  #if ENABLED(PIDTEMP) && ENABLED(PID_EXTRUSION_SCALING)
963 963
     last_e_position = 0;
964 964
   #endif
965 965
 

+ 4
- 4
Marlin/temperature.h View File

@@ -31,7 +31,7 @@
31 31
 #include "planner.h"
32 32
 #include "thermistortables.h"
33 33
 
34
-#if ENABLED(PID_ADD_EXTRUSION_RATE)
34
+#if ENABLED(PID_EXTRUSION_SCALING)
35 35
   #include "stepper.h"
36 36
 #endif
37 37
 
@@ -79,7 +79,7 @@ class Temperature {
79 79
       #if ENABLED(PID_PARAMS_PER_HOTEND) && HOTENDS > 1
80 80
 
81 81
         static float Kp[HOTENDS], Ki[HOTENDS], Kd[HOTENDS];
82
-        #if ENABLED(PID_ADD_EXTRUSION_RATE)
82
+        #if ENABLED(PID_EXTRUSION_SCALING)
83 83
           static float Kc[HOTENDS];
84 84
         #endif
85 85
         #define PID_PARAM(param, h) Temperature::param[h]
@@ -87,7 +87,7 @@ class Temperature {
87 87
       #else
88 88
 
89 89
         static float Kp, Ki, Kd;
90
-        #if ENABLED(PID_ADD_EXTRUSION_RATE)
90
+        #if ENABLED(PID_EXTRUSION_SCALING)
91 91
           static float Kc;
92 92
         #endif
93 93
         #define PID_PARAM(param, h) Temperature::param
@@ -149,7 +149,7 @@ class Temperature {
149 149
                    iTerm[HOTENDS],
150 150
                    dTerm[HOTENDS];
151 151
 
152
-      #if ENABLED(PID_ADD_EXTRUSION_RATE)
152
+      #if ENABLED(PID_EXTRUSION_SCALING)
153 153
         static float cTerm[HOTENDS];
154 154
         static long last_e_position;
155 155
         static long lpq[LPQ_MAX_LEN];

+ 1
- 1
Marlin/ultralcd.cpp View File

@@ -1684,7 +1684,7 @@ void kill_screen(const char* lcd_msg) {
1684 1684
         MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I ELABEL, &raw_Ki, 0.01, 9990, copy_and_scalePID_i_E ## eindex); \
1685 1685
         MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D ELABEL, &raw_Kd, 1, 9990, copy_and_scalePID_d_E ## eindex)
1686 1686
 
1687
-      #if ENABLED(PID_ADD_EXTRUSION_RATE)
1687
+      #if ENABLED(PID_EXTRUSION_SCALING)
1688 1688
         #define _PID_MENU_ITEMS(ELABEL, eindex) \
1689 1689
           _PID_BASE_MENU_ITEMS(ELABEL, eindex); \
1690 1690
           MENU_ITEM_EDIT(float3, MSG_PID_C ELABEL, &PID_PARAM(Kc, eindex), 1, 9990)

Loading…
Cancel
Save