Browse Source

Pt100 and Pt1000 temperature sensors handling

Josef Pavlik 10 years ago
parent
commit
831fc2a952
2 changed files with 69 additions and 0 deletions
  1. 5
    0
      Marlin/Configuration.h
  2. 64
    0
      Marlin/thermistortables.h

+ 5
- 0
Marlin/Configuration.h View File

@@ -120,6 +120,11 @@
120 120
 // 51 is 100k thermistor - EPCOS (1k pullup)
121 121
 // 52 is 200k thermistor - ATC Semitec 204GT-2 (1k pullup)
122 122
 // 55 is 100k thermistor - ATC Semitec 104GT-2 (Used in ParCan & J-Head) (1k pullup)
123
+//
124
+// 1047 is Pt1000 with 4k7 pullup
125
+// 1010 is Pt1000 with 1k pullup (non standard)
126
+// 147 is Pt100 with 4k7 pullup
127
+// 110 is Pt100 with 1k pullup (non standard)
123 128
 
124 129
 #define TEMP_SENSOR_0 -1
125 130
 #define TEMP_SENSOR_1 -1

+ 64
- 0
Marlin/thermistortables.h View File

@@ -857,6 +857,70 @@ const short temptable_60[][2] PROGMEM = {
857 857
 };
858 858
 #endif
859 859
 
860
+// Pt1000 and Pt100 handling
861
+// 
862
+// Rt=R0*(1+a*T+b*T*T) [for T>0]
863
+// a=3.9083E-3, b=-5.775E-7
864
+
865
+#define PtA 3.9083E-3
866
+#define PtB -5.775E-7
867
+#define PtRt(T,R0) ((R0)*(1.0+(PtA)*(T)+(PtB)*(T)*(T)))
868
+#define PtAdVal(T,R0,Rup) (short)(1024/(Rup/PtRt(T,R0)+1))
869
+#define PtLine(T,R0,Rup) { PtAdVal(T,R0,Rup)*OVERSAMPLENR, T },
870
+
871
+#if (THERMISTORHEATER_0 == 110) || (THERMISTORHEATER_1 == 110) || (THERMISTORHEATER_2 == 110) || (THERMISTORBED == 110) // Pt100 with 1k0 pullup
872
+const short temptable_110[][2] PROGMEM = {
873
+// only few values are needed as the curve is very flat  
874
+  PtLine(0,100,1000)
875
+  PtLine(50,100,1000)
876
+  PtLine(100,100,1000)
877
+  PtLine(150,100,1000)
878
+  PtLine(200,100,1000)
879
+  PtLine(250,100,1000)
880
+  PtLine(300,100,1000)
881
+};
882
+#endif
883
+#if (THERMISTORHEATER_0 == 147) || (THERMISTORHEATER_1 == 147) || (THERMISTORHEATER_2 == 147) || (THERMISTORBED == 147) // Pt100 with 4k7 pullup
884
+const short temptable_147[][2] PROGMEM = {
885
+// only few values are needed as the curve is very flat  
886
+  PtLine(0,100,4700)
887
+  PtLine(50,100,4700)
888
+  PtLine(100,100,4700)
889
+  PtLine(150,100,4700)
890
+  PtLine(200,100,4700)
891
+  PtLine(250,100,4700)
892
+  PtLine(300,100,4700)
893
+};
894
+#endif
895
+#if (THERMISTORHEATER_0 == 1010) || (THERMISTORHEATER_1 == 1010) || (THERMISTORHEATER_2 == 1010) || (THERMISTORBED == 1010) // Pt1000 with 1k0 pullup
896
+const short temptable_1010[][2] PROGMEM = {
897
+  PtLine(0,1000,1000)
898
+  PtLine(25,1000,1000)
899
+  PtLine(50,1000,1000)
900
+  PtLine(75,1000,1000)
901
+  PtLine(100,1000,1000)
902
+  PtLine(125,1000,1000)
903
+  PtLine(150,1000,1000)
904
+  PtLine(175,1000,1000)
905
+  PtLine(200,1000,1000)
906
+  PtLine(225,1000,1000)
907
+  PtLine(250,1000,1000)
908
+  PtLine(275,1000,1000)
909
+  PtLine(300,1000,1000)
910
+};
911
+#endif
912
+#if (THERMISTORHEATER_0 == 1047) || (THERMISTORHEATER_1 == 1047) || (THERMISTORHEATER_2 == 1047) || (THERMISTORBED == 1047) // Pt1000 with 4k7 pullup
913
+const short temptable_1047[][2] PROGMEM = {
914
+// only few values are needed as the curve is very flat  
915
+  PtLine(0,1000,4700)
916
+  PtLine(50,1000,4700)
917
+  PtLine(100,1000,4700)
918
+  PtLine(150,1000,4700)
919
+  PtLine(200,1000,4700)
920
+  PtLine(250,1000,4700)
921
+  PtLine(300,1000,4700)
922
+};
923
+#endif
860 924
 
861 925
 #define _TT_NAME(_N) temptable_ ## _N
862 926
 #define TT_NAME(_N) _TT_NAME(_N)

Loading…
Cancel
Save