2 this file is part of smoothie (http://smoothieware.org/). the motion control part is heavily based on grbl (https://github.com/simen/grbl).
3 smoothie is free software: you can redistribute it and/or modify it under the terms of the gnu general public license as published by the free software foundation, either version 3 of the license, or (at your option) any later version.
4 smoothie is distributed in the hope that it will be useful, but without any warranty; without even the implied warranty of merchantability or fitness for a particular purpose. see the gnu general public license for more details.
5 you should have received a copy of the gnu general public license along with smoothie. if not, see <http://www.gnu.org/licenses/>.
8 #ifndef TEMPERATURECONTROL_H
9 #define TEMPERATURECONTROL_H
13 #include "TempSensor.h"
14 #include "TemperatureControlPublicAccess.h"
16 class TemperatureControl
: public Module
{
19 TemperatureControl(uint16_t name
, int index
);
20 ~TemperatureControl();
22 void on_module_loaded();
23 void on_main_loop(void* argument
);
24 void on_gcode_received(void* argument
);
25 void on_second_tick(void* argument
);
26 void on_get_public_data(void* argument
);
27 void on_set_public_data(void* argument
);
28 void on_halt(void* argument
);
30 void set_desired_temperature(float desired_temperature
);
32 float get_temperature();
34 enum RUNAWAY_TYPE
{NOT_HEATING
, WAITING_FOR_TEMP_TO_BE_REACHED
, TARGET_TEMPERATURE_REACHED
};
36 friend class PID_Autotuner
;
40 uint32_t thermistor_read_tick(uint32_t dummy
);
41 void pid_process(float);
45 float target_temperature
;
46 float max_temp
, min_temp
;
60 float readings_per_second
;
62 uint16_t name_checksum
;
67 uint16_t set_and_wait_m_code
;
70 std::string designator
;
72 void setPIDp(float p
);
73 void setPIDi(float i
);
74 void setPIDd(float d
);
85 // Temperature runaway values
86 RUNAWAY_TYPE runaway_state
;
90 uint8_t runaway_heating_timer
:8;
91 // Temperature runaway config options
92 uint8_t runaway_range
:8;
93 uint8_t runaway_heating_timeout
:8;
101 bool sensor_settings
:1;