-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathclass_p_i_d_controller.html
More file actions
213 lines (207 loc) · 9.33 KB
/
class_p_i_d_controller.html
File metadata and controls
213 lines (207 loc) · 9.33 KB
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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<title>naowalkoptimiser: PIDController Class Reference</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<link href="doxygen.css" rel="stylesheet" type="text/css"/>
</head>
<body>
<!-- Generated by Doxygen 1.6.1 -->
<div class="navigation" id="top">
<div class="tabs">
<ul>
<li><a href="main.html"><span>Main Page</span></a></li>
<li><a href="namespaces.html"><span>Namespaces</span></a></li>
<li class="current"><a href="annotated.html"><span>Classes</span></a></li>
<li><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div class="tabs">
<ul>
<li><a href="annotated.html"><span>Class List</span></a></li>
<li><a href="hierarchy.html"><span>Class Hierarchy</span></a></li>
<li><a href="functions.html"><span>Class Members</span></a></li>
</ul>
</div>
</div>
<div class="contents">
<h1>PIDController Class Reference</h1><!-- doxytag: class="PIDController" -->
<p><code>#include <<a class="el" href="pidcontroller_8h_source.html">pidcontroller.h</a>></code></p>
<p><a href="class_p_i_d_controller-members.html">List of all members.</a></p>
<table border="0" cellpadding="0" cellspacing="0">
<tr><td colspan="2"><h2>Public Member Functions</h2></td></tr>
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_i_d_controller.html#ae454e37251b6cd7509abe4a4600a0e0d">PIDController</a> (std::string name, float Kp, float Ki, float Kd, float period, float outputlowerlimit, float outputupperlimit)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top"> </td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_i_d_controller.html#a690e7ad4796e5c5143aa4b90f2f6677b">~PIDController</a> ()</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">float </td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_i_d_controller.html#a42a2fe12ab1468779dc15a5214c8ddf6">doControl</a> (float input)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_i_d_controller.html#a3a1ae9863a8db4e4253051dc60f92289">setTarget</a> (float target)</td></tr>
<tr><td class="memItemLeft" align="right" valign="top">void </td><td class="memItemRight" valign="bottom"><a class="el" href="class_p_i_d_controller.html#a2350478bf030bb30e65b38847b25cece">clearState</a> ()</td></tr>
</table>
<hr/><h2>Constructor & Destructor Documentation</h2>
<a class="anchor" id="ae454e37251b6cd7509abe4a4600a0e0d"></a><!-- doxytag: member="PIDController::PIDController" ref="ae454e37251b6cd7509abe4a4600a0e0d" args="(std::string name, float Kp, float Ki, float Kd, float period, float outputlowerlimit, float outputupperlimit)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">PIDController::PIDController </td>
<td>(</td>
<td class="paramtype">std::string </td>
<td class="paramname"> <em>mname</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float </td>
<td class="paramname"> <em>mKp</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float </td>
<td class="paramname"> <em>mKi</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float </td>
<td class="paramname"> <em>mKd</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float </td>
<td class="paramname"> <em>mperiod</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float </td>
<td class="paramname"> <em>moutputlowerlimit</em>, </td>
</tr>
<tr>
<td class="paramkey"></td>
<td></td>
<td class="paramtype">float </td>
<td class="paramname"> <em>moutputupperlimit</em></td><td> </td>
</tr>
<tr>
<td></td>
<td>)</td>
<td></td><td></td><td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>PID Controller:</p>
<dl class="author"><dt><b>Author:</b></dt><dd>Jason Kulk</dd></dl>
<p>NUbots (c) 2008 All Rights Reserved</p>
<p>Create a generic PID Controller</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>mname</em> </td><td>the name of the PID controller (this is used to idenitify it) </td></tr>
<tr><td valign="top"></td><td valign="top"><em>mKp</em> </td><td>the proportional gain </td></tr>
<tr><td valign="top"></td><td valign="top"><em>mKi</em> </td><td>the integra gain </td></tr>
<tr><td valign="top"></td><td valign="top"><em>mKd</em> </td><td>the derivative gain </td></tr>
<tr><td valign="top"></td><td valign="top"><em>mperiod</em> </td><td>the control loop period </td></tr>
<tr><td valign="top"></td><td valign="top"><em>moutputlowerlimit</em> </td><td>the actuator lower limit </td></tr>
<tr><td valign="top"></td><td valign="top"><em>moutputupperlimit</em> </td><td>the actuator upper limit </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<a class="anchor" id="a690e7ad4796e5c5143aa4b90f2f6677b"></a><!-- doxytag: member="PIDController::~PIDController" ref="a690e7ad4796e5c5143aa4b90f2f6677b" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">PIDController::~PIDController </td>
<td>(</td>
<td class="paramname"></td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Destroys the PID controller </p>
</div>
</div>
<hr/><h2>Member Function Documentation</h2>
<a class="anchor" id="a2350478bf030bb30e65b38847b25cece"></a><!-- doxytag: member="PIDController::clearState" ref="a2350478bf030bb30e65b38847b25cece" args="()" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void PIDController::clearState </td>
<td>(</td>
<td class="paramname"></td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Clear the controller's state.</p>
<p>This will reset the integral and derivative terms, as well as reset any historical values. Use this just prior to turning the motor back on, or when turning the motor off </p>
</div>
</div>
<a class="anchor" id="a42a2fe12ab1468779dc15a5214c8ddf6"></a><!-- doxytag: member="PIDController::doControl" ref="a42a2fe12ab1468779dc15a5214c8ddf6" args="(float input)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">float PIDController::doControl </td>
<td>(</td>
<td class="paramtype">float </td>
<td class="paramname"> <em>input</em></td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>The controller function; call this inside the control loop.</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>input</em> </td><td>the measured value</td></tr>
</table>
</dd>
</dl>
<dl class="return"><dt><b>Returns:</b></dt><dd>the calculated control output </dd></dl>
</div>
</div>
<a class="anchor" id="a3a1ae9863a8db4e4253051dc60f92289"></a><!-- doxytag: member="PIDController::setTarget" ref="a3a1ae9863a8db4e4253051dc60f92289" args="(float target)" -->
<div class="memitem">
<div class="memproto">
<table class="memname">
<tr>
<td class="memname">void PIDController::setTarget </td>
<td>(</td>
<td class="paramtype">float </td>
<td class="paramname"> <em>mtarget</em></td>
<td> ) </td>
<td></td>
</tr>
</table>
</div>
<div class="memdoc">
<p>Set the controller's set point</p>
<dl><dt><b>Parameters:</b></dt><dd>
<table border="0" cellspacing="2" cellpadding="0">
<tr><td valign="top"></td><td valign="top"><em>mtarget</em> </td><td>the target current (A) </td></tr>
</table>
</dd>
</dl>
</div>
</div>
<hr/>The documentation for this class was generated from the following files:<ul>
<li>/Users/jason/Code/naowalkoptimiser/src/Locomotion/Walk/<a class="el" href="pidcontroller_8h_source.html">pidcontroller.h</a></li>
<li>/Users/jason/Code/naowalkoptimiser/src/Locomotion/Walk/<a class="el" href="pidcontroller_8cpp.html">pidcontroller.cpp</a></li>
</ul>
</div>
<hr size="1"/><address style="text-align: right;"><small>Generated on Fri Oct 9 13:42:12 2009 for naowalkoptimiser by
<a href="http://www.doxygen.org/index.html">
<img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.6.1 </small></address>
</body>
</html>