Browse Source

Merge pull request #1344 from grob6000/independent_pid

Independent PID parameters for each extruder
Bo Herrmannsen 10 years ago
parent
commit
ab074dac17

+ 2
- 0
Marlin/Configuration.h View File

@@ -152,6 +152,8 @@
152 152
   //#define PID_DEBUG // Sends debug data to the serial port.
153 153
   //#define PID_OPENLOOP 1 // Puts PID in open loop. M104/M140 sets the output power from 0 to PID_MAX
154 154
   //#define SLOW_PWM_HEATERS // PWM with very low frequency (roughly 0.125Hz=8s) and minimum state time of approximately 1s useful for heaters driven by a relay
155
+  //#define PID_PARAMS_PER_EXTRUDER // Uses separate PID parameters for each extruder (useful for mismatched extruders)
156
+                                    // Set/get with gcode: M301 E[extruder number, 0-2]
155 157
   #define PID_FUNCTIONAL_RANGE 10 // If the temperature difference between the target temperature and the actual temperature
156 158
                                   // is more then PID_FUNCTIONAL_RANGE then the PID will be shut off and the heater will be set to min/max.
157 159
   #define PID_INTEGRAL_DRIVE_MAX PID_MAX  //limit for the integral term

+ 123
- 64
Marlin/ConfigurationStore.cpp View File

@@ -38,7 +38,7 @@ void _EEPROM_readData(int &pos, uint8_t* value, uint8_t size)
38 38
 // wrong data being written to the variables.
39 39
 // ALSO:  always make sure the variables in the Store and retrieve sections are in the same order.
40 40
 
41
-#define EEPROM_VERSION "V13"
41
+#define EEPROM_VERSION "V14"
42 42
 
43 43
 #ifdef EEPROM_SETTINGS
44 44
 void Config_StoreSettings() 
@@ -63,11 +63,11 @@ void Config_StoreSettings()
63 63
   EEPROM_WRITE_VAR(i,delta_radius);
64 64
   EEPROM_WRITE_VAR(i,delta_diagonal_rod);
65 65
   EEPROM_WRITE_VAR(i,delta_segments_per_second);
66
-  #endif
66
+  #endif//DELTA
67 67
   #ifndef ULTIPANEL
68 68
   int plaPreheatHotendTemp = PLA_PREHEAT_HOTEND_TEMP, plaPreheatHPBTemp = PLA_PREHEAT_HPB_TEMP, plaPreheatFanSpeed = PLA_PREHEAT_FAN_SPEED;
69 69
   int absPreheatHotendTemp = ABS_PREHEAT_HOTEND_TEMP, absPreheatHPBTemp = ABS_PREHEAT_HPB_TEMP, absPreheatFanSpeed = ABS_PREHEAT_FAN_SPEED;
70
-  #endif
70
+  #endif//ULTIPANEL
71 71
   EEPROM_WRITE_VAR(i,plaPreheatHotendTemp);
72 72
   EEPROM_WRITE_VAR(i,plaPreheatHPBTemp);
73 73
   EEPROM_WRITE_VAR(i,plaPreheatFanSpeed);
@@ -76,37 +76,58 @@ void Config_StoreSettings()
76 76
   EEPROM_WRITE_VAR(i,absPreheatFanSpeed);
77 77
   EEPROM_WRITE_VAR(i,zprobe_zoffset);
78 78
   #ifdef PIDTEMP
79
-    EEPROM_WRITE_VAR(i,Kp);
80
-    EEPROM_WRITE_VAR(i,Ki);
81
-    EEPROM_WRITE_VAR(i,Kd);
82
-  #else
79
+    float dummy = 0.0f;
80
+    for (int e = 0; e < 3; e++)
81
+	{
82
+	  if (e < EXTRUDERS)
83
+	  {
84
+        EEPROM_WRITE_VAR(i,PID_PARAM(Kp,e));
85
+        EEPROM_WRITE_VAR(i,PID_PARAM(Ki,e));
86
+        EEPROM_WRITE_VAR(i,PID_PARAM(Kd,e));
87
+        #ifdef PID_ADD_EXTRUSION_RATE
88
+        EEPROM_WRITE_VAR(i,PID_PARAM(Kc,e));
89
+        #else//PID_ADD_EXTRUSION_RATE
90
+		dummy = 1.0f; // 1.0 = default kc
91
+	    EEPROM_WRITE_VAR(dummmy);
92
+        #endif//PID_ADD_EXTRUSION_RATE
93
+	  }
94
+	  else
95
+	  {
96
+		dummy = 3000.0f;
97
+	    EEPROM_WRITE_VAR(i, dummy);
98
+		dummy = 0.0f;
99
+        EEPROM_WRITE_VAR(i,dummy);
100
+        EEPROM_WRITE_VAR(i,dummy);
101
+	  }
102
+	}
103
+  #else//PIDTEMP
83 104
 		float dummy = 3000.0f;
84 105
     EEPROM_WRITE_VAR(i,dummy);
85 106
 		dummy = 0.0f;
86 107
     EEPROM_WRITE_VAR(i,dummy);
87 108
     EEPROM_WRITE_VAR(i,dummy);
88
-  #endif
109
+  #endif//PIDTEMP
89 110
   #ifndef DOGLCD
90 111
     int lcd_contrast = 32;
91
-  #endif
112
+  #endif//DOGLCD
92 113
   EEPROM_WRITE_VAR(i,lcd_contrast);
93 114
   #ifdef SCARA
94 115
   EEPROM_WRITE_VAR(i,axis_scaling);        // Add scaling for SCARA
95
-  #endif
116
+  #endif//SCARA
96 117
   #ifdef FWRETRACT
97 118
   EEPROM_WRITE_VAR(i,autoretract_enabled);
98 119
   EEPROM_WRITE_VAR(i,retract_length);
99 120
   #if EXTRUDERS > 1
100 121
   EEPROM_WRITE_VAR(i,retract_length_swap);
101
-  #endif
122
+  #endif//EXTRUDERS > 1
102 123
   EEPROM_WRITE_VAR(i,retract_feedrate);
103 124
   EEPROM_WRITE_VAR(i,retract_zlift);
104 125
   EEPROM_WRITE_VAR(i,retract_recover_length);
105 126
   #if EXTRUDERS > 1
106 127
   EEPROM_WRITE_VAR(i,retract_recover_length_swap);
107
-  #endif
128
+  #endif//EXTRUDERS > 1
108 129
   EEPROM_WRITE_VAR(i,retract_recover_feedrate);
109
-  #endif
130
+  #endif//FWRETRACT
110 131
 
111 132
   // Save filament sizes
112 133
   EEPROM_WRITE_VAR(i, volumetric_enabled);
@@ -115,8 +136,8 @@ void Config_StoreSettings()
115 136
   EEPROM_WRITE_VAR(i, filament_size[1]);
116 137
   #if EXTRUDERS > 2
117 138
   EEPROM_WRITE_VAR(i, filament_size[2]);
118
-  #endif
119
-  #endif
139
+  #endif//EXTRUDERS > 2
140
+  #endif//EXTRUDERS > 1
120 141
   
121 142
   char ver2[4]=EEPROM_VERSION;
122 143
   i=EEPROM_OFFSET;
@@ -149,7 +170,7 @@ SERIAL_ECHOLNPGM("Scaling factors:");
149 170
     SERIAL_ECHOLN("");
150 171
       
151 172
     SERIAL_ECHO_START;
152
-#endif
173
+#endif//SCARA
153 174
     SERIAL_ECHOLNPGM("Maximum feedrates (mm/s):");
154 175
     SERIAL_ECHO_START;
155 176
     SERIAL_ECHOPAIR("  M203 X", max_feedrate[X_AXIS]);
@@ -206,16 +227,16 @@ SERIAL_ECHOLNPGM("Scaling factors:");
206 227
 	SERIAL_ECHOPAIR(" R" ,delta_radius );
207 228
 	SERIAL_ECHOPAIR(" S" ,delta_segments_per_second );
208 229
 	SERIAL_ECHOLN("");
209
-#endif
230
+#endif//DELTA
210 231
 #ifdef PIDTEMP
211 232
     SERIAL_ECHO_START;
212 233
     SERIAL_ECHOLNPGM("PID settings:");
213
-    SERIAL_ECHO_START;
214
-    SERIAL_ECHOPAIR("   M301 P",Kp); 
215
-    SERIAL_ECHOPAIR(" I" ,unscalePID_i(Ki)); 
216
-    SERIAL_ECHOPAIR(" D" ,unscalePID_d(Kd));
234
+	SERIAL_ECHO_START;
235
+    SERIAL_ECHOPAIR("   M301 P", PID_PARAM(Kp,0)); // for compatibility with hosts, only echos values for E0
236
+	SERIAL_ECHOPAIR(" I", unscalePID_i(PID_PARAM(Ki, 0)));
237
+	SERIAL_ECHOPAIR(" D", unscalePID_d(PID_PARAM(Kd, 0)));
217 238
     SERIAL_ECHOLN(""); 
218
-#endif
239
+#endif//PIDTEMP
219 240
 #ifdef FWRETRACT
220 241
     SERIAL_ECHO_START;
221 242
     SERIAL_ECHOLNPGM("Retract: S=Length (mm) F:Speed (mm/m) Z: ZLift (mm)");
@@ -244,7 +265,7 @@ SERIAL_ECHOLNPGM("Scaling factors:");
244 265
     SERIAL_ECHO_START;
245 266
     SERIAL_ECHOPAIR("   Swap rec. addl. length (mm): ", retract_recover_length_swap);
246 267
     SERIAL_ECHOLN("");
247
-#endif
268
+#endif//EXTRUDERS > 1
248 269
     SERIAL_ECHO_START;
249 270
     if (volumetric_enabled) {
250 271
         SERIAL_ECHOLNPGM("Filament settings:");
@@ -259,14 +280,14 @@ SERIAL_ECHOLNPGM("Scaling factors:");
259 280
 		SERIAL_ECHO_START;
260 281
         SERIAL_ECHOPAIR("   M200 T2 D", filament_size[2]);
261 282
 		SERIAL_ECHOLN("");
262
-#endif
263
-#endif
283
+#endif//EXTRUDERS > 2
284
+#endif//EXTRUDERS > 1
264 285
     } else {
265 286
         SERIAL_ECHOLNPGM("Filament settings: Disabled");
266 287
     }
267
-#endif
288
+#endif//FWRETRACT
268 289
 }
269
-#endif
290
+#endif//DISABLE_M503
270 291
 
271 292
 
272 293
 #ifdef EEPROM_SETTINGS
@@ -301,11 +322,11 @@ void Config_RetrieveSettings()
301 322
 		EEPROM_READ_VAR(i,delta_radius);
302 323
 		EEPROM_READ_VAR(i,delta_diagonal_rod);
303 324
 		EEPROM_READ_VAR(i,delta_segments_per_second);
304
-        #endif
325
+        #endif//DELTA
305 326
         #ifndef ULTIPANEL
306 327
         int plaPreheatHotendTemp, plaPreheatHPBTemp, plaPreheatFanSpeed;
307 328
         int absPreheatHotendTemp, absPreheatHPBTemp, absPreheatFanSpeed;
308
-        #endif
329
+        #endif//ULTIPANEL
309 330
         EEPROM_READ_VAR(i,plaPreheatHotendTemp);
310 331
         EEPROM_READ_VAR(i,plaPreheatHPBTemp);
311 332
         EEPROM_READ_VAR(i,plaPreheatFanSpeed);
@@ -313,35 +334,68 @@ void Config_RetrieveSettings()
313 334
         EEPROM_READ_VAR(i,absPreheatHPBTemp);
314 335
         EEPROM_READ_VAR(i,absPreheatFanSpeed);
315 336
         EEPROM_READ_VAR(i,zprobe_zoffset);
316
-        #ifndef PIDTEMP
317
-        float Kp,Ki,Kd;
318
-        #endif
319
-        // do not need to scale PID values as the values in EEPROM are already scaled		
320
-        EEPROM_READ_VAR(i,Kp);
321
-        EEPROM_READ_VAR(i,Ki);
322
-        EEPROM_READ_VAR(i,Kd);
337
+        #ifdef PIDTEMP
338
+		float dummy = 0.0f;
339
+		for (int e = 0; e < 3; e++) // 3 = max extruders supported by marlin
340
+		{
341
+		  if (e < EXTRUDERS)
342
+		  {
343
+		    // do not need to scale PID values as the values in EEPROM are already scaled			  
344
+            EEPROM_READ_VAR(i,PID_PARAM(Kp,e));
345
+            EEPROM_READ_VAR(i,PID_PARAM(Ki,e));
346
+		    EEPROM_READ_VAR(i,PID_PARAM(Kd,e));
347
+#ifdef PID_ADD_EXTRUSION_RATE
348
+            EEPROM_READ_VAR(i,PID_PARAM(Kc,e));
349
+#else//PID_ADD_EXTRUSION_RATE
350
+	        EEPROM_READ_VAR(i,dummy);
351
+#endif//PID_ADD_EXTRUSION_RATE
352
+		  }
353
+		  else
354
+		  {
355
+			EEPROM_READ_VAR(i,dummy);
356
+			EEPROM_READ_VAR(i,dummy);
357
+			EEPROM_READ_VAR(i,dummy);
358
+			EEPROM_READ_VAR(i,dummy);
359
+		  }
360
+		}
361
+		#else//PIDTEMP
362
+		// 4 x 3 = 12 slots for PID parameters
363
+		float dummy = 0.0f;
364
+		EEPROM_READ_VAR(i,dummy);
365
+		EEPROM_READ_VAR(i,dummy);
366
+		EEPROM_READ_VAR(i,dummy);
367
+		EEPROM_READ_VAR(i,dummy);
368
+		EEPROM_READ_VAR(i,dummy);
369
+		EEPROM_READ_VAR(i,dummy);
370
+		EEPROM_READ_VAR(i,dummy);
371
+		EEPROM_READ_VAR(i,dummy);
372
+		EEPROM_READ_VAR(i,dummy);
373
+		EEPROM_READ_VAR(i,dummy);
374
+		EEPROM_READ_VAR(i,dummy);
375
+		EEPROM_READ_VAR(i,dummy);			
376
+		#endif//PIDTEMP
323 377
         #ifndef DOGLCD
324 378
         int lcd_contrast;
325
-        #endif
379
+        #endif//DOGLCD
326 380
         EEPROM_READ_VAR(i,lcd_contrast);
327 381
 		#ifdef SCARA
328 382
 		EEPROM_READ_VAR(i,axis_scaling);
329
-		#endif
383
+		#endif//SCARA
330 384
 
331 385
 		#ifdef FWRETRACT
332 386
 		EEPROM_READ_VAR(i,autoretract_enabled);
333 387
 		EEPROM_READ_VAR(i,retract_length);
334 388
 		#if EXTRUDERS > 1
335 389
 		EEPROM_READ_VAR(i,retract_length_swap);
336
-		#endif
390
+		#endif//EXTRUDERS > 1
337 391
 		EEPROM_READ_VAR(i,retract_feedrate);
338 392
 		EEPROM_READ_VAR(i,retract_zlift);
339 393
 		EEPROM_READ_VAR(i,retract_recover_length);
340 394
 		#if EXTRUDERS > 1
341 395
 		EEPROM_READ_VAR(i,retract_recover_length_swap);
342
-		#endif
396
+		#endif//EXTRUDERS > 1
343 397
 		EEPROM_READ_VAR(i,retract_recover_feedrate);
344
-		#endif
398
+		#endif//FWRETRACT
345 399
 
346 400
 		EEPROM_READ_VAR(i, volumetric_enabled);
347 401
 		EEPROM_READ_VAR(i, filament_size[0]);
@@ -349,8 +403,8 @@ void Config_RetrieveSettings()
349 403
 		EEPROM_READ_VAR(i, filament_size[1]);
350 404
 #if EXTRUDERS > 2
351 405
 		EEPROM_READ_VAR(i, filament_size[2]);
352
-#endif
353
-#endif
406
+#endif//EXTRUDERS > 2
407
+#endif//EXTRUDERS > 1
354 408
 		calculate_volumetric_multipliers();
355 409
 		// Call updatePID (similar to when we have processed M301)
356 410
 		updatePID();
@@ -363,9 +417,9 @@ void Config_RetrieveSettings()
363 417
     }
364 418
     #ifdef EEPROM_CHITCHAT
365 419
       Config_PrintSettings();
366
-    #endif
420
+    #endif//EEPROM_CHITCHAT
367 421
 }
368
-#endif
422
+#endif//EEPROM_SETTINGS
369 423
 
370 424
 void Config_ResetDefault()
371 425
 {
@@ -379,7 +433,7 @@ void Config_ResetDefault()
379 433
         max_acceleration_units_per_sq_second[i]=pgm_read_float(&tmp3[i]);
380 434
 		#ifdef SCARA
381 435
 		axis_scaling[i]=1;
382
-		#endif
436
+		#endif//SCARA
383 437
     }
384 438
     
385 439
     // steps per sq second need to be updated to agree with the units per sq second
@@ -400,7 +454,7 @@ void Config_ResetDefault()
400 454
 	delta_diagonal_rod= DELTA_DIAGONAL_ROD;
401 455
 	delta_segments_per_second= DELTA_SEGMENTS_PER_SECOND;
402 456
 	recalc_delta_settings(delta_radius, delta_diagonal_rod);
403
-#endif
457
+#endif//DELTA
404 458
 #ifdef ULTIPANEL
405 459
     plaPreheatHotendTemp = PLA_PREHEAT_HOTEND_TEMP;
406 460
     plaPreheatHPBTemp = PLA_PREHEAT_HPB_TEMP;
@@ -408,24 +462,29 @@ void Config_ResetDefault()
408 462
     absPreheatHotendTemp = ABS_PREHEAT_HOTEND_TEMP;
409 463
     absPreheatHPBTemp = ABS_PREHEAT_HPB_TEMP;
410 464
     absPreheatFanSpeed = ABS_PREHEAT_FAN_SPEED;
411
-#endif
465
+#endif//ULTIPANEL
412 466
 #ifdef ENABLE_AUTO_BED_LEVELING
413 467
     zprobe_zoffset = -Z_PROBE_OFFSET_FROM_EXTRUDER;
414
-#endif
468
+#endif//ENABLE_AUTO_BED_LEVELING
415 469
 #ifdef DOGLCD
416 470
     lcd_contrast = DEFAULT_LCD_CONTRAST;
417
-#endif
471
+#endif//DOGLCD
418 472
 #ifdef PIDTEMP
419
-    Kp = DEFAULT_Kp;
420
-    Ki = scalePID_i(DEFAULT_Ki);
421
-    Kd = scalePID_d(DEFAULT_Kd);
422
-    
473
+#ifdef PID_PARAMS_PER_EXTRUDER
474
+	for (int e = 0; e < EXTRUDERS; e++)
475
+#else // PID_PARAMS_PER_EXTRUDER
476
+	int e = 0; // only need to write once
477
+#endif // PID_PARAMS_PER_EXTRUDER
478
+	{
479
+      PID_PARAM(Kp,e) = DEFAULT_Kp;
480
+      PID_PARAM(Ki,e) = scalePID_i(DEFAULT_Ki);
481
+      PID_PARAM(Kd,e) = scalePID_d(DEFAULT_Kd);
482
+      #ifdef PID_ADD_EXTRUSION_RATE
483
+        PID_PARAM(Kc,e) = DEFAULT_Kc;
484
+      #endif//PID_ADD_EXTRUSION_RATE
485
+    }
423 486
     // call updatePID (similar to when we have processed M301)
424 487
     updatePID();
425
-    
426
-#ifdef PID_ADD_EXTRUSION_RATE
427
-    Kc = DEFAULT_Kc;
428
-#endif//PID_ADD_EXTRUSION_RATE
429 488
 #endif//PIDTEMP
430 489
 
431 490
 #ifdef FWRETRACT
@@ -433,15 +492,15 @@ void Config_ResetDefault()
433 492
 	retract_length = RETRACT_LENGTH;
434 493
 #if EXTRUDERS > 1
435 494
 	retract_length_swap = RETRACT_LENGTH_SWAP;
436
-#endif
495
+#endif//EXTRUDERS > 1
437 496
 	retract_feedrate = RETRACT_FEEDRATE;
438 497
 	retract_zlift = RETRACT_ZLIFT;
439 498
 	retract_recover_length = RETRACT_RECOVER_LENGTH;
440 499
 #if EXTRUDERS > 1
441 500
 	retract_recover_length_swap = RETRACT_RECOVER_LENGTH_SWAP;
442
-#endif
501
+#endif//EXTRUDERS > 1
443 502
 	retract_recover_feedrate = RETRACT_RECOVER_FEEDRATE;
444
-#endif
503
+#endif//FWRETRACT
445 504
 
446 505
 	volumetric_enabled = false;
447 506
 	filament_size[0] = DEFAULT_NOMINAL_FILAMENT_DIA;
@@ -449,11 +508,11 @@ void Config_ResetDefault()
449 508
 	filament_size[1] = DEFAULT_NOMINAL_FILAMENT_DIA;
450 509
 #if EXTRUDERS > 2
451 510
 	filament_size[2] = DEFAULT_NOMINAL_FILAMENT_DIA;
452
-#endif
453
-#endif
511
+#endif//EXTRUDERS > 2
512
+#endif//EXTRUDERS > 1
454 513
 	calculate_volumetric_multipliers();
455 514
 
456 515
 SERIAL_ECHO_START;
457 516
 SERIAL_ECHOLNPGM("Hardcoded Default Settings Loaded");
458 517
 
459
-}
518
+}

+ 44
- 22
Marlin/Marlin_main.cpp View File

@@ -3196,30 +3196,52 @@ Sigma_Exit:
3196 3196
     #endif // M300
3197 3197
 
3198 3198
     #ifdef PIDTEMP
3199
-    case 301: // M301
3200
-      {
3201
-        if(code_seen('P')) Kp = code_value();
3202
-        if(code_seen('I')) Ki = scalePID_i(code_value());
3203
-        if(code_seen('D')) Kd = scalePID_d(code_value());
3199
+	case 301: // M301
3200
+	{
3204 3201
 
3205
-        #ifdef PID_ADD_EXTRUSION_RATE
3206
-        if(code_seen('C')) Kc = code_value();
3207
-        #endif
3202
+		// multi-extruder PID patch: M301 updates or prints a single extruder's PID values
3203
+		// default behaviour (omitting E parameter) is to update for extruder 0 only
3204
+		int e = 0; // extruder being updated
3205
+		if (code_seen('E'))
3206
+		{
3207
+			e = (int)code_value();
3208
+		}
3209
+		if (e < EXTRUDERS) // catch bad input value
3210
+		{
3211
+
3212
+			if (code_seen('P')) PID_PARAM(Kp,e) = code_value();
3213
+			if (code_seen('I')) PID_PARAM(Ki,e) = scalePID_i(code_value());
3214
+			if (code_seen('D')) PID_PARAM(Kd,e) = scalePID_d(code_value());
3215
+			#ifdef PID_ADD_EXTRUSION_RATE
3216
+			if (code_seen('C')) PID_PARAM(Kc,e) = code_value();
3217
+			#endif			
3218
+
3219
+			updatePID();
3220
+			SERIAL_PROTOCOL(MSG_OK);
3221
+            #ifdef PID_PARAMS_PER_EXTRUDER
3222
+			  SERIAL_PROTOCOL(" e:"); // specify extruder in serial output
3223
+			  SERIAL_PROTOCOL(e);
3224
+            #endif // PID_PARAMS_PER_EXTRUDER
3225
+			SERIAL_PROTOCOL(" p:");
3226
+			SERIAL_PROTOCOL(PID_PARAM(Kp,e));
3227
+			SERIAL_PROTOCOL(" i:");
3228
+			SERIAL_PROTOCOL(unscalePID_i(PID_PARAM(Ki,e)));
3229
+			SERIAL_PROTOCOL(" d:");
3230
+			SERIAL_PROTOCOL(unscalePID_d(PID_PARAM(Kd,e)));
3231
+			#ifdef PID_ADD_EXTRUSION_RATE
3232
+			SERIAL_PROTOCOL(" c:");
3233
+			//Kc does not have scaling applied above, or in resetting defaults
3234
+			SERIAL_PROTOCOL(PID_PARAM(Kc,e));
3235
+			#endif
3236
+			SERIAL_PROTOCOLLN("");
3237
+		
3238
+		}
3239
+		else
3240
+		{
3241
+			SERIAL_ECHO_START;
3242
+			SERIAL_ECHOLN(MSG_INVALID_EXTRUDER);
3243
+		}
3208 3244
 
3209
-        updatePID();
3210
-        SERIAL_PROTOCOL(MSG_OK);
3211
-        SERIAL_PROTOCOL(" p:");
3212
-        SERIAL_PROTOCOL(Kp);
3213
-        SERIAL_PROTOCOL(" i:");
3214
-        SERIAL_PROTOCOL(unscalePID_i(Ki));
3215
-        SERIAL_PROTOCOL(" d:");
3216
-        SERIAL_PROTOCOL(unscalePID_d(Kd));
3217
-        #ifdef PID_ADD_EXTRUSION_RATE
3218
-        SERIAL_PROTOCOL(" c:");
3219
-        //Kc does not have scaling applied above, or in resetting defaults
3220
-        SERIAL_PROTOCOL(Kc);
3221
-        #endif
3222
-        SERIAL_PROTOCOLLN("");
3223 3245
       }
3224 3246
       break;
3225 3247
     #endif //PIDTEMP

+ 8
- 0
Marlin/language_ca.h View File

@@ -67,6 +67,14 @@
67 67
 #define MSG_PID_I                           "PID-I"
68 68
 #define MSG_PID_D                           "PID-D"
69 69
 #define MSG_PID_C                           "PID-C"
70
+#define MSG_PID_P1                          "PID-P E2"
71
+#define MSG_PID_I1                          "PID-I E2"
72
+#define MSG_PID_D1                          "PID-D E2"
73
+#define MSG_PID_C1                          "PID-C E2"
74
+#define MSG_PID_P2                          "PID-P E3"
75
+#define MSG_PID_I2                          "PID-I E3"
76
+#define MSG_PID_D2                          "PID-D E3"
77
+#define MSG_PID_C2                          "PID-C E3"
70 78
 #define MSG_ACC                             "Accel"
71 79
 #define MSG_VXY_JERK                        "Vxy-jerk"
72 80
 #define MSG_VZ_JERK                         "Vz-jerk"

+ 8
- 0
Marlin/language_de.h View File

@@ -67,6 +67,14 @@
67 67
 #define MSG_PID_I                           "PID-I"
68 68
 #define MSG_PID_D                           "PID-D"
69 69
 #define MSG_PID_C                           "PID-C"
70
+#define MSG_PID_P1                          "PID-P E2"
71
+#define MSG_PID_I1                          "PID-I E2"
72
+#define MSG_PID_D1                          "PID-D E2"
73
+#define MSG_PID_C1                          "PID-C E2"
74
+#define MSG_PID_P2                          "PID-P E3"
75
+#define MSG_PID_I2                          "PID-I E3"
76
+#define MSG_PID_D2                          "PID-D E3"
77
+#define MSG_PID_C2                          "PID-C E3"
70 78
 #define MSG_ACC                             "Acc"
71 79
 #define MSG_VXY_JERK                        "Vxy-jerk"
72 80
 #define MSG_VZ_JERK                         "Vz-jerk"

+ 8
- 0
Marlin/language_en.h View File

@@ -67,6 +67,14 @@
67 67
 #define MSG_PID_I                           "PID-I"
68 68
 #define MSG_PID_D                           "PID-D"
69 69
 #define MSG_PID_C                           "PID-C"
70
+#define MSG_PID_P1                          "PID-P E2"
71
+#define MSG_PID_I1                          "PID-I E2"
72
+#define MSG_PID_D1                          "PID-D E2"
73
+#define MSG_PID_C1                          "PID-C E2"
74
+#define MSG_PID_P2                          "PID-P E3"
75
+#define MSG_PID_I2                          "PID-I E3"
76
+#define MSG_PID_D2                          "PID-D E3"
77
+#define MSG_PID_C2                          "PID-C E3"
70 78
 #define MSG_ACC                             "Accel"
71 79
 #define MSG_VXY_JERK                        "Vxy-jerk"
72 80
 #define MSG_VZ_JERK                         "Vz-jerk"

+ 8
- 0
Marlin/language_es.h View File

@@ -67,6 +67,14 @@
67 67
 #define MSG_PID_I                           "PID-I"
68 68
 #define MSG_PID_D                           "PID-D"
69 69
 #define MSG_PID_C                           "PID-C"
70
+#define MSG_PID_P1                          "PID-P E2"
71
+#define MSG_PID_I1                          "PID-I E2"
72
+#define MSG_PID_D1                          "PID-D E2"
73
+#define MSG_PID_C1                          "PID-C E2"
74
+#define MSG_PID_P2                          "PID-P E3"
75
+#define MSG_PID_I2                          "PID-I E3"
76
+#define MSG_PID_D2                          "PID-D E3"
77
+#define MSG_PID_C2                          "PID-C E3"
70 78
 #define MSG_ACC                             "Acel"
71 79
 #define MSG_VXY_JERK                        "Vxy-jerk"
72 80
 #define MSG_VZ_JERK                         "Vz-jerk"

+ 8
- 0
Marlin/language_eu.h View File

@@ -67,6 +67,14 @@
67 67
 #define MSG_PID_I                           "PID-I"
68 68
 #define MSG_PID_D                           "PID-D"
69 69
 #define MSG_PID_C                           "PID-C"
70
+#define MSG_PID_P1                          "PID-P E2"
71
+#define MSG_PID_I1                          "PID-I E2"
72
+#define MSG_PID_D1                          "PID-D E2"
73
+#define MSG_PID_C1                          "PID-C E2"
74
+#define MSG_PID_P2                          "PID-P E3"
75
+#define MSG_PID_I2                          "PID-I E3"
76
+#define MSG_PID_D2                          "PID-D E3"
77
+#define MSG_PID_C2                          "PID-C E3"
70 78
 #define MSG_ACC                             "Azelerazioa"
71 79
 #define MSG_VXY_JERK                        "Vxy-astindua"
72 80
 #define MSG_VZ_JERK                         "Vz-astindua"

+ 8
- 0
Marlin/language_fi.h View File

@@ -67,6 +67,14 @@
67 67
 #define MSG_PID_I                           "PID-I"
68 68
 #define MSG_PID_D                           "PID-D"
69 69
 #define MSG_PID_C                           "PID-C"
70
+#define MSG_PID_P1                          "PID-P E2"
71
+#define MSG_PID_I1                          "PID-I E2"
72
+#define MSG_PID_D1                          "PID-D E2"
73
+#define MSG_PID_C1                          "PID-C E2"
74
+#define MSG_PID_P2                          "PID-P E3"
75
+#define MSG_PID_I2                          "PID-I E3"
76
+#define MSG_PID_D2                          "PID-D E3"
77
+#define MSG_PID_C2                          "PID-C E3"
70 78
 #define MSG_ACC                             "Kiihtyv"
71 79
 #define MSG_VXY_JERK                        "Vxy-jerk"
72 80
 #define MSG_VZ_JERK                         "Vz-jerk"

+ 8
- 0
Marlin/language_fr.h View File

@@ -67,6 +67,14 @@
67 67
 #define MSG_PID_I                           "PID-I"
68 68
 #define MSG_PID_D                           "PID-D"
69 69
 #define MSG_PID_C                           "PID-C"
70
+#define MSG_PID_P1                          "PID-P E2"
71
+#define MSG_PID_I1                          "PID-I E2"
72
+#define MSG_PID_D1                          "PID-D E2"
73
+#define MSG_PID_C1                          "PID-C E2"
74
+#define MSG_PID_P2                          "PID-P E3"
75
+#define MSG_PID_I2                          "PID-I E3"
76
+#define MSG_PID_D2                          "PID-D E3"
77
+#define MSG_PID_C2                          "PID-C E3"
70 78
 #define MSG_ACC                             "Accel"
71 79
 #define MSG_VXY_JERK                        "Vxy-jerk"
72 80
 #define MSG_VZ_JERK                         "Vz-jerk"

+ 8
- 0
Marlin/language_it.h View File

@@ -67,6 +67,14 @@
67 67
 #define MSG_PID_I                           "PID-I"
68 68
 #define MSG_PID_D                           "PID-D"
69 69
 #define MSG_PID_C                           "PID-C"
70
+#define MSG_PID_P1                          "PID-P E2"
71
+#define MSG_PID_I1                          "PID-I E2"
72
+#define MSG_PID_D1                          "PID-D E2"
73
+#define MSG_PID_C1                          "PID-C E2"
74
+#define MSG_PID_P2                          "PID-P E3"
75
+#define MSG_PID_I2                          "PID-I E3"
76
+#define MSG_PID_D2                          "PID-D E3"
77
+#define MSG_PID_C2                          "PID-C E3"
70 78
 #define MSG_ACC                             "Accel."
71 79
 #define MSG_VXY_JERK                        "Vxy-jerk"
72 80
 #define MSG_VZ_JERK                         "Vz-jerk"

+ 8
- 0
Marlin/language_nl.h View File

@@ -67,6 +67,14 @@
67 67
 #define MSG_PID_I                           "PID-I"
68 68
 #define MSG_PID_D                           "PID-D"
69 69
 #define MSG_PID_C                           "PID-C"
70
+#define MSG_PID_P1                          "PID-P E2"
71
+#define MSG_PID_I1                          "PID-I E2"
72
+#define MSG_PID_D1                          "PID-D E2"
73
+#define MSG_PID_C1                          "PID-C E2"
74
+#define MSG_PID_P2                          "PID-P E3"
75
+#define MSG_PID_I2                          "PID-I E3"
76
+#define MSG_PID_D2                          "PID-D E3"
77
+#define MSG_PID_C2                          "PID-C E3"
70 78
 #define MSG_ACC                             "Versn"
71 79
 #define MSG_VXY_JERK                        "Vxy-jerk"
72 80
 #define MSG_VZ_JERK                         "Vz-jerk"

+ 8
- 0
Marlin/language_pl.h View File

@@ -67,6 +67,14 @@
67 67
 #define MSG_PID_I                           "PID-I"
68 68
 #define MSG_PID_D                           "PID-D"
69 69
 #define MSG_PID_C                           "PID-C"
70
+#define MSG_PID_P1                          "PID-P E2"
71
+#define MSG_PID_I1                          "PID-I E2"
72
+#define MSG_PID_D1                          "PID-D E2"
73
+#define MSG_PID_C1                          "PID-C E2"
74
+#define MSG_PID_P2                          "PID-P E3"
75
+#define MSG_PID_I2                          "PID-I E3"
76
+#define MSG_PID_D2                          "PID-D E3"
77
+#define MSG_PID_C2                          "PID-C E3"
70 78
 #define MSG_ACC                             "Przyspieszenie"
71 79
 #define MSG_VXY_JERK                        "Zryw Vxy"
72 80
 #define MSG_VZ_JERK                         "Zryw Vz"

+ 8
- 0
Marlin/language_pt.h View File

@@ -67,6 +67,14 @@
67 67
 #define MSG_PID_I                           "PID-I: "
68 68
 #define MSG_PID_D                           "PID-D: "
69 69
 #define MSG_PID_C                           "PID-C: "
70
+#define MSG_PID_P1                          "PID-P E2: "
71
+#define MSG_PID_I1                          "PID-I E2: "
72
+#define MSG_PID_D1                          "PID-D E2: "
73
+#define MSG_PID_C1                          "PID-C E2: "
74
+#define MSG_PID_P2                          "PID-P E3: "
75
+#define MSG_PID_I2                          "PID-I E3: "
76
+#define MSG_PID_D2                          "PID-D E3: "
77
+#define MSG_PID_C2                          "PID-C E3: "
70 78
 #define MSG_ACC                             "Acc:"
71 79
 #define MSG_VXY_JERK                        "Vxy-jerk: "
72 80
 #define MSG_VZ_JERK                         "Vz-jerk"

+ 8
- 0
Marlin/language_ru.h View File

@@ -69,6 +69,14 @@
69 69
 #define MSG_PID_I                           "PID-I: "
70 70
 #define MSG_PID_D                           "PID-D: "
71 71
 #define MSG_PID_C                           "PID-C: "
72
+#define MSG_PID_P1                          "PID-P E2: "
73
+#define MSG_PID_I1                          "PID-I E2: "
74
+#define MSG_PID_D1                          "PID-D E2: "
75
+#define MSG_PID_C1                          "PID-C E2: "
76
+#define MSG_PID_P2                          "PID-P E3: "
77
+#define MSG_PID_I2                          "PID-I E3: "
78
+#define MSG_PID_D2                          "PID-D E3: "
79
+#define MSG_PID_C2                          "PID-C E3: "
72 80
 #define MSG_ACC                             "Acc:"
73 81
 #define MSG_VXY_JERK                        "Vxy-jerk: "
74 82
 #define MSG_VZ_JERK                         "Vz-jerk"

+ 23
- 13
Marlin/temperature.cpp View File

@@ -51,14 +51,6 @@ float current_temperature_bed = 0.0;
51 51
   int redundant_temperature_raw = 0;
52 52
   float redundant_temperature = 0.0;
53 53
 #endif
54
-#ifdef PIDTEMP
55
-  float Kp=DEFAULT_Kp;
56
-  float Ki=(DEFAULT_Ki*PID_dT);
57
-  float Kd=(DEFAULT_Kd/PID_dT);
58
-  #ifdef PID_ADD_EXTRUSION_RATE
59
-    float Kc=DEFAULT_Kc;
60
-  #endif
61
-#endif //PIDTEMP
62 54
 
63 55
 #ifdef PIDTEMPBED
64 56
   float bedKp=DEFAULT_bedKp;
@@ -134,6 +126,24 @@ static volatile bool temp_meas_ready = false;
134 126
   # define ARRAY_BY_EXTRUDERS(v1, v2, v3) { v1 }
135 127
 #endif
136 128
 
129
+#ifdef PIDTEMP
130
+#ifdef PID_PARAMS_PER_EXTRUDER
131
+  float Kp[EXTRUDERS] = ARRAY_BY_EXTRUDERS(DEFAULT_Kp, DEFAULT_Kp, DEFAULT_Kp);
132
+  float Ki[EXTRUDERS] = ARRAY_BY_EXTRUDERS(DEFAULT_Ki*PID_dT, DEFAULT_Ki*PID_dT, DEFAULT_Ki*PID_dT);
133
+  float Kd[EXTRUDERS] = ARRAY_BY_EXTRUDERS(DEFAULT_Kd / PID_dT, DEFAULT_Kd / PID_dT, DEFAULT_Kd / PID_dT);
134
+  #ifdef PID_ADD_EXTRUSION_RATE
135
+    float Kc[EXTRUDERS] = ARRAY_BY_EXTRUDERS(DEFAULT_Kc, DEFAULT_Kc, DEFAULT_Kc);
136
+  #endif // PID_ADD_EXTRUSION_RATE
137
+#else //PID_PARAMS_PER_EXTRUDER
138
+  float Kp = DEFAULT_Kp;
139
+  float Ki = DEFAULT_Ki * PID_dT;
140
+  float Kd = DEFAULT_Kd / PID_dT;
141
+  #ifdef PID_ADD_EXTRUSION_RATE
142
+    float Kc = DEFAULT_Kc;
143
+  #endif // PID_ADD_EXTRUSION_RATE
144
+#endif // PID_PARAMS_PER_EXTRUDER
145
+#endif //PIDTEMP
146
+
137 147
 // Init min and max temp with extreme values to prevent false errors during startup
138 148
 static int minttemp_raw[EXTRUDERS] = ARRAY_BY_EXTRUDERS( HEATER_0_RAW_LO_TEMP , HEATER_1_RAW_LO_TEMP , HEATER_2_RAW_LO_TEMP );
139 149
 static int maxttemp_raw[EXTRUDERS] = ARRAY_BY_EXTRUDERS( HEATER_0_RAW_HI_TEMP , HEATER_1_RAW_HI_TEMP , HEATER_2_RAW_HI_TEMP );
@@ -343,7 +353,7 @@ void updatePID()
343 353
 {
344 354
 #ifdef PIDTEMP
345 355
   for(int e = 0; e < EXTRUDERS; e++) { 
346
-     temp_iState_max[e] = PID_INTEGRAL_DRIVE_MAX / Ki;  
356
+     temp_iState_max[e] = PID_INTEGRAL_DRIVE_MAX / PID_PARAM(Ki,e);  
347 357
   }
348 358
 #endif
349 359
 #ifdef PIDTEMPBED
@@ -464,14 +474,14 @@ void manage_heater()
464 474
             temp_iState[e] = 0.0;
465 475
             pid_reset[e] = false;
466 476
           }
467
-          pTerm[e] = Kp * pid_error[e];
477
+          pTerm[e] = PID_PARAM(Kp,e) * pid_error[e];
468 478
           temp_iState[e] += pid_error[e];
469 479
           temp_iState[e] = constrain(temp_iState[e], temp_iState_min[e], temp_iState_max[e]);
470
-          iTerm[e] = Ki * temp_iState[e];
480
+          iTerm[e] = PID_PARAM(Ki,e) * temp_iState[e];
471 481
 
472 482
           //K1 defined in Configuration.h in the PID settings
473 483
           #define K2 (1.0-K1)
474
-          dTerm[e] = (Kd * (pid_input - temp_dState[e]))*K2 + (K1 * dTerm[e]);
484
+          dTerm[e] = (PID_PARAM(Kd,e) * (pid_input - temp_dState[e]))*K2 + (K1 * dTerm[e]);
475 485
           pid_output = pTerm[e] + iTerm[e] - dTerm[e];
476 486
           if (pid_output > PID_MAX) {
477 487
             if (pid_error[e] > 0 )  temp_iState[e] -= pid_error[e]; // conditional un-integration
@@ -811,7 +821,7 @@ void tp_init()
811 821
     maxttemp[e] = maxttemp[0];
812 822
 #ifdef PIDTEMP
813 823
     temp_iState_min[e] = 0.0;
814
-    temp_iState_max[e] = PID_INTEGRAL_DRIVE_MAX / Ki;
824
+    temp_iState_max[e] = PID_INTEGRAL_DRIVE_MAX / PID_PARAM(Ki,e);
815 825
 #endif //PIDTEMP
816 826
 #ifdef PIDTEMPBED
817 827
     temp_iState_min_bed = 0.0;

+ 8
- 1
Marlin/temperature.h View File

@@ -58,7 +58,14 @@ extern float current_temperature_bed;
58 58
 #endif
59 59
 
60 60
 #ifdef PIDTEMP
61
-  extern float Kp,Ki,Kd,Kc;
61
+
62
+  #ifdef PID_PARAMS_PER_EXTRUDER
63
+    extern float Kp[EXTRUDERS], Ki[EXTRUDERS], Kd[EXTRUDERS], Kc[EXTRUDERS]; // one param per extruder
64
+    #define PID_PARAM(param,e) param[e] // use macro to point to array value
65
+  #else
66
+    extern float Kp, Ki, Kd, Kc; // one param per extruder - saves 20 or 36 bytes of ram (inc array pointer)
67
+    #define PID_PARAM(param, e) param // use macro to point directly to value
68
+  #endif // PID_PARAMS_PER_EXTRUDER	
62 69
   float scalePID_i(float i);
63 70
   float scalePID_d(float d);
64 71
   float unscalePID_i(float i);

+ 43
- 16
Marlin/ultralcd.cpp View File

@@ -185,8 +185,9 @@ void* editValue;
185 185
 int32_t minEditValue, maxEditValue;
186 186
 menuFunc_t callbackFunc;
187 187
 
188
-// place-holders for Ki and Kd edits
188
+// place-holders for Ki and Kd edits, and the extruder # being edited
189 189
 float raw_Ki, raw_Kd;
190
+int pid_current_extruder;
190 191
 
191 192
 static void lcd_goto_menu(menuFunc_t menu, const uint32_t encoder=0, const bool feedback=true) {
192 193
   if (currentMenu != menu) {
@@ -765,12 +766,6 @@ static void lcd_control_menu()
765 766
 
766 767
 static void lcd_control_temperature_menu()
767 768
 {
768
-#ifdef PIDTEMP
769
-    // set up temp variables - undo the default scaling
770
-    raw_Ki = unscalePID_i(Ki);
771
-    raw_Kd = unscalePID_d(Kd);
772
-#endif
773
-
774 769
     START_MENU();
775 770
     MENU_ITEM(back, MSG_CONTROL, lcd_control_menu);
776 771
 #if TEMP_SENSOR_0 != 0
@@ -793,13 +788,45 @@ static void lcd_control_temperature_menu()
793 788
     MENU_ITEM_EDIT(float32, MSG_FACTOR, &autotemp_factor, 0.0, 1.0);
794 789
 #endif
795 790
 #ifdef PIDTEMP
796
-    MENU_ITEM_EDIT(float52, MSG_PID_P, &Kp, 1, 9990);
797
-    // i is typically a small value so allows values below 1
798
-    MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I, &raw_Ki, 0.01, 9990, copy_and_scalePID_i);
799
-    MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D, &raw_Kd, 1, 9990, copy_and_scalePID_d);
800
-# ifdef PID_ADD_EXTRUSION_RATE
801
-    MENU_ITEM_EDIT(float3, MSG_PID_C, &Kc, 1, 9990);
802
-# endif//PID_ADD_EXTRUSION_RATE
791
+	// set up temp variables - undo the default scaling
792
+	pid_current_extruder = 0;
793
+	raw_Ki = unscalePID_i(PID_PARAM(Ki,0));
794
+	raw_Kd = unscalePID_d(PID_PARAM(Kd,0));
795
+	MENU_ITEM_EDIT(float52, MSG_PID_P, &PID_PARAM(Kp,0), 1, 9990);
796
+	// i is typically a small value so allows values below 1
797
+	MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I, &raw_Ki, 0.01, 9990, copy_and_scalePID_i);
798
+	MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D, &raw_Kd, 1, 9990, copy_and_scalePID_d);
799
+    #ifdef PID_ADD_EXTRUSION_RATE
800
+	  MENU_ITEM_EDIT(float3, MSG_PID_C, &PID_PARAM(Kc,0), 1, 9990);
801
+    #endif//PID_ADD_EXTRUSION_RATE
802
+#ifdef PID_PARAMS_PER_EXTRUDER
803
+  #if EXTRUDERS > 1
804
+	  // set up temp variables - undo the default scaling
805
+	  pid_current_extruder = 0;
806
+	  raw_Ki = unscalePID_i(PID_PARAM(Ki,1));
807
+	  raw_Kd = unscalePID_d(PID_PARAM(Kd,1));
808
+	  MENU_ITEM_EDIT(float52, MSG_PID_P1, &PID_PARAM(Kp,1), 1, 9990);
809
+	  // i is typically a small value so allows values below 1
810
+	  MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I1, &raw_Ki, 0.01, 9990, copy_and_scalePID_i);
811
+	  MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D1, &raw_Kd, 1, 9990, copy_and_scalePID_d);
812
+      #ifdef PID_ADD_EXTRUSION_RATE
813
+	    MENU_ITEM_EDIT(float3, MSG_PID_C1, &PID_PARAM(Kc,1), 1, 9990);
814
+      #endif//PID_ADD_EXTRUSION_RATE
815
+  #endif//EXTRUDERS > 1
816
+  #if EXTRUDERS > 2
817
+	    // set up temp variables - undo the default scaling
818
+	    pid_current_extruder = 0;
819
+	    raw_Ki = unscalePID_i(PID_PARAM(Ki,2));
820
+	    raw_Kd = unscalePID_d(PID_PARAM(Kd,2));
821
+	    MENU_ITEM_EDIT(float52, MSG_PID_P2, &PID_PARAM(Kp,2), 1, 9990);
822
+	    // i is typically a small value so allows values below 1
823
+	    MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_I2, &raw_Ki, 0.01, 9990, copy_and_scalePID_i);
824
+	    MENU_ITEM_EDIT_CALLBACK(float52, MSG_PID_D2, &raw_Kd, 1, 9990, copy_and_scalePID_d);
825
+        #ifdef PID_ADD_EXTRUSION_RATE
826
+	      MENU_ITEM_EDIT(float3, MSG_PID_C2, &PID_PARAM(Kc,2), 1, 9990);
827
+        #endif//PID_ADD_EXTRUSION_RATE
828
+  #endif//EXTRUDERS > 2
829
+#endif // PID_PARAMS_PER_EXTRUDER
803 830
 #endif//PIDTEMP
804 831
     MENU_ITEM(submenu, MSG_PREHEAT_PLA_SETTINGS, lcd_control_temperature_preheat_pla_settings_menu);
805 832
     MENU_ITEM(submenu, MSG_PREHEAT_ABS_SETTINGS, lcd_control_temperature_preheat_abs_settings_menu);
@@ -1706,7 +1733,7 @@ char *ftostr52(const float &x)
1706 1733
 void copy_and_scalePID_i()
1707 1734
 {
1708 1735
 #ifdef PIDTEMP
1709
-  Ki = scalePID_i(raw_Ki);
1736
+  PID_PARAM(Ki, pid_current_extruder) = scalePID_i(raw_Ki);
1710 1737
   updatePID();
1711 1738
 #endif
1712 1739
 }
@@ -1716,7 +1743,7 @@ void copy_and_scalePID_i()
1716 1743
 void copy_and_scalePID_d()
1717 1744
 {
1718 1745
 #ifdef PIDTEMP
1719
-  Kd = scalePID_d(raw_Kd);
1746
+	PID_PARAM(Kd, pid_current_extruder) = scalePID_d(raw_Kd);
1720 1747
   updatePID();
1721 1748
 #endif
1722 1749
 }

Loading…
Cancel
Save