OpenWAM
TPIDController.h
1 /*--------------------------------------------------------------------------------*\
2 ==========================|
3  \\ /\ /\ // O pen | OpenWAM: The Open Source 1D Gas-Dynamic Code
4  \\ | X | // W ave |
5  \\ \/_\/ // A ction | CMT-Motores Termicos / Universidad Politecnica Valencia
6  \\/ \// M odel |
7  ----------------------------------------------------------------------------------
8  License
9 
10  This file is part of OpenWAM.
11 
12  OpenWAM is free software: you can redistribute it and/or modify
13  it under the terms of the GNU General Public License as published by
14  the Free Software Foundation, either version 3 of the License, or
15  (at your option) any later version.
16 
17  OpenWAM is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
20  GNU General Public License for more details.
21 
22  You should have received a copy of the GNU General Public License
23  along with OpenWAM. If not, see <http://www.gnu.org/licenses/>.
24 
25 
26  \*--------------------------------------------------------------------------------*/
27 
28 //---------------------------------------------------------------------------
29 #ifndef TPIDControllerH
30 #define TPIDControllerH
31 
32 #include "TController.h"
33 
35 class TPIDController: public TController {
36  private:
37  int fID;
38 
39  double fKP_pos;
40  double fKI_pos;
41  double fKD_pos;
42 
43  double fKP_neg;
44  double fKI_neg;
45  double fKD_neg;
46 
47  double fpact;
48  double fdact;
49  double fiact;
50 
51  double fMax_out;
52  double fMin_out;
53 
54  double fError;
55  double fError_ant;
56 
57  double fTime_ant;
58 
59  double fSetPoint;
60 
61  //double fVar_ant;
62  double fI_ant;
63 
64  double fOutput;
65  double fOutput0;
66 
67  double fOutput_filt;
68  double fOutput_filt_ant;
69  double fOutput_ant;
70  double fTime_ant_filt;
71 
72  double fPeriod;
73  double fGain;
74  double fDelay;
75 
76  double fDwell;
77 
78  bool fInicio;
79 
80  bool fSetPointControlled;
81  int fSetPointControllerID;
82 
83  TController *fSetPointController;
84 
85  public:
86 
88  TPIDController(int i
89  );
90 
93 
95  double Output(double Time
96  );
97 
99  void LeeController(const char *FileWAM,
100  fpos_t &filepos
101  );
102 
104  void AsignaObjetos(TSensor **Sensor,
105  TController **Controller
106  );
107 
109  void LeeResultadosMedControlador(const char *FileWAM,
110  fpos_t &filepos
111  );
112 
114  void LeeResultadosInsControlador(const char *FileWAM,
115  fpos_t &filepos
116  );
117 
119  void CabeceraResultadosMedControlador(stringstream& medoutput
120  );
121 
123  void CabeceraResultadosInsControlador(stringstream&
124  insoutput
125  );
126 
128  void ImprimeResultadosMedControlador(stringstream& medoutput
129  );
130 
132  void ImprimeResultadosInsControlador(stringstream&
133  insoutput
134  );
135 
137  void IniciaMedias();
138 
141 
143  void AcumulaResultadosMediosController(double Actual
144  );
145 
148 
149 };
150 
151 //---------------------------------------------------------------------------
152 #endif
void ResultadosInstantController()
void LeeResultadosMedControlador(const char *FileWAM, fpos_t &filepos)
void ImprimeResultadosInsControlador(stringstream &insoutput)
void AsignaObjetos(TSensor **Sensor, TController **Controller)
void ImprimeResultadosMedControlador(stringstream &medoutput)
void AcumulaResultadosMediosController(double Actual)
void CabeceraResultadosInsControlador(stringstream &insoutput)
void ResultadosMediosController()
void CabeceraResultadosMedControlador(stringstream &medoutput)
void LeeResultadosInsControlador(const char *FileWAM, fpos_t &filepos)
void LeeController(const char *FileWAM, fpos_t &filepos)
double Output(double Time)