APM:Libraries
Heat_Pwm.h
Go to the documentation of this file.
1 /*
2  This program is free software: you can redistribute it and/or modify
3  it under the terms of the GNU General Public License as published by
4  the Free Software Foundation, either version 3 of the License, or
5  (at your option) any later version.
6 
7  This program is distributed in the hope that it will be useful,
8  but WITHOUT ANY WARRANTY; without even the implied warranty of
9  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
10  GNU General Public License for more details.
11 
12  You should have received a copy of the GNU General Public License
13  along with this program. If not, see <http://www.gnu.org/licenses/>.
14  */
15 #pragma once
16 
17 #include "AP_HAL_Linux.h"
18 #include "PWM_Sysfs.h"
19 #include "Heat.h"
20 
21 namespace Linux {
22 
23 class HeatPwm : public Heat {
24 public:
25  HeatPwm(uint8_t pwm_num, float Kp, float Ki,
26  uint32_t period_ns);
27  void set_imu_temp(float current) override;
28  void set_imu_target_temp(int8_t *target) override;
29 
30 private:
32  uint32_t _last_temp_update = 0;
33  float _Kp;
34  float _Ki;
35  uint32_t _period_ns;
36  float _sum_error;
37  int8_t *_target = nullptr;
38 };
39 
40 }
HeatPwm(uint8_t pwm_num, float Kp, float Ki, uint32_t period_ns)
Definition: Heat_Pwm.cpp:39
int8_t * _target
Definition: Heat_Pwm.h:37
float _sum_error
Definition: Heat_Pwm.h:36
uint32_t _last_temp_update
Definition: Heat_Pwm.h:32
uint32_t _period_ns
Definition: Heat_Pwm.h:35
void set_imu_target_temp(int8_t *target) override
Definition: Heat_Pwm.cpp:92
PWM_Sysfs_Base * _pwm
Definition: Heat_Pwm.h:31
void set_imu_temp(float current) override
Definition: Heat_Pwm.cpp:57