blob: 954d0da0f89d36e7ee0dfed4718405cd50e1ccae (
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
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
|
#ifndef MODULES_HEATERS_HEATERS_H_
#define MODULES_HEATERS_HEATERS_H_
#include "PMR/Hardware/HardwarePidControl.pb-c.h"
#include "PMR/Hardware/HardwarePidControlType.pb-c.h"
/******************** DEFINITIONS ********************************************/
#define MAX_AC_HEATERS HARDWARE_PID_CONTROL_TYPE__DryerHeater200w2+1
#define MAX_TIMESLICES 200
#define MAX_HEATERS_NUM HARDWARE_PID_CONTROL_TYPE__MixerHeater+1
#define MAX_HEATERS_TEMPERATURE 300
extern uint32_t OutputProportionalSingleStep; //A/C Heaters step size from one decision point to another - in cpu clocks. 120000 = 1 millisecod
extern uint32_t OutputProportionalCycleTime; //A/C Heaters Cycle time in milliseconds - one for all heaters
//extern uint32_t Heater_timerBase; //Timer handle
extern char TimeSliceAllocation[MAX_TIMESLICES];
extern int DCTimeSliceAllocation[MAX_HEATERS_NUM];
extern int NumberOFSlicesInUse;
extern uint32_t MillisecondsPerChange;
typedef struct HeaterPIDControlConfigstruc
{
bool configured;
int id; //HardwarePidControlType
char name[20];
int32_t outputproportionalpowerlimit;
int32_t outputproportionalband;
int32_t integraltime;
int32_t derivativetime;
int32_t sensorcorrectionadjustment;
int32_t sensortypeandsetpointlimits;
int32_t setpointramprateorsoftstartramp;
int32_t setpointcontroloutputrate;
int32_t controloutputtype;
int32_t ssrcontroloutputtype;
int32_t outputonoffhysteresisvalues;
int32_t processvariablesamplingrate;
int32_t pvinputfilterfactormode;
double kp;
double ki;
double kd;
}HeaterPIDControlConfig;
typedef struct HeaterCommandstruc
{
int heaterid; //HardwarePidControlType
bool command;
uint32_t targettemperatue;
}HeaterCommand;
typedef struct
{
bool m_isEnabled;
float m_SetParam;
float m_mesuredParam;
float m_preError;
float m_integral;
float m_calculatedError;
bool m_isReady;
PID_Config_Params m_params;
}HeaterControlConfig_t;
extern HeaterPIDControlConfig HeaterControl[MAX_HEATERS_NUM];
extern HeaterControlConfig_t HeaterPIDConfig[MAX_HEATERS_NUM];
extern HeaterCommand HeaterCmd[MAX_HEATERS_NUM];
extern uint32_t HeaterId2PT100Id[MAX_HEATERS_NUM];
extern uint32_t Heater_timerBase;
uint32_t HeaterRecalculateSharedHeatersParams(uint32_t deviceId, uint32_t new_outputproportionalpowerlimit);
void HeatingTestSendResonse(uint32_t status, bool last,bool heater1Active,bool heater2Active, int temperature1, int temperature2,int Heater1Percentage,int Heater2Percentage, char* Message);
#endif
|