Patrick Venture | d801218 | 2018-03-08 08:21:38 -0800 | [diff] [blame] | 1 | #pragma once |
| 2 | |
Patrick Venture | d801218 | 2018-03-08 08:21:38 -0800 | [diff] [blame] | 3 | #include "ec/pid.hpp" |
James Feist | 22c257a | 2018-08-31 14:07:12 -0700 | [diff] [blame] | 4 | #include "pidcontroller.hpp" |
Patrick Venture | d801218 | 2018-03-08 08:21:38 -0800 | [diff] [blame] | 5 | |
Patrick Venture | da4a5dd | 2018-08-31 09:42:48 -0700 | [diff] [blame] | 6 | #include <memory> |
| 7 | #include <string> |
| 8 | #include <vector> |
Patrick Venture | d801218 | 2018-03-08 08:21:38 -0800 | [diff] [blame] | 9 | |
| 10 | /* |
| 11 | * A ThermalController is a PID controller that reads a number of sensors and |
| 12 | * provides the set-points for the fans. |
| 13 | */ |
| 14 | class ThermalController : public PIDController |
| 15 | { |
Patrick Venture | da4a5dd | 2018-08-31 09:42:48 -0700 | [diff] [blame] | 16 | public: |
| 17 | static std::unique_ptr<PIDController> |
| 18 | CreateThermalPid(ZoneInterface* owner, const std::string& id, |
| 19 | std::vector<std::string>& inputs, float setpoint, |
| 20 | ec::pidinfo initial); |
Patrick Venture | d801218 | 2018-03-08 08:21:38 -0800 | [diff] [blame] | 21 | |
Patrick Venture | da4a5dd | 2018-08-31 09:42:48 -0700 | [diff] [blame] | 22 | ThermalController(const std::string& id, std::vector<std::string>& inputs, |
| 23 | ZoneInterface* owner) : |
| 24 | PIDController(id, owner), |
| 25 | _inputs(inputs) |
| 26 | { |
| 27 | } |
Patrick Venture | d801218 | 2018-03-08 08:21:38 -0800 | [diff] [blame] | 28 | |
Patrick Venture | da4a5dd | 2018-08-31 09:42:48 -0700 | [diff] [blame] | 29 | float input_proc(void) override; |
| 30 | float setpt_proc(void) override; |
| 31 | void output_proc(float value) override; |
Patrick Venture | d801218 | 2018-03-08 08:21:38 -0800 | [diff] [blame] | 32 | |
Patrick Venture | da4a5dd | 2018-08-31 09:42:48 -0700 | [diff] [blame] | 33 | private: |
| 34 | std::vector<std::string> _inputs; |
Patrick Venture | d801218 | 2018-03-08 08:21:38 -0800 | [diff] [blame] | 35 | }; |