Browse Source

Merge pull request #1652 from AnHardt/PIDdebug

PID debug
Scott Lahteine 10 years ago
parent
commit
526a755a66

+ 2
- 0
Marlin/Configuration.h View File

225
 // so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
225
 // so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
226
 #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
226
 #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
227
 
227
 
228
+//#define PID_BED_DEBUG // Sends debug data to the serial port.
229
+
228
 #ifdef PIDTEMPBED
230
 #ifdef PIDTEMPBED
229
 //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
231
 //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
230
 //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
232
 //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)

+ 2
- 0
Marlin/configurator/config/Configuration.h View File

234
 // so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
234
 // so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
235
 #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
235
 #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
236
 
236
 
237
+//#define PID_BED_DEBUG // Sends debug data to the serial port.
238
+
237
 #ifdef PIDTEMPBED
239
 #ifdef PIDTEMPBED
238
 //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
240
 //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
239
 //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
241
 //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)

+ 2
- 0
Marlin/example_configurations/Felix/Configuration.h View File

215
 // so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
215
 // so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
216
 #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
216
 #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
217
 
217
 
218
+//#define PID_BED_DEBUG // Sends debug data to the serial port.
219
+
218
 #ifdef PIDTEMPBED
220
 #ifdef PIDTEMPBED
219
 // Felix Foil Heater
221
 // Felix Foil Heater
220
    #define DEFAULT_bedKp 103.37
222
    #define DEFAULT_bedKp 103.37

+ 2
- 0
Marlin/example_configurations/Felix/Configuration_DUAL.h View File

215
 // so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
215
 // so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
216
 #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
216
 #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
217
 
217
 
218
+//#define PID_BED_DEBUG // Sends debug data to the serial port.
219
+
218
 #ifdef PIDTEMPBED
220
 #ifdef PIDTEMPBED
219
 // Felix Foil Heater
221
 // Felix Foil Heater
220
    #define DEFAULT_bedKp 103.37
222
    #define DEFAULT_bedKp 103.37

+ 2
- 0
Marlin/example_configurations/Hephestos/Configuration.h View File

231
 // so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
231
 // so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
232
 #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
232
 #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
233
 
233
 
234
+//#define PID_BED_DEBUG // Sends debug data to the serial port.
235
+
234
 #ifdef PIDTEMPBED
236
 #ifdef PIDTEMPBED
235
 //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
237
 //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
236
 //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
238
 //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)

+ 2
- 0
Marlin/example_configurations/K8200/Configuration.h View File

230
 // so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
230
 // so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
231
 #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
231
 #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
232
 
232
 
233
+//#define PID_BED_DEBUG // Sends debug data to the serial port.
234
+
233
 #ifdef PIDTEMPBED
235
 #ifdef PIDTEMPBED
234
 //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
236
 //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
235
 //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
237
 //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)

+ 2
- 0
Marlin/example_configurations/SCARA/Configuration.h View File

254
 // so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
254
 // so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
255
 #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
255
 #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
256
 
256
 
257
+//#define PID_BED_DEBUG // Sends debug data to the serial port.
258
+
257
 #ifdef PIDTEMPBED
259
 #ifdef PIDTEMPBED
258
 //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
260
 //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
259
 //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
261
 //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)

+ 2
- 0
Marlin/example_configurations/WITBOX/Configuration.h View File

230
 // so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
230
 // so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
231
 #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
231
 #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
232
 
232
 
233
+//#define PID_BED_DEBUG // Sends debug data to the serial port.
234
+
233
 #ifdef PIDTEMPBED
235
 #ifdef PIDTEMPBED
234
 //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
236
 //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
235
 //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
237
 //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)

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

258
 // so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
258
 // so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
259
 #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
259
 #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
260
 
260
 
261
+//#define PID_BED_DEBUG // Sends debug data to the serial port.
262
+
261
 #ifdef PIDTEMPBED
263
 #ifdef PIDTEMPBED
262
 //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
264
 //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
263
 //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
265
 //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)

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

259
 // so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
259
 // so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
260
 #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
260
 #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
261
 
261
 
262
+//#define PID_BED_DEBUG // Sends debug data to the serial port.
263
+
262
 #ifdef PIDTEMPBED
264
 #ifdef PIDTEMPBED
263
 //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
265
 //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
264
 //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
266
 //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)

+ 2
- 0
Marlin/example_configurations/makibox/Configuration.h View File

228
 // to increase the heat up rate. However, if changed, user must be aware of the safety concerns
228
 // to increase the heat up rate. However, if changed, user must be aware of the safety concerns
229
 // of drawing too much current from the power supply.
229
 // of drawing too much current from the power supply.
230
 
230
 
231
+//#define PID_BED_DEBUG // Sends debug data to the serial port.
232
+
231
 #ifdef PIDTEMPBED
233
 #ifdef PIDTEMPBED
232
 //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
234
 //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
233
 //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
235
 //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)

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

230
 // so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
230
 // so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
231
 #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
231
 #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
232
 
232
 
233
+//#define PID_BED_DEBUG // Sends debug data to the serial port.
234
+
233
 #ifdef PIDTEMPBED
235
 #ifdef PIDTEMPBED
234
 //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
236
 //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
235
 //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)
237
 //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)

+ 15
- 0
Marlin/temperature.cpp View File

636
       pid_output = constrain(target_temperature_bed, 0, MAX_BED_POWER);
636
       pid_output = constrain(target_temperature_bed, 0, MAX_BED_POWER);
637
     #endif // PID_OPENLOOP
637
     #endif // PID_OPENLOOP
638
 
638
 
639
+    #ifdef PID_BED_DEBUG
640
+      SERIAL_ECHO_START;
641
+      SERIAL_ECHO(" PID_BED_DEBUG ");
642
+      SERIAL_ECHO(": Input ");
643
+      SERIAL_ECHO(current_temperature_bed);
644
+      SERIAL_ECHO(" Output ");
645
+      SERIAL_ECHO(pid_output);
646
+      SERIAL_ECHO(" pTerm ");
647
+      SERIAL_ECHO(pTerm_bed);
648
+      SERIAL_ECHO(" iTerm ");
649
+      SERIAL_ECHO(iTerm_bed);
650
+      SERIAL_ECHO(" dTerm ");
651
+      SERIAL_ECHOLN(dTerm_bed);
652
+    #endif //PID_BED_DEBUG
653
+
639
     return pid_output;
654
     return pid_output;
640
   }
655
   }
641
 #endif
656
 #endif

Loading…
Cancel
Save