- Aldebaran documentation |
- C++ Libraries |
- index

libalmath 2.8.7.4

- Main Page
- Related Pages
- Modules
- Namespaces
- Classes
- Files

- File List
- File Members

All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
pidcontroller.h
Go to the documentation of this file.
1 /*
2 * Copyright (c) 2012-2014 Aldebaran Robotics. All rights reserved.
3 * Use of this source code is governed by a BSD-style license that can be
4 * found in the COPYING file.
5 */
6
7 #ifndef _LIB_ALMATH_ALMATH_DSP_PIDCONTROLLER_H_
8 #define _LIB_ALMATH_ALMATH_DSP_PIDCONTROLLER_H_
9 #include <almath/api.h>
10
11 namespace AL {
12 namespace Math {
13
14 namespace DSP {
15 class ALMATH_API PIDController
16 {
17
18 public :
19 PIDController(void);
20
21 PIDController(float pKp,
22 float pKv,
23 float pKi,
24 float pThreshold,
25 float pStaticOffset,
26 float pPeriod);
27
28 ~PIDController();
29
30 void initialize();
31
32 void initialize(float pKp,
33 float pKv,
34 float pKi,
35 float pThreshold,
36 float pStaticOffset,
37 float pPeriod);
38
39 float computeFeedback(float pCommand,
40 float pSensor,
41 float pPeriod = -1.0f);
42 float computeFeedbackAbsolute(float pAbsoluteErr);
43
44 void setGains(float pKp, float pKv, float pKi);
45
46 private:
47 float fKp;
48 float fKv;
49 float fKi;
50
51 float fPeriod;
52
53 float fThreshold;
54 float fStaticOffset;
55
56 float fErr;
57 float fPreviousErr;
58 float fdErr;
59 float fiErr;
60
61 bool fFirstIteration;
62
63 void xResetParameters(void);
64 void xCheckData(void) const;
65 void xCheckPositif(float pVal) const;
66 void xCheckStriclyPositif(float pVal) const;
67 };
68 }
69 }
70 }
71 #endif // _LIB_ALMATH_ALMATH_DSP_PIDCONTROLLER_H_
AL::Math::DSP::PIDController
Definition: pidcontroller.h:15