From 0a19109476fd9053a0e13df191342bc3604076de Mon Sep 17 00:00:00 2001
From: kieranc <kieranc@gmail.com>
Date: Tue, 10 Feb 2015 14:11:44 +0100
Subject: [PATCH 1/9] Enable PID debugging for heated bed

---
 Marlin/temperature.cpp | 14 ++++++++++++++
 1 file changed, 14 insertions(+)

diff --git a/Marlin/temperature.cpp b/Marlin/temperature.cpp
index 9889e1fda5..6289288b45 100644
--- a/Marlin/temperature.cpp
+++ b/Marlin/temperature.cpp
@@ -647,6 +647,20 @@ void manage_heater()
     #else 
       pid_output = constrain(target_temperature_bed, 0, MAX_BED_POWER);
     #endif //PID_OPENLOOP
+        #ifdef PID_BED_DEBUG
+    SERIAL_ECHO_START;
+    SERIAL_ECHO(" PID_BED_DEBUG ");
+    SERIAL_ECHO(": Input ");
+    SERIAL_ECHO(pid_input);
+    SERIAL_ECHO(" Output ");
+    SERIAL_ECHO(pid_output);
+    SERIAL_ECHO(" pTerm ");
+    SERIAL_ECHO(pTerm_bed);
+    SERIAL_ECHO(" iTerm ");
+    SERIAL_ECHO(iTerm_bed);
+    SERIAL_ECHO(" dTerm ");
+    SERIAL_ECHOLN(dTerm_bed);
+    #endif //PID_BED_DEBUG
 
 	  if((current_temperature_bed > BED_MINTEMP) && (current_temperature_bed < BED_MAXTEMP)) 
 	  {

From b9ed873827f03482bc5cca12efd4a8cb8b301604 Mon Sep 17 00:00:00 2001
From: kieranc <kieranc@gmail.com>
Date: Tue, 10 Feb 2015 14:13:06 +0100
Subject: [PATCH 2/9] Enable PID debugging for heated bed

---
 Marlin/Configuration.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Marlin/Configuration.h b/Marlin/Configuration.h
index 9b422a812c..b9f31540bb 100644
--- a/Marlin/Configuration.h
+++ b/Marlin/Configuration.h
@@ -218,6 +218,8 @@ Here are some standard links for getting your machine calibrated:
 // so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
 #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
 
+//#define PID_BED_DEBUG // Sends debug data to the serial port.
+
 #ifdef PIDTEMPBED
 //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
 //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)

From 1c71e4751a157bfc1c5df1aff5d08aeee7ae98af Mon Sep 17 00:00:00 2001
From: kieranc <kieranc@gmail.com>
Date: Mon, 23 Feb 2015 09:39:07 +0100
Subject: [PATCH 3/9] Enable PID debugging for heated bed

---
 Marlin/example_configurations/Hephestos/Configuration.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Marlin/example_configurations/Hephestos/Configuration.h b/Marlin/example_configurations/Hephestos/Configuration.h
index 2823f2d95c..7025a33b8e 100644
--- a/Marlin/example_configurations/Hephestos/Configuration.h
+++ b/Marlin/example_configurations/Hephestos/Configuration.h
@@ -224,6 +224,8 @@ Here are some standard links for getting your machine calibrated:
 // so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
 #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
 
+//#define PID_BED_DEBUG // Sends debug data to the serial port.
+
 #ifdef PIDTEMPBED
 //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
 //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)

From c89413db1e4c0551e05050bd6a3229f7706aaa6c Mon Sep 17 00:00:00 2001
From: kieranc <kieranc@gmail.com>
Date: Mon, 23 Feb 2015 09:39:39 +0100
Subject: [PATCH 4/9] Enable PID debugging for heated bed

---
 Marlin/example_configurations/K8200/Configuration.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Marlin/example_configurations/K8200/Configuration.h b/Marlin/example_configurations/K8200/Configuration.h
index 06e944b194..3eef687360 100644
--- a/Marlin/example_configurations/K8200/Configuration.h
+++ b/Marlin/example_configurations/K8200/Configuration.h
@@ -225,6 +225,8 @@ Here are some standard links for getting your machine calibrated:
 // so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
 #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
 
+//#define PID_BED_DEBUG // Sends debug data to the serial port.
+
 #ifdef PIDTEMPBED
 //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
 //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)

From 08c543f8fb7af47e74f0fa7c56a09730216a993b Mon Sep 17 00:00:00 2001
From: kieranc <kieranc@gmail.com>
Date: Mon, 23 Feb 2015 09:40:06 +0100
Subject: [PATCH 5/9] Enable PID debugging for heated bed

---
 Marlin/example_configurations/SCARA/Configuration.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Marlin/example_configurations/SCARA/Configuration.h b/Marlin/example_configurations/SCARA/Configuration.h
index 8bc4eb70e9..c4d54cdde3 100644
--- a/Marlin/example_configurations/SCARA/Configuration.h
+++ b/Marlin/example_configurations/SCARA/Configuration.h
@@ -245,6 +245,8 @@ Here are some standard links for getting your machine calibrated:
 // so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
 #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
 
+//#define PID_BED_DEBUG // Sends debug data to the serial port.
+
 #ifdef PIDTEMPBED
 //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
 //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)

From fb56aad8984f995d08bf798bab7e43b38504d632 Mon Sep 17 00:00:00 2001
From: kieranc <kieranc@gmail.com>
Date: Mon, 23 Feb 2015 09:40:29 +0100
Subject: [PATCH 6/9] Enable PID debugging for heated bed

---
 Marlin/example_configurations/WITBOX/Configuration.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Marlin/example_configurations/WITBOX/Configuration.h b/Marlin/example_configurations/WITBOX/Configuration.h
index 4a12bda515..547bef050b 100644
--- a/Marlin/example_configurations/WITBOX/Configuration.h
+++ b/Marlin/example_configurations/WITBOX/Configuration.h
@@ -227,6 +227,8 @@ Here are some standard links for getting your machine calibrated:
 // so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
 #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
 
+//#define PID_BED_DEBUG // Sends debug data to the serial port.
+
 #ifdef PIDTEMPBED
 //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
 //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)

From 21bd4fd6dbe1093ee3463d6f2d1993f16f99794a Mon Sep 17 00:00:00 2001
From: kieranc <kieranc@gmail.com>
Date: Mon, 23 Feb 2015 09:40:53 +0100
Subject: [PATCH 7/9] Enable PID debugging for heated bed

---
 Marlin/example_configurations/delta/Configuration.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Marlin/example_configurations/delta/Configuration.h b/Marlin/example_configurations/delta/Configuration.h
index 3eb268041a..c33f2f9582 100644
--- a/Marlin/example_configurations/delta/Configuration.h
+++ b/Marlin/example_configurations/delta/Configuration.h
@@ -242,6 +242,8 @@ Here are some standard links for getting your machine calibrated:
 // so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
 #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
 
+//#define PID_BED_DEBUG // Sends debug data to the serial port.
+
 #ifdef PIDTEMPBED
 //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
 //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)

From 29097b0ab228840090d9be0364cfa1d1fd4ef0df Mon Sep 17 00:00:00 2001
From: kieranc <kieranc@gmail.com>
Date: Mon, 23 Feb 2015 09:41:25 +0100
Subject: [PATCH 8/9] Enable PID debugging for heated bed

---
 Marlin/example_configurations/makibox/Configuration.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Marlin/example_configurations/makibox/Configuration.h b/Marlin/example_configurations/makibox/Configuration.h
index 99feceba8c..788f3b2271 100644
--- a/Marlin/example_configurations/makibox/Configuration.h
+++ b/Marlin/example_configurations/makibox/Configuration.h
@@ -225,6 +225,8 @@ Here are some standard links for getting your machine calibrated:
 // to increase the heat up rate. However, if changed, user must be aware of the safety concerns
 // of drawing too much current from the power supply.
 
+//#define PID_BED_DEBUG // Sends debug data to the serial port.
+
 #ifdef PIDTEMPBED
 //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
 //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)

From 8ccdac9898ca1c724e076ce1de6e4fd2fe4ad622 Mon Sep 17 00:00:00 2001
From: kieranc <kieranc@gmail.com>
Date: Mon, 23 Feb 2015 09:42:01 +0100
Subject: [PATCH 9/9] Enable PID debugging for heated bed

---
 Marlin/example_configurations/tvrrug/Round2/Configuration.h | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/Marlin/example_configurations/tvrrug/Round2/Configuration.h b/Marlin/example_configurations/tvrrug/Round2/Configuration.h
index 4ca415d8ff..f12fd01caa 100644
--- a/Marlin/example_configurations/tvrrug/Round2/Configuration.h
+++ b/Marlin/example_configurations/tvrrug/Round2/Configuration.h
@@ -228,6 +228,8 @@ Here are some standard links for getting your machine calibrated:
 // so you shouldn't use it unless you are OK with PWM on your bed.  (see the comment on enabling PIDTEMPBED)
 #define MAX_BED_POWER 255 // limits duty cycle to bed; 255=full current
 
+//#define PID_BED_DEBUG // Sends debug data to the serial port.
+
 #ifdef PIDTEMPBED
 //120v 250W silicone heater into 4mm borosilicate (MendelMax 1.5+)
 //from FOPDT model - kp=.39 Tp=405 Tdead=66, Tc set to 79.2, aggressive factor of .15 (vs .1, 1, 10)