AnimatLab  2
Test
StdPID.h
1 
7 #pragma once
8 
9 namespace StdUtils
10 {
17  class STD_UTILS_PORT CStdPID
18  {
19  protected:
20  CStdCircularArray<float> m_aryOldErrors;
21  float m_fltError;
22  float m_fltSetpoint;
23  float m_fltErrorChange;
24 
25  float m_fltGain;
26  float m_fltIntegralAct;
27  float m_fltDerivativeAct;
28 
29  float m_fltProportional;
30  float m_fltIntegral;
31  float m_fltOldIntegral;
32  float m_fltDerivative;
33 
34  float m_fltOutput;
35  float m_fltOldOutput;
36 
37  bool m_bComplexError;
38  bool m_bAntiResetWindup;
39  bool m_bRampLimit;
40 
41  float m_fltRangeMax;
42  float m_fltRangeMin;
43  float m_fltRange;
44  float m_fltARWBound;
45  float m_fltRampGradient;
46 
47  virtual void FullReset();
48 
49  public:
50  CStdPID(void);
51  CStdPID(float fltSetpoint, float fltGain, float fltIntegralAct, float fltDerivativeAct,
52  bool bComplexError, bool bAntiResetWindup, bool bRampLimit,
53  float fltRangeMax, float fltRangeMin, float fltARWBound, float fltRampGradient);
54  virtual ~CStdPID(void);
55 
56  virtual float Error();
57  virtual float ErrorChange();
58 
59  virtual void Setpoint(float fltVal);
60  virtual float Setpoint();
61 
62  virtual void Gain(float fltVal);
63  virtual float Gain();
64 
65  virtual void IntegralAct(float fltVal);
66  virtual float IntegralAct();
67 
68  virtual void DerivativeAct(float fltVal) ;
69  virtual float DerivativeAct();
70 
71  virtual float Proportional();
72  virtual float Integral();
73  virtual float OldIntegral();
74  virtual float Derivative();
75  virtual float Output();
76  virtual float OldOutput();
77 
78  virtual void ComplexError(bool bVal);
79  virtual bool ComplexError();
80 
81  virtual void AntiResetWindup(bool bVal);
82  virtual bool AntiResetWindup();
83 
84  virtual void RampLimit(bool bVal);
85  virtual bool RampLimit();
86 
87  virtual void RangeMax(float fltVal);
88  virtual float RangeMax();
89 
90  virtual void RangeMin(float fltVal);
91  virtual float RangeMin();
92 
93  virtual float Range();
94 
95  virtual void ARWBound(float fltVal);
96  virtual float ARWBound();
97 
98  virtual void RampGradient(float fltVal);
99  virtual float RampGradient();
100 
101  virtual void ResetVars();
102  virtual float Calculate(float fltDt, float fltInput);
103 
104  //virtual void Load(CStdXml &oXml);
105  };
106 
107 } //AnimatSim
Implements a basic PID control algorithm.
Definition: StdPID.h:17
Namespace for the standard utility objects.
Definition: MarkupSTL.cpp:19