Skip to content
Snippets Groups Projects
Commit aabbaa06 authored by wactbprot's avatar wactbprot
Browse files

set target temp

parent 5c7782b8
Branches
No related tags found
No related merge requests found
......@@ -90,6 +90,8 @@ CT > UL 1 0 1
* run
* init
* off
* target_temp_hold (get/ set with =val)
* target_temp_end (get/ set with =val)
* holdhours (get/ set with =val)
* voltage (get/ set with =val)
......@@ -109,6 +111,20 @@ curl -d '{"Action":"TCP","Host":"192.168.98.134","Port":"9009", "Value":"curren
```
curl -d '{"Action":"TCP","Host":"192.168.98.134","Port":"9009", "Value":"target_temp\n"}' -X PUT http://localhost:55555
```
### set hold temperature
```
curl -d '{"Action":"TCP","Host":"192.168.98.134","Port":"9009", "Value":"target_temp_hold=180.0\n"}' -X PUT http://localhost:55555
```
### set end temperature
```
curl -d '{"Action":"TCP","Host":"192.168.98.134","Port":"9009", "Value":"target_temp_end=100.0\n"}' -X PUT http://localhost:55555
```
### set voltage
```
......
......@@ -6,8 +6,7 @@
#define MAXTEMP 200.0
#define TEMPSLOPEPERHOUR 30.0
#define TARGETTEMPHIGH 180.0
#define TARGETTEMPEND 100.0
#define ROOMTEMP 22.5
#define BREAKTEMP 10.0
......@@ -27,12 +26,12 @@ T in C |
|--- MAXTEMP ----------------------------- MAXTEMP ----------
|
|
| xxxxxxxxxxxxxxxxxxxx TARGETTEMPHIGH
| xxxxxxxxxxxxxxxxxxxx target_temp_hold
| xx | xx
| xx | xx
| xxx | xx
| xx| TEMPSLOPE xx
| xx | +-------xx TARGETTEMPEND
| xx | +-------xx target_temp_end
| xx |
| xx |
| xx |
......@@ -60,6 +59,10 @@ IPAddress ip(192, 168, 98, 134);
EthernetServer server(PORT);
String cmd, param;
// temperatures
float target_temp_hold = 180.0;
float target_temp_end = 100.0;
// run
unsigned long start_time = 0;
int holdhours = 0;
......@@ -130,7 +133,7 @@ float get_current_temperature() {
t1...t3: see drawing
*/
unsigned long get_t1(){
return (TARGETTEMPHIGH-ROOMTEMP)/TEMPSLOPEPERHOUR*HOURTOSECOND;
return (target_temp_hold-ROOMTEMP)/TEMPSLOPEPERHOUR*HOURTOSECOND;
}
unsigned long get_t2(){
unsigned long t1 = get_t1();
......@@ -138,7 +141,7 @@ unsigned long get_t2(){
}
unsigned long get_t3(){
unsigned long t2 = get_t2();
return t2 +(TARGETTEMPHIGH-TARGETTEMPEND)/TEMPSLOPEPERHOUR*HOURTOSECOND;
return t2 +(target_temp_hold-target_temp_end)/TEMPSLOPEPERHOUR*HOURTOSECOND;
}
String current_state() {
......@@ -257,13 +260,13 @@ float get_target_temperature(String state, float ct) {
tt = ROOMTEMP+TEMPSLOPEPERHOUR*rel_time/HOURTOSECOND;
}
if (state == "bakeout"){
tt = TARGETTEMPHIGH;
tt = target_temp_hold;
}
if (state == "ramp_down"){
tt = TARGETTEMPHIGH-TEMPSLOPEPERHOUR*(rel_time-t2)/HOURTOSECOND;
tt = target_temp_hold-TEMPSLOPEPERHOUR*(rel_time-t2)/HOURTOSECOND;
}
if (state == "hold_end") {
tt = TARGETTEMPEND;
tt = target_temp_end;
}
Serial.print("temperature should: ");
......@@ -417,6 +420,32 @@ String net_exec(String state, String cmd, String param) {
res = String(tt);
}
if (cmd == "target_temp_hold") {
if (param != "") {
if(digitalRead(CONTROLLINO_DI0)) {
target_temp_hold = param.toFloat();
res = String(target_temp_hold);
} else {
res = "read only mode";
}
} else {
res = String(target_temp_hold);
}
}
if (cmd == "target_temp_end") {
if (param != "") {
if(digitalRead(CONTROLLINO_DI0)) {
target_temp_end = param.toFloat();
res = String(target_temp_end);
} else {
res = "read only mode";
}
} else {
res = String(target_temp_end);
}
}
if (cmd == "run") {
if(digitalRead(CONTROLLINO_DI0)) {
unsigned long st = set_start_seconds("now");
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment