Skip to content

Commit 2f3e7c7

Browse files
author
Andrew Schalk
committed
Fixed typos/grammar and broken gif
1 parent 68dc77d commit 2f3e7c7

File tree

3 files changed

+152
-12
lines changed

3 files changed

+152
-12
lines changed

Gemfile.lock

Lines changed: 140 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,140 @@
1+
GEM
2+
remote: https://rubygems.org/
3+
specs:
4+
addressable (2.8.8)
5+
public_suffix (>= 2.0.2, < 8.0)
6+
base64 (0.3.0)
7+
bigdecimal (4.0.1)
8+
colorator (1.1.0)
9+
concurrent-ruby (1.3.6)
10+
csv (3.3.5)
11+
em-websocket (0.5.3)
12+
eventmachine (>= 0.12.9)
13+
http_parser.rb (~> 0)
14+
eventmachine (1.2.7)
15+
ffi (1.17.2-x64-mingw-ucrt)
16+
forwardable-extended (2.6.0)
17+
google-protobuf (4.33.2-x64-mingw-ucrt)
18+
bigdecimal
19+
rake (>= 13)
20+
http_parser.rb (0.8.0)
21+
i18n (1.14.7)
22+
concurrent-ruby (~> 1.0)
23+
jekyll (4.4.1)
24+
addressable (~> 2.4)
25+
base64 (~> 0.2)
26+
colorator (~> 1.0)
27+
csv (~> 3.0)
28+
em-websocket (~> 0.5)
29+
i18n (~> 1.0)
30+
jekyll-sass-converter (>= 2.0, < 4.0)
31+
jekyll-watch (~> 2.0)
32+
json (~> 2.6)
33+
kramdown (~> 2.3, >= 2.3.1)
34+
kramdown-parser-gfm (~> 1.0)
35+
liquid (~> 4.0)
36+
mercenary (~> 0.3, >= 0.3.6)
37+
pathutil (~> 0.9)
38+
rouge (>= 3.0, < 5.0)
39+
safe_yaml (~> 1.0)
40+
terminal-table (>= 1.8, < 4.0)
41+
webrick (~> 1.7)
42+
jekyll-remote-theme (0.4.3)
43+
addressable (~> 2.0)
44+
jekyll (>= 3.5, < 5.0)
45+
jekyll-sass-converter (>= 1.0, <= 3.0.0, != 2.0.0)
46+
rubyzip (>= 1.3.0, < 3.0)
47+
jekyll-sass-converter (3.0.0)
48+
sass-embedded (~> 1.54)
49+
jekyll-seo-tag (2.8.0)
50+
jekyll (>= 3.8, < 5.0)
51+
jekyll-toc (0.19.0)
52+
jekyll (>= 3.9)
53+
nokogiri (~> 1.12)
54+
jekyll-watch (2.2.1)
55+
listen (~> 3.0)
56+
json (2.18.0)
57+
kramdown (2.5.1)
58+
rexml (>= 3.3.9)
59+
kramdown-parser-gfm (1.1.0)
60+
kramdown (~> 2.0)
61+
liquid (4.0.4)
62+
listen (3.9.0)
63+
rb-fsevent (~> 0.10, >= 0.10.3)
64+
rb-inotify (~> 0.9, >= 0.9.10)
65+
mercenary (0.4.0)
66+
nokogiri (1.18.10-x64-mingw-ucrt)
67+
racc (~> 1.4)
68+
pathutil (0.16.2)
69+
forwardable-extended (~> 2.6)
70+
public_suffix (7.0.0)
71+
racc (1.8.1)
72+
rake (13.3.1)
73+
rb-fsevent (0.11.2)
74+
rb-inotify (0.11.1)
75+
ffi (~> 1.0)
76+
rexml (3.4.4)
77+
rouge (4.6.1)
78+
rubyzip (2.4.1)
79+
safe_yaml (1.0.5)
80+
sass-embedded (1.97.0-x64-mingw-ucrt)
81+
google-protobuf (~> 4.31)
82+
terminal-table (3.0.2)
83+
unicode-display_width (>= 1.1.1, < 3)
84+
unicode-display_width (2.6.0)
85+
webrick (1.9.2)
86+
87+
PLATFORMS
88+
x64-mingw-ucrt
89+
90+
DEPENDENCIES
91+
bundler
92+
jekyll-remote-theme
93+
jekyll-seo-tag
94+
jekyll-toc
95+
rake
96+
97+
CHECKSUMS
98+
addressable (2.8.8) sha256=7c13b8f9536cf6364c03b9d417c19986019e28f7c00ac8132da4eb0fe393b057
99+
base64 (0.3.0) sha256=27337aeabad6ffae05c265c450490628ef3ebd4b67be58257393227588f5a97b
100+
bigdecimal (4.0.1) sha256=8b07d3d065a9f921c80ceaea7c9d4ae596697295b584c296fe599dd0ad01c4a7
101+
colorator (1.1.0) sha256=e2f85daf57af47d740db2a32191d1bdfb0f6503a0dfbc8327d0c9154d5ddfc38
102+
concurrent-ruby (1.3.6) sha256=6b56837e1e7e5292f9864f34b69c5a2cbc75c0cf5338f1ce9903d10fa762d5ab
103+
csv (3.3.5) sha256=6e5134ac3383ef728b7f02725d9872934f523cb40b961479f69cf3afa6c8e73f
104+
em-websocket (0.5.3) sha256=f56a92bde4e6cb879256d58ee31f124181f68f8887bd14d53d5d9a292758c6a8
105+
eventmachine (1.2.7) sha256=994016e42aa041477ba9cff45cbe50de2047f25dd418eba003e84f0d16560972
106+
ffi (1.17.2-x64-mingw-ucrt) sha256=15d2da54ee578657a333a6059ed16eaba1cbd794ceecd15944825b65c8381ac0
107+
forwardable-extended (2.6.0) sha256=1bec948c469bbddfadeb3bd90eb8c85f6e627a412a3e852acfd7eaedbac3ec97
108+
google-protobuf (4.33.2-x64-mingw-ucrt) sha256=16ed6f9c96da64c8d5c4ee763b58ab62c5e1431128891f4fe1d74370e4419e61
109+
http_parser.rb (0.8.0) sha256=5a0932f1fa82ce08a8516a2685d5a86031c000560f89946913c555a0697544be
110+
i18n (1.14.7) sha256=ceba573f8138ff2c0915427f1fc5bdf4aa3ab8ae88c8ce255eb3ecf0a11a5d0f
111+
jekyll (4.4.1) sha256=4c1144d857a5b2b80d45b8cf5138289579a9f8136aadfa6dd684b31fe2bc18c1
112+
jekyll-remote-theme (0.4.3) sha256=d3fde726484fb3df04de9e347baf75aaa3d5bfea771a330412e0c52608e54b40
113+
jekyll-sass-converter (3.0.0) sha256=e2e7674f186e906b9d99b8066e13f9b4d5cb9f806d36f7bc8cf2610053d8c902
114+
jekyll-seo-tag (2.8.0) sha256=3f2ed1916d56f14ebfa38e24acde9b7c946df70cb183af2cb5f0598f21ae6818
115+
jekyll-toc (0.19.0) sha256=8a8270f7e8e3d849e2035710b1713d0af5e2185a4bfaca70f9192ecf5ac50668
116+
jekyll-watch (2.2.1) sha256=bc44ed43f5e0a552836245a54dbff3ea7421ecc2856707e8a1ee203a8387a7e1
117+
json (2.18.0) sha256=b10506aee4183f5cf49e0efc48073d7b75843ce3782c68dbeb763351c08fd505
118+
kramdown (2.5.1) sha256=87bbb6abd9d3cebe4fc1f33e367c392b4500e6f8fa19dd61c0972cf4afe7368c
119+
kramdown-parser-gfm (1.1.0) sha256=fb39745516427d2988543bf01fc4cf0ab1149476382393e0e9c48592f6581729
120+
liquid (4.0.4) sha256=4fcfebb1a045e47918388dbb7a0925e7c3893e58d2bd6c3b3c73ec17a2d8fdb3
121+
listen (3.9.0) sha256=db9e4424e0e5834480385197c139cb6b0ae0ef28cc13310cfd1ca78377d59c67
122+
mercenary (0.4.0) sha256=b25a1e4a59adca88665e08e24acf0af30da5b5d859f7d8f38fba52c28f405138
123+
nokogiri (1.18.10-x64-mingw-ucrt) sha256=64f40d4a41af9f7f83a4e236ad0cf8cca621b97e31f727b1bebdae565a653104
124+
pathutil (0.16.2) sha256=e43b74365631cab4f6d5e4228f812927efc9cb2c71e62976edcb252ee948d589
125+
public_suffix (7.0.0) sha256=f7090b5beb0e56f9f10d79eed4d5fbe551b3b425da65877e075dad47a6a1b095
126+
racc (1.8.1) sha256=4a7f6929691dbec8b5209a0b373bc2614882b55fc5d2e447a21aaa691303d62f
127+
rake (13.3.1) sha256=8c9e89d09f66a26a01264e7e3480ec0607f0c497a861ef16063604b1b08eb19c
128+
rb-fsevent (0.11.2) sha256=43900b972e7301d6570f64b850a5aa67833ee7d87b458ee92805d56b7318aefe
129+
rb-inotify (0.11.1) sha256=a0a700441239b0ff18eb65e3866236cd78613d6b9f78fea1f9ac47a85e47be6e
130+
rexml (3.4.4) sha256=19e0a2c3425dfbf2d4fc1189747bdb2f849b6c5e74180401b15734bc97b5d142
131+
rouge (4.6.1) sha256=5075346d5797d6864be93f7adc75a16047a7dbfa572c63c502419ffa582c77de
132+
rubyzip (2.4.1) sha256=8577c88edc1fde8935eb91064c5cb1aef9ad5494b940cf19c775ee833e075615
133+
safe_yaml (1.0.5) sha256=a6ac2d64b7eb027bdeeca1851fe7e7af0d668e133e8a88066a0c6f7087d9f848
134+
sass-embedded (1.97.0-x64-mingw-ucrt) sha256=d0c714cf4daa05598b0b3da1503e0ccd6d6df271625ab3b16f0f96fd26b8e187
135+
terminal-table (3.0.2) sha256=f951b6af5f3e00203fb290a669e0a85c5dd5b051b3b023392ccfd67ba5abae91
136+
unicode-display_width (2.6.0) sha256=12279874bba6d5e4d2728cef814b19197dbb10d7a7837a869bab65da943b7f5a
137+
webrick (1.9.2) sha256=beb4a15fc474defed24a3bda4ffd88a490d517c9e4e6118c3edce59e45864131
138+
139+
BUNDLED WITH
140+
4.0.2

docs/simplefoc_library/digging_deeper/theory/FOC_routine.md

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -17,11 +17,11 @@ Field oriented control algorithm's main task is to take user defined voltage <i>
1717

1818
<img src="../extras/Images/voltage_loop.png">
1919

20-
FOC algorithm calculates the phase voltages which create the magnetic field in the motor's stator which are exactly 90 degrees "behind" the magnetic field of the permanent magnets of the rotor, creating a pushing effect. Here is a very nice animation of what happens inside of the motor when running simplified version of the the FOC called six-step modulation.
20+
The FOC algorithm calculates the phase voltages which create the magnetic field in the motor's stator which are exactly 90 degrees "behind" the magnetic field of the permanent magnets of the rotor, creating a pushing effect. Here is a very nice animation of what happens inside of the motor when running simplified version of the the FOC called six-step modulation.
2121

22-
<iframe src='https://gfycat.com/ifr/MealyDeafeningHarpyeagle' frameborder='0' scrolling='no' allowfullscreen width='640' height='404'></iframe><p> <a href="https://gfycat.com/mealydeafeningharpyeagle">via Gfycat</a></p>
22+
<img src="../extras/Images/FOC_6_step_modulation.gif" >
2323

24-
Another way to look at why we need 90 degree angle in between rotor and stator fields if by remembering the equation of the electric force generated by the wire passing through the magnetic field:
24+
Another way to look at why we need 90 degree angle in between rotor and stator fields is by remembering the equation of the electric force generated by the wire passing through the magnetic field:
2525

2626
```cpp
2727
F = B*I*L*sin(alpha)
@@ -32,12 +32,12 @@ Where `B` is the strength of the magnetic field, `L` is the length of the wire,
3232
3333
## How to calculate the appropriate voltages <i>u<sub>a</sub></i>,<i>u<sub>b</sub></i> and <i>u<sub>c</sub></i>
3434
35-
Since the <span class="simple">Simple<span class="foc">FOC</span>library</span> is intended for education about the FOC algorithm as well for enabling various applications, the two most standard versions of the FOC modulation are implemented in this library.
35+
Since the <span class="simple">Simple<span class="foc">FOC</span>library</span> is intended for education about the FOC algorithm as well for enabling various applications, the two most standard versions of FOC modulation are implemented in this library.
3636
3737
- Sinusoidal PWM: `SinePWM`
3838
- Space Vector PWM: `SpaceVectorPWM`
3939
40-
You can configure them by setting the value of `motor.foc_modulation` variable:
40+
You can configure them by setting the value of the `motor.foc_modulation` variable:
4141
```cpp
4242
motor.foc_modulation = FOCModulationType::SinePWM; // default
4343
// or
@@ -65,7 +65,7 @@ $$u_b = \frac{-U_{\alpha} + \sqrt{3}U_{\beta}}{2}$$
6565

6666
$$u_c = \frac{-U_{\alpha} - \sqrt{3}U_{\beta}}{2}$$
6767

68-
Here is the code of implementation of the Sinusoidal PWM in the <span class="simple">Simple<span class="foc">FOC</span>library</span>:
68+
Here is the implementation of Sinusoidal PWM in the <span class="simple">Simple<span class="foc">FOC</span>library</span>:
6969
```cpp
7070
// Method using FOC to set Uq to the motor at the optimal angle
7171
void BLDCMotor::setPhaseVoltage(float Uq, float angle_el) {
@@ -100,7 +100,7 @@ In the first step we find the sector <i>s</i> the rotor is currently in. The ang
100100
<img src="../extras/Images/svm_1.png" style="margin-left:50px;margin-top:10px;margin-bottom:10px;width:250px"><br>
101101
102102
103-
Second step is projecting the <i>T<sub>0,1,2</sub></i> values to the appropriate duty-cycles <i>T<sub>a,b,c</sub></i> which depend directly of the sector the motor is currently in.
103+
The second step is projecting the <i>T<sub>0,1,2</sub></i> values to the appropriate duty-cycles <i>T<sub>a,b,c</sub></i> which depend directly on the sector the motor is currently in.
104104
105105
Sector | <i>T<sub>a</sub></i> | <i>T<sub>b</sub></i> | <i>T<sub>c</sub></i>
106106
--- | --- | --- | ---
@@ -111,7 +111,7 @@ Sector | <i>T<sub>a</sub></i> | <i>T<sub>b</sub></i> | <i>T<sub>c</sub></i>
111111
5| <i>T<sub>2</sub></i> + <i>T<sub>0</sub></i>/2|<i>T<sub>0</sub></i>/2 | <i>T<sub>1</sub></i> + <i>T<sub>2</sub></i> + <i>T<sub>0</sub></i>/2
112112
6| <i>T<sub>1</sub></i> + <i>T<sub>2</sub></i> + <i>T<sub>0</sub></i>/2| <i>T<sub>0</sub></i>/2| <i>T<sub>1</sub></i> + <i>T<sub>0</sub></i>/2
113113
114-
Here is one example of a pwm signal generated using SVM table for parameters: <i>s = 2</i>, <i><i>T<sub>1</sub></i> = 1/8 = 0.125</i>, <i><i>T<sub>2</sub></i> = 1/8 = 0.125</i> and <i><i>T<sub>0</sub></i> = 1/2 = 0.5</i>
114+
Here is one example of a pwm signal generated using the SVM table for parameters: <i>s = 2</i>, <i><i>T<sub>1</sub></i> = 1/8 = 0.125</i>, <i><i>T<sub>2</sub></i> = 1/8 = 0.125</i> and <i><i>T<sub>0</sub></i> = 1/2 = 0.5</i>
115115
116116
<img src="../extras/Images/svm_dc.png" >
117117
@@ -202,7 +202,7 @@ Sinusoidal | Space Vector
202202
--- | ---
203203
<img src="../extras/Images/0.5.jpg" class="img400"> | <img src="../extras/Images/svm0.5.jpg" class="img400">
204204

205-
There are several key differences in between these two algorithms. But in terms of <span class="simple">Simple<span class="foc">FOC</span>library</span> all that you need to know is that Space Vector algorithm better uses the maximal voltage range of the power supply. In the tables above, you can see that for <i>U<sub>q</sub> = 0.5V</i> the magnitude of sine waves generated by the Sinusoidal modulation is exactly equal to 1, and Space vector modulation is not quite there yet. The "double sine" wave produced by the space vector has lower magnitude by the factor of `2/sqrt(3) = 1.15` which means that it can deliver 15% more power to the motor using same power supply.
205+
There are several key differences between these two algorithms. But in terms of the <span class="simple">Simple<span class="foc">FOC</span>library</span> all that you need to know is that the Space Vector algorithm better uses the maximal voltage range of the power supply. In the tables above, you can see that for <i>U<sub>q</sub> = 0.5V</i> the magnitude of sine waves generated by the Sinusoidal modulation is exactly equal to 1, and Space vector modulation is not quite there yet. The "double sine" wave produced by the space vector has lower magnitude by the factor of `2/sqrt(3) = 1.15` which means that it can deliver 15% more power to the motor using same power supply.
206206

207207
This means, for your power-supply with the voltage <i>V<sub>power_supply</sub></i>, when using `SinePWM` you will be able to set maximal <i>U<sub>q</sub> = 0.5 V<sub>power_supply</sub> </i> and if using `SpaceVectorPWM` you will be able to set <i>U<sub>q</sub> = 0.58 V<sub>power_supply</sub> </i>
208208

@@ -213,7 +213,7 @@ The power supply voltage <i>V<sub>power_supply</sub></i> you should specify by c
213213
motor.voltage_power_supply = 12;
214214
```
215215
<blockquote class="warning"> <p class="heading">What if I don't specify this parameter?</p>
216-
If you don't <code class="highlighter-rouge">motor.voltage_power_supply</code>, the algorithm will still work but your <code class="highlighter-rouge">motor.voltage_q</code> value will no longer be equal to the real output voltage.
216+
If you don't specify <code class="highlighter-rouge">motor.voltage_power_supply</code>, the algorithm will still work but your <code class="highlighter-rouge">motor.voltage_q</code> value will no longer be equal to the real output voltage.
217217
</blockquote>
218218
<img src="../extras/Images/sine_foc.png" >
219219

@@ -222,7 +222,7 @@ If you don't <code class="highlighter-rouge">motor.voltage_power_supply</code>,
222222

223223
If you try to put voltage <i>U<sub>q</sub></i> higher than <i>U<sub>q</sub> = 0.5 V<sub>power_supply</sub> </i> for `SinePWM` or <i>U<sub>q</sub> = 0.58 V<sub>power_supply</sub> </i> for `SpaceVectorPWM`, it will still work but the <i>U<sub>a,b,c</sub></i> signals will be saturated.
224224

225-
Here are few images of the `SinePWM` for different <i>U<sub>q</sub></i> values.
225+
Here are a few images of the `SinePWM` for different <i>U<sub>q</sub></i> values.
226226

227227
<i>U<sub>q</sub> = 0.5 V<sub>power_supply</sub> </i> | <i>U<sub>q</sub> = 0.6 V<sub>power_supply</sub> </i> | <i>U<sub>q</sub> = V<sub>power_supply</sub> </i>
228228
--- | --- | ---
@@ -232,7 +232,7 @@ Basically what you can see on images is that the <i>U<sub>a,b,c</sub></i> are sa
232232
The motor is still getting some increase of power, but it is no longer linear or smooth.
233233

234234
<blockquote class="warning"> <p class="heading">RULE OF THUMB</p>
235-
In reality the motor can see the difference all the way till <i>U<sub>q</sub> ~ 0.7 V<sub>power_supply</sub> </i>. After this value the <i>U<sub>a,b,c</sub></i> are too saturated and further increase of <i>U<sub>q</sub></i> doesn't result in increase of motor power.
235+
In reality the motor can see the difference all the way till <i>U<sub>q</sub> ~ 0.7 V<sub>power_supply</sub> </i>. After this value the <i>U<sub>a,b,c</sub></i> are too saturated and further increase of <i>U<sub>q</sub></i> doesn't result in an increase of motor power.
236236

237237
But every motor is a bit different and you can check these values empirically on your own easily. Just put the motor in the voltage control and see after which value of the voltage <i>U<sub>q</sub></i> you can no longer see the improvement in motor power (it will stop accelerating).
238238
</blockquote>
1.56 MB
Loading

0 commit comments

Comments
 (0)