Skip to content

Commit a9b76ef

Browse files
committed
fixing typos pointed out by the community
1 parent 7fe1c49 commit a9b76ef

File tree

8 files changed

+18
-18
lines changed

8 files changed

+18
-18
lines changed

docs/simplefoc_library/code/current_sense/inline.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,14 +10,14 @@ grand_grand_parent: Arduino <span class="simple">Simple<span class="foc">FOC</sp
1010

1111
# In-line current sensing
1212

13-
Inline current sensing technique is the simplest one to use and the most precise one. The shunt resistors are placed in-line with motor phases and the current measured on these shunt resistors will be motor phase current regardless of the state of the PWM duty cycle. This implementation is therefore very suitable for Arduino devices due to the fact that adc can be sampled at any time to read the current and the adc acquisition duration is as important as for the other current sensing approaches. The downside of this approach is the hardware, this current sensing architecture requirers high-precision bidirectional amplifiers with much better PWM rejection than the regular low-side or high-side amplifiers.
13+
Inline current sensing technique is the simplest one to use and the most precise one. The shunt resistors are placed in-line with motor phases and the current measured on these shunt resistors will be motor phase current regardless of the state of the PWM duty cycle. This implementation is therefore very suitable for Arduino devices due to the fact that adc can be sampled at any time to read the current and the adc acquisition duration is not as important as for the other current sensing approaches. The downside of this approach is the hardware, this current sensing architecture requires high-precision bidirectional amplifiers with much better PWM rejection than the regular low-side or high-side amplifiers.
1414

1515
<img src="extras/Images/in-line.png" class="width60"><img src="extras/Images/comparison_cs.png" class="width30">
1616

1717

1818
## Current sensing support per MCU architecture
1919

20-
In-line current sensing is currently supported for almost all MCU architectures supported by the <span class="simple">Simple<span class="foc">FOC</span>library</span>. Only not supported architecture is teh ESP8266 which does not have 2 ADC pins, making it unable to run FOC.
20+
In-line current sensing is currently supported for almost all MCU architectures supported by the <span class="simple">Simple<span class="foc">FOC</span>library</span>. Only not supported architecture is the ESP8266 which does not have 2 ADC pins, making it unable to run FOC.
2121

2222
MCU | In-line Current sensing
2323
--- | ---
@@ -44,7 +44,7 @@ Portenta H7 | ✔️
4444
// - phC - C phase adc pin (optional)
4545
InlineCurrentSense current_sense = InlineCurrentSense(0.01, 20, A0, A1, A2);
4646
```
47-
To instantiate the inline current sensor using the <span class="simple">Simple<span class="foc">FOC</span>library</span> just create an instance of the class `InlineCurrentSense`. This class takes as a parameter shunt resistance value `shunt_resistor`, amplification gain `gain` and two or three ADC channel pins depending on the available measuring hardware that you might have. It is important to specify right adc channels for right driver/motor phase. So if your pin `A0` measures the phase current `A` and pin `A1` measures the phase current `B` make sure to put provide them to the constructor in that order.
47+
To instantiate the inline current sensor using the <span class="simple">Simple<span class="foc">FOC</span>library</span> just create an instance of the class `InlineCurrentSense`. This class takes as a parameter shunt resistance value `shunt_resistor`, amplification gain `gain` and two or three ADC channel pins depending on the available measuring hardware that you might have. It is important to specify right adc channels for right driver/motor phase. So if your pin `A0` measures the phase current `A` and pin `A1` measures the phase current `B` make sure to provide them to the constructor in that order.
4848

4949
### Measuring 2 out of 3 currents
5050
Field Oriented Control algorithm can run with both 2 or 3 phase current measurements. If measuring 2 out of 3 currents, when defining your `InlineCurrentSense` class put the flag `_NC` (not connected) to the phase value you are not using.

docs/simplefoc_library/code/current_sense/low_side.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ driver.pwm_frequency = 20000;
6767

6868
####  2. PWM pin considerations
6969

70-
As ADC conversion has to be synchronised with the PWM generated on ALL the phases, it is important that all the PWM generated for all the phases have aligned PWM. Since the microcontrollers usually have more than one timer for PWM generation on its pins, different architectures of microcontrollers have different degrees of alinement in between the PWM generated from different timers.
70+
As ADC conversion has to be synchronised with the PWM generated on ALL the phases, it is important that all the PWM generated for all the phases have aligned PWM. Since the microcontrollers usually have more than one timer for PWM generation on its pins, different architectures of microcontrollers have different degrees of alignment in between the PWM generated from different timers.
7171

7272

7373
<blockquote class="info">
@@ -171,10 +171,10 @@ else{
171171
}
172172
```
173173

174-
Once when your current sense has been intialised and calibrated you can start measuring the currents!
174+
When your current sense has been intialised and calibrated you can start measuring the currents!
175175

176176
## Using the current sense with FOC algorithm
177-
To use the `LowsideCurrentSense` with the FOC algorithm all you need to do is to add it to link it with the `BLDCMotor` you wish to use it with:
177+
To use the `LowsideCurrentSense` with the FOC algorithm all you need to do is link it with the `BLDCMotor` you wish to use it with:
178178
```cpp
179179
// link motor and current sense
180180
motor.linkCurrentSense(&current_sense);
@@ -272,7 +272,7 @@ See the full example for the Aliexpress DRB8302 based board in the library examp
272272
## Standalone current sense
273273

274274
Since the low-side current sense has to be synchornised with PWM of a driver of interest it does not make sense to use it as a stand-alone sensor.
275-
But once when you linked the current sense with the `BLDCMotor` you can use it to read your phase currents, overall current magnitude and DQ currents.
275+
But once you have linked the current sense with the `BLDCMotor` you can use it to read your phase currents, overall current magnitude and DQ currents.
276276

277277
Reading the phase currents can be done by calling:
278278
```cpp

docs/simplefoc_library/code/motion_control/closed_loop_control/torque_control/foc_current.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -27,7 +27,7 @@ The FOC current torque control algorithm reads the phase currents of the BLDC mo
2727
The torque generated in the motor is proportional to the q-axis current <i>i<sub>q</sub></i>, making this torque control mode the *true torque control* of a BLDC motor.
2828

2929
## Configuration parameters
30-
In order to make this loop run smoothly the user needs to configure the PID controller parameters of teh `PID_current_q` and Low pass filter `LPF_current_q` time constant.
30+
In order to make this loop run smoothly the user needs to configure the PID controller parameters of the `PID_current_q` and Low pass filter `LPF_current_q` time constant.
3131
```cpp
3232
// Q axis
3333
// PID parameters - default

docs/simplefoc_library/code/motion_control/closed_loop_control/torque_control/index.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ has_toc: False
4141
- [DC current mode](dc_current_torque_mode) - `dc_current`
4242
- [FOC current mode](foc_current_torque_mode) - `foc_current`
4343

44-
In short **voltage control mode** is the simplest approximation of the motor torque control and it so basic that can be run on any motor+driver+mcu combination out there. **DC current mode** is teh next step of the motor's torque approximation which is much more exact than the voltage mode but requires current sensing and much stronger microcontroller. **FOC current mode** is controls motor's true torque and it is not an approximation, it also requires current sensor and even more processing power than the DC current mode. See in depth explanations in [torque mode docs](torque_control).
44+
In short **voltage control mode** is the simplest approximation of the motor torque control and it so basic that can be run on any motor+driver+mcu combination out there. **DC current mode** is the next step of the motor's torque approximation which is much more exact than the voltage mode but requires current sensing and much stronger microcontroller. **FOC current mode** is controls motor's true torque and it is not an approximation, it also requires current sensor and even more processing power than the DC current mode. See in depth explanations in [torque mode docs](torque_control).
4545

4646
This motion control mode is enabled setting the `controller` parameter to:
4747
```cpp
@@ -73,7 +73,7 @@ For more information about the source code implementation of the motion control
7373
Torque control type | PROS | CONS
7474
----- | ----- | ------
7575
Voltage | ✔️ Very simple and fast <br>✔️ Good performance with any MCU <br> ✔️ Very smooth on low speeds<br> ✔️ No current sense needed | ❌ Not optimal on high speeds <br> ❌ Cannot control true current draw <br> ❌ Torque is approximated (low error on low speeds)
76-
DC current | ✔️ Can control true current draw <br> ✔️ Suitable for low performance MUCs <br> ✔️ Current limiting | ❌ More complex to execute (slower) <br> ❌ Can achieve lower speeds than voltage mode <br>❌ Torque is approximated (low error on low speeds) <br> ❌ Needs current sensing
76+
DC current | ✔️ Can control true current draw <br> ✔️ Suitable for low performance MCUs <br> ✔️ Current limiting | ❌ More complex to execute (slower) <br> ❌ Can achieve lower speeds than voltage mode <br>❌ Torque is approximated (low error on low speeds) <br> ❌ Needs current sensing
7777
FOC current | ✔️ True torque control (any velocity) <br> ✔️ Can control true current draw <br> ✔️ Very efficient on higher velocities <br> ✔️ Current limiting | ❌ The most complex to execute (slowest) <br> ❌ Not suitable for low-performing MCUs (can become unstable) <br> ❌ Needs current sensing
7878

7979
### Voltage mode - `voltage`

docs/simplefoc_library/code/motion_control/open_loop/angle_openloop.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -71,12 +71,12 @@ The angle open-loop control will (if not provided phase resistance) set the volt
7171
```cpp
7272
voltage = voltage_limit; // Volts
7373
```
74-
This is very ineficeint, as for different motors with different phase resistances the same voltage values can produce wildly different currents.
75-
For gimbal motor, you can run it in the open loop with the voltage limits of 5-10 Volts and it will reach the currents of 0.5-2 amps as it has the pahse resistance from 5-15 Ohms. For drone motors, the voltage limits should stay very low, under 1 volt. Because they have pahse resisatnce of 0.05 to 0.2 Ohms.
74+
This is very inefficient, as for different motors with different phase resistances the same voltage values can produce wildly different currents.
75+
For gimbal motor, you can run it in the open loop with the voltage limits of 5-10 Volts and it will reach the currents of 0.5-2 amps as it has the phase resistance from 5-15 Ohms. For drone motors, the voltage limits should stay very low, under 1 volt. Because they have phase resisatnce of 0.05 to 0.2 Ohms.
7676

7777
### Current limiting approaches
7878

79-
We suggest you to provide the motor class with the `phase_resistance` value and set the `motor.current_limit` instead the voltage limit. This current might be surpassed but at least you will know an approximate current your motor is drawing. You can calculate the current the motor is going to be producing by checking the motor resistance `phase_resistance` and evaluating:
79+
We suggest you to provide the motor class with the `phase_resistance` value and set the `motor.current_limit` instead of the voltage limit. This current might be surpassed but at least you will know an approximate current your motor is drawing. You can calculate the current the motor is going to be producing by checking the motor resistance `phase_resistance` and evaluating:
8080
```cpp
8181
voltage = current_limit * phase_resistance; // Amps
8282
```

docs/simplefoc_library/digging_deeper/theory/FOC_routine.md

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

1616
<img src="../extras/Images/voltage_loop.png">
1717

18-
FOC algorithm calculates the phase voltages which create the magnetic field in the motor's rotor 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.
18+
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.
1919

2020
<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>
2121

@@ -192,7 +192,7 @@ Sinusoidal | Space Vector
192192
--- | ---
193193
<img src="../extras/Images/0.5.jpg" class="img400"> | <img src="../extras/Images/svm0.5.jpg" class="img400">
194194

195-
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 quiet 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.
195+
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.
196196

197197
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>
198198

docs/simplefoc_library/digging_deeper/theory/low_pass_filtering.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ This makes it a bit more clear what the time constant `Tf` of the Low pass filte
3333
alpha = 0.01/(0.01 + 0.001) = 0.91
3434
```
3535

36-
Which means that your actual velocity measurement <i>v</i> will influence the filtered value <i>v<sub>f</sub><i> with the coefficient `1-alpha = 0.09` which is going to smooth the velocity values considerably (maybe even too much, depends of the application).
36+
Which means that your actual velocity measurement <i>v</i> will influence the filtered value <i>v<sub>f</sub><i> with the coefficient `1-alpha = 0.09` which is going to smooth the velocity values considerably (maybe even too much, depending on the application).
3737

3838

3939
## Implementation details

docs/simplefoc_library/digging_deeper/theory/voltage_torque_control.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,13 +26,13 @@ Therefore as for the DC motor we know that the motor torque `T` is directly prop
2626
T = I*K
2727
```
2828
Where `K` is the motor constant defined by its hardware.
29-
And we also know that the curren is proportional to the set voltage `U`:
29+
And we also know that the current is proportional to the set voltage `U`:
3030

3131
```cpp
3232
I = (U - EMF)/R
3333
```
3434

35-
Where `R` is the motor resistance and `EMF` is the generated back EMF voltage. Thi equation doesn't take in consideration any dynamics but in general it works good enough.
35+
Where `R` is the motor resistance and `EMF` is the generated back EMF voltage. This equation doesn't take in consideration any dynamics but in general it works good enough.
3636

3737
So what we can conclude from all this is that (if we neglect the EMF):
3838
```cpp

0 commit comments

Comments
 (0)