Skip to content

Commit d8f1aee

Browse files
committed
prepatations for v2.3.3
1 parent 668160f commit d8f1aee

36 files changed

+685
-88
lines changed

docs/simplefoc_libraries/helper.md

+14
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
---
2+
layout: default
3+
title: <i class="fa fa-sm fa-book"></i> stm32 pinouts
4+
#title: <a href="http://docs.simplefoc.com/stm32pinouts" style="padding:0px;color:inherit;background:none">stm32 pinout helper</a>
5+
parent: <span class="simple">Simple<span class="foc">FOC</span>utils</span>
6+
description: "Arduino Simple Field Oriented Control (FOC) library ."
7+
nav_order: 1
8+
permalink: stm32pinouts
9+
has_children: False
10+
---
11+
12+
Redirecting to the stm32 pinout helper page...
13+
14+
<meta http-equiv="refresh" content="0;url=https://docs.simplefoc.com/stm32pinouts/">

docs/simplefoc_libraries/index.md

+14
Original file line numberDiff line numberDiff line change
@@ -6,12 +6,26 @@ nav_order: 5
66
permalink: /arduino_simplefoc_utils
77
has_children: True
88
has_toc: False
9+
navbar:
10+
items:
11+
- title: External Link
12+
url: https://example.com
13+
external: true
914
---
1015

1116

1217
# <span class="simple">Simple<span class="foc">FOC</span>utils</span>
1318
In the context of the <span class="simple">Simple<span class="foc">FOC</span>project</span> many different open-source community projects have been developed.
1419

20+
## Helper tools
21+
22+
- ### Stm32 Pinout documentation
23+
24+
This is repo that aims providing a documentation on available PWM and ADC pins of most of the families of stm32 microcontrollers. This is an information that is usually hard to find and therefore we have decided to put it all in one place. The website is autogenerated parsing the latest release of the [stm32duino core](https://github.com/stm32duino/Arduino_Core_STM32).
25+
26+
<a href ="https://github.com/simplefoc/stm32pinouts" class="btn"><i class="fa fa-github"></i> Github repo</a> <a href ="https://docs.simplefoc.com/stm32pinouts/" class="btn btn-primary"><i class="fa fa-github"></i> Open stm32 pinout helper</a>
27+
28+
<blockquote class="info"> 📢 Here is a quick guide to choosing appropriate PWM pins for different MCU architectures <a href="choosing_pwm_pins">see in docs</a>.</blockquote>
1529

1630
## Arduino libraries
1731

docs/simplefoc_libraries/libraries/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: default
33
title: libraries
44
parent: <span class="simple">Simple<span class="foc">FOC</span>utils</span>
55
description: "Arduino Simple Field Oriented Control (FOC) library ."
6-
nav_order: 1
6+
nav_order: 2
77
permalink: /additional_libraries
88
has_children: True
99
has_toc: False

docs/simplefoc_libraries/tools/index.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ layout: default
33
title: tools
44
parent: <span class="simple">Simple<span class="foc">FOC</span>utils</span>
55
description: "Arduino Simple Field Oriented Control (FOC) library ."
6-
nav_order: 2
6+
nav_order: 3
77
permalink: /additional_tools
88
has_children: True
99
has_toc: False

docs/simplefoc_library/cheatsheet/build_flags.md

+3
Original file line numberDiff line numberDiff line change
@@ -32,3 +32,6 @@ Flag | Architecture | Description
3232
`SIMPLEFOC_DEBUG_RP2040` | RP2040 | set to enable extra debug output on Raspberry Pico.
3333
`SIMPLEFOC_ESP32_USELEDC` | ESP32 | force use of the LEDC PWM driver even on ESP32s that support MCPWM. Mainly useful for testing purposes, normally you would prefer MCPWM if it is available.
3434
`SIMPLEFOC_ESP32_HW_DEADTIME` | ESP32 | Select between MCPWM hardware deadtime and a software implementation allowing phase_state configuration. Defaults to hardware for being tested more.
35+
`SIMPLEFOC_TEENSY_DEBUG` | Teensy 3.x / 4.x | Set to enable extra debug output for Teensy 3.x / 4.x MCUs.
36+
`SIMPLEFOC_TEENSY4_ADC_INTERRUPT_DEBUG` | Teensy 4 | Enables a simple debugging for low-side current sense interrupts which sets the pin `30` to high each time the ADC1 fires an interrupt.
37+
`SIMPLEFOC_TEENSY4_FORCE_CENTER_ALIGNED_3PWM` | Teensy 4 | Force center aligned 3PWM mode on Teensy 4. Normally 3PWM mode is not center aligned and the timers are not synchronized.

docs/simplefoc_library/code/current_sense/index.md

+4-2
Original file line numberDiff line numberDiff line change
@@ -51,14 +51,16 @@ stm32 (in general) | ✔️ | ❌ | ❌
5151
stm32f1 family | ✔️ | ✔️ (one motor) | ❌
5252
stm32f4 family | ✔️ | ✔️ (one motor) | ❌
5353
stm32g4 family | ✔️ | ✔️ (one motor) | ❌
54-
stm32l4 family | ✔️ | ✔️ (initial) | ❌
54+
stm32l4 family | ✔️ | ✔️ (one motor) | ❌
55+
stm32f7 family | ✔️ | ✔️ (initial) | ❌
5556
stm32 B_G431B_ESC1 | ❌ | ✔️ (one motor) | ❌
5657
esp32/esp32s3 | ✔️ | ✔️ | ❌
5758
esp32s2/esp32c3 | ✔️ | ❌ | ❌
5859
esp8266 | ❌ | ❌ | ❌
5960
samd21 | ✔️ | ✔️ (one motor) | ❌
6061
samd51 | ✔️ | ❌ | ❌
61-
teensy | ✔️ | ❌ | ❌
62+
teensy3 | ✔️ | ❌ | ❌
63+
teensy4 | ✔️ | ✔️(one motor) | ❌
6264
Raspberry Pi Pico | ✔️ | ❌ | ❌
6365
Portenta H7 | ✔️ | ❌ | ❌
6466
nRF52 | ✔️ | ❌ | ❌

docs/simplefoc_library/code/current_sense/low_side.md

+4-1
Original file line numberDiff line numberDiff line change
@@ -31,12 +31,15 @@ STM32 (in general) |❌
3131
STM32f1 family | ✔️ (one motor)
3232
STM32f4 family | ✔️ (one motor)
3333
STM32g4 family | ✔️ (one motor)
34+
STM32l4 family | ✔️ (one motor)
35+
STM32f7 family | ✔️ (one motor)
3436
STM32 B_G431B_ESC1 | ✔️
3537
ESP32 |✔️
3638
ESP8266 | ❌
3739
SAMD21 | ✔️/❌ (one motor, poorly tested)
3840
SAMD51 | ❌
39-
Teensy | ❌
41+
Teensy3 | ❌
42+
Teensy4 | ✔️ (inital)
4043
Raspberry Pi Pico | ❌
4144
Portenta H7 | ❌
4245
Renesas (UNO R4) | ❌ (TBD)

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

+2-5
Original file line numberDiff line numberDiff line change
@@ -42,6 +42,7 @@ Additionally this bldc driver class enables the user to provide enable signal fo
4242
BLDCDriver3PWM driver = BLDCDriver3PWM(9, 10, 11, 8, 7, 6);
4343
```
4444

45+
<blockquote class="info"> 📢 Here is a quick guide to choosing appropriate PWM pins for different MCU architectures <a href="choosing_pwm_pins">see in docs</a>.</blockquote>
4546

4647
### Low-side current sensing considerations
4748

@@ -59,13 +60,10 @@ You can also always ask the community for help - <a href="https://community.simp
5960
## Step 2.1 PWM Configuration
6061
```cpp
6162
// pwm frequency to be used [Hz]
62-
// for atmega328 fixed to 32kHz
63+
// for atmega328 either 4k or 32kHz
6364
// esp32/stm32/teensy configurable
6465
driver.pwm_frequency = 20000;
6566
```
66-
<blockquote class="warning">
67-
⚠️ Arduino devices based on ATMega328 chips have fixed pwm frequency of 32kHz.
68-
</blockquote>
6967

7068
Here is a list of different microcontrollers and their PWM frequency and resolution used with the Arduino <span class="simple">Simple<span class="foc">FOC</span>library</span>.
7169

@@ -78,7 +76,6 @@ Teensy | 25kHz | 50kHz | 8bit | yes | yes
7876

7977
All of these settings are defined in the `drivers/hardware_specific/x_mcu.cpp/h` of the library source.
8078

81-
8279
### Low-side current sensing considerations
8380

8481
As the ADC conversion takes some time to finish and as this conversion has to happen only during the specific time window ( when all the phases are grounded - low-side mosfets are ON ) it is important to use an appropriate PWM frequency. PWM frequency will determine how long each period of the PWM is and in term how much time the low-side switches are ON. Higher PWM frequency will leave less time for the ADC to read the current values.

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

+4-5
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,8 @@ BLDCDriver6PWM driver = BLDCDriver6PWM(5,6, 9,10, 3,11, 8);
3838
⚠️ 6 PWM configuration is very hardware specific and please make sure to respect certain guidelines in order for it to work properly!
3939
</blockquote>
4040

41+
<blockquote class="info"> 📢 Here is a quick guide to choosing appropriate PWM pins for different MCU architectures <a href="choosing_pwm_pins">see in docs</a>.</blockquote>
42+
4143
### Arduino UNO support
4244
Arduino UNO and all the atmega328 based boards have only 6 PWM pins and in order to use the `BLDCDrievr6PWM` we need to use all of them. Those are `3`,`5`,`6`,`9`,`10` and `11`.
4345
Furthermore in order for the algorithm to work well we need to use the PWM pins that belong to the same timer for each high/low side pair of each phase.
@@ -106,20 +108,17 @@ As ADC conversion has to be synchronised with the PWM generated on ALL the phase
106108
In order to maximise your chances for the low-side current sensing to work well we suggest to make sure that the PWM pins chosen for your driver all belong to the same timer.
107109

108110
Finding out which pins belong to different timers might require some time to be spent in the MCU datasheet 😄
111+
To try to save you some time, we have created a quick guide to choosing appropriate PWM pins for different MCU architectures <a href="choosing_pwm_pins">see in docs</a>.
109112
You can also always ask the community for help - <a href="https://community.simplefoc.com/">community link</a>!
110113
</blockquote>
111114

112115
## Step 2.1 PWM Configuration
113116
```cpp
114117
// pwm frequency to be used [Hz]
115-
// for atmega328 fixed to 32kHz
118+
// for atmega328 either 4k or 32kHz
116119
// esp32/stm32/teensy configurable
117120
driver.pwm_frequency = 20000;
118121
```
119-
<blockquote class="warning">
120-
⚠️ Arduino devices based on ATMega328 chips have fixed PWM frequency of 32kHz.
121-
</blockquote>
122-
123122
Here is a list of different microcontrollers and their PWM frequency and resolution used with the Arduino <span class="simple">Simple<span class="foc">FOC</span>library</span>.
124123

125124
MCU | default frequency | MAX frequency | PWM resolution | Center-aligned | Configurable freq

docs/simplefoc_library/code/drivers/index.md

+4-3
Original file line numberDiff line numberDiff line change
@@ -33,15 +33,16 @@ These classes can be used as stand-alone classes and they can be used to set cer
3333

3434
MCU | 2 PWM mode | 4 PWM mode | 3 PWM mode | 6 PWM mode | pwm frequency config
3535
--- | --- |--- |--- |--- |---
36-
Arduino (8-bit) | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ (either 4kHz or 32kHz)
36+
Arduino AVR (8-bit) | ✔️ | ✔️ | ✔️ | ✔️ | ✔️ (either 4kHz or 32kHz)
3737
Arduino DUE | ✔️ | ✔️ | ✔️ | ❌ | ✔️
3838
stm32 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️
39-
esp32 | ✔️ | ✔️ | ✔️ | ✔️ / ❌<sup>*</sup> | ✔️
39+
esp32 `MCPWM` | ✔️ | ✔️ | ✔️ | ✔️ | ✔️
40+
esp32 `LEDC`| ✔️ | ✔️ | ✔️ | ❌ | ✔️
4041
esp8266 | ✔️ | ✔️ | ✔️ | ❌ | ✔️
4142
samd21/51 | ✔️ | ✔️ | ✔️ | ✔️ | ✔️
4243
teensy | ✔️ | ✔️ | ✔️ | ✔️ | ✔️
4344
Raspberry Pi Pico | ✔️ | ✔️ | ✔️ | ✔️ | ✔️
4445
Portenta H7 | ✔️ | ✔️ | ✔️ | ❌ | ✔️
4546
Renesas (UNO R4 Minima) | ✔️ | ✔️ | ✔️ | ✔️ | ✔️
4647

47-
<sup>*</sup> For ESP32, the support for 6 PWM depends on the model of ESP32. The models that have a MCPWM peripheral support 6 PWM, the ones that do not only support the other PWM modes.
48+
<blockquote class="info"> 📢 Here is a quick guide to choosing appropriate PWM pins for different MCU architectures <a href="choosing_pwm_pins">see in docs</a>.</blockquote>

docs/simplefoc_library/code/drivers/stepper_driver/stepper_driver_2pwm.md

+11-12
Original file line numberDiff line numberDiff line change
@@ -34,13 +34,13 @@ To create the interface to the stepper driver you need to specify the 2 `PWM` pi
3434

3535
For two direction pins per phase use the constructor:
3636
```cpp
37-
// pwm1 PWM1 phase pwm pin
38-
// in1 IN1A phase dir pins
39-
// pwm2 PWM2 phase pwm pin
40-
// in2 IN2A phase dir pins
41-
// en1 enable pin phase 1 (optional input)
42-
// en2 enable pin phase 2 (optional input)
43-
// StepperDriver2PWM(int pwm1, int* in1, int pwm2, int* in2, int en1 = NOT_SET, int en2 = NOT_SET);
37+
// pwm1 PWM1 phase pwm pin
38+
// in1 IN1A phase dir pins
39+
// pwm2 PWM2 phase pwm pin
40+
// in2 IN2A phase dir pins
41+
// en1 enable pin phase 1 (optional input)
42+
// en2 enable pin phase 2 (optional input)
43+
// StepperDriver2PWM(int pwm1, int* in1, int pwm2, int* in2, int en1 = NOT_SET, int en2 = NOT_SET);
4444
StepperDriver2PWM driver = StepperDriver2PWM(3, {4,5}, 10, {9,8}, 11, 12);
4545
```
4646
@@ -55,16 +55,15 @@ For only one direction pin per phase use the constructor:
5555
StepperDriver2PWM driver = StepperDriver2PWM(3, 4, 5, 6, 11, 12);
5656
```
5757

58+
<blockquote class="info"> 📢 Here is a quick guide to choosing appropriate PWM pins for different MCU architectures <a href="choosing_pwm_pins">see in docs</a>.</blockquote>
59+
5860
## Step 2.1 PWM Configuration
5961
```cpp
6062
// pwm frequency to be used [Hz]
61-
// for atmega328 fixed to 32kHz
63+
// for atmega328 either 4k or 32kHz
6264
// esp32/stm32/teensy configurable
6365
driver.pwm_frequency = 20000;
6466
```
65-
<blockquote class="warning">
66-
⚠️ Arduino devices based on ATMega328 chips have fixed PWM frequency of 32kHz.
67-
</blockquote>
6867

6968
Here is a list of different microcontrollers and their PWM frequency and resolution used with the Arduino <span class="simple">Simple<span class="foc">FOC</span>library</span>.
7069

@@ -75,7 +74,7 @@ STM32 | 50kHz | 100kHz | 14bit | yes | yes
7574
ESP32 | 40kHz | 100kHz | 10bit | yes | yes
7675
Teensy | 50kHz | 100kHz | 8bit | yes | yes
7776

78-
All of these settings are defined in the `drivers/hardware_specific/x_mcu.cpp/h` of the library source.
77+
All of these settings are defined in the `drivers/hardware_specific/x/x_mcu.cpp/h` of the library source.
7978

8079

8180
## Step 2.2 Voltages

docs/simplefoc_library/code/drivers/stepper_driver/stepper_driver_4pwm.md

+4-5
Original file line numberDiff line numberDiff line change
@@ -31,18 +31,17 @@ To create the interface to the stepper driver you need to specify the 4 `pwm` pi
3131
StepperDriver4PWM driver = StepperDriver4PWM(5, 6, 9, 10, 7, 8);
3232
```
3333

34+
<blockquote class="info"> 📢 Here is a quick guide to choosing appropriate PWM pins for different MCU architectures <a href="choosing_pwm_pins">see in docs</a>.</blockquote>
35+
3436
## Step 2.1 PWM Configuration
3537
```cpp
3638
// pwm frequency to be used [Hz]
37-
// for atmega328 fixed to 32kHz
39+
// for atmega328 either 4k or 32kHz
3840
// esp32/stm32/teensy configurable
3941
driver.pwm_frequency = 20000;
4042
```
41-
<blockquote class="warning">
42-
⚠️ Arduino devices based on ATMega328 chips have fixed pwm frequency of 32kHz.
43-
</blockquote>
4443

45-
Here is a list of different microcontrollers and their PWM frequency and resolution used with the Arduino <span class="simple">Simple<span class="foc">FOC</span>library</span>.
44+
Here is a list of different microcontrollers and their PWM frequency and resolution used with the Arduino <span class="simple">Simple<span class="foc">FOC</span>library</span>.
4645

4746
MCU | default frequency | MAX frequency | PWM resolution | Center-aligned | Configurable freq
4847
--- | --- | --- | --- | ---

docs/simplefoc_library/digging_deeper/index.md

+7
Original file line numberDiff line numberDiff line change
@@ -27,5 +27,12 @@ To better understand what is going on under the hood of this algorithm and to ge
2727
</a>
2828
<p> A discussion about the theory of different parts of the FOC algorithm and <span class="simple">Simple<span class="foc">FOC</span>library</span> </p>
2929
</div>
30+
<div style="width:50%;text-align:center;" class="">
31+
<a href="practical_guides">
32+
<i class="fa fa-4x fa-cubes"></i>
33+
<h4 style="color:inherit">Practical guides</h4>
34+
</a>
35+
<p> A collection of practical guides and explanations of different procedures when it comes to interacting with BLDC motors </p>
36+
</div>
3037
</div>
3138

0 commit comments

Comments
 (0)