Переглянути джерело

✨ Steinhart-Hart C Coeff for Custom Thermistor (#24428)

Nikolay-Po 2 роки тому
джерело
коміт
8a1643587b
Аккаунт користувача з таким Email не знайдено
2 змінених файлів з 70 додано та 56 видалено
  1. 56
    42
      Marlin/Configuration_adv.h
  2. 14
    14
      Marlin/src/module/temperature.cpp

+ 56
- 42
Marlin/Configuration_adv.h Переглянути файл

@@ -54,87 +54,101 @@
54 54
 // Custom Thermistor 1000 parameters
55 55
 //
56 56
 #if TEMP_SENSOR_0 == 1000
57
-  #define HOTEND0_PULLUP_RESISTOR_OHMS 4700    // Pullup resistor
58
-  #define HOTEND0_RESISTANCE_25C_OHMS  100000  // Resistance at 25C
59
-  #define HOTEND0_BETA                 3950    // Beta value
57
+  #define HOTEND0_PULLUP_RESISTOR_OHMS    4700 // Pullup resistor
58
+  #define HOTEND0_RESISTANCE_25C_OHMS   100000 // Resistance at 25C
59
+  #define HOTEND0_BETA                    3950 // Beta value
60
+  #define HOTEND0_SH_C_COEFF                 0 // Steinhart-Hart C coefficient
60 61
 #endif
61 62
 
62 63
 #if TEMP_SENSOR_1 == 1000
63
-  #define HOTEND1_PULLUP_RESISTOR_OHMS 4700    // Pullup resistor
64
-  #define HOTEND1_RESISTANCE_25C_OHMS  100000  // Resistance at 25C
65
-  #define HOTEND1_BETA                 3950    // Beta value
64
+  #define HOTEND1_PULLUP_RESISTOR_OHMS    4700 // Pullup resistor
65
+  #define HOTEND1_RESISTANCE_25C_OHMS   100000 // Resistance at 25C
66
+  #define HOTEND1_BETA                    3950 // Beta value
67
+  #define HOTEND1_SH_C_COEFF                 0 // Steinhart-Hart C coefficient
66 68
 #endif
67 69
 
68 70
 #if TEMP_SENSOR_2 == 1000
69
-  #define HOTEND2_PULLUP_RESISTOR_OHMS 4700    // Pullup resistor
70
-  #define HOTEND2_RESISTANCE_25C_OHMS  100000  // Resistance at 25C
71
-  #define HOTEND2_BETA                 3950    // Beta value
71
+  #define HOTEND2_PULLUP_RESISTOR_OHMS    4700 // Pullup resistor
72
+  #define HOTEND2_RESISTANCE_25C_OHMS   100000 // Resistance at 25C
73
+  #define HOTEND2_BETA                    3950 // Beta value
74
+  #define HOTEND2_SH_C_COEFF                 0 // Steinhart-Hart C coefficient
72 75
 #endif
73 76
 
74 77
 #if TEMP_SENSOR_3 == 1000
75
-  #define HOTEND3_PULLUP_RESISTOR_OHMS 4700    // Pullup resistor
76
-  #define HOTEND3_RESISTANCE_25C_OHMS  100000  // Resistance at 25C
77
-  #define HOTEND3_BETA                 3950    // Beta value
78
+  #define HOTEND3_PULLUP_RESISTOR_OHMS    4700 // Pullup resistor
79
+  #define HOTEND3_RESISTANCE_25C_OHMS   100000 // Resistance at 25C
80
+  #define HOTEND3_BETA                    3950 // Beta value
81
+  #define HOTEND3_SH_C_COEFF                 0 // Steinhart-Hart C coefficient
78 82
 #endif
79 83
 
80 84
 #if TEMP_SENSOR_4 == 1000
81
-  #define HOTEND4_PULLUP_RESISTOR_OHMS 4700    // Pullup resistor
82
-  #define HOTEND4_RESISTANCE_25C_OHMS  100000  // Resistance at 25C
83
-  #define HOTEND4_BETA                 3950    // Beta value
85
+  #define HOTEND4_PULLUP_RESISTOR_OHMS    4700 // Pullup resistor
86
+  #define HOTEND4_RESISTANCE_25C_OHMS   100000 // Resistance at 25C
87
+  #define HOTEND4_BETA                    3950 // Beta value
88
+  #define HOTEND4_SH_C_COEFF                 0 // Steinhart-Hart C coefficient
84 89
 #endif
85 90
 
86 91
 #if TEMP_SENSOR_5 == 1000
87
-  #define HOTEND5_PULLUP_RESISTOR_OHMS 4700    // Pullup resistor
88
-  #define HOTEND5_RESISTANCE_25C_OHMS  100000  // Resistance at 25C
89
-  #define HOTEND5_BETA                 3950    // Beta value
92
+  #define HOTEND5_PULLUP_RESISTOR_OHMS    4700 // Pullup resistor
93
+  #define HOTEND5_RESISTANCE_25C_OHMS   100000 // Resistance at 25C
94
+  #define HOTEND5_BETA                    3950 // Beta value
95
+  #define HOTEND5_SH_C_COEFF                 0 // Steinhart-Hart C coefficient
90 96
 #endif
91 97
 
92 98
 #if TEMP_SENSOR_6 == 1000
93
-  #define HOTEND6_PULLUP_RESISTOR_OHMS 4700    // Pullup resistor
94
-  #define HOTEND6_RESISTANCE_25C_OHMS  100000  // Resistance at 25C
95
-  #define HOTEND6_BETA                 3950    // Beta value
99
+  #define HOTEND6_PULLUP_RESISTOR_OHMS    4700 // Pullup resistor
100
+  #define HOTEND6_RESISTANCE_25C_OHMS   100000 // Resistance at 25C
101
+  #define HOTEND6_BETA                    3950 // Beta value
102
+  #define HOTEND6_SH_C_COEFF                 0 // Steinhart-Hart C coefficient
96 103
 #endif
97 104
 
98 105
 #if TEMP_SENSOR_7 == 1000
99
-  #define HOTEND7_PULLUP_RESISTOR_OHMS 4700    // Pullup resistor
100
-  #define HOTEND7_RESISTANCE_25C_OHMS  100000  // Resistance at 25C
101
-  #define HOTEND7_BETA                 3950    // Beta value
106
+  #define HOTEND7_PULLUP_RESISTOR_OHMS    4700 // Pullup resistor
107
+  #define HOTEND7_RESISTANCE_25C_OHMS   100000 // Resistance at 25C
108
+  #define HOTEND7_BETA                    3950 // Beta value
109
+  #define HOTEND7_SH_C_COEFF                 0 // Steinhart-Hart C coefficient
102 110
 #endif
103 111
 
104 112
 #if TEMP_SENSOR_BED == 1000
105
-  #define BED_PULLUP_RESISTOR_OHMS     4700    // Pullup resistor
106
-  #define BED_RESISTANCE_25C_OHMS      100000  // Resistance at 25C
107
-  #define BED_BETA                     3950    // Beta value
113
+  #define BED_PULLUP_RESISTOR_OHMS        4700 // Pullup resistor
114
+  #define BED_RESISTANCE_25C_OHMS       100000 // Resistance at 25C
115
+  #define BED_BETA                        3950 // Beta value
116
+  #define BED_SH_C_COEFF                     0 // Steinhart-Hart C coefficient
108 117
 #endif
109 118
 
110 119
 #if TEMP_SENSOR_CHAMBER == 1000
111
-  #define CHAMBER_PULLUP_RESISTOR_OHMS 4700    // Pullup resistor
112
-  #define CHAMBER_RESISTANCE_25C_OHMS  100000  // Resistance at 25C
113
-  #define CHAMBER_BETA                 3950    // Beta value
120
+  #define CHAMBER_PULLUP_RESISTOR_OHMS    4700 // Pullup resistor
121
+  #define CHAMBER_RESISTANCE_25C_OHMS   100000 // Resistance at 25C
122
+  #define CHAMBER_BETA                    3950 // Beta value
123
+  #define CHAMBER_SH_C_COEFF                 0 // Steinhart-Hart C coefficient
114 124
 #endif
115 125
 
116 126
 #if TEMP_SENSOR_COOLER == 1000
117
-  #define COOLER_PULLUP_RESISTOR_OHMS 4700    // Pullup resistor
118
-  #define COOLER_RESISTANCE_25C_OHMS  100000  // Resistance at 25C
119
-  #define COOLER_BETA                 3950    // Beta value
127
+  #define COOLER_PULLUP_RESISTOR_OHMS     4700 // Pullup resistor
128
+  #define COOLER_RESISTANCE_25C_OHMS    100000 // Resistance at 25C
129
+  #define COOLER_BETA                     3950 // Beta value
130
+  #define COOLER_SH_C_COEFF                  0 // Steinhart-Hart C coefficient
120 131
 #endif
121 132
 
122 133
 #if TEMP_SENSOR_PROBE == 1000
123
-  #define PROBE_PULLUP_RESISTOR_OHMS   4700    // Pullup resistor
124
-  #define PROBE_RESISTANCE_25C_OHMS    100000  // Resistance at 25C
125
-  #define PROBE_BETA                   3950    // Beta value
134
+  #define PROBE_PULLUP_RESISTOR_OHMS      4700 // Pullup resistor
135
+  #define PROBE_RESISTANCE_25C_OHMS     100000 // Resistance at 25C
136
+  #define PROBE_BETA                      3950 // Beta value
137
+  #define PROBE_SH_C_COEFF                   0 // Steinhart-Hart C coefficient
126 138
 #endif
127 139
 
128 140
 #if TEMP_SENSOR_BOARD == 1000
129
-  #define BOARD_PULLUP_RESISTOR_OHMS   4700    // Pullup resistor
130
-  #define BOARD_RESISTANCE_25C_OHMS    100000  // Resistance at 25C
131
-  #define BOARD_BETA                   3950    // Beta value
141
+  #define BOARD_PULLUP_RESISTOR_OHMS      4700 // Pullup resistor
142
+  #define BOARD_RESISTANCE_25C_OHMS     100000 // Resistance at 25C
143
+  #define BOARD_BETA                      3950 // Beta value
144
+  #define BOARD_SH_C_COEFF                   0 // Steinhart-Hart C coefficient
132 145
 #endif
133 146
 
134 147
 #if TEMP_SENSOR_REDUNDANT == 1000
135
-  #define REDUNDANT_PULLUP_RESISTOR_OHMS   4700    // Pullup resistor
136
-  #define REDUNDANT_RESISTANCE_25C_OHMS    100000  // Resistance at 25C
137
-  #define REDUNDANT_BETA                   3950    // Beta value
148
+  #define REDUNDANT_PULLUP_RESISTOR_OHMS  4700 // Pullup resistor
149
+  #define REDUNDANT_RESISTANCE_25C_OHMS 100000 // Resistance at 25C
150
+  #define REDUNDANT_BETA                  3950 // Beta value
151
+  #define REDUNDANT_SH_C_COEFF               0 // Steinhart-Hart C coefficient
138 152
 #endif
139 153
 
140 154
 /**

+ 14
- 14
Marlin/src/module/temperature.cpp Переглянути файл

@@ -1947,46 +1947,46 @@ void Temperature::task() {
1947 1947
   void Temperature::reset_user_thermistors() {
1948 1948
     user_thermistor_t default_user_thermistor[USER_THERMISTORS] = {
1949 1949
       #if TEMP_SENSOR_0_IS_CUSTOM
1950
-        { true, 0, 0, HOTEND0_PULLUP_RESISTOR_OHMS, HOTEND0_RESISTANCE_25C_OHMS, 0, 0, HOTEND0_BETA, 0 },
1950
+        { true, HOTEND0_SH_C_COEFF, 0, HOTEND0_PULLUP_RESISTOR_OHMS, HOTEND0_RESISTANCE_25C_OHMS, 0, 0, HOTEND0_BETA, 0 },
1951 1951
       #endif
1952 1952
       #if TEMP_SENSOR_1_IS_CUSTOM
1953
-        { true, 0, 0, HOTEND1_PULLUP_RESISTOR_OHMS, HOTEND1_RESISTANCE_25C_OHMS, 0, 0, HOTEND1_BETA, 0 },
1953
+        { true, HOTEND1_SH_C_COEFF, 0, HOTEND1_PULLUP_RESISTOR_OHMS, HOTEND1_RESISTANCE_25C_OHMS, 0, 0, HOTEND1_BETA, 0 },
1954 1954
       #endif
1955 1955
       #if TEMP_SENSOR_2_IS_CUSTOM
1956
-        { true, 0, 0, HOTEND2_PULLUP_RESISTOR_OHMS, HOTEND2_RESISTANCE_25C_OHMS, 0, 0, HOTEND2_BETA, 0 },
1956
+        { true, HOTEND2_SH_C_COEFF, 0, HOTEND2_PULLUP_RESISTOR_OHMS, HOTEND2_RESISTANCE_25C_OHMS, 0, 0, HOTEND2_BETA, 0 },
1957 1957
       #endif
1958 1958
       #if TEMP_SENSOR_3_IS_CUSTOM
1959
-        { true, 0, 0, HOTEND3_PULLUP_RESISTOR_OHMS, HOTEND3_RESISTANCE_25C_OHMS, 0, 0, HOTEND3_BETA, 0 },
1959
+        { true, HOTEND3_SH_C_COEFF, 0, HOTEND3_PULLUP_RESISTOR_OHMS, HOTEND3_RESISTANCE_25C_OHMS, 0, 0, HOTEND3_BETA, 0 },
1960 1960
       #endif
1961 1961
       #if TEMP_SENSOR_4_IS_CUSTOM
1962
-        { true, 0, 0, HOTEND4_PULLUP_RESISTOR_OHMS, HOTEND4_RESISTANCE_25C_OHMS, 0, 0, HOTEND4_BETA, 0 },
1962
+        { true, HOTEND4_SH_C_COEFF, 0, HOTEND4_PULLUP_RESISTOR_OHMS, HOTEND4_RESISTANCE_25C_OHMS, 0, 0, HOTEND4_BETA, 0 },
1963 1963
       #endif
1964 1964
       #if TEMP_SENSOR_5_IS_CUSTOM
1965
-        { true, 0, 0, HOTEND5_PULLUP_RESISTOR_OHMS, HOTEND5_RESISTANCE_25C_OHMS, 0, 0, HOTEND5_BETA, 0 },
1965
+        { true, HOTEND5_SH_C_COEFF, 0, HOTEND5_PULLUP_RESISTOR_OHMS, HOTEND5_RESISTANCE_25C_OHMS, 0, 0, HOTEND5_BETA, 0 },
1966 1966
       #endif
1967 1967
       #if TEMP_SENSOR_6_IS_CUSTOM
1968
-        { true, 0, 0, HOTEND6_PULLUP_RESISTOR_OHMS, HOTEND6_RESISTANCE_25C_OHMS, 0, 0, HOTEND6_BETA, 0 },
1968
+        { true, HOTEND6_SH_C_COEFF, 0, HOTEND6_PULLUP_RESISTOR_OHMS, HOTEND6_RESISTANCE_25C_OHMS, 0, 0, HOTEND6_BETA, 0 },
1969 1969
       #endif
1970 1970
       #if TEMP_SENSOR_7_IS_CUSTOM
1971
-        { true, 0, 0, HOTEND7_PULLUP_RESISTOR_OHMS, HOTEND7_RESISTANCE_25C_OHMS, 0, 0, HOTEND7_BETA, 0 },
1971
+        { true, HOTEND7_SH_C_COEFF, 0, HOTEND7_PULLUP_RESISTOR_OHMS, HOTEND7_RESISTANCE_25C_OHMS, 0, 0, HOTEND7_BETA, 0 },
1972 1972
       #endif
1973 1973
       #if TEMP_SENSOR_BED_IS_CUSTOM
1974
-        { true, 0, 0, BED_PULLUP_RESISTOR_OHMS, BED_RESISTANCE_25C_OHMS, 0, 0, BED_BETA, 0 },
1974
+        { true, BED_SH_C_COEFF, 0, BED_PULLUP_RESISTOR_OHMS, BED_RESISTANCE_25C_OHMS, 0, 0, BED_BETA, 0 },
1975 1975
       #endif
1976 1976
       #if TEMP_SENSOR_CHAMBER_IS_CUSTOM
1977
-        { true, 0, 0, CHAMBER_PULLUP_RESISTOR_OHMS, CHAMBER_RESISTANCE_25C_OHMS, 0, 0, CHAMBER_BETA, 0 },
1977
+        { true, CHAMBER_SH_C_COEFF, 0, CHAMBER_PULLUP_RESISTOR_OHMS, CHAMBER_RESISTANCE_25C_OHMS, 0, 0, CHAMBER_BETA, 0 },
1978 1978
       #endif
1979 1979
       #if TEMP_SENSOR_COOLER_IS_CUSTOM
1980
-        { true, 0, 0, COOLER_PULLUP_RESISTOR_OHMS, COOLER_RESISTANCE_25C_OHMS, 0, 0, COOLER_BETA, 0 },
1980
+        { true, COOLER_SH_C_COEFF, 0, COOLER_PULLUP_RESISTOR_OHMS, COOLER_RESISTANCE_25C_OHMS, 0, 0, COOLER_BETA, 0 },
1981 1981
       #endif
1982 1982
       #if TEMP_SENSOR_PROBE_IS_CUSTOM
1983
-        { true, 0, 0, PROBE_PULLUP_RESISTOR_OHMS, PROBE_RESISTANCE_25C_OHMS, 0, 0, PROBE_BETA, 0 },
1983
+        { true, PROBE_SH_C_COEFF, 0, PROBE_PULLUP_RESISTOR_OHMS, PROBE_RESISTANCE_25C_OHMS, 0, 0, PROBE_BETA, 0 },
1984 1984
       #endif
1985 1985
       #if TEMP_SENSOR_BOARD_IS_CUSTOM
1986
-        { true, 0, 0, BOARD_PULLUP_RESISTOR_OHMS, BOARD_RESISTANCE_25C_OHMS, 0, 0, BOARD_BETA, 0 },
1986
+        { true, BOARD_SH_C_COEFF, 0, BOARD_PULLUP_RESISTOR_OHMS, BOARD_RESISTANCE_25C_OHMS, 0, 0, BOARD_BETA, 0 },
1987 1987
       #endif
1988 1988
       #if TEMP_SENSOR_REDUNDANT_IS_CUSTOM
1989
-        { true, 0, 0, REDUNDANT_PULLUP_RESISTOR_OHMS, REDUNDANT_RESISTANCE_25C_OHMS, 0, 0, REDUNDANT_BETA, 0 },
1989
+        { true, REDUNDANT_SH_C_COEFF, 0, REDUNDANT_PULLUP_RESISTOR_OHMS, REDUNDANT_RESISTANCE_25C_OHMS, 0, 0, REDUNDANT_BETA, 0 },
1990 1990
       #endif
1991 1991
     };
1992 1992
     COPY(user_thermistor, default_user_thermistor);

Завантаження…
Відмінити
Зберегти