INOS
cinospidcontroller.h
Go to the documentation of this file.
1//******************************************************************************
27//******************************************************************************
28
29#ifndef INC_CINOSPIDCONTROL_H
30#define INC_CINOSPIDCONTROL_H
31
32//------------------------------------------------------------------------------
33// defines
34//------------------------------------------------------------------------------
35//
36#define DF_INOS_PID_CONTROLLER_NAME "CINOSPidController" // controller name
37//
38//------------------------------------------------------------------------------
39// includes
40//------------------------------------------------------------------------------
41//
42// system
43#include <cinosbasecontroller.h>
44//
45// C++
46//
47// project
48//
49//------------------------------------------------------------------------------
50//--- structures ---------------------------------------------------------------
51//------------------------------------------------------------------------------
52//
53struct SPidVal
54 //; structure of PID parameters
55{
56 real64 m_rKp;
57 real64 m_rKi;
58 real64 m_rKd;
59 real64 m_rAff;
60 real64 m_rTi;
61 real64 m_rTd;
62 real64 m_rVff;
63 real64 m_rBff;
64 real64 m_rSff;
65 real64 m_rSffoffset;
66};
67
68//------------------------------------------------------------------------------
69// class definition
70//------------------------------------------------------------------------------
71//
73{
74 //--- user interface ---------------------------------------------------
75
76 // public member functions
77 public :
78
79 // constructor/destructor
80
81 CINOSPidController(const char* apInpName, const char* apOutName);
82 //; constructor
83 virtual ~CINOSPidController();
84 //; destructor
85 virtual void SetCycleTime(real64 arCycleTime);
86 //; set controller cycle time [sec]
87
88 virtual void Activate(bool abCheckVal = true, bool abSimulateVal = false,
89 bool abSimulateOut = false, bool abSimulateAct = false);
90
91 virtual CINCOObject* GetRegister();
92 //; do inco registration and return pointer to it
93
94 //--- internals --------------------------------------------------------
95
96 friend class CINCOPidCtrPar;
97
98 // protected member functions
99 protected:
100 virtual void Reset();
101 //; reset controller values (called whenever the controller is
102 //; switched on)
103 ICACHE virtual void Control();
104 //; do a control cycle
105
106 // protected members
107 protected:
108 uint8 m_uActSet;
109 //; actual PID set (0-halt, 1-run)
110
111 // controller parameters (0-halt, 1-run forward, 2-run backward)
112 SPidVal m_Pid[3];
113 //; pid parameters
114 real64 m_rSint;
115 //; actual value integrator
116 real64 m_rSintMin;
117 //; min. allowed value integrator
118 real64 m_rSintMax;
119 //; max. allowed value integrator
120 real64 m_rSignalFF;
121 //; signal feed forward factor
122 inosName32 m_cSignalName;
123 //; signal name (analog input or analog output)
124 CINOSAdcChannel* m_pAdcSignal;
125 //; analog input
126 CINOSDacChannel* m_pDacSignal;
127 //; analog output
128
129 // allow dynamic object handling (new/delete)
130 DECLARE_DYNAMIC_CACHE(CINOSPidController);
131};
132
133
134//------------------------------------------------------------------------------
135// end of file
136//------------------------------------------------------------------------------
137
138#endif // INC_CINOSPIDCONTROLLER_H
Short comment.
Definition cinosadcchannel.h:53
Definition cinosbasecontroller.h:110
Definition cinosdacchannel.h:52
Definition cinosmcmodule.h:1900
Definition cinospidcontroller.h:73
Definition cinospidcontroller.h:55