temperature.h

Sat, 07 Nov 2015 13:24:46 +0100

author
mbayer
date
Sat, 07 Nov 2015 13:24:46 +0100
changeset 1
b584642d4f58
parent 0
2c8ba1964db7
permissions
-rw-r--r--

several modifications to support laser enable - still needs cleanup

0
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
1 /*
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
2 temperature.h - temperature controller
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
3 Part of Marlin
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
4
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
5 Copyright (c) 2011 Erik van der Zalm
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
6
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
7 Grbl is free software: you can redistribute it and/or modify
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
8 it under the terms of the GNU General Public License as published by
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
9 the Free Software Foundation, either version 3 of the License, or
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
10 (at your option) any later version.
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
11
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
12 Grbl is distributed in the hope that it will be useful,
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
13 but WITHOUT ANY WARRANTY; without even the implied warranty of
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
15 GNU General Public License for more details.
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
16
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
17 You should have received a copy of the GNU General Public License
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
18 along with Grbl. If not, see <http://www.gnu.org/licenses/>.
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
19 */
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
20
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
21 #ifndef temperature_h
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
22 #define temperature_h
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
23
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
24 #include "Marlin.h"
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
25 #include "planner.h"
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
26 #include "slave_comms.h"
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
27
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
28 // If we are using a slave board we have multiple extruders, but we only have to worry
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
29 // about the temperature of the first one of them.
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
30
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
31 #ifdef REPRAPPRO_MULTIMATERIALS
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
32 #define EXTRUDERS_T 1
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
33 #else
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
34 #define EXTRUDERS_T EXTRUDERS
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
35 #endif
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
36
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
37 // public functions
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
38 void tp_init(); //initialise the heating
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
39 void manage_heater(); //it is critical that this is called periodically.
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
40
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
41 //low leven conversion routines
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
42 // do not use this routines and variables outsie of temperature.cpp
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
43 int temp2analog(int celsius, uint8_t e);
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
44 int temp2analogBed(int celsius);
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
45 float analog2temp(int raw, uint8_t e);
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
46 float analog2tempBed(int raw);
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
47 extern int target_raw[EXTRUDERS_T];
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
48 extern int heatingtarget_raw[EXTRUDERS_T];
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
49 extern int current_raw[EXTRUDERS_T];
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
50 static int minttemp[EXTRUDERS_T] = { 50 };
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
51 static int maxttemp[EXTRUDERS_T] = { 16383 }; // the first value used for all
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
52 extern int target_raw_bed;
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
53 extern int current_raw_bed;
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
54 extern int b_beta;
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
55 extern int b_resistor;
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
56 extern long b_thermistor;
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
57 extern float b_inf;
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
58
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
59 extern int n_beta;
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
60 extern int n_resistor;
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
61 extern long n_thermistor;
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
62 extern float n_inf;
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
63
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
64 extern float Kp,Ki,Kd,Kc;
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
65 extern int Ki_Max;
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
66
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
67 #ifdef PIDTEMP
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
68 extern float pid_setpoint[EXTRUDERS_T];
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
69 #endif
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
70
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
71 //high level conversion routines, for use outside of temperature.cpp
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
72 //inline so that there is no performance decrease.
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
73 //deg=degreeCelsius
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
74
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
75 #ifdef REPRAPPRO_MULTIMATERIALS
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
76 FORCE_INLINE float degHotend(uint8_t extruder)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
77 {
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
78 if(extruder == 0)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
79 return analog2temp(current_raw[extruder], extruder);
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
80 else
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
81 return slaveDegHotend(extruder);
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
82 };
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
83
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
84 FORCE_INLINE void setTargetHotend(const float &celsius, uint8_t extruder)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
85 {
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
86 if(extruder == 0)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
87 {
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
88 target_raw[extruder] = temp2analog(celsius, extruder);
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
89 #ifdef PIDTEMP
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
90 pid_setpoint[extruder] = celsius;
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
91 #endif //PIDTEMP
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
92 } else
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
93 slaveSetTargetHotend(celsius, extruder);
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
94 };
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
95
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
96 FORCE_INLINE float degTargetHotend(uint8_t extruder)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
97 {
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
98 if(extruder == 0)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
99 return analog2temp(target_raw[extruder], extruder);
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
100 else
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
101 return slaveDegTargetHotend(extruder);
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
102 };
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
103
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
104 FORCE_INLINE bool isHeatingHotend(uint8_t extruder)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
105 {
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
106 if(extruder == 0)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
107 return target_raw[extruder] > current_raw[extruder];
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
108 else
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
109 return slaveIsHeatingHotend(extruder);
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
110 };
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
111
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
112 FORCE_INLINE bool isCoolingHotend(uint8_t extruder)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
113 {
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
114 if(extruder == 0)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
115 return target_raw[extruder] < current_raw[extruder];
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
116 else
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
117 return slaveIsCoolingHotend(extruder);
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
118 };
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
119
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
120 #else
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
121
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
122 FORCE_INLINE float degHotend(uint8_t extruder) {
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
123 return analog2temp(current_raw[extruder], extruder);
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
124 };
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
125 FORCE_INLINE int rawHotend(uint8_t extruder) {
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
126 return current_raw[extruder];
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
127 };
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
128 FORCE_INLINE int minHotend(uint8_t extruder) {
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
129 return minttemp[extruder];
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
130 };
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
131 FORCE_INLINE int maxHotend(uint8_t extruder) {
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
132 return maxttemp[extruder];
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
133 };
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
134
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
135 FORCE_INLINE void setTargetHotend(const float &celsius, uint8_t extruder) {
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
136 target_raw[extruder] = temp2analog(celsius, extruder);
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
137 #ifdef PIDTEMP
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
138 pid_setpoint[extruder] = celsius;
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
139 #endif //PIDTEMP
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
140 };
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
141
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
142 FORCE_INLINE float degTargetHotend(uint8_t extruder) {
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
143 return analog2temp(target_raw[extruder], extruder);
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
144 };
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
145
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
146 FORCE_INLINE bool isHeatingHotend(uint8_t extruder){
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
147 return target_raw[extruder] > current_raw[extruder];
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
148 };
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
149
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
150 FORCE_INLINE bool isCoolingHotend(uint8_t extruder) {
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
151 return target_raw[extruder] < current_raw[extruder];
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
152 };
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
153 #endif // REPRAPPRO_MULTIMATERIALS
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
154
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
155
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
156
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
157 FORCE_INLINE float degBed() {
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
158 return analog2tempBed(current_raw_bed);
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
159 };
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
160
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
161 FORCE_INLINE float degTargetBed() {
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
162 return analog2tempBed(target_raw_bed);
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
163 };
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
164
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
165 FORCE_INLINE void setTargetBed(const float &celsius) {
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
166
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
167 target_raw_bed = temp2analogBed(celsius);
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
168 };
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
169
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
170 FORCE_INLINE bool isHeatingBed() {
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
171 return target_raw_bed > current_raw_bed;
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
172 };
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
173
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
174 FORCE_INLINE bool isCoolingBed() {
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
175 return target_raw_bed < current_raw_bed;
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
176 };
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
177
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
178 #define degHotend0() degHotend(0)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
179 #define degTargetHotend0() degTargetHotend(0)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
180 #define setTargetHotend0(_celsius) setTargetHotend((_celsius), 0)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
181 #define isHeatingHotend0() isHeatingHotend(0)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
182 #define isCoolingHotend0() isCoolingHotend(0)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
183 #if EXTRUDERS_T > 1
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
184 #define degHotend1() degHotend(1)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
185 #define degTargetHotend1() degTargetHotend(1)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
186 #define setTargetHotend1(_celsius) setTargetHotend((_celsius), 1)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
187 #define isHeatingHotend1() isHeatingHotend(1)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
188 #define isCoolingHotend1() isCoolingHotend(1)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
189 #else
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
190 #define setTargetHotend1(_celsius) do{}while(0)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
191 #endif
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
192 #if EXTRUDERS_T > 2
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
193 #define degHotend2() degHotend(2)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
194 #define degTargetHotend2() degTargetHotend(2)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
195 #define setTargetHotend2(_celsius) setTargetHotend((_celsius), 2)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
196 #define isHeatingHotend2() isHeatingHotend(2)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
197 #define isCoolingHotend2() isCoolingHotend(2)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
198 #else
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
199 #define setTargetHotend2(_celsius) do{}while(0)
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
200 #endif
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
201 #if EXTRUDERS_T > 3
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
202 #error Invalid number of extruders
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
203 #endif
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
204
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
205
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
206
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
207 int getHeaterPower(int heater);
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
208 void disable_heater();
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
209 void updatePID();
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
210
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
211 FORCE_INLINE void autotempShutdown(){
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
212 }
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
213
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
214 void PID_autotune(float temp);
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
215
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
216 #endif
2c8ba1964db7 Initial code from reprappro Marlin repository
mbayer
parents:
diff changeset
217

mercurial