aboutsummaryrefslogtreecommitdiffstats
path: root/Software/Embedded_SW/Embedded/Modules/Heaters/Heaters.h
blob: b1d870919301d8dc6b0f19545bf1903e7c95f779 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
pre { line-height: 125%; }
td.linenos .normal { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
span.linenos { color: inherit; background-color: transparent; padding-left: 5px; padding-right: 5px; }
td.linenos .special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
span.linenos.special { color: #000000; background-color: #ffffc0; padding-left: 5px; padding-right: 5px; }
.highlight .hll { background-co
#ifndef MODULES_HEATERS_HEATERS_H_
#define MODULES_HEATERS_HEATERS_H_
#include "PMR/Hardware/HardwarePidControl.pb-c.h"
#include "PMR/Hardware/HardwarePidControlType.pb-c.h"
#include "heaters_ex.h"
#include "Drivers/Heater/Heater.h"
/******************** DEFINITIONS  ********************************************/
#define MAX_AC_HEATERS (HARDWARE_PID_CONTROL_TYPE__DryerHeaterSecondary+1)
#define MAX_TIMESLICES 200

extern uint32_t OutputProportionalSingleStep;  //A/C Heaters step size from one decision point to another - in cpu clocks. 120000 = 1 millisecod
extern uint32_t 
rn char TimeSliceAllocation[MAX_TIMESLICES]; extern int DCTimeSliceAllocation[HEATER_TYPE_MAX_HEATERS]; extern int NumberOFSlicesInUse; extern uint32_t MillisecondsPerChange; void initializeArrays(void); typedef struct HeaterPIDControlConfigstruc { bool configured; int id; //HardwarePidControlType float outputproportionalpowerlimit; float outputproportionalband; //int32_t sensorcorrectionadjustment; //int32_t sensortypeandsetpointlimits; float IntegralErrorMultiplier; //setpointramprateorsoftstartramp //int32_t setpointcontroloutputrate; float ProportionalErrorMultiplier;//outputonoffhysteresisvalue; //int32_t processvariablesamplingrate; //int32_t pvinputfilterfactormode; int32_t sensormaxvalue; int32_t sensorminvalue; double kp; double ki; double kd; double epsilon; double dt; bool pidactive; }HeaterPIDControlConfig; typedef struct HeaterCommandstruc { int heaterid; //HardwarePidControlType bool command; uint32_t targettemperatue; }HeaterCommand; extern HeaterPIDControlConfig HeaterControl[HEATER_TYPE_MAX_HEATERS]; extern HeaterCommand HeaterCmd[HEATER_TYPE_MAX_HEATERS]; extern uint32_t Heater_timerBase; uint32_t HeaterRecalculateSharedHeatersParams(uint32_t deviceId, uint32_t new_outputproportionalpowerlimit); uint32_t HeaterRecalculateHeaterParams(uint32_t deviceId, uint32_t new_outputproportionalpowerlimit); uint32_t HeatersSingleHeaterEnd(int HeaterId); #endif