Skip to content

Commit bd84b1a

Browse files
committed
Merge branch 'master' into esp32_copper_hfi
2 parents 4b8e37f + a9074ee commit bd84b1a

File tree

38 files changed

+2483
-227
lines changed

38 files changed

+2483
-227
lines changed

.github/workflows/arduino.yml

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
name: AVR
2+
on: [push, pull_request]
3+
jobs:
4+
lint:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
- uses: arduino/arduino-lint-action@v1
9+
with:
10+
library-manager: update
11+
project-type: library
12+
build:
13+
name: Test compiling
14+
runs-on: ubuntu-latest
15+
16+
strategy:
17+
matrix:
18+
arduino-boards-fqbn:
19+
- arduino:avr:uno # arudino uno
20+
- arduino:sam:arduino_due_x # arduino due
21+
- arduino:avr:mega # arduino mega2650
22+
- arduino:avr:leonardo # arduino leonardo
23+
24+
include:
25+
- arduino-boards-fqbn: arduino:avr:uno # arudino uno - compiling almost all examples
26+
sketch-names: '**.ino'
27+
required-libraries: PciManager
28+
sketches-exclude: teensy4_current_control_low_side, full_control_serial, angle_control, bluepill_position_control, esp32_position_control, esp32_i2c_dual_bus_example, stm32_i2c_dual_bus_example, magnetic_sensor_spi_alt_example, osc_esp32_3pwm, osc_esp32_fullcontrol, nano33IoT_velocity_control, smartstepper_control,esp32_current_control_low_side, stm32_spi_alt_example, esp32_spi_alt_example, B_G431B_ESC1, odrive_example_spi, odrive_example_encoder, single_full_control_example, double_full_control_example, stm32_current_control_low_side, open_loop_velocity_6pwm
29+
30+
- arduino-boards-fqbn: arduino:sam:arduino_due_x # arduino due - one full example
31+
sketch-names: single_full_control_example.ino
32+
33+
- arduino-boards-fqbn: arduino:avr:leonardo # arduino leonardo - one full example
34+
sketch-names: open_loop_position_example.ino
35+
36+
- arduino-boards-fqbn: arduino:avr:mega # arduino mega2660 - one full example
37+
sketch-names: single_full_control_example.ino
38+
39+
40+
# Do not cancel all jobs / architectures if one job fails
41+
fail-fast: false
42+
steps:
43+
- name: Checkout
44+
uses: actions/checkout@master
45+
- name: Compile all examples
46+
uses: ArminJo/arduino-test-compile@master
47+
with:
48+
arduino-board-fqbn: ${{ matrix.arduino-boards-fqbn }}
49+
required-libraries: ${{ matrix.required-libraries }}
50+
platform-url: ${{ matrix.platform-url }}
51+
sketch-names: ${{ matrix.sketch-names }}
52+
sketches-exclude: ${{ matrix.sketches-exclude }}
53+
build-properties: ${{ toJson(matrix.build-properties) }}

.github/workflows/ccpp.yml

Lines changed: 4 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -1,14 +1,6 @@
11
name: Library Compile
22
on: [push, pull_request]
33
jobs:
4-
lint:
5-
runs-on: ubuntu-latest
6-
steps:
7-
- uses: actions/checkout@v2
8-
- uses: arduino/arduino-lint-action@v1
9-
with:
10-
library-manager: update
11-
project-type: library
124
build:
135
name: Test compiling
146
runs-on: ubuntu-latest
@@ -59,15 +51,15 @@ jobs:
5951
sketch-names: single_full_control_example.ino
6052

6153
- arduino-boards-fqbn: esp32:esp32:esp32s2 # esp32s2
62-
platform-url: https://espressif.github.io/arduino-esp32/package_esp32_index.json
63-
sketch-names: bldc_driver_3pwm_standalone.ino,stepper_driver_2pwm_standalone.ino,stepper_driver_4pwm_standalone.ino
54+
platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json
55+
sketch-names: bldc_driver_3pwm_standalone.ino, stepper_driver_2pwm_standalone.ino, stepper_driver_4pwm_standalone
6456

6557
- arduino-boards-fqbn: esp32:esp32:esp32s3 # esp32s3
66-
platform-url: https://espressif.github.io/arduino-esp32/package_esp32_index.json
58+
platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json
6759
sketch-names: esp32_position_control.ino, esp32_i2c_dual_bus_example.ino
6860

6961
- arduino-boards-fqbn: esp32:esp32:esp32doit-devkit-v1 # esp32
70-
platform-url: https://espressif.github.io/arduino-esp32/package_esp32_index.json
62+
platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json
7163
sketch-names: esp32_position_control.ino, esp32_i2c_dual_bus_example.ino, esp32_current_control_low_side.ino, esp32_spi_alt_example.ino
7264

7365
- arduino-boards-fqbn: STMicroelectronics:stm32:GenF1:pnum=BLUEPILL_F103C8 # bluepill - hs examples

.github/workflows/esp32.yml

Lines changed: 50 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,50 @@
1+
name: ESP32
2+
on: [push, pull_request]
3+
jobs:
4+
lint:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
- uses: arduino/arduino-lint-action@v1
9+
with:
10+
library-manager: update
11+
project-type: library
12+
build:
13+
name: Test compiling
14+
runs-on: ubuntu-latest
15+
16+
strategy:
17+
matrix:
18+
arduino-boards-fqbn:
19+
- esp32:esp32:esp32doit-devkit-v1 # esp32
20+
- esp32:esp32:esp32s2 # esp32s2
21+
- esp32:esp32:esp32s3 # esp32s3
22+
23+
include:
24+
25+
- arduino-boards-fqbn: esp32:esp32:esp32s2 # esp32s2
26+
platform-url: https://espressif.github.io/arduino-esp32/package_esp32_index.json
27+
sketch-names: bldc_driver_3pwm_standalone.ino,stepper_driver_2pwm_standalone.ino,stepper_driver_4pwm_standalone.ino
28+
29+
- arduino-boards-fqbn: esp32:esp32:esp32s3 # esp32s3
30+
platform-url: https://espressif.github.io/arduino-esp32/package_esp32_index.json
31+
sketch-names: esp32_position_control.ino, esp32_i2c_dual_bus_example.ino
32+
33+
- arduino-boards-fqbn: esp32:esp32:esp32doit-devkit-v1 # esp32
34+
platform-url: https://espressif.github.io/arduino-esp32/package_esp32_index.json
35+
sketch-names: esp32_position_control.ino, esp32_i2c_dual_bus_example.ino, esp32_current_control_low_side.ino, esp32_spi_alt_example.ino
36+
37+
# Do not cancel all jobs / architectures if one job fails
38+
fail-fast: false
39+
steps:
40+
- name: Checkout
41+
uses: actions/checkout@master
42+
- name: Compile all examples
43+
uses: ArminJo/arduino-test-compile@master
44+
with:
45+
arduino-board-fqbn: ${{ matrix.arduino-boards-fqbn }}
46+
required-libraries: ${{ matrix.required-libraries }}
47+
platform-url: ${{ matrix.platform-url }}
48+
sketch-names: ${{ matrix.sketch-names }}
49+
sketches-exclude: ${{ matrix.sketches-exclude }}
50+
build-properties: ${{ toJson(matrix.build-properties) }}

.github/workflows/rpi.yml

Lines changed: 39 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,39 @@
1+
name: RP2040
2+
on: [push, pull_request]
3+
jobs:
4+
lint:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
- uses: arduino/arduino-lint-action@v1
9+
with:
10+
library-manager: update
11+
project-type: library
12+
build:
13+
name: Test compiling
14+
runs-on: ubuntu-latest
15+
16+
strategy:
17+
matrix:
18+
arduino-boards-fqbn:
19+
- arduino:mbed_rp2040:pico # rpi pico
20+
21+
include:
22+
23+
- arduino-boards-fqbn: arduino:mbed_rp2040:pico # raspberry pi pico - one example
24+
sketch-names: open_loop_position_example.ino
25+
26+
# Do not cancel all jobs / architectures if one job fails
27+
fail-fast: false
28+
steps:
29+
- name: Checkout
30+
uses: actions/checkout@master
31+
- name: Compile all examples
32+
uses: ArminJo/arduino-test-compile@master
33+
with:
34+
arduino-board-fqbn: ${{ matrix.arduino-boards-fqbn }}
35+
required-libraries: ${{ matrix.required-libraries }}
36+
platform-url: ${{ matrix.platform-url }}
37+
sketch-names: ${{ matrix.sketch-names }}
38+
sketches-exclude: ${{ matrix.sketches-exclude }}
39+
build-properties: ${{ toJson(matrix.build-properties) }}

.github/workflows/samd.yml

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
name: SAMD
2+
on: [push, pull_request]
3+
jobs:
4+
lint:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
- uses: arduino/arduino-lint-action@v1
9+
with:
10+
library-manager: update
11+
project-type: library
12+
build:
13+
name: Test compiling
14+
runs-on: ubuntu-latest
15+
16+
strategy:
17+
matrix:
18+
arduino-boards-fqbn:
19+
- arduino:samd:nano_33_iot # samd21
20+
- adafruit:samd:adafruit_metro_m4 # samd51
21+
22+
include:
23+
24+
- arduino-boards-fqbn: arduino:samd:nano_33_iot # samd21
25+
sketch-names: nano33IoT_velocity_control.ino, smartstepper_control.ino
26+
27+
- arduino-boards-fqbn: adafruit:samd:adafruit_metro_m4 # samd51 - one full example
28+
platform-url: https://adafruit.github.io/arduino-board-index/package_adafruit_index.json
29+
sketch-names: single_full_control_example.ino
30+
31+
# Do not cancel all jobs / architectures if one job fails
32+
fail-fast: false
33+
steps:
34+
- name: Checkout
35+
uses: actions/checkout@master
36+
- name: Compile all examples
37+
uses: ArminJo/arduino-test-compile@master
38+
with:
39+
arduino-board-fqbn: ${{ matrix.arduino-boards-fqbn }}
40+
required-libraries: ${{ matrix.required-libraries }}
41+
platform-url: ${{ matrix.platform-url }}
42+
sketch-names: ${{ matrix.sketch-names }}
43+
sketches-exclude: ${{ matrix.sketches-exclude }}
44+
build-properties: ${{ toJson(matrix.build-properties) }}

.github/workflows/stm32.yml

Lines changed: 68 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,68 @@
1+
name: STM32
2+
on: [push, pull_request]
3+
jobs:
4+
lint:
5+
runs-on: ubuntu-latest
6+
steps:
7+
- uses: actions/checkout@v2
8+
- uses: arduino/arduino-lint-action@v1
9+
with:
10+
library-manager: update
11+
project-type: library
12+
build:
13+
name: Test compiling
14+
runs-on: ubuntu-latest
15+
16+
strategy:
17+
matrix:
18+
arduino-boards-fqbn:
19+
- STMicroelectronics:stm32:GenF1:pnum=BLUEPILL_F103C8 # stm32 bluepill
20+
- STMicroelectronics:stm32:Nucleo_64:pnum=NUCLEO_F411RE # stm32 nucleo
21+
- STMicroelectronics:stm32:Nucleo_144:pnum=NUCLEO_F746ZG # stm32 nucleo f746zg
22+
- STMicroelectronics:stm32:GenF4:pnum=GENERIC_F405RGTX # stm32f405 - odrive
23+
- STMicroelectronics:stm32:GenL4:pnum=GENERIC_L475RGTX # stm32l475
24+
- STMicroelectronics:stm32:Disco:pnum=B_G431B_ESC1 # B-G431-ESC1
25+
26+
include:
27+
- arduino-boards-fqbn: STMicroelectronics:stm32:GenF1:pnum=BLUEPILL_F103C8 # bluepill - hs examples
28+
platform-url: https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json
29+
sketch-names: bluepill_position_control.ino, stm32_i2c_dual_bus_example.ino, stm32_spi_alt_example.ino
30+
31+
- arduino-boards-fqbn: STMicroelectronics:stm32:Disco:pnum=B_G431B_ESC1 # B-G431-ESC1
32+
platform-url: https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json
33+
sketch-names: B_G431B_ESC1.ino
34+
build-properties:
35+
B_G431B_ESC1:
36+
-DHAL_OPAMP_MODULE_ENABLED
37+
38+
- arduino-boards-fqbn: STMicroelectronics:stm32:GenF4:pnum=GENERIC_F405RGTX # stm32f405 - odrive
39+
platform-url: https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json
40+
sketch-names: odrive_example_encoder.ino, odrive_example_spi.ino, stm32_current_control_low_side.ino
41+
42+
- arduino-boards-fqbn: STMicroelectronics:stm32:GenL4:pnum=GENERIC_L475RGTX # stm32l475
43+
platform-url: https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json
44+
sketch-names: single_full_control_example.ino, stm32_spi_alt_example.ino, double_full_control_example.ino, stm32_current_control_low_side.ino
45+
46+
- arduino-boards-fqbn: STMicroelectronics:stm32:Nucleo_64:pnum=NUCLEO_F411RE # nucleo one full example
47+
platform-url: https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json
48+
sketch-names: single_full_control_example.ino, stm32_spi_alt_example.ino, double_full_control_example.ino, stm32_current_control_low_side.ino
49+
50+
- arduino-boards-fqbn: STMicroelectronics:stm32:Nucleo_144:pnum=NUCLEO_F746ZG # nucleo f7 one full example
51+
platform-url: https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json
52+
sketch-names: single_full_control_example.ino, stm32_spi_alt_example.ino, double_full_control_example.ino, stm32_current_control_low_side.ino
53+
54+
55+
# Do not cancel all jobs / architectures if one job fails
56+
fail-fast: false
57+
steps:
58+
- name: Checkout
59+
uses: actions/checkout@master
60+
- name: Compile all examples
61+
uses: ArminJo/arduino-test-compile@master
62+
with:
63+
arduino-board-fqbn: ${{ matrix.arduino-boards-fqbn }}
64+
required-libraries: ${{ matrix.required-libraries }}
65+
platform-url: ${{ matrix.platform-url }}
66+
sketch-names: ${{ matrix.sketch-names }}
67+
sketches-exclude: ${{ matrix.sketches-exclude }}
68+
build-properties: ${{ toJson(matrix.build-properties) }}

.github/workflows/teensy.yml

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
name: PlatformIO - Teensy build
1+
name: Teensy
22

33
on: [push]
44

@@ -29,6 +29,11 @@ jobs:
2929
run: pio ci --lib="." --board=teensy41 --board=teensy40
3030
env:
3131
PLATFORMIO_CI_SRC: examples/hardware_specific_examples/Teensy/Teensy4/open_loop_velocity_6pwm/open_loop_velocity_6pwm.ino
32+
33+
- name: PIO Run Teensy 4
34+
run: pio ci --lib="." --board=teensy41 --board=teensy40
35+
env:
36+
PLATFORMIO_CI_SRC: examples/hardware_specific_examples/DRV8302_driver/teensy4_current_control_low_side/teensy4_current_control_low_side.ino
3237

3338
- name: PIO Run Teensy 3
3439
run: pio ci --lib="." --board=teensy31 --board=teensy30 --board=teensy35 --board=teensy36

README.md

Lines changed: 23 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,12 @@
11
# SimpleFOClibrary - **Simple** Field Oriented Control (FOC) **library** <br>
22
### A Cross-Platform FOC implementation for BLDC and Stepper motors<br> based on the Arduino IDE and PlatformIO
33

4-
![Library Compile](https://github.com/simplefoc/Arduino-FOC/workflows/Library%20Compile/badge.svg) [![PlatformIO - Teensy build](https://github.com/simplefoc/Arduino-FOC/actions/workflows/teensy.yml/badge.svg)](https://github.com/simplefoc/Arduino-FOC/actions/workflows/teensy.yml)
4+
[![AVR build](https://github.com/simplefoc/Arduino-FOC/actions/workflows/arduino.yml/badge.svg)](https://github.com/simplefoc/Arduino-FOC/actions/workflows/arduino.yml)
5+
[![STM32 build](https://github.com/simplefoc/Arduino-FOC/actions/workflows/stm32.yml/badge.svg)](https://github.com/simplefoc/Arduino-FOC/actions/workflows/stm32.yml)
6+
[![ESP32 build](https://github.com/simplefoc/Arduino-FOC/actions/workflows/esp32.yml/badge.svg)](https://github.com/simplefoc/Arduino-FOC/actions/workflows/esp32.yml)
7+
[![RP2040 build](https://github.com/simplefoc/Arduino-FOC/actions/workflows/rpi.yml/badge.svg)](https://github.com/simplefoc/Arduino-FOC/actions/workflows/rpi.yml)
8+
[![SAMD build](https://github.com/simplefoc/Arduino-FOC/actions/workflows/samd.yml/badge.svg)](https://github.com/simplefoc/Arduino-FOC/actions/workflows/samd.yml)
9+
[![Teensy build](https://github.com/simplefoc/Arduino-FOC/actions/workflows/teensy.yml/badge.svg)](https://github.com/simplefoc/Arduino-FOC/actions/workflows/teensy.yml)
510

611
![GitHub release (latest by date)](https://img.shields.io/github/v/release/simplefoc/arduino-foc)
712
![GitHub Release Date](https://img.shields.io/github/release-date/simplefoc/arduino-foc?color=blue)
@@ -19,17 +24,25 @@ Additionally, most of the efforts at this moment are still channeled towards the
1924
Therefore this is an attempt to:
2025
- 🎯 Demystify FOC algorithm and make a robust but simple Arduino library: [Arduino *SimpleFOClibrary*](https://docs.simplefoc.com/arduino_simplefoc_library_showcase)
2126
- <i>Support as many <b>motor + sensor + driver + mcu</b> combinations out there</i>
22-
- 🎯 Develop a modular FOC supporting BLDC driver boards:
23-
- ***NEW*** 📢: *Minimalistic* BLDC driver (<3Amps) : [<span class="simple">Simple<b>FOC</b>Mini</span> ](https://github.com/simplefoc/SimpleFOCMini).
24-
- *Low-power* gimbal driver (<5Amps) : [*Arduino Simple**FOC**Shield*](https://docs.simplefoc.com/arduino_simplefoc_shield_showcase).
25-
- *Medium-power* BLDC driver (<30Amps): [Arduino <span class="simple">Simple<b>FOC</b>PowerShield</span> ](https://github.com/simplefoc/Arduino-SimpleFOC-PowerShield).
26-
- See also [@byDagor](https://github.com/byDagor)'s *fully-integrated* ESP32 based board: [Dagor Brushless Controller](https://github.com/byDagor/Dagor-Brushless-Controller)
27+
- 🎯 Develop modular and easy to use FOC supporting BLDC driver boards
28+
- For official driver boards see [<span class="simple">Simple<span class="foc">FOC</span>Boards</span>](https://docs.simplefoc.com/boards)
29+
- Many many more boards developed by the community members, see [<span class="simple">Simple<span class="foc">FOC</span>Community</span>](https://community.simplefoc.com/)
2730

2831
> NEW RELEASE 📢 : <span class="simple">Simple<span class="foc">FOC</span>library</span> v2.3.3
29-
> - And more bugfixes - see the complete list of 2.3.3 [fixes and PRs](https://github.com/simplefoc/Arduino-FOC/milestone/10?closed=1)
30-
31-
32-
## Arduino *SimpleFOClibrary* v2.3.2
32+
> - Teensy4
33+
> - support for low-side current sensing [#392](https://github.com/simplefoc/Arduino-FOC/pull/392)
34+
> - support for center aligned 6pwm and 3pwm (optional) [#392](https://github.com/simplefoc/Arduino-FOC/pull/392)
35+
> - stm32
36+
> - support for center aligned pwm (even across multiple timers and motors/drivers) [#374](https://github.com/simplefoc/Arduino-FOC/pull/374), [#388](https://github.com/simplefoc/Arduino-FOC/pull/388)
37+
> - support for DMA based low-side current sensing: [#383](https://github.com/simplefoc/Arduino-FOC/pull/383),[#378](https://github.com/simplefoc/Arduino-FOC/pull/378)
38+
> - support for f7 architecture [#388](https://github.com/simplefoc/Arduino-FOC/pull/388),[#394](https://github.com/simplefoc/Arduino-FOC/pull/394)
39+
> - KV rating calculation fix [#347](https://github.com/simplefoc/Arduino-FOC/pull/347)
40+
> - Much more performant Space Vector PWM calculation [#340](https://github.com/simplefoc/Arduino-FOC/pull/340)
41+
> - And much more:
42+
> - See the complete list of bugfixes and new features of v2.3.3 [fixes and PRs](https://github.com/simplefoc/Arduino-FOC/milestone/10?closed=1)
43+
44+
45+
## Arduino *SimpleFOClibrary* v2.3.3
3346

3447
<p align="">
3548
<a href="https://youtu.be/Y5kLeqTc6Zk">

0 commit comments

Comments
 (0)