You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+14Lines changed: 14 additions & 0 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -563,26 +563,40 @@ In order to get optimal performance you will have to fiddle a bit with with the
563
563
564
564
#### Control theory lovers corner :D
565
565
Transfer funciton of the PI contorller this library implements is:
566
+
566
567
<p><imgsrc="./extras/Images/cont_PI.png" /></p>
568
+
567
569
Continiuos PI is discretized using Tustin transform. The final discrete equation becomes:
570
+
568
571
<p><imgsrc="./extras/Images/dis_PI.png" /></p>
572
+
569
573
Where the <i>u(k)</i> is the control signal (voltage <i>U<sub>q</sub></i> in our case) in moment <i>k</i>, <i>e(k),e(k-1)</i> is the tracking error in current moment <i>k</i> and previous step <i>k-1</i>. Tracking error presents the difference in between the target velocity value <i>v<sub>d</sub></i> and measured velocity <i>v</i>.
574
+
570
575
<p><imgsrc="./extras/Images/track.png" /></p>
571
576
572
577
Transfer funciton of the Low pass filter is contorller is:
578
+
573
579
<p><imgsrc="./extras/Images/cont_LPF.png" /></p>
574
580
In it discrete form it becomes:
581
+
575
582
<p><imgsrc="./extras/Images/dis_LPF.png" /></p>
583
+
576
584
where <i>v<sub>f</sub>(k)</i> is filtered velocity value in moment <i>k</i>, <i>v(k)</i> is the measured velocity in the moment <i>k</i>, <i>T<sub>f</sub></i> is the filter time constant and <i>T<sub>s</sub></i> is the sampling time (or time in between executions of the equation).
577
585
This low pass filter can be also written in the form:
586
+
578
587
<p><imgsrc="./extras/Images/LPF_alpha.png" /></p>
588
+
579
589
where:
590
+
580
591
<p><imgsrc="./extras/Images/alpha.png" /></p>
592
+
581
593
This makes it a bit more clear what the time constat `Tf` of the Low pass filter stands for. If your sample time is around 1millisecond (for arduino UNO this can be taken as an average) then setting the
582
594
`Tf` value to `Tf = 0.01` will result in:
595
+
583
596
```cpp
584
597
alpha = 0.01/(0.01 + 0.001) = 0.91
585
598
```
599
+
586
600
Which means that your actual velocity measurement <i>v</i> will influence the filtered value <i>v<sub>f</sub><i> with the coeficient `1-alpha = 0.09` which is going to smooth the velocity values considerably (maybe even too muuch, depends of the application).
0 commit comments