Browse Source

Merge pull request #4486 from thinkyhead/rc_pid_add_extrusion_rate_off

PID_EXTRUSION_SCALING, disabled by default
Scott Lahteine 9 years ago
parent
commit
6eed37aafb

+ 2
- 2
Marlin/Configuration_adv.h View File

113
 #if ENABLED(PIDTEMP)
113
 #if ENABLED(PIDTEMP)
114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
115
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
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
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
118
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
119
     #define LPQ_MAX_LEN 50
119
     #define LPQ_MAX_LEN 50
120
   #endif
120
   #endif

+ 1
- 1
Marlin/Marlin.h View File

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

+ 4
- 4
Marlin/Marlin_main.cpp View File

531
   boolean chdkActive = false;
531
   boolean chdkActive = false;
532
 #endif
532
 #endif
533
 
533
 
534
-#if ENABLED(PID_ADD_EXTRUSION_RATE)
534
+#if ENABLED(PID_EXTRUSION_SCALING)
535
   int lpq_len = 20;
535
   int lpq_len = 20;
536
 #endif
536
 #endif
537
 
537
 
5671
    *   I[float] Ki term (unscaled)
5671
    *   I[float] Ki term (unscaled)
5672
    *   D[float] Kd term (unscaled)
5672
    *   D[float] Kd term (unscaled)
5673
    *
5673
    *
5674
-   * With PID_ADD_EXTRUSION_RATE:
5674
+   * With PID_EXTRUSION_SCALING:
5675
    *
5675
    *
5676
    *   C[float] Kc term
5676
    *   C[float] Kc term
5677
    *   L[float] LPQ length
5677
    *   L[float] LPQ length
5686
       if (code_seen('P')) PID_PARAM(Kp, e) = code_value_float();
5686
       if (code_seen('P')) PID_PARAM(Kp, e) = code_value_float();
5687
       if (code_seen('I')) PID_PARAM(Ki, e) = scalePID_i(code_value_float());
5687
       if (code_seen('I')) PID_PARAM(Ki, e) = scalePID_i(code_value_float());
5688
       if (code_seen('D')) PID_PARAM(Kd, e) = scalePID_d(code_value_float());
5688
       if (code_seen('D')) PID_PARAM(Kd, e) = scalePID_d(code_value_float());
5689
-      #if ENABLED(PID_ADD_EXTRUSION_RATE)
5689
+      #if ENABLED(PID_EXTRUSION_SCALING)
5690
         if (code_seen('C')) PID_PARAM(Kc, e) = code_value_float();
5690
         if (code_seen('C')) PID_PARAM(Kc, e) = code_value_float();
5691
         if (code_seen('L')) lpq_len = code_value_float();
5691
         if (code_seen('L')) lpq_len = code_value_float();
5692
         NOMORE(lpq_len, LPQ_MAX_LEN);
5692
         NOMORE(lpq_len, LPQ_MAX_LEN);
5704
       SERIAL_ECHO(unscalePID_i(PID_PARAM(Ki, e)));
5704
       SERIAL_ECHO(unscalePID_i(PID_PARAM(Ki, e)));
5705
       SERIAL_ECHOPGM(" d:");
5705
       SERIAL_ECHOPGM(" d:");
5706
       SERIAL_ECHO(unscalePID_d(PID_PARAM(Kd, e)));
5706
       SERIAL_ECHO(unscalePID_d(PID_PARAM(Kd, e)));
5707
-      #if ENABLED(PID_ADD_EXTRUSION_RATE)
5707
+      #if ENABLED(PID_EXTRUSION_SCALING)
5708
         SERIAL_ECHOPGM(" c:");
5708
         SERIAL_ECHOPGM(" c:");
5709
         //Kc does not have scaling applied above, or in resetting defaults
5709
         //Kc does not have scaling applied above, or in resetting defaults
5710
         SERIAL_ECHO(PID_PARAM(Kc, e));
5710
         SERIAL_ECHO(PID_PARAM(Kc, e));

+ 2
- 0
Marlin/SanityCheck.h View File

730
   #error "HOMING_FEEDRATE is deprecated. Set individual rates with HOMING_FEEDRATE_(XY|Z|E) instead."
730
   #error "HOMING_FEEDRATE is deprecated. Set individual rates with HOMING_FEEDRATE_(XY|Z|E) instead."
731
 #elif defined(MANUAL_HOME_POSITIONS)
731
 #elif defined(MANUAL_HOME_POSITIONS)
732
   #error "MANUAL_HOME_POSITIONS is deprecated. Set MANUAL_[XYZ]_HOME_POS as-needed instead."
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
 #endif
735
 #endif

+ 8
- 8
Marlin/configuration_store.cpp View File

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

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

113
 #if ENABLED(PIDTEMP)
113
 #if ENABLED(PIDTEMP)
114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
115
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
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
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
118
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
119
     #define LPQ_MAX_LEN 50
119
     #define LPQ_MAX_LEN 50
120
   #endif
120
   #endif

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

113
 #if ENABLED(PIDTEMP)
113
 #if ENABLED(PIDTEMP)
114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
115
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
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
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
118
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
119
     #define LPQ_MAX_LEN 50
119
     #define LPQ_MAX_LEN 50
120
   #endif
120
   #endif

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

113
 #if ENABLED(PIDTEMP)
113
 #if ENABLED(PIDTEMP)
114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
115
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
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
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
118
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
119
     #define LPQ_MAX_LEN 50
119
     #define LPQ_MAX_LEN 50
120
   #endif
120
   #endif

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

113
 #if ENABLED(PIDTEMP)
113
 #if ENABLED(PIDTEMP)
114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
115
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
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
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
118
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
119
     #define LPQ_MAX_LEN 50
119
     #define LPQ_MAX_LEN 50
120
   #endif
120
   #endif

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

119
 #if ENABLED(PIDTEMP)
119
 #if ENABLED(PIDTEMP)
120
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
120
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
121
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
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
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
124
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
125
     #define LPQ_MAX_LEN 50
125
     #define LPQ_MAX_LEN 50
126
   #endif
126
   #endif

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

113
 #if ENABLED(PIDTEMP)
113
 #if ENABLED(PIDTEMP)
114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
115
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
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
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
118
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
119
     #define LPQ_MAX_LEN 50
119
     #define LPQ_MAX_LEN 50
120
   #endif
120
   #endif

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

113
 #if ENABLED(PIDTEMP)
113
 #if ENABLED(PIDTEMP)
114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
115
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
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
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
118
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
119
     #define LPQ_MAX_LEN 50
119
     #define LPQ_MAX_LEN 50
120
   #endif
120
   #endif

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

113
 #if ENABLED(PIDTEMP)
113
 #if ENABLED(PIDTEMP)
114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
115
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
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
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
118
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
119
     #define LPQ_MAX_LEN 50
119
     #define LPQ_MAX_LEN 50
120
   #endif
120
   #endif

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

113
 #if ENABLED(PIDTEMP)
113
 #if ENABLED(PIDTEMP)
114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
115
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
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
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
118
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
119
     #define LPQ_MAX_LEN 50
119
     #define LPQ_MAX_LEN 50
120
   #endif
120
   #endif

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

113
 #if ENABLED(PIDTEMP)
113
 #if ENABLED(PIDTEMP)
114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
115
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
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
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
118
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
119
     #define LPQ_MAX_LEN 50
119
     #define LPQ_MAX_LEN 50
120
   #endif
120
   #endif

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

113
 #if ENABLED(PIDTEMP)
113
 #if ENABLED(PIDTEMP)
114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
115
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
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
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
118
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
119
     #define LPQ_MAX_LEN 50
119
     #define LPQ_MAX_LEN 50
120
   #endif
120
   #endif

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

113
 #if ENABLED(PIDTEMP)
113
 #if ENABLED(PIDTEMP)
114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
115
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
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
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
118
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
119
     #define LPQ_MAX_LEN 50
119
     #define LPQ_MAX_LEN 50
120
   #endif
120
   #endif

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

113
 #if ENABLED(PIDTEMP)
113
 #if ENABLED(PIDTEMP)
114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
115
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
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
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
118
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
119
     #define LPQ_MAX_LEN 50
119
     #define LPQ_MAX_LEN 50
120
   #endif
120
   #endif

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

118
 #if ENABLED(PIDTEMP)
118
 #if ENABLED(PIDTEMP)
119
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
119
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
120
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
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
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
123
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
124
     #define LPQ_MAX_LEN 50
124
     #define LPQ_MAX_LEN 50
125
   #endif
125
   #endif

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

113
 #if ENABLED(PIDTEMP)
113
 #if ENABLED(PIDTEMP)
114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
115
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
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
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
118
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
119
     #define LPQ_MAX_LEN 50
119
     #define LPQ_MAX_LEN 50
120
   #endif
120
   #endif

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

113
 #if ENABLED(PIDTEMP)
113
 #if ENABLED(PIDTEMP)
114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
115
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
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
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
118
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
119
     #define LPQ_MAX_LEN 50
119
     #define LPQ_MAX_LEN 50
120
   #endif
120
   #endif

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

113
 #if ENABLED(PIDTEMP)
113
 #if ENABLED(PIDTEMP)
114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
114
   // this adds an experimental additional term to the heating power, proportional to the extrusion speed.
115
   // if Kc is chosen well, the additional required power due to increased melting should be compensated.
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
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
118
     #define DEFAULT_Kc (100) //heating power=Kc*(e_speed)
119
     #define LPQ_MAX_LEN 50
119
     #define LPQ_MAX_LEN 50
120
   #endif
120
   #endif

+ 9
- 9
Marlin/temperature.cpp View File

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

+ 4
- 4
Marlin/temperature.h View File

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

+ 1
- 1
Marlin/ultralcd.cpp View File

1684
         MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I ELABEL, &raw_Ki, 0.01, 9990, copy_and_scalePID_i_E ## eindex); \
1684
         MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I ELABEL, &raw_Ki, 0.01, 9990, copy_and_scalePID_i_E ## eindex); \
1685
         MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D ELABEL, &raw_Kd, 1, 9990, copy_and_scalePID_d_E ## eindex)
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
         #define _PID_MENU_ITEMS(ELABEL, eindex) \
1688
         #define _PID_MENU_ITEMS(ELABEL, eindex) \
1689
           _PID_BASE_MENU_ITEMS(ELABEL, eindex); \
1689
           _PID_BASE_MENU_ITEMS(ELABEL, eindex); \
1690
           MENU_ITEM_EDIT(float3, MSG_PID_C ELABEL, &PID_PARAM(Kc, eindex), 1, 9990)
1690
           MENU_ITEM_EDIT(float3, MSG_PID_C ELABEL, &PID_PARAM(Kc, eindex), 1, 9990)

Loading…
Cancel
Save