Skip to content

Commit db520fd

Browse files
Merge pull request #10 from runger1101001/dev
fixing typos pointed out by the community
2 parents 7fe1c49 + c81e7ba commit db520fd

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+179
-173
lines changed

docs/simplefoc_library/code/communication/commander/index.md

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ has_toc: false
1212

1313
# Commander interface
1414

15-
Commander is a simple and flexible interface monitoring, supervision, configuration and control using the G-code like communication protocol. The communication is based on `ASCII` character command ids which makes simple and efficient to parse on any mcu. After the command id has been received the function attached to this command is called and provided the remaining string of characters received which follows the command character.
15+
Commander is a simple and flexible interface monitoring, supervision, configuration and control using the G-code like communication protocol. The communication is based on `ASCII` character command ids which makes simple and efficient to parse on any MCU. After the command id has been received the function attached to this command is called and provided the remaining string of characters received which follows the command character.
1616

1717
<img src="extras/Images/cmd_motor.gif" class="img100">
1818
<img src="extras/Images/cmd_motor_get.gif" class="img100">
@@ -166,7 +166,6 @@ void loop(){
166166
}
167167
```
168168
Or maybe you wish to tune the velocity PID and you and change the target value of the motor and you wish to remove unnecessary memory overhead due to the other functionalities you do nto necessarily need, then your code could look something like:
169-
something like this:
170169
```cpp
171170
BLDCMotor motor = .....
172171
Commander commander = ....

docs/simplefoc_library/code/communication/commander/motion.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ Motion control interface in the `Commander` can be integrated in user's applicat
2525

2626

2727
## Target setting in one line
28-
Commander interface enables the user to set the target value for the motion control as well as the limits at once. However different motion control strategies have different numbers of limits (angle, velocity, torque) so depending of the motion control mode used the behavior of the command will change:
28+
Commander interface enables the user to set the target value for the motion control as well as the limits at once. However different motion control strategies have different numbers of limits (angle, velocity, torque) so depending of the motion control mode used the behaviour of the command will change:
2929

3030
This feature is available to the user if any one of the three interfaces is added to the `Commander`.
3131

docs/simplefoc_library/code/communication/commander/scalar.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ void loop(){
3434
}
3535
```
3636
37-
You will be able to configure (set and get) itfrom serial monitor:
37+
You will be able to configure (set and get) it from serial monitor:
3838
```sh
3939
$ ? # list available commands
4040
A: my variable

docs/simplefoc_library/code/communication/step_dir.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -63,7 +63,7 @@ step_dir.attach(&my_value);
6363
```
6464

6565
<blockquote class="warning"><p class="heading">⚠️ BEWARE: Suboptimal performance</p>
66-
The simplest forms of communication such as step/dir are designed to be handled in hardware and software, interrupt based, implementation of these communication interfaces is usually not the optimal solution. It will provide the user a good base for testing purposes, but it is hard guarantee long-term robustness.
66+
The simplest forms of communication such as step/dir are designed to be handled in hardware and software, interrupt based, implementation of these communication interfaces is usually not the optimal solution. It will provide the user a good base for testing purposes, but it is hard to guarantee long-term robustness.
6767
</blockquote>
6868

6969

docs/simplefoc_library/code/current_sense/index.md

Lines changed: 13 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ Arduino <span class="simple">Simple<span class="foc">FOC</span>library</span> ha
2020

2121
<img src="extras/Images/comparison_cs.png" class="width40">
2222

23-
up to this moment ( [check the releases <i class="fa fa-tag"></i>](https://github.com/simplefoc/Arduino-FOC/releases) ), Arduino <span class="simple">Simple<span class="foc">FOC</span>library</span> supports in-line current sensing for almost all platforms and low-side current sensing on ESP32 boards, stm32 (f1, f4 and g4 families - one motor), samd21 (one motor) and on the stm32 based B_G431B_ESC1 boards (one motor).
23+
up to this moment ( [check the releases <i class="fa fa-tag"></i>](https://github.com/simplefoc/Arduino-FOC/releases) ), Arduino <span class="simple">Simple<span class="foc">FOC</span>library</span> supports in-line current sensing for almost all platforms and low-side current sensing on ESP32 boards, stm32 (f1, f4 and g4 families - one motor), SAMD21 (one motor) and on the STM32 based B-G431B-ESC1 boards (one motor).
2424

2525
Each one of the current sensing classes will implement all the necessary functionalities for simple and robust implementation of FOC algorithm:
2626
- Hardware config
@@ -31,7 +31,7 @@ Each one of the current sensing classes will implement all the necessary functio
3131
- Adaptive alignment with driver phases
3232
- Reading the phase currents
3333
- Calculation of the current vector magnitude
34-
- Calculation of the FOC d and q currents
34+
- Calculation of the FOC D and Q currents
3535

3636
Each of the implemented classes can be used as stand-alone classes and they can be used to read current values on BLDC driver outputs out of scope of the Arduino <span class="simple">Simple<span class="foc">FOC</span>library</span>, see example codes in `utils > current_sense_test`.
3737
In order for FOC algorithm to work the current sense classes are linked to a `BLDCMotor` class which uses the driver to read the FOC currents.
@@ -47,18 +47,19 @@ MCU | In-line | Low-side | High-side
4747
--- | --- |--- |---
4848
Arduino (8-bit) | ✔️ | ❌ | ❌
4949
Arduino DUE | ✔️ | ❌ | ❌
50-
stm32 (in general) | ✔️ | ❌ | ❌
51-
stm32f1 family | ✔️ | ✔️ (one motor) | ❌
52-
stm32f4 family | ✔️ | ✔️ (one motor) | ❌
53-
stm32g4 family | ✔️ | ✔️ (one motor) | ❌
54-
stm32 B_G431B_ESC1 | ✔️ | ✔️ | ❌
55-
esp32 | ✔️ | ✔️ | ❌
56-
esp8266 | ❌ | ❌ | ❌
57-
samd21 | ✔️ | ✔️ (one motor) | ❌
58-
samd51 | ✔️ | ❌ | ❌
59-
teensy | ✔️ | ❌ | ❌
50+
STM32 (in general) | ✔️ | ❌ | ❌
51+
STM32F1 family | ✔️ | ✔️ (one motor) | ❌
52+
STM32F4 family | ✔️ | ✔️ (one motor) | ❌
53+
STM32G4 family | ✔️ | ✔️ (one motor) | ❌
54+
STM32 B-G431B-ESC1 | ✔️ | ✔️ | ❌
55+
ESP32 | ✔️ | ✔️ | ❌
56+
ESP8266 | ❌ | ❌ | ❌
57+
SAMD21 | ✔️ | ✔️ (one motor) | ❌
58+
SAMD51 | ✔️ | ❌ | ❌
59+
Teensy | ✔️ | ❌ | ❌
6060
Raspberry Pi Pico | ✔️ | ❌ | ❌
6161
Portenta H7 | ✔️ | ❌ | ❌
6262

6363
## Digging deeper
64+
6465
For more theoretical explanations and source code implementations of the current sensing and its integration into the FOC and motion check out the [digging deeper section](digging_deeper).

docs/simplefoc_library/code/current_sense/inline.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -10,26 +10,26 @@ 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>. The 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
--- | ---
2424
Arduino (8-bit) | ✔️
2525
Arduino DUE | ✔️
26-
stm32 | ✔️
27-
stm32 B_G431B_ESC1 | ✔️
28-
esp32 | ✔️
29-
esp8266 | ❌
30-
samd21 | ✔️
31-
samd51 | ✔️
32-
teensy | ✔️
26+
STM32 | ✔️
27+
STM32 B_G431B_ESC1 | ✔️
28+
ESP32 | ✔️
29+
ESP8266 | ❌
30+
SAMD21 | ✔️
31+
SAMD51 | ✔️
32+
Teensy | ✔️
3333
Raspberry Pi Pico | ✔️
3434
Portenta H7 | ✔️
3535

@@ -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: 16 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -21,22 +21,22 @@ Low side current sensing for all the architectures is on our road-map and we are
2121

2222
## Current sensing support per MCU architecture
2323

24-
Low side current sensing is currently supported for several MCU architectures supported by the <span class="simple">Simple<span class="foc">FOC</span>library</span>. ESP32 architecture has the most generic support, supporting multiple motors per chip. Stm32 families f1, f4 and g4 are initially supported and support low-side sensing for only one motor. A special case of the stm32 board is the BG431_ESC1 development kit which has very specific low-side implementation for its hardware configuration, and it is fully supported by the library. Samd21 architecture is under development, it has an initial support for only one motor, but for now as it has not been extensively tested, we suggest not to rely on our implementation.
24+
Low side current sensing is currently supported for several MCU architectures supported by the <span class="simple">Simple<span class="foc">FOC</span>library</span>. ESP32 architecture has the most generic support, supporting multiple motors per chip. Stm32 families f1, f4 and g4 are initially supported and support low-side sensing for only one motor. A special case of the STM32 board is the B-G431-ESC1 development kit which has very specific low-side implementation for its hardware configuration, and it is fully supported by the library. Samd21 architecture is under development, it has an initial support for only one motor, but for now as it has not been extensively tested, we suggest not to rely on our implementation.
2525

2626
MCU | Low-side Current sensing
2727
--- | ---
2828
Arduino (8-bit) | ❌
2929
Arduino DUE | ❌
30-
stm32 (in general) |❌
31-
stm32f1 family | ✔️ (one motor)
32-
stm32f4 family | ✔️ (one motor)
33-
stm32g4 family | ✔️ (one motor)
34-
stm32 B_G431B_ESC1 | ✔️
35-
esp32 |✔️
36-
esp8266 | ❌
37-
samd21 | ✔️/❌ (one motor, poorly tested)
38-
samd51 | ❌
39-
teensy | ❌
30+
STM32 (in general) |❌
31+
STM32f1 family | ✔️ (one motor)
32+
STM32f4 family | ✔️ (one motor)
33+
STM32g4 family | ✔️ (one motor)
34+
STM32 B_G431B_ESC1 | ✔️
35+
ESP32 |✔️
36+
ESP8266 | ❌
37+
SAMD21 | ✔️/❌ (one motor, poorly tested)
38+
SAMD51 | ❌
39+
Teensy | ❌
4040
Raspberry Pi Pico | ❌
4141
Portenta H7 | ❌
4242

@@ -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);
@@ -233,8 +233,7 @@ If you are sure in your configuration and if you wish to skip the alignment proc
233233
current_sense.skip_align = true;
234234
```
235235

236-
For example [AliExpress DRV8302 board](https://fr.aliexpress.com/wholesale?catId=0&initiative_id=SB_20211003032006&SearchText=bldc+drv8302) , you would have a code similar to this:
237-
For example, Arduino <span class="simple">Simple<span class="foc">FOC</span>Shield</span> v2, you would have a code similar to this:
236+
For example for the [AliExpress DRV8302 board](https://fr.aliexpress.com/wholesale?catId=0&initiative_id=SB_20211003032006&SearchText=bldc+drv8302), you would have code similar to this:
238237
```cpp
239238
// one possible combination of current sensing pins for SimpleFOCShield v2
240239
// shunt - 5milliOhm
@@ -272,7 +271,7 @@ See the full example for the Aliexpress DRB8302 based board in the library examp
272271
## Standalone current sense
273272

274273
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.
274+
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.
276275

277276
Reading the phase currents can be done by calling:
278277
```cpp

docs/simplefoc_library/code/drivers/bldc_driver/bldc_driver_3pwm.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,15 +9,15 @@ grand_grand_parent: Writing the Code
99
grand_grand_grand_parent: Arduino <span class="simple">Simple<span class="foc">FOC</span>library</span>
1010
---
1111

12-
# BLDC driver 3PWM - `BLDCDriver3PWM`
12+
# BLDC driver 3 PWM - `BLDCDriver3PWM`
1313

1414
This is the class which provides an abstraction layer of most of the common 3PWM bldc drivers out there. Basically any BLDC driver board that can be run using 3PWM signals can be represented with this class.
1515
Examples:
1616
- Arduino <span class="simple">Simple<span class="foc">FOC</span>Shield</span>
1717
- Arduino <span class="simple">Simple<span class="foc">FOC</span> <span class="power">Power</span>Shield</span>
1818
- L6234 breakout board
1919
- HMBGC v2.2
20-
- DRV830x ( can be run in 3pwm or 6pwm mode )
20+
- DRV830x ( can be run in 3 PWM or 6 PWM mode )
2121
- X-NUCLEO-IHM07M1
2222
- etc.
2323

@@ -164,7 +164,7 @@ void loop() {
164164
}
165165
```
166166

167-
An example code of the BLDC driver with three enable pins, one for each phase. This code will put one phase at the time to the high-impedance mode and pun 3 and 6 Volts on the remaining two.
167+
An example code of the BLDC driver with three enable pins, one for each phase. This code will put one phase at the time to the high-impedance mode and put 3 and 6 Volts on the remaining two.
168168
```cpp
169169
// BLDC driver standalone example
170170
#include <SimpleFOC.h>

0 commit comments

Comments
 (0)