-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathcontrol_8h_source.html
314 lines (314 loc) · 74.9 KB
/
control_8h_source.html
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
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en-US">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=11"/>
<meta name="generator" content="Doxygen 1.9.5"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>MasterFOC: control.h Source File</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
<tbody>
<tr id="projectrow">
<td id="projectalign">
<div id="projectname">MasterFOC<span id="projectnumber"> 0.0.1</span>
</div>
</td>
</tr>
</tbody>
</table>
</div>
<!-- end header part -->
<!-- Generated by Doxygen 1.9.5 -->
<div id="navrow1" class="tabs">
<ul class="tablist">
<li><a href="index.html"><span>Main Page</span></a></li>
<li><a href="annotated.html"><span>Data Structures</span></a></li>
<li class="current"><a href="files.html"><span>Files</span></a></li>
</ul>
</div>
<div id="navrow2" class="tabs2">
<ul class="tablist">
<li><a href="files.html"><span>File List</span></a></li>
<li><a href="globals.html"><span>Globals</span></a></li>
</ul>
</div>
</div><!-- top -->
<div class="header">
<div class="headertitle"><div class="title">control.h</div></div>
</div><!--header-->
<div class="contents">
<a href="control_8h.html">Go to the documentation of this file.</a><div class="fragment"><div class="line"><a id="l00001" name="l00001"></a><span class="lineno"> 1</span> </div>
<div class="line"><a id="l00012" name="l00012"></a><span class="lineno"> 12</span><span class="preprocessor">#ifndef __CONTROL_H</span></div>
<div class="line"><a id="l00013" name="l00013"></a><span class="lineno"> 13</span><span class="preprocessor">#define __CONTROL_H</span></div>
<div class="line"><a id="l00014" name="l00014"></a><span class="lineno"> 14</span> </div>
<div class="line"><a id="l00015" name="l00015"></a><span class="lineno"> 15</span><span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a id="l00016" name="l00016"></a><span class="lineno"> 16</span><span class="keyword">extern</span> <span class="stringliteral">"C"</span> {</div>
<div class="line"><a id="l00017" name="l00017"></a><span class="lineno"> 17</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00018" name="l00018"></a><span class="lineno"> 18</span> </div>
<div class="line"><a id="l00019" name="l00019"></a><span class="lineno"> 19</span><span class="preprocessor">#ifdef __cplusplus</span></div>
<div class="line"><a id="l00020" name="l00020"></a><span class="lineno"> 20</span>}</div>
<div class="line"><a id="l00021" name="l00021"></a><span class="lineno"> 21</span><span class="preprocessor">#endif</span></div>
<div class="line"><a id="l00022" name="l00022"></a><span class="lineno"> 22</span> </div>
<div class="line"><a id="l00023" name="l00023"></a><span class="lineno"> 23</span> </div>
<div class="line"><a id="l00024" name="l00024"></a><span class="lineno"> 24</span><span class="preprocessor">#include "stm32f4xx_hal.h"</span></div>
<div class="line"><a id="l00025" name="l00025"></a><span class="lineno"> 25</span><span class="preprocessor">#include "arm_math.h"</span></div>
<div class="line"><a id="l00026" name="l00026"></a><span class="lineno"> 26</span><span class="preprocessor">#include "tim.h"</span></div>
<div class="line"><a id="l00027" name="l00027"></a><span class="lineno"> 27</span><span class="preprocessor">#include "stdio.h"</span></div>
<div class="line"><a id="l00028" name="l00028"></a><span class="lineno"> 28</span> </div>
<div class="line"><a id="l00029" name="l00029"></a><span class="lineno"><a class="line" href="control_8h.html#a1daf785e3f68d293c7caa1c756d5cb74"> 29</a></span><span class="preprocessor">#define pi 3.14159265359f</span></div>
<div class="line"><a id="l00030" name="l00030"></a><span class="lineno"><a class="line" href="control_8h.html#a4c7cca717941f9eb5c7f90f44ac8746b"> 30</a></span><span class="preprocessor">#define SQRT_3 1.7320508f</span></div>
<div class="line"><a id="l00031" name="l00031"></a><span class="lineno"><a class="line" href="control_8h.html#aec2a4da8c1ff32ae0a52daebe3fe6d00"> 31</a></span><span class="preprocessor">#define UnitPulse 4096 </span><span class="comment">//pulses from encoder per cycle(2pi)</span></div>
<div class="line"><a id="l00032" name="l00032"></a><span class="lineno"> 32</span><span class="comment">//#define BLOCK_SIZE 1 </span></div>
<div class="line"><a id="l00033" name="l00033"></a><span class="lineno"> 33</span><span class="comment">//#define NUM_TAPS 6</span></div>
<div class="line"><a id="l00034" name="l00034"></a><span class="lineno"> 34</span> </div>
<div class="line"><a id="l00039" name="l00039"></a><span class="lineno"><a class="line" href="struct_components.html"> 39</a></span><span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code hl_struct" href="struct_components.html">Components</a></div>
<div class="line"><a id="l00040" name="l00040"></a><span class="lineno"> 40</span>{</div>
<div class="line"><a id="l00041" name="l00041"></a><span class="lineno"><a class="line" href="struct_components.html#ae5e8b4d32e434ec0360c3d06d4fa7219"> 41</a></span> int16_t <a class="code hl_variable" href="struct_components.html#ae5e8b4d32e434ec0360c3d06d4fa7219">a</a>, <a class="code hl_variable" href="struct_components.html#a070cc5ce80d6538c54c390304e858ebe">b</a>, <a class="code hl_variable" href="struct_components.html#ad23c91bdeebe3f7ce86956114696b462">c</a>; </div>
<div class="line"><a id="l00042" name="l00042"></a><span class="lineno"><a class="line" href="struct_components.html#ab1551d8043c2aa4410fb7dbb1fe3be7b"> 42</a></span> <span class="keywordtype">float</span> <a class="code hl_variable" href="struct_components.html#ab1551d8043c2aa4410fb7dbb1fe3be7b">alpha</a>, <a class="code hl_variable" href="struct_components.html#aa773d9a6c0ccefaa0fc9ab66fec68ec1">beta</a>; </div>
<div class="line"><a id="l00043" name="l00043"></a><span class="lineno"><a class="line" href="struct_components.html#a3fbbd8a3959e76a2bc3455d3bade52dc"> 43</a></span> <span class="keywordtype">float</span> <a class="code hl_variable" href="struct_components.html#a3fbbd8a3959e76a2bc3455d3bade52dc">d</a>, <a class="code hl_variable" href="struct_components.html#a0a19a0620af7373e3ddba0ce4e1058e1">q</a>; </div>
<div class="line"><a id="l00044" name="l00044"></a><span class="lineno"><a class="line" href="control_8h.html#a646bef2e4e0d58c4b2a1c3d3037475a4"> 44</a></span>}<a class="code hl_typedef" href="control_8h.html#a646bef2e4e0d58c4b2a1c3d3037475a4">Coordinates</a>;</div>
<div class="line"><a id="l00045" name="l00045"></a><span class="lineno"> 45</span> </div>
<div class="line"><a id="l00050" name="l00050"></a><span class="lineno"><a class="line" href="struct_p_i_d__para.html"> 50</a></span><span class="keyword">typedef</span> <span class="keyword">struct </span><a class="code hl_struct" href="struct_p_i_d__para.html">PID_para</a>{</div>
<div class="line"><a id="l00051" name="l00051"></a><span class="lineno"><a class="line" href="struct_p_i_d__para.html#ae7a5c6018507bb1361fcca170e069b9c"> 51</a></span> <span class="keywordtype">float</span> <a class="code hl_variable" href="struct_p_i_d__para.html#a1f7add0f84d583bc2eceb290d6c4cc06">kp</a>, <a class="code hl_variable" href="struct_p_i_d__para.html#a050993b7ca6c97e62c1020017f716b91">ki</a>, <a class="code hl_variable" href="struct_p_i_d__para.html#ae7a5c6018507bb1361fcca170e069b9c">kd</a>; </div>
<div class="line"><a id="l00052" name="l00052"></a><span class="lineno"><a class="line" href="struct_p_i_d__para.html#a5bc58d43105d723b774621219125aeb1"> 52</a></span> <span class="keywordtype">float</span> <a class="code hl_variable" href="struct_p_i_d__para.html#af0df2177301e4061ab72ade2ea437bcd">target</a>, <a class="code hl_variable" href="struct_p_i_d__para.html#a5bc58d43105d723b774621219125aeb1">err</a>, <a class="code hl_variable" href="struct_p_i_d__para.html#afaa5762f885189bc07c5702d0e9ff140">err_pre</a>, <a class="code hl_variable" href="struct_p_i_d__para.html#a16676aeaa8bf988301616be3eca67dfe">err_sum</a>; </div>
<div class="line"><a id="l00053" name="l00053"></a><span class="lineno"><a class="line" href="control_8h.html#a7381bd99b9f8d665d55ffc97eedc9e9d"> 53</a></span>}<a class="code hl_struct" href="struct_p_i_d__para.html">PID_para</a>;</div>
<div class="line"><a id="l00054" name="l00054"></a><span class="lineno"> 54</span> </div>
<div class="line"><a id="l00059" name="l00059"></a><span class="lineno"><a class="line" href="control_8h.html#aee3ea37f4f505980157cf93a84687bcb"> 59</a></span><span class="keyword">typedef</span> <span class="keyword">enum</span> <a class="code hl_enumeration" href="control_8h.html#aee3ea37f4f505980157cf93a84687bcb">ControlMode</a></div>
<div class="line"><a id="l00060" name="l00060"></a><span class="lineno"><a class="line" href="control_8h.html#a7041679f372ba53525b1eaed6001e67a"> 60</a></span>{ <a class="code hl_enumvalue" href="control_8h.html#aee3ea37f4f505980157cf93a84687bcbad3fa9ae9431d6cb1772f9d9df48cab19">Idle</a> = 0, <a class="code hl_enumvalue" href="control_8h.html#aee3ea37f4f505980157cf93a84687bcba2891de101c03df22f3bf8137f8622908">Speed</a>, <a class="code hl_enumvalue" href="control_8h.html#aee3ea37f4f505980157cf93a84687bcba0ca2444163688098d8e674e31fb11397">Position</a>, <a class="code hl_enumvalue" href="control_8h.html#aee3ea37f4f505980157cf93a84687bcbaa1ffbb212863410b17ce950709b7caa1">Torque</a> }<a class="code hl_enumeration" href="control_8h.html#aee3ea37f4f505980157cf93a84687bcb">ControlMode</a>;</div>
<div class="line"><a id="l00061" name="l00061"></a><span class="lineno"> 61</span> </div>
<div class="line"><a id="l00066" name="l00066"></a><span class="lineno"><a class="line" href="control_8h.html#ab8fd4796026dfcd8e06f047989acb66a"> 66</a></span><span class="keyword">typedef</span> <span class="keyword">enum</span> <a class="code hl_enumeration" href="control_8h.html#ab8fd4796026dfcd8e06f047989acb66a">UserAPP</a></div>
<div class="line"><a id="l00067" name="l00067"></a><span class="lineno"><a class="line" href="control_8h.html#ab8fd4796026dfcd8e06f047989acb66aacc842255ac43e600deac25fefd0fdb0a"> 67</a></span>{ <a class="code hl_enumvalue" href="control_8h.html#ab8fd4796026dfcd8e06f047989acb66aacc842255ac43e600deac25fefd0fdb0a">Drag</a> = 1, <a class="code hl_enumvalue" href="control_8h.html#ab8fd4796026dfcd8e06f047989acb66aa436ecffb0346b444ef8e03489844ebf3">ForceFeedback</a>, <a class="code hl_enumvalue" href="control_8h.html#ab8fd4796026dfcd8e06f047989acb66aaab57132cff95cd4bb6b65a486c127dfb">Switch</a>, <a class="code hl_enumvalue" href="control_8h.html#ab8fd4796026dfcd8e06f047989acb66aae72db1ad60dbc5ad7dbcb42d6035038f">SpaceWalk</a> }<a class="code hl_enumeration" href="control_8h.html#ab8fd4796026dfcd8e06f047989acb66a">UserAPP</a>;</div>
<div class="line"><a id="l00068" name="l00068"></a><span class="lineno"> 68</span> </div>
<div class="line"><a id="l00073" name="l00073"></a><span class="lineno"><a class="line" href="control_8h.html#a4fe62c345b7ce33aac126a260c5a82fb"> 73</a></span><span class="keyword">typedef</span> <span class="keyword">enum</span> <a class="code hl_enumeration" href="control_8h.html#a4fe62c345b7ce33aac126a260c5a82fb">DRV_GAIN</a></div>
<div class="line"><a id="l00074" name="l00074"></a><span class="lineno"><a class="line" href="control_8h.html#aa7c4fecf4e12490cdae6a6a0abd3959e"> 74</a></span>{ <a class="code hl_enumvalue" href="control_8h.html#a4fe62c345b7ce33aac126a260c5a82fba30f3f2fba31dab5fa94c1979df5b3648">DRV_GAIN_10</a> = 0, <a class="code hl_enumvalue" href="control_8h.html#a4fe62c345b7ce33aac126a260c5a82fba003ad48d1b5cdccf078d183a8ebb6660">DRV_GAIN_40</a>}<a class="code hl_enumeration" href="control_8h.html#a4fe62c345b7ce33aac126a260c5a82fb">DRV_GAIN</a>;</div>
<div class="line"><a id="l00079" name="l00079"></a><span class="lineno"><a class="line" href="struct_motor.html"> 79</a></span><span class="keyword">typedef</span> <span class="keyword">struct</span></div>
<div class="line"><a id="l00080" name="l00080"></a><span class="lineno"> 80</span>{</div>
<div class="line"><a id="l00081" name="l00081"></a><span class="lineno"><a class="line" href="struct_motor.html#a801b68b4e2ff446330c2fb973a7a5a35"> 81</a></span> ADC_HandleTypeDef <a class="code hl_variable" href="struct_motor.html#a801b68b4e2ff446330c2fb973a7a5a35">hMotorADC</a>; </div>
<div class="line"><a id="l00082" name="l00082"></a><span class="lineno"><a class="line" href="struct_motor.html#af44336d6087385213b2da6b874c8d0c9"> 82</a></span> TIM_HandleTypeDef <a class="code hl_variable" href="struct_motor.html#af44336d6087385213b2da6b874c8d0c9">hTimDriver</a>; </div>
<div class="line"><a id="l00083" name="l00083"></a><span class="lineno"><a class="line" href="struct_motor.html#a5ffac741774414b0bee0b8e7d87400f3"> 83</a></span> TIM_HandleTypeDef <a class="code hl_variable" href="struct_motor.html#a5ffac741774414b0bee0b8e7d87400f3">hTimEncoder</a>; </div>
<div class="line"><a id="l00084" name="l00084"></a><span class="lineno"><a class="line" href="struct_motor.html#a5222692e4ce396dc210789ad78e73f2e"> 84</a></span> I2C_HandleTypeDef <a class="code hl_variable" href="struct_motor.html#a5222692e4ce396dc210789ad78e73f2e">hI2CEncoder</a>; </div>
<div class="line"><a id="l00086" name="l00086"></a><span class="lineno"><a class="line" href="struct_motor.html#a3ed6c84fc54eaa26a6be1426ca449c74"> 86</a></span> <a class="code hl_enumeration" href="control_8h.html#aee3ea37f4f505980157cf93a84687bcb">ControlMode</a> <a class="code hl_variable" href="struct_motor.html#a3ed6c84fc54eaa26a6be1426ca449c74">Mode</a>; </div>
<div class="line"><a id="l00087" name="l00087"></a><span class="lineno"><a class="line" href="struct_motor.html#a6ebfed80acf44488ab8e7d22a4ac4c71"> 87</a></span> <a class="code hl_enumeration" href="control_8h.html#ab8fd4796026dfcd8e06f047989acb66a">UserAPP</a> <a class="code hl_variable" href="struct_motor.html#a6ebfed80acf44488ab8e7d22a4ac4c71">APP</a>; </div>
<div class="line"><a id="l00089" name="l00089"></a><span class="lineno"><a class="line" href="struct_motor.html#a848e7f0227cdb284ae2e733510c80493"> 89</a></span> <a class="code hl_struct" href="struct_components.html">Coordinates</a> <a class="code hl_variable" href="struct_motor.html#a848e7f0227cdb284ae2e733510c80493">Voltage</a>; </div>
<div class="line"><a id="l00090" name="l00090"></a><span class="lineno"><a class="line" href="struct_motor.html#a9e1b1632eb525d17b7377f974c3095a8"> 90</a></span> <a class="code hl_struct" href="struct_components.html">Coordinates</a> <a class="code hl_variable" href="struct_motor.html#a9e1b1632eb525d17b7377f974c3095a8">Current</a>; </div>
<div class="line"><a id="l00092" name="l00092"></a><span class="lineno"><a class="line" href="struct_motor.html#a7adb1ec60b36b079779994003a1c8224"> 92</a></span> <a class="code hl_struct" href="struct_p_i_d__para.html">PID_para</a> <a class="code hl_variable" href="struct_motor.html#a7adb1ec60b36b079779994003a1c8224">idPID</a>; </div>
<div class="line"><a id="l00093" name="l00093"></a><span class="lineno"><a class="line" href="struct_motor.html#a49609d8014cc2f172f982aa34a0abced"> 93</a></span> <a class="code hl_struct" href="struct_p_i_d__para.html">PID_para</a> <a class="code hl_variable" href="struct_motor.html#a49609d8014cc2f172f982aa34a0abced">iqPID</a>; </div>
<div class="line"><a id="l00094" name="l00094"></a><span class="lineno"><a class="line" href="struct_motor.html#a8c9772f89af80dbb285c149a0374172c"> 94</a></span> <a class="code hl_struct" href="struct_p_i_d__para.html">PID_para</a> <a class="code hl_variable" href="struct_motor.html#a8c9772f89af80dbb285c149a0374172c">speedPID</a>; </div>
<div class="line"><a id="l00095" name="l00095"></a><span class="lineno"><a class="line" href="struct_motor.html#ae42e7244616d6d75ce0e711a945a30a9"> 95</a></span> <a class="code hl_struct" href="struct_p_i_d__para.html">PID_para</a> <a class="code hl_variable" href="struct_motor.html#ae42e7244616d6d75ce0e711a945a30a9">anglePID</a>; </div>
<div class="line"><a id="l00097" name="l00097"></a><span class="lineno"><a class="line" href="struct_motor.html#a8718e12c63580137f1045c19563d91e8"> 97</a></span> uint8_t <a class="code hl_variable" href="struct_motor.html#a8718e12c63580137f1045c19563d91e8">nCalibrationFlag</a>; </div>
<div class="line"><a id="l00098" name="l00098"></a><span class="lineno"><a class="line" href="struct_motor.html#a991a1f8c68f79e75a71471dfc90d602f"> 98</a></span> uint8_t <a class="code hl_variable" href="struct_motor.html#a991a1f8c68f79e75a71471dfc90d602f">Vdc</a>; </div>
<div class="line"><a id="l00099" name="l00099"></a><span class="lineno"><a class="line" href="struct_motor.html#af3f1c7d958554a481027e6d53acf02d7"> 99</a></span> uint8_t <a class="code hl_variable" href="struct_motor.html#af3f1c7d958554a481027e6d53acf02d7">nPhase</a>; </div>
<div class="line"><a id="l00100" name="l00100"></a><span class="lineno"><a class="line" href="struct_motor.html#a514da89140a829d5eb40403a1bf3fabe"> 100</a></span> uint8_t <a class="code hl_variable" href="struct_motor.html#a514da89140a829d5eb40403a1bf3fabe">nPolePairs</a>; </div>
<div class="line"><a id="l00102" name="l00102"></a><span class="lineno"><a class="line" href="struct_motor.html#a9e751f80e20e54a66ba08973f9e9d3c1"> 102</a></span> int16_t <a class="code hl_variable" href="struct_motor.html#a9e751f80e20e54a66ba08973f9e9d3c1">SpeedCNT</a>; </div>
<div class="line"><a id="l00103" name="l00103"></a><span class="lineno"><a class="line" href="struct_motor.html#acb4618d69b8a7c34c416c427bbc842a4"> 103</a></span> uint16_t <a class="code hl_variable" href="struct_motor.html#acb4618d69b8a7c34c416c427bbc842a4">M_angle</a>; </div>
<div class="line"><a id="l00104" name="l00104"></a><span class="lineno"><a class="line" href="struct_motor.html#a959161fa583c55e53eb1b708f81c5877"> 104</a></span> uint16_t <a class="code hl_variable" href="struct_motor.html#a959161fa583c55e53eb1b708f81c5877">M_angle_pre</a>; </div>
<div class="line"><a id="l00105" name="l00105"></a><span class="lineno"><a class="line" href="struct_motor.html#a592212da4a52fdaa5fa9484176076347"> 105</a></span> int16_t <a class="code hl_variable" href="struct_motor.html#a592212da4a52fdaa5fa9484176076347">E_angle</a>; </div>
<div class="line"><a id="l00106" name="l00106"></a><span class="lineno"><a class="line" href="struct_motor.html#a00c1a71e5c10bac5a24b57ef7980838c"> 106</a></span> int16_t <a class="code hl_variable" href="struct_motor.html#a00c1a71e5c10bac5a24b57ef7980838c">E_angle_pre</a>; </div>
<div class="line"><a id="l00107" name="l00107"></a><span class="lineno"><a class="line" href="struct_motor.html#a403c3eddba3c7150f02374ac5681f9c0"> 107</a></span> uint16_t <a class="code hl_variable" href="struct_motor.html#a403c3eddba3c7150f02374ac5681f9c0">Angle_offset</a>; </div>
<div class="line"><a id="l00109" name="l00109"></a><span class="lineno"><a class="line" href="struct_motor.html#a7f7e4724cf57d59513b39c5ecc81adc8"> 109</a></span> <span class="keywordtype">float</span> <a class="code hl_variable" href="struct_motor.html#a7f7e4724cf57d59513b39c5ecc81adc8">speed</a>, speed_pre; </div>
<div class="line"><a id="l00110" name="l00110"></a><span class="lineno"><a class="line" href="struct_motor.html#a5c73e4801b04f509ab15b0939cf51019"> 110</a></span> <span class="keywordtype">float</span> <a class="code hl_variable" href="struct_motor.html#a5c73e4801b04f509ab15b0939cf51019">CurrentLimit</a>, VoltageLimit, SpeedLimit; </div>
<div class="line"><a id="l00111" name="l00111"></a><span class="lineno"><a class="line" href="struct_motor.html#aad92deaf7a5b8c4b060a1b3aa01236bb"> 111</a></span> int32_t <a class="code hl_variable" href="struct_motor.html#aad92deaf7a5b8c4b060a1b3aa01236bb">lapCNT</a>,lapCNT_pre; </div>
<div class="line"><a id="l00112" name="l00112"></a><span class="lineno"><a class="line" href="struct_motor.html#a75cc7805bfd0f3ad0c48a5d1542c9c85"> 112</a></span> uint8_t <a class="code hl_variable" href="struct_motor.html#a75cc7805bfd0f3ad0c48a5d1542c9c85">sector</a>; </div>
<div class="line"><a id="l00113" name="l00113"></a><span class="lineno"><a class="line" href="struct_motor.html#ab9b1e67e079f673b0c46489faf3278e6"> 113</a></span> <span class="keywordtype">float</span> <a class="code hl_variable" href="struct_motor.html#ab9b1e67e079f673b0c46489faf3278e6">Uref1</a>, Uref2, Uref3; </div>
<div class="line"><a id="l00114" name="l00114"></a><span class="lineno"><a class="line" href="struct_motor.html#ab3c4b737dfc5c78a6aba50dda616f7c3"> 114</a></span> <span class="keywordtype">float</span> <a class="code hl_variable" href="struct_motor.html#ab3c4b737dfc5c78a6aba50dda616f7c3">X</a>, Y, Z; </div>
<div class="line"><a id="l00115" name="l00115"></a><span class="lineno"><a class="line" href="struct_motor.html#ac4c7ec6bf2a7b0636c00216576186d68"> 115</a></span> <span class="keywordtype">float</span> <a class="code hl_variable" href="struct_motor.html#ac4c7ec6bf2a7b0636c00216576186d68">T1</a>,T2,Tx,Ty,Tz; </div>
<div class="line"><a id="l00116" name="l00116"></a><span class="lineno"><a class="line" href="struct_motor.html#a50351efee76ac59cbfddc319a43f0081"> 116</a></span> <span class="keywordtype">float</span> <a class="code hl_variable" href="struct_motor.html#a50351efee76ac59cbfddc319a43f0081">Ta</a>, Tb, Tc; </div>
<div class="line"><a id="l00118" name="l00118"></a><span class="lineno"><a class="line" href="struct_motor.html#aa09b6a3c9ddd083b8712980ca29e3f2a"> 118</a></span> uint16_t ADC_DMA_RAW[3]; </div>
<div class="line"><a id="l00119" name="l00119"></a><span class="lineno"><a class="line" href="struct_motor.html#a36e10e934636a4c529d3e721fc662201"> 119</a></span> uint16_t DC_offset[2]; </div>
<div class="line"><a id="l00120" name="l00120"></a><span class="lineno"><a class="line" href="struct_motor.html#a4f836c05b4c50f280525806c7a8f5983"> 120</a></span> int16_t ADC_Filtered[3]; </div>
<div class="line"><a id="l00121" name="l00121"></a><span class="lineno"> 121</span> <span class="comment">//int16_t ADC_lastValue[3]; </span></div>
<div class="line"><a id="l00122" name="l00122"></a><span class="lineno"><a class="line" href="struct_motor.html#a7efe7dfc0d85ca33ea9903e552104c59"> 122</a></span> int16_t Current_lastValue[5]; </div>
<div class="line"><a id="l00124" name="l00124"></a><span class="lineno"> 124</span>}<a class="code hl_struct" href="struct_motor.html">Motor</a>;</div>
<div class="line"><a id="l00125" name="l00125"></a><span class="lineno"> 125</span> </div>
<div class="line"><a id="l00126" name="l00126"></a><span class="lineno"> 126</span> </div>
<div class="line"><a id="l00139" name="l00139"></a><span class="lineno"><a class="line" href="control_8h.html#a10d4a5658201a6cb630bbe063d898472"> 139</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#a10d4a5658201a6cb630bbe063d898472">MotorInit</a>(<a class="code hl_struct" href="struct_motor.html">Motor</a>* mHandle,ADC_HandleTypeDef hadc,TIM_HandleTypeDef hDriver, TIM_HandleTypeDef hEncoder, I2C_HandleTypeDef hIICEncoder, <a class="code hl_enumeration" href="control_8h.html#aee3ea37f4f505980157cf93a84687bcb">ControlMode</a> mode);</div>
<div class="line"><a id="l00140" name="l00140"></a><span class="lineno"> 140</span> </div>
<div class="line"><a id="l00149" name="l00149"></a><span class="lineno"><a class="line" href="control_8h.html#a9ca0cc7c05bfaf12c86799a2d71c8ede"> 149</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#a9ca0cc7c05bfaf12c86799a2d71c8ede">ModeSelection</a>(<a class="code hl_struct" href="struct_motor.html">Motor</a>* mHandle,<a class="code hl_enumeration" href="control_8h.html#aee3ea37f4f505980157cf93a84687bcb">ControlMode</a> mode);</div>
<div class="line"><a id="l00150" name="l00150"></a><span class="lineno"> 150</span> </div>
<div class="line"><a id="l00151" name="l00151"></a><span class="lineno"> 151</span> </div>
<div class="line"><a id="l00160" name="l00160"></a><span class="lineno"><a class="line" href="control_8h.html#a503ae511083e4a1a1c330a01cd21cf1a"> 160</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#a503ae511083e4a1a1c330a01cd21cf1a">UserAPPSelection</a>(<a class="code hl_struct" href="struct_motor.html">Motor</a>* mHandle,<a class="code hl_enumeration" href="control_8h.html#ab8fd4796026dfcd8e06f047989acb66a">UserAPP</a> app);</div>
<div class="line"><a id="l00161" name="l00161"></a><span class="lineno"> 161</span> </div>
<div class="line"><a id="l00168" name="l00168"></a><span class="lineno"><a class="line" href="control_8h.html#a74b8d54f398d5cace9878611ddda252b"> 168</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#a74b8d54f398d5cace9878611ddda252b">EnableGate</a>(<span class="keywordtype">void</span>);</div>
<div class="line"><a id="l00169" name="l00169"></a><span class="lineno"> 169</span> </div>
<div class="line"><a id="l00178" name="l00178"></a><span class="lineno"><a class="line" href="control_8h.html#adab12f80393f46ebe1732964a965ffff"> 178</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#adab12f80393f46ebe1732964a965ffff">GainSelection</a>(<a class="code hl_enumeration" href="control_8h.html#a4fe62c345b7ce33aac126a260c5a82fb">DRV_GAIN</a> gain);</div>
<div class="line"><a id="l00179" name="l00179"></a><span class="lineno"> 179</span> </div>
<div class="line"><a id="l00189" name="l00189"></a><span class="lineno"><a class="line" href="control_8h.html#a7eb418de90bcd7d3f2faf0075c9d88f3"> 189</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#a7eb418de90bcd7d3f2faf0075c9d88f3">DC_Calibration</a>(<a class="code hl_struct" href="struct_motor.html">Motor</a>* mHandle);</div>
<div class="line"><a id="l00190" name="l00190"></a><span class="lineno"> 190</span> </div>
<div class="line"><a id="l00203" name="l00203"></a><span class="lineno"><a class="line" href="control_8h.html#a21066fe1f928c7c279fbcab34c8d094b"> 203</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#a21066fe1f928c7c279fbcab34c8d094b">SetMotorParam</a>(<a class="code hl_struct" href="struct_motor.html">Motor</a>* mHandle,uint8_t DC_supply, uint8_t phase, uint8_t polePairs, <span class="keywordtype">float</span> MaxCurrent, <span class="keywordtype">float</span> MaxSpeed);</div>
<div class="line"><a id="l00204" name="l00204"></a><span class="lineno"> 204</span> </div>
<div class="line"><a id="l00213" name="l00213"></a><span class="lineno"><a class="line" href="control_8h.html#a16576dccb7e1137b80a15a0259b77eb6"> 213</a></span><span class="keywordtype">int</span> <a class="code hl_function" href="control_8h.html#a16576dccb7e1137b80a15a0259b77eb6">calcAngle</a>(<a class="code hl_struct" href="struct_motor.html">Motor</a>* mHandle);</div>
<div class="line"><a id="l00214" name="l00214"></a><span class="lineno"> 214</span> </div>
<div class="line"><a id="l00224" name="l00224"></a><span class="lineno"><a class="line" href="control_8h.html#aa05889183d3dd27313d91a9f5c6105e9"> 224</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#aa05889183d3dd27313d91a9f5c6105e9">MotorCalibration</a>(<a class="code hl_struct" href="struct_motor.html">Motor</a>* mHandle);</div>
<div class="line"><a id="l00225" name="l00225"></a><span class="lineno"> 225</span> </div>
<div class="line"><a id="l00226" name="l00226"></a><span class="lineno"> 226</span><span class="comment">//void AngelAlignment(Motor* mHandle);</span></div>
<div class="line"><a id="l00227" name="l00227"></a><span class="lineno"> 227</span> </div>
<div class="line"><a id="l00236" name="l00236"></a><span class="lineno"><a class="line" href="control_8h.html#a86ebf8db552e7de7117d19c4b32ce6af"> 236</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#a86ebf8db552e7de7117d19c4b32ce6af">MotorOpenLoop</a>(<a class="code hl_struct" href="struct_motor.html">Motor</a>* mHandle);</div>
<div class="line"><a id="l00237" name="l00237"></a><span class="lineno"> 237</span> </div>
<div class="line"><a id="l00248" name="l00248"></a><span class="lineno"><a class="line" href="control_8h.html#a0b27b50e40405c6fc149078e10387372"> 248</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#a0b27b50e40405c6fc149078e10387372">ADCSample</a>(<a class="code hl_struct" href="struct_motor.html">Motor</a>* mHandle);</div>
<div class="line"><a id="l00249" name="l00249"></a><span class="lineno"> 249</span> </div>
<div class="line"><a id="l00258" name="l00258"></a><span class="lineno"><a class="line" href="control_8h.html#a8a4f56dcb39e5926827ed0907e6a8459"> 258</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#a8a4f56dcb39e5926827ed0907e6a8459">ADCFilter</a>(<a class="code hl_struct" href="struct_motor.html">Motor</a>* mHandle);</div>
<div class="line"><a id="l00259" name="l00259"></a><span class="lineno"> 259</span> </div>
<div class="line"><a id="l00268" name="l00268"></a><span class="lineno"><a class="line" href="control_8h.html#a6907fe9118a5749f9ef88ccc2888fc5d"> 268</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#a6907fe9118a5749f9ef88ccc2888fc5d">CurrentReconstruction</a>(<a class="code hl_struct" href="struct_motor.html">Motor</a>* mHandle);</div>
<div class="line"><a id="l00269" name="l00269"></a><span class="lineno"> 269</span> </div>
<div class="line"><a id="l00278" name="l00278"></a><span class="lineno"><a class="line" href="control_8h.html#a121e9fcddd5f7811aeeccb023ab60751"> 278</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#a121e9fcddd5f7811aeeccb023ab60751">getEangle</a>(<a class="code hl_struct" href="struct_motor.html">Motor</a>* mHandle);</div>
<div class="line"><a id="l00279" name="l00279"></a><span class="lineno"> 279</span> </div>
<div class="line"><a id="l00288" name="l00288"></a><span class="lineno"><a class="line" href="control_8h.html#a3f371a9588ee8097b54b5893c53a310c"> 288</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#a3f371a9588ee8097b54b5893c53a310c">getSpeed</a>(<a class="code hl_struct" href="struct_motor.html">Motor</a>* mHandle);</div>
<div class="line"><a id="l00289" name="l00289"></a><span class="lineno"> 289</span><span class="comment">//void setDQ(Motor mHandle, double d, double q);</span></div>
<div class="line"><a id="l00290" name="l00290"></a><span class="lineno"> 290</span> </div>
<div class="line"><a id="l00299" name="l00299"></a><span class="lineno"><a class="line" href="control_8h.html#a378d01f7b019cd1abfe5745c3c0c5e1f"> 299</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#a378d01f7b019cd1abfe5745c3c0c5e1f">ClarkeTransform</a>(<a class="code hl_struct" href="struct_components.html">Coordinates</a>* pComponents);</div>
<div class="line"><a id="l00300" name="l00300"></a><span class="lineno"> 300</span> </div>
<div class="line"><a id="l00311" name="l00311"></a><span class="lineno"><a class="line" href="control_8h.html#a78b6d2cd4422b49b7ea838ce02d4bbcd"> 311</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#a78b6d2cd4422b49b7ea838ce02d4bbcd">ParkTransform</a>(<a class="code hl_struct" href="struct_components.html">Coordinates</a>* pComponents, <span class="keywordtype">int</span> theta);</div>
<div class="line"><a id="l00312" name="l00312"></a><span class="lineno"> 312</span> </div>
<div class="line"><a id="l00323" name="l00323"></a><span class="lineno"><a class="line" href="control_8h.html#a7658aa110661b90ebb23f29cfbc73b92"> 323</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#a7658aa110661b90ebb23f29cfbc73b92">InvPark</a>(<a class="code hl_struct" href="struct_components.html">Coordinates</a>* pComponents, <span class="keywordtype">int</span> theta);</div>
<div class="line"><a id="l00324" name="l00324"></a><span class="lineno"> 324</span> </div>
<div class="line"><a id="l00333" name="l00333"></a><span class="lineno"><a class="line" href="control_8h.html#a96353709b0ece65a0f458f13f7ebd35b"> 333</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#a96353709b0ece65a0f458f13f7ebd35b">GetSector</a>(<a class="code hl_struct" href="struct_motor.html">Motor</a>* mHandle);</div>
<div class="line"><a id="l00334" name="l00334"></a><span class="lineno"> 334</span> </div>
<div class="line"><a id="l00343" name="l00343"></a><span class="lineno"><a class="line" href="control_8h.html#a39d7de953ea95e29b89b7294a304fca1"> 343</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#a39d7de953ea95e29b89b7294a304fca1">ModulationLimit</a>(<a class="code hl_struct" href="struct_motor.html">Motor</a>* mHandle);</div>
<div class="line"><a id="l00344" name="l00344"></a><span class="lineno"> 344</span> </div>
<div class="line"><a id="l00353" name="l00353"></a><span class="lineno"><a class="line" href="control_8h.html#adf18f98940d1b08559520b06d6ff405c"> 353</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#adf18f98940d1b08559520b06d6ff405c">SetSVPWM</a>(<a class="code hl_struct" href="struct_motor.html">Motor</a>* mHandle);</div>
<div class="line"><a id="l00354" name="l00354"></a><span class="lineno"> 354</span> </div>
<div class="line"><a id="l00363" name="l00363"></a><span class="lineno"><a class="line" href="control_8h.html#a5cde34a6778b1b8e9d106a8b94405cd2"> 363</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#a5cde34a6778b1b8e9d106a8b94405cd2">dq2SVPWM</a>(<a class="code hl_struct" href="struct_motor.html">Motor</a>* mHandle);</div>
<div class="line"><a id="l00364" name="l00364"></a><span class="lineno"> 364</span> </div>
<div class="line"><a id="l00374" name="l00374"></a><span class="lineno"><a class="line" href="control_8h.html#a84d9a96ad0f0c9549bb4d32581957441"> 374</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#a84d9a96ad0f0c9549bb4d32581957441">SetCurrentPID</a>(<a class="code hl_struct" href="struct_motor.html">Motor</a>* mHandle, <span class="keywordtype">float</span> kp, <span class="keywordtype">float</span> ki, <span class="keywordtype">float</span> kd);</div>
<div class="line"><a id="l00375" name="l00375"></a><span class="lineno"> 375</span> </div>
<div class="line"><a id="l00385" name="l00385"></a><span class="lineno"><a class="line" href="control_8h.html#a9c1255dcaf68017b30f5d2132e2a5a6d"> 385</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#a9c1255dcaf68017b30f5d2132e2a5a6d">SetSpeedPID</a>(<a class="code hl_struct" href="struct_motor.html">Motor</a>* mHandle, <span class="keywordtype">float</span> kp, <span class="keywordtype">float</span> ki, <span class="keywordtype">float</span> kd, <span class="keywordtype">float</span> outMax);</div>
<div class="line"><a id="l00386" name="l00386"></a><span class="lineno"> 386</span> </div>
<div class="line"><a id="l00396" name="l00396"></a><span class="lineno"><a class="line" href="control_8h.html#ac84226769ac245e2efd1ad7811489a68"> 396</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#ac84226769ac245e2efd1ad7811489a68">SetCurrentTarget</a>(<a class="code hl_struct" href="struct_motor.html">Motor</a>* mHandle, <span class="keywordtype">float</span> idTarget, <span class="keywordtype">float</span> iqTarget);</div>
<div class="line"><a id="l00397" name="l00397"></a><span class="lineno"> 397</span> </div>
<div class="line"><a id="l00409" name="l00409"></a><span class="lineno"><a class="line" href="control_8h.html#aa16906f85af7a938b4cecb1b76953762"> 409</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#aa16906f85af7a938b4cecb1b76953762">SetSpeedTarget</a>(<a class="code hl_struct" href="struct_motor.html">Motor</a>* mHandle, <span class="keywordtype">float</span> Target);</div>
<div class="line"><a id="l00410" name="l00410"></a><span class="lineno"> 410</span> </div>
<div class="line"><a id="l00420" name="l00420"></a><span class="lineno"><a class="line" href="control_8h.html#a412e84f409f4dc2bfbc19a3eccca4570"> 420</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#a412e84f409f4dc2bfbc19a3eccca4570">IdPID</a>(<a class="code hl_struct" href="struct_motor.html">Motor</a>* mHandle);</div>
<div class="line"><a id="l00421" name="l00421"></a><span class="lineno"> 421</span> </div>
<div class="line"><a id="l00431" name="l00431"></a><span class="lineno"><a class="line" href="control_8h.html#a2773bdccd83bd5da909b5578439d569b"> 431</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#a2773bdccd83bd5da909b5578439d569b">IqPID</a>(<a class="code hl_struct" href="struct_motor.html">Motor</a>* mHandle);</div>
<div class="line"><a id="l00432" name="l00432"></a><span class="lineno"> 432</span> </div>
<div class="line"><a id="l00442" name="l00442"></a><span class="lineno"><a class="line" href="control_8h.html#a7d7728f0aacb1fbae2a6accff6ae7f09"> 442</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#a7d7728f0aacb1fbae2a6accff6ae7f09">SpeedPID</a>(<a class="code hl_struct" href="struct_motor.html">Motor</a>* mHandle);</div>
<div class="line"><a id="l00443" name="l00443"></a><span class="lineno"> 443</span> </div>
<div class="line"><a id="l00455" name="l00455"></a><span class="lineno"><a class="line" href="control_8h.html#a06324f7942b9d7b3b74ce9eae71dad39"> 455</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#a06324f7942b9d7b3b74ce9eae71dad39">AnglePID</a>(<a class="code hl_struct" href="struct_motor.html">Motor</a>* mHandle);</div>
<div class="line"><a id="l00456" name="l00456"></a><span class="lineno"> 456</span> </div>
<div class="line"><a id="l00466" name="l00466"></a><span class="lineno"><a class="line" href="control_8h.html#a88ae85a44012b8f171bd1fcd4064ace0"> 466</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#a88ae85a44012b8f171bd1fcd4064ace0">SetAnglePID</a>(<a class="code hl_struct" href="struct_motor.html">Motor</a>* mHandle, <span class="keywordtype">float</span> kp, <span class="keywordtype">float</span> ki, <span class="keywordtype">float</span> kd);</div>
<div class="line"><a id="l00467" name="l00467"></a><span class="lineno"> 467</span> </div>
<div class="line"><a id="l00477" name="l00477"></a><span class="lineno"><a class="line" href="control_8h.html#ad5d2a006a653c2eb76f455b9277d8729"> 477</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#ad5d2a006a653c2eb76f455b9277d8729">SetAngleTarget</a>(<a class="code hl_struct" href="struct_motor.html">Motor</a>* mHandle, <span class="keywordtype">float</span> Target);</div>
<div class="line"><a id="l00478" name="l00478"></a><span class="lineno"> 478</span> </div>
<div class="line"><a id="l00487" name="l00487"></a><span class="lineno"><a class="line" href="control_8h.html#a8db1fd960af01c3aa2bfb514e1def9d5"> 487</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#a8db1fd960af01c3aa2bfb514e1def9d5">SetIncrementAngle</a>(<a class="code hl_struct" href="struct_motor.html">Motor</a>* mHandle, <span class="keywordtype">float</span> Target);</div>
<div class="line"><a id="l00488" name="l00488"></a><span class="lineno"> 488</span> </div>
<div class="line"><a id="l00499" name="l00499"></a><span class="lineno"><a class="line" href="control_8h.html#a3833cbec98df3e6c130c4841b8401d70"> 499</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#a3833cbec98df3e6c130c4841b8401d70">FOC</a>(<a class="code hl_struct" href="struct_motor.html">Motor</a>* mHandle);</div>
<div class="line"><a id="l00500" name="l00500"></a><span class="lineno"> 500</span> </div>
<div class="line"><a id="l00509" name="l00509"></a><span class="lineno"><a class="line" href="control_8h.html#a8d782bbdb4cf49779abe695b1bc32b43"> 509</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#a8d782bbdb4cf49779abe695b1bc32b43">FOCcheck</a>(<a class="code hl_struct" href="struct_motor.html">Motor</a>* mHandle);</div>
<div class="line"><a id="l00510" name="l00510"></a><span class="lineno"> 510</span> </div>
<div class="line"><a id="l00519" name="l00519"></a><span class="lineno"><a class="line" href="control_8h.html#ae4de542701bd589dcf40374765b978a2"> 519</a></span><span class="keywordtype">void</span> <a class="code hl_function" href="control_8h.html#ae4de542701bd589dcf40374765b978a2">GetSVPWM</a>(<a class="code hl_struct" href="struct_motor.html">Motor</a>* mHandle);</div>
<div class="line"><a id="l00520" name="l00520"></a><span class="lineno"> 520</span> </div>
<div class="line"><a id="l00554" name="l00554"></a><span class="lineno"> 554</span><span class="preprocessor">#endif </span><span class="comment">/* __CONTROL_H */</span><span class="preprocessor"></span></div>
<div class="line"><a id="l00555" name="l00555"></a><span class="lineno"> 555</span> </div>
<div class="line"><a id="l00556" name="l00556"></a><span class="lineno"> 556</span> </div>
<div class="ttc" id="acontrol_8h_html_a06324f7942b9d7b3b74ce9eae71dad39"><div class="ttname"><a href="control_8h.html#a06324f7942b9d7b3b74ce9eae71dad39">AnglePID</a></div><div class="ttdeci">void AnglePID(Motor *mHandle)</div><div class="ttdoc">: Angle loop PID calculation, calculate target speed with integral limiter</div></div>
<div class="ttc" id="acontrol_8h_html_a0b27b50e40405c6fc149078e10387372"><div class="ttname"><a href="control_8h.html#a0b27b50e40405c6fc149078e10387372">ADCSample</a></div><div class="ttdeci">void ADCSample(Motor *mHandle)</div><div class="ttdoc">: Current sampling function, once called, retrieve one set of sampled data from DMA Data stored in mH...</div></div>
<div class="ttc" id="acontrol_8h_html_a10d4a5658201a6cb630bbe063d898472"><div class="ttname"><a href="control_8h.html#a10d4a5658201a6cb630bbe063d898472">MotorInit</a></div><div class="ttdeci">void MotorInit(Motor *mHandle, ADC_HandleTypeDef hadc, TIM_HandleTypeDef hDriver, TIM_HandleTypeDef hEncoder, I2C_HandleTypeDef hIICEncoder, ControlMode mode)</div><div class="ttdoc">: Motor initialization function</div></div>
<div class="ttc" id="acontrol_8h_html_a121e9fcddd5f7811aeeccb023ab60751"><div class="ttname"><a href="control_8h.html#a121e9fcddd5f7811aeeccb023ab60751">getEangle</a></div><div class="ttdeci">void getEangle(Motor *mHandle)</div><div class="ttdoc">: Calculate electric angle from mechanical angle, store in mHandle->E_angle</div></div>
<div class="ttc" id="acontrol_8h_html_a16576dccb7e1137b80a15a0259b77eb6"><div class="ttname"><a href="control_8h.html#a16576dccb7e1137b80a15a0259b77eb6">calcAngle</a></div><div class="ttdeci">int calcAngle(Motor *mHandle)</div><div class="ttdoc">: [Auxiliary Debug Function] calculate electric angle from Valpha and Vbeta</div></div>
<div class="ttc" id="acontrol_8h_html_a21066fe1f928c7c279fbcab34c8d094b"><div class="ttname"><a href="control_8h.html#a21066fe1f928c7c279fbcab34c8d094b">SetMotorParam</a></div><div class="ttdeci">void SetMotorParam(Motor *mHandle, uint8_t DC_supply, uint8_t phase, uint8_t polePairs, float MaxCurrent, float MaxSpeed)</div><div class="ttdoc">: Set motor parameters</div></div>
<div class="ttc" id="acontrol_8h_html_a2773bdccd83bd5da909b5578439d569b"><div class="ttname"><a href="control_8h.html#a2773bdccd83bd5da909b5578439d569b">IqPID</a></div><div class="ttdeci">void IqPID(Motor *mHandle)</div><div class="ttdoc">: Current loop Iq PID calculation, calculate target Vq from Iq with current kalman filter,...</div></div>
<div class="ttc" id="acontrol_8h_html_a378d01f7b019cd1abfe5745c3c0c5e1f"><div class="ttname"><a href="control_8h.html#a378d01f7b019cd1abfe5745c3c0c5e1f">ClarkeTransform</a></div><div class="ttdeci">void ClarkeTransform(Coordinates *pComponents)</div><div class="ttdoc">: Clarke Transformation function, convert abc to alpha beta</div></div>
<div class="ttc" id="acontrol_8h_html_a3833cbec98df3e6c130c4841b8401d70"><div class="ttname"><a href="control_8h.html#a3833cbec98df3e6c130c4841b8401d70">FOC</a></div><div class="ttdeci">void FOC(Motor *mHandle)</div><div class="ttdoc">: FOC loop funtion, including electric angle conversion, phase current filtering, Clarke/Park transfo...</div></div>
<div class="ttc" id="acontrol_8h_html_a39d7de953ea95e29b89b7294a304fca1"><div class="ttname"><a href="control_8h.html#a39d7de953ea95e29b89b7294a304fca1">ModulationLimit</a></div><div class="ttdeci">void ModulationLimit(Motor *mHandle)</div><div class="ttdoc">: Overmodulation limiting function, prevent overmodulation</div></div>
<div class="ttc" id="acontrol_8h_html_a3f371a9588ee8097b54b5893c53a310c"><div class="ttname"><a href="control_8h.html#a3f371a9588ee8097b54b5893c53a310c">getSpeed</a></div><div class="ttdeci">void getSpeed(Motor *mHandle)</div><div class="ttdoc">: Calculate the motor speed in rpm, store in mHandle->speed</div></div>
<div class="ttc" id="acontrol_8h_html_a412e84f409f4dc2bfbc19a3eccca4570"><div class="ttname"><a href="control_8h.html#a412e84f409f4dc2bfbc19a3eccca4570">IdPID</a></div><div class="ttdeci">void IdPID(Motor *mHandle)</div><div class="ttdoc">: Current loop Id PID calculation, calculate target Vd from Id with current kalman filter,...</div></div>
<div class="ttc" id="acontrol_8h_html_a4fe62c345b7ce33aac126a260c5a82fb"><div class="ttname"><a href="control_8h.html#a4fe62c345b7ce33aac126a260c5a82fb">DRV_GAIN</a></div><div class="ttdeci">DRV_GAIN</div><div class="ttdoc">DRV8302 amplification gain enumerator.</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00073">control.h:74</a></div></div>
<div class="ttc" id="acontrol_8h_html_a4fe62c345b7ce33aac126a260c5a82fba003ad48d1b5cdccf078d183a8ebb6660"><div class="ttname"><a href="control_8h.html#a4fe62c345b7ce33aac126a260c5a82fba003ad48d1b5cdccf078d183a8ebb6660">DRV_GAIN_40</a></div><div class="ttdeci">@ DRV_GAIN_40</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00074">control.h:74</a></div></div>
<div class="ttc" id="acontrol_8h_html_a4fe62c345b7ce33aac126a260c5a82fba30f3f2fba31dab5fa94c1979df5b3648"><div class="ttname"><a href="control_8h.html#a4fe62c345b7ce33aac126a260c5a82fba30f3f2fba31dab5fa94c1979df5b3648">DRV_GAIN_10</a></div><div class="ttdeci">@ DRV_GAIN_10</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00074">control.h:74</a></div></div>
<div class="ttc" id="acontrol_8h_html_a503ae511083e4a1a1c330a01cd21cf1a"><div class="ttname"><a href="control_8h.html#a503ae511083e4a1a1c330a01cd21cf1a">UserAPPSelection</a></div><div class="ttdeci">void UserAPPSelection(Motor *mHandle, UserAPP app)</div><div class="ttdoc">: user application selection function</div></div>
<div class="ttc" id="acontrol_8h_html_a5cde34a6778b1b8e9d106a8b94405cd2"><div class="ttname"><a href="control_8h.html#a5cde34a6778b1b8e9d106a8b94405cd2">dq2SVPWM</a></div><div class="ttdeci">void dq2SVPWM(Motor *mHandle)</div><div class="ttdoc">: Generate SVPWM directly from dq voltage</div></div>
<div class="ttc" id="acontrol_8h_html_a646bef2e4e0d58c4b2a1c3d3037475a4"><div class="ttname"><a href="control_8h.html#a646bef2e4e0d58c4b2a1c3d3037475a4">Coordinates</a></div><div class="ttdeci">struct Components Coordinates</div><div class="ttdoc">Coordinates components structure.</div></div>
<div class="ttc" id="acontrol_8h_html_a6907fe9118a5749f9ef88ccc2888fc5d"><div class="ttname"><a href="control_8h.html#a6907fe9118a5749f9ef88ccc2888fc5d">CurrentReconstruction</a></div><div class="ttdeci">void CurrentReconstruction(Motor *mHandle)</div><div class="ttdoc">: Reconstruct the sampled current from 2 phases to three phases</div></div>
<div class="ttc" id="acontrol_8h_html_a74b8d54f398d5cace9878611ddda252b"><div class="ttname"><a href="control_8h.html#a74b8d54f398d5cace9878611ddda252b">EnableGate</a></div><div class="ttdeci">void EnableGate(void)</div><div class="ttdoc">: Pull up the ENGATE pin of the DRV8302 to activate the gate</div></div>
<div class="ttc" id="acontrol_8h_html_a7658aa110661b90ebb23f29cfbc73b92"><div class="ttname"><a href="control_8h.html#a7658aa110661b90ebb23f29cfbc73b92">InvPark</a></div><div class="ttdeci">void InvPark(Coordinates *pComponents, int theta)</div><div class="ttdoc">: Inverse Park Transformation function, convert d, q to alpha, beta Original park: q leads d axis by ...</div></div>
<div class="ttc" id="acontrol_8h_html_a78b6d2cd4422b49b7ea838ce02d4bbcd"><div class="ttname"><a href="control_8h.html#a78b6d2cd4422b49b7ea838ce02d4bbcd">ParkTransform</a></div><div class="ttdeci">void ParkTransform(Coordinates *pComponents, int theta)</div><div class="ttdoc">: Park Transformation function, convert alpha, beta to d, q Original park: q leads d axis by 90 deg M...</div></div>
<div class="ttc" id="acontrol_8h_html_a7d7728f0aacb1fbae2a6accff6ae7f09"><div class="ttname"><a href="control_8h.html#a7d7728f0aacb1fbae2a6accff6ae7f09">SpeedPID</a></div><div class="ttdeci">void SpeedPID(Motor *mHandle)</div><div class="ttdoc">: Speed loop PID calculation, set target Id = 0, calculate target Iq from speed with integral limiter...</div></div>
<div class="ttc" id="acontrol_8h_html_a7eb418de90bcd7d3f2faf0075c9d88f3"><div class="ttname"><a href="control_8h.html#a7eb418de90bcd7d3f2faf0075c9d88f3">DC_Calibration</a></div><div class="ttdeci">void DC_Calibration(Motor *mHandle)</div><div class="ttdoc">: Calibrate the DC offset of the current shunt amplifier should be called after EnableGate()</div></div>
<div class="ttc" id="acontrol_8h_html_a84d9a96ad0f0c9549bb4d32581957441"><div class="ttname"><a href="control_8h.html#a84d9a96ad0f0c9549bb4d32581957441">SetCurrentPID</a></div><div class="ttdeci">void SetCurrentPID(Motor *mHandle, float kp, float ki, float kd)</div><div class="ttdoc">: Set PID parameters of both d,q current loop</div></div>
<div class="ttc" id="acontrol_8h_html_a86ebf8db552e7de7117d19c4b32ce6af"><div class="ttname"><a href="control_8h.html#a86ebf8db552e7de7117d19c4b32ce6af">MotorOpenLoop</a></div><div class="ttdeci">void MotorOpenLoop(Motor *mHandle)</div><div class="ttdoc">: openloop drag control</div></div>
<div class="ttc" id="acontrol_8h_html_a88ae85a44012b8f171bd1fcd4064ace0"><div class="ttname"><a href="control_8h.html#a88ae85a44012b8f171bd1fcd4064ace0">SetAnglePID</a></div><div class="ttdeci">void SetAnglePID(Motor *mHandle, float kp, float ki, float kd)</div><div class="ttdoc">: Set angle loop PID parameters</div></div>
<div class="ttc" id="acontrol_8h_html_a8a4f56dcb39e5926827ed0907e6a8459"><div class="ttname"><a href="control_8h.html#a8a4f56dcb39e5926827ed0907e6a8459">ADCFilter</a></div><div class="ttdeci">void ADCFilter(Motor *mHandle)</div><div class="ttdoc">: Filter the sampled current</div></div>
<div class="ttc" id="acontrol_8h_html_a8d782bbdb4cf49779abe695b1bc32b43"><div class="ttname"><a href="control_8h.html#a8d782bbdb4cf49779abe695b1bc32b43">FOCcheck</a></div><div class="ttdeci">void FOCcheck(Motor *mHandle)</div><div class="ttdoc">: [Auxiliary Debug Function] call to print FOC PID parameters</div></div>
<div class="ttc" id="acontrol_8h_html_a8db1fd960af01c3aa2bfb514e1def9d5"><div class="ttname"><a href="control_8h.html#a8db1fd960af01c3aa2bfb514e1def9d5">SetIncrementAngle</a></div><div class="ttdeci">void SetIncrementAngle(Motor *mHandle, float Target)</div><div class="ttdoc">: Set increment target angle, the incremental angle is also restricted in (0-360 deg)</div></div>
<div class="ttc" id="acontrol_8h_html_a96353709b0ece65a0f458f13f7ebd35b"><div class="ttname"><a href="control_8h.html#a96353709b0ece65a0f458f13f7ebd35b">GetSector</a></div><div class="ttdeci">void GetSector(Motor *mHandle)</div><div class="ttdoc">: Calculate the sector of the target space voltage vector</div></div>
<div class="ttc" id="acontrol_8h_html_a9c1255dcaf68017b30f5d2132e2a5a6d"><div class="ttname"><a href="control_8h.html#a9c1255dcaf68017b30f5d2132e2a5a6d">SetSpeedPID</a></div><div class="ttdeci">void SetSpeedPID(Motor *mHandle, float kp, float ki, float kd, float outMax)</div><div class="ttdoc">: Set speed loop PID parameters and the speed limit</div></div>
<div class="ttc" id="acontrol_8h_html_a9ca0cc7c05bfaf12c86799a2d71c8ede"><div class="ttname"><a href="control_8h.html#a9ca0cc7c05bfaf12c86799a2d71c8ede">ModeSelection</a></div><div class="ttdeci">void ModeSelection(Motor *mHandle, ControlMode mode)</div><div class="ttdoc">: Mode selection function</div></div>
<div class="ttc" id="acontrol_8h_html_aa05889183d3dd27313d91a9f5c6105e9"><div class="ttname"><a href="control_8h.html#aa05889183d3dd27313d91a9f5c6105e9">MotorCalibration</a></div><div class="ttdeci">void MotorCalibration(Motor *mHandle)</div><div class="ttdoc">: Calibrate motor when power on Measure the angle offset between encoder 0 deg and motor electrical 0...</div></div>
<div class="ttc" id="acontrol_8h_html_aa16906f85af7a938b4cecb1b76953762"><div class="ttname"><a href="control_8h.html#aa16906f85af7a938b4cecb1b76953762">SetSpeedTarget</a></div><div class="ttdeci">void SetSpeedTarget(Motor *mHandle, float Target)</div><div class="ttdoc">: Set target motor speed, with over speed limit</div></div>
<div class="ttc" id="acontrol_8h_html_ab8fd4796026dfcd8e06f047989acb66a"><div class="ttname"><a href="control_8h.html#ab8fd4796026dfcd8e06f047989acb66a">UserAPP</a></div><div class="ttdeci">UserAPP</div><div class="ttdoc">UserAPP enumerator.</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00066">control.h:67</a></div></div>
<div class="ttc" id="acontrol_8h_html_ab8fd4796026dfcd8e06f047989acb66aa436ecffb0346b444ef8e03489844ebf3"><div class="ttname"><a href="control_8h.html#ab8fd4796026dfcd8e06f047989acb66aa436ecffb0346b444ef8e03489844ebf3">ForceFeedback</a></div><div class="ttdeci">@ ForceFeedback</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00067">control.h:67</a></div></div>
<div class="ttc" id="acontrol_8h_html_ab8fd4796026dfcd8e06f047989acb66aaab57132cff95cd4bb6b65a486c127dfb"><div class="ttname"><a href="control_8h.html#ab8fd4796026dfcd8e06f047989acb66aaab57132cff95cd4bb6b65a486c127dfb">Switch</a></div><div class="ttdeci">@ Switch</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00067">control.h:67</a></div></div>
<div class="ttc" id="acontrol_8h_html_ab8fd4796026dfcd8e06f047989acb66aacc842255ac43e600deac25fefd0fdb0a"><div class="ttname"><a href="control_8h.html#ab8fd4796026dfcd8e06f047989acb66aacc842255ac43e600deac25fefd0fdb0a">Drag</a></div><div class="ttdeci">@ Drag</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00067">control.h:67</a></div></div>
<div class="ttc" id="acontrol_8h_html_ab8fd4796026dfcd8e06f047989acb66aae72db1ad60dbc5ad7dbcb42d6035038f"><div class="ttname"><a href="control_8h.html#ab8fd4796026dfcd8e06f047989acb66aae72db1ad60dbc5ad7dbcb42d6035038f">SpaceWalk</a></div><div class="ttdeci">@ SpaceWalk</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00067">control.h:67</a></div></div>
<div class="ttc" id="acontrol_8h_html_ac84226769ac245e2efd1ad7811489a68"><div class="ttname"><a href="control_8h.html#ac84226769ac245e2efd1ad7811489a68">SetCurrentTarget</a></div><div class="ttdeci">void SetCurrentTarget(Motor *mHandle, float idTarget, float iqTarget)</div><div class="ttdoc">: Set target id, iq</div></div>
<div class="ttc" id="acontrol_8h_html_ad5d2a006a653c2eb76f455b9277d8729"><div class="ttname"><a href="control_8h.html#ad5d2a006a653c2eb76f455b9277d8729">SetAngleTarget</a></div><div class="ttdeci">void SetAngleTarget(Motor *mHandle, float Target)</div><div class="ttdoc">: Set absolute target angle, only single-turn (0-360 deg)</div></div>
<div class="ttc" id="acontrol_8h_html_adab12f80393f46ebe1732964a965ffff"><div class="ttname"><a href="control_8h.html#adab12f80393f46ebe1732964a965ffff">GainSelection</a></div><div class="ttdeci">void GainSelection(DRV_GAIN gain)</div><div class="ttdoc">: Select the gain of the buit-in amplifier of DRV8302 If GAIN = LOW, the internal current shunt ampli...</div></div>
<div class="ttc" id="acontrol_8h_html_adf18f98940d1b08559520b06d6ff405c"><div class="ttname"><a href="control_8h.html#adf18f98940d1b08559520b06d6ff405c">SetSVPWM</a></div><div class="ttdeci">void SetSVPWM(Motor *mHandle)</div><div class="ttdoc">: MOSFET dwelling time calculation function, to generate SVPWM</div></div>
<div class="ttc" id="acontrol_8h_html_ae4de542701bd589dcf40374765b978a2"><div class="ttname"><a href="control_8h.html#ae4de542701bd589dcf40374765b978a2">GetSVPWM</a></div><div class="ttdeci">void GetSVPWM(Motor *mHandle)</div><div class="ttdoc">: Original SVPWM calculation function using complex numbers, slow</div></div>
<div class="ttc" id="acontrol_8h_html_aee3ea37f4f505980157cf93a84687bcb"><div class="ttname"><a href="control_8h.html#aee3ea37f4f505980157cf93a84687bcb">ControlMode</a></div><div class="ttdeci">ControlMode</div><div class="ttdoc">ControlMode enumerator.</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00059">control.h:60</a></div></div>
<div class="ttc" id="acontrol_8h_html_aee3ea37f4f505980157cf93a84687bcba0ca2444163688098d8e674e31fb11397"><div class="ttname"><a href="control_8h.html#aee3ea37f4f505980157cf93a84687bcba0ca2444163688098d8e674e31fb11397">Position</a></div><div class="ttdeci">@ Position</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00060">control.h:60</a></div></div>
<div class="ttc" id="acontrol_8h_html_aee3ea37f4f505980157cf93a84687bcba2891de101c03df22f3bf8137f8622908"><div class="ttname"><a href="control_8h.html#aee3ea37f4f505980157cf93a84687bcba2891de101c03df22f3bf8137f8622908">Speed</a></div><div class="ttdeci">@ Speed</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00060">control.h:60</a></div></div>
<div class="ttc" id="acontrol_8h_html_aee3ea37f4f505980157cf93a84687bcbaa1ffbb212863410b17ce950709b7caa1"><div class="ttname"><a href="control_8h.html#aee3ea37f4f505980157cf93a84687bcbaa1ffbb212863410b17ce950709b7caa1">Torque</a></div><div class="ttdeci">@ Torque</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00060">control.h:60</a></div></div>
<div class="ttc" id="acontrol_8h_html_aee3ea37f4f505980157cf93a84687bcbad3fa9ae9431d6cb1772f9d9df48cab19"><div class="ttname"><a href="control_8h.html#aee3ea37f4f505980157cf93a84687bcbad3fa9ae9431d6cb1772f9d9df48cab19">Idle</a></div><div class="ttdeci">@ Idle</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00060">control.h:60</a></div></div>
<div class="ttc" id="astruct_components_html"><div class="ttname"><a href="struct_components.html">Components</a></div><div class="ttdoc">Coordinates components structure.</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00039">control.h:40</a></div></div>
<div class="ttc" id="astruct_components_html_a070cc5ce80d6538c54c390304e858ebe"><div class="ttname"><a href="struct_components.html#a070cc5ce80d6538c54c390304e858ebe">Components::b</a></div><div class="ttdeci">int16_t b</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00041">control.h:41</a></div></div>
<div class="ttc" id="astruct_components_html_a0a19a0620af7373e3ddba0ce4e1058e1"><div class="ttname"><a href="struct_components.html#a0a19a0620af7373e3ddba0ce4e1058e1">Components::q</a></div><div class="ttdeci">float q</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00043">control.h:43</a></div></div>
<div class="ttc" id="astruct_components_html_a3fbbd8a3959e76a2bc3455d3bade52dc"><div class="ttname"><a href="struct_components.html#a3fbbd8a3959e76a2bc3455d3bade52dc">Components::d</a></div><div class="ttdeci">float d</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00043">control.h:43</a></div></div>
<div class="ttc" id="astruct_components_html_aa773d9a6c0ccefaa0fc9ab66fec68ec1"><div class="ttname"><a href="struct_components.html#aa773d9a6c0ccefaa0fc9ab66fec68ec1">Components::beta</a></div><div class="ttdeci">float beta</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00042">control.h:42</a></div></div>
<div class="ttc" id="astruct_components_html_ab1551d8043c2aa4410fb7dbb1fe3be7b"><div class="ttname"><a href="struct_components.html#ab1551d8043c2aa4410fb7dbb1fe3be7b">Components::alpha</a></div><div class="ttdeci">float alpha</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00042">control.h:42</a></div></div>
<div class="ttc" id="astruct_components_html_ad23c91bdeebe3f7ce86956114696b462"><div class="ttname"><a href="struct_components.html#ad23c91bdeebe3f7ce86956114696b462">Components::c</a></div><div class="ttdeci">int16_t c</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00041">control.h:41</a></div></div>
<div class="ttc" id="astruct_components_html_ae5e8b4d32e434ec0360c3d06d4fa7219"><div class="ttname"><a href="struct_components.html#ae5e8b4d32e434ec0360c3d06d4fa7219">Components::a</a></div><div class="ttdeci">int16_t a</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00041">control.h:41</a></div></div>
<div class="ttc" id="astruct_motor_html"><div class="ttname"><a href="struct_motor.html">Motor</a></div><div class="ttdoc">Motor parameter structure.</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00079">control.h:80</a></div></div>
<div class="ttc" id="astruct_motor_html_a00c1a71e5c10bac5a24b57ef7980838c"><div class="ttname"><a href="struct_motor.html#a00c1a71e5c10bac5a24b57ef7980838c">Motor::E_angle_pre</a></div><div class="ttdeci">int16_t E_angle_pre</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00106">control.h:106</a></div></div>
<div class="ttc" id="astruct_motor_html_a3ed6c84fc54eaa26a6be1426ca449c74"><div class="ttname"><a href="struct_motor.html#a3ed6c84fc54eaa26a6be1426ca449c74">Motor::Mode</a></div><div class="ttdeci">ControlMode Mode</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00086">control.h:86</a></div></div>
<div class="ttc" id="astruct_motor_html_a403c3eddba3c7150f02374ac5681f9c0"><div class="ttname"><a href="struct_motor.html#a403c3eddba3c7150f02374ac5681f9c0">Motor::Angle_offset</a></div><div class="ttdeci">uint16_t Angle_offset</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00107">control.h:107</a></div></div>
<div class="ttc" id="astruct_motor_html_a49609d8014cc2f172f982aa34a0abced"><div class="ttname"><a href="struct_motor.html#a49609d8014cc2f172f982aa34a0abced">Motor::iqPID</a></div><div class="ttdeci">PID_para iqPID</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00093">control.h:93</a></div></div>
<div class="ttc" id="astruct_motor_html_a50351efee76ac59cbfddc319a43f0081"><div class="ttname"><a href="struct_motor.html#a50351efee76ac59cbfddc319a43f0081">Motor::Ta</a></div><div class="ttdeci">float Ta</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00116">control.h:116</a></div></div>
<div class="ttc" id="astruct_motor_html_a514da89140a829d5eb40403a1bf3fabe"><div class="ttname"><a href="struct_motor.html#a514da89140a829d5eb40403a1bf3fabe">Motor::nPolePairs</a></div><div class="ttdeci">uint8_t nPolePairs</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00100">control.h:100</a></div></div>
<div class="ttc" id="astruct_motor_html_a5222692e4ce396dc210789ad78e73f2e"><div class="ttname"><a href="struct_motor.html#a5222692e4ce396dc210789ad78e73f2e">Motor::hI2CEncoder</a></div><div class="ttdeci">I2C_HandleTypeDef hI2CEncoder</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00084">control.h:84</a></div></div>
<div class="ttc" id="astruct_motor_html_a592212da4a52fdaa5fa9484176076347"><div class="ttname"><a href="struct_motor.html#a592212da4a52fdaa5fa9484176076347">Motor::E_angle</a></div><div class="ttdeci">int16_t E_angle</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00105">control.h:105</a></div></div>
<div class="ttc" id="astruct_motor_html_a5c73e4801b04f509ab15b0939cf51019"><div class="ttname"><a href="struct_motor.html#a5c73e4801b04f509ab15b0939cf51019">Motor::CurrentLimit</a></div><div class="ttdeci">float CurrentLimit</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00110">control.h:110</a></div></div>
<div class="ttc" id="astruct_motor_html_a5ffac741774414b0bee0b8e7d87400f3"><div class="ttname"><a href="struct_motor.html#a5ffac741774414b0bee0b8e7d87400f3">Motor::hTimEncoder</a></div><div class="ttdeci">TIM_HandleTypeDef hTimEncoder</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00083">control.h:83</a></div></div>
<div class="ttc" id="astruct_motor_html_a6ebfed80acf44488ab8e7d22a4ac4c71"><div class="ttname"><a href="struct_motor.html#a6ebfed80acf44488ab8e7d22a4ac4c71">Motor::APP</a></div><div class="ttdeci">UserAPP APP</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00087">control.h:87</a></div></div>
<div class="ttc" id="astruct_motor_html_a75cc7805bfd0f3ad0c48a5d1542c9c85"><div class="ttname"><a href="struct_motor.html#a75cc7805bfd0f3ad0c48a5d1542c9c85">Motor::sector</a></div><div class="ttdeci">uint8_t sector</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00112">control.h:112</a></div></div>
<div class="ttc" id="astruct_motor_html_a7adb1ec60b36b079779994003a1c8224"><div class="ttname"><a href="struct_motor.html#a7adb1ec60b36b079779994003a1c8224">Motor::idPID</a></div><div class="ttdeci">PID_para idPID</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00092">control.h:92</a></div></div>
<div class="ttc" id="astruct_motor_html_a7f7e4724cf57d59513b39c5ecc81adc8"><div class="ttname"><a href="struct_motor.html#a7f7e4724cf57d59513b39c5ecc81adc8">Motor::speed</a></div><div class="ttdeci">float speed</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00109">control.h:109</a></div></div>
<div class="ttc" id="astruct_motor_html_a801b68b4e2ff446330c2fb973a7a5a35"><div class="ttname"><a href="struct_motor.html#a801b68b4e2ff446330c2fb973a7a5a35">Motor::hMotorADC</a></div><div class="ttdeci">ADC_HandleTypeDef hMotorADC</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00081">control.h:81</a></div></div>
<div class="ttc" id="astruct_motor_html_a848e7f0227cdb284ae2e733510c80493"><div class="ttname"><a href="struct_motor.html#a848e7f0227cdb284ae2e733510c80493">Motor::Voltage</a></div><div class="ttdeci">Coordinates Voltage</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00089">control.h:89</a></div></div>
<div class="ttc" id="astruct_motor_html_a8718e12c63580137f1045c19563d91e8"><div class="ttname"><a href="struct_motor.html#a8718e12c63580137f1045c19563d91e8">Motor::nCalibrationFlag</a></div><div class="ttdeci">uint8_t nCalibrationFlag</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00097">control.h:97</a></div></div>
<div class="ttc" id="astruct_motor_html_a8c9772f89af80dbb285c149a0374172c"><div class="ttname"><a href="struct_motor.html#a8c9772f89af80dbb285c149a0374172c">Motor::speedPID</a></div><div class="ttdeci">PID_para speedPID</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00094">control.h:94</a></div></div>
<div class="ttc" id="astruct_motor_html_a959161fa583c55e53eb1b708f81c5877"><div class="ttname"><a href="struct_motor.html#a959161fa583c55e53eb1b708f81c5877">Motor::M_angle_pre</a></div><div class="ttdeci">uint16_t M_angle_pre</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00104">control.h:104</a></div></div>
<div class="ttc" id="astruct_motor_html_a991a1f8c68f79e75a71471dfc90d602f"><div class="ttname"><a href="struct_motor.html#a991a1f8c68f79e75a71471dfc90d602f">Motor::Vdc</a></div><div class="ttdeci">uint8_t Vdc</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00098">control.h:98</a></div></div>
<div class="ttc" id="astruct_motor_html_a9e1b1632eb525d17b7377f974c3095a8"><div class="ttname"><a href="struct_motor.html#a9e1b1632eb525d17b7377f974c3095a8">Motor::Current</a></div><div class="ttdeci">Coordinates Current</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00090">control.h:90</a></div></div>
<div class="ttc" id="astruct_motor_html_a9e751f80e20e54a66ba08973f9e9d3c1"><div class="ttname"><a href="struct_motor.html#a9e751f80e20e54a66ba08973f9e9d3c1">Motor::SpeedCNT</a></div><div class="ttdeci">int16_t SpeedCNT</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00102">control.h:102</a></div></div>
<div class="ttc" id="astruct_motor_html_aad92deaf7a5b8c4b060a1b3aa01236bb"><div class="ttname"><a href="struct_motor.html#aad92deaf7a5b8c4b060a1b3aa01236bb">Motor::lapCNT</a></div><div class="ttdeci">int32_t lapCNT</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00111">control.h:111</a></div></div>
<div class="ttc" id="astruct_motor_html_ab3c4b737dfc5c78a6aba50dda616f7c3"><div class="ttname"><a href="struct_motor.html#ab3c4b737dfc5c78a6aba50dda616f7c3">Motor::X</a></div><div class="ttdeci">float X</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00114">control.h:114</a></div></div>
<div class="ttc" id="astruct_motor_html_ab9b1e67e079f673b0c46489faf3278e6"><div class="ttname"><a href="struct_motor.html#ab9b1e67e079f673b0c46489faf3278e6">Motor::Uref1</a></div><div class="ttdeci">float Uref1</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00113">control.h:113</a></div></div>
<div class="ttc" id="astruct_motor_html_ac4c7ec6bf2a7b0636c00216576186d68"><div class="ttname"><a href="struct_motor.html#ac4c7ec6bf2a7b0636c00216576186d68">Motor::T1</a></div><div class="ttdeci">float T1</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00115">control.h:115</a></div></div>
<div class="ttc" id="astruct_motor_html_acb4618d69b8a7c34c416c427bbc842a4"><div class="ttname"><a href="struct_motor.html#acb4618d69b8a7c34c416c427bbc842a4">Motor::M_angle</a></div><div class="ttdeci">uint16_t M_angle</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00103">control.h:103</a></div></div>
<div class="ttc" id="astruct_motor_html_ae42e7244616d6d75ce0e711a945a30a9"><div class="ttname"><a href="struct_motor.html#ae42e7244616d6d75ce0e711a945a30a9">Motor::anglePID</a></div><div class="ttdeci">PID_para anglePID</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00095">control.h:95</a></div></div>
<div class="ttc" id="astruct_motor_html_af3f1c7d958554a481027e6d53acf02d7"><div class="ttname"><a href="struct_motor.html#af3f1c7d958554a481027e6d53acf02d7">Motor::nPhase</a></div><div class="ttdeci">uint8_t nPhase</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00099">control.h:99</a></div></div>
<div class="ttc" id="astruct_motor_html_af44336d6087385213b2da6b874c8d0c9"><div class="ttname"><a href="struct_motor.html#af44336d6087385213b2da6b874c8d0c9">Motor::hTimDriver</a></div><div class="ttdeci">TIM_HandleTypeDef hTimDriver</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00082">control.h:82</a></div></div>
<div class="ttc" id="astruct_p_i_d__para_html"><div class="ttname"><a href="struct_p_i_d__para.html">PID_para</a></div><div class="ttdoc">PID parameter structure.</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00050">control.h:50</a></div></div>
<div class="ttc" id="astruct_p_i_d__para_html_a050993b7ca6c97e62c1020017f716b91"><div class="ttname"><a href="struct_p_i_d__para.html#a050993b7ca6c97e62c1020017f716b91">PID_para::ki</a></div><div class="ttdeci">float ki</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00051">control.h:51</a></div></div>
<div class="ttc" id="astruct_p_i_d__para_html_a16676aeaa8bf988301616be3eca67dfe"><div class="ttname"><a href="struct_p_i_d__para.html#a16676aeaa8bf988301616be3eca67dfe">PID_para::err_sum</a></div><div class="ttdeci">float err_sum</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00052">control.h:52</a></div></div>
<div class="ttc" id="astruct_p_i_d__para_html_a1f7add0f84d583bc2eceb290d6c4cc06"><div class="ttname"><a href="struct_p_i_d__para.html#a1f7add0f84d583bc2eceb290d6c4cc06">PID_para::kp</a></div><div class="ttdeci">float kp</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00051">control.h:51</a></div></div>
<div class="ttc" id="astruct_p_i_d__para_html_a5bc58d43105d723b774621219125aeb1"><div class="ttname"><a href="struct_p_i_d__para.html#a5bc58d43105d723b774621219125aeb1">PID_para::err</a></div><div class="ttdeci">float err</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00052">control.h:52</a></div></div>
<div class="ttc" id="astruct_p_i_d__para_html_ae7a5c6018507bb1361fcca170e069b9c"><div class="ttname"><a href="struct_p_i_d__para.html#ae7a5c6018507bb1361fcca170e069b9c">PID_para::kd</a></div><div class="ttdeci">float kd</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00051">control.h:51</a></div></div>
<div class="ttc" id="astruct_p_i_d__para_html_af0df2177301e4061ab72ade2ea437bcd"><div class="ttname"><a href="struct_p_i_d__para.html#af0df2177301e4061ab72ade2ea437bcd">PID_para::target</a></div><div class="ttdeci">float target</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00052">control.h:52</a></div></div>
<div class="ttc" id="astruct_p_i_d__para_html_afaa5762f885189bc07c5702d0e9ff140"><div class="ttname"><a href="struct_p_i_d__para.html#afaa5762f885189bc07c5702d0e9ff140">PID_para::err_pre</a></div><div class="ttdeci">float err_pre</div><div class="ttdef"><b>Definition:</b> <a href="control_8h_source.html#l00052">control.h:52</a></div></div>
</div><!-- fragment --></div><!-- contents -->
<!-- start footer part -->
<hr class="footer"/><address class="footer"><small>
Generated by <a href="https://www.doxygen.org/index.html"><img class="footer" src="doxygen.svg" width="104" height="31" alt="doxygen"/></a> 1.9.5
</small></address>
</body>
</html>