Skip to content

Commit a9074ee

Browse files
committed
2 parents 68c74b9 + 6fafa35 commit a9074ee

File tree

74 files changed

+3192
-463
lines changed

Some content is hidden

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

74 files changed

+3192
-463
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/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: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,46 @@
1+
name: Teensy
2+
3+
on: [push]
4+
5+
jobs:
6+
build:
7+
8+
runs-on: ubuntu-latest
9+
steps:
10+
- uses: actions/checkout@v3
11+
- uses: actions/cache@v3
12+
with:
13+
path: |
14+
~/.cache/pip
15+
~/.platformio/.cache
16+
key: ${{ runner.os }}-pio
17+
- uses: actions/setup-python@v4
18+
with:
19+
python-version: '3.9'
20+
- name: Install PlatformIO Core
21+
run: pip install --upgrade platformio
22+
23+
- name: PIO Run Teensy 4
24+
run: pio ci --lib="." --board=teensy41 --board=teensy40
25+
env:
26+
PLATFORMIO_CI_SRC: examples/hardware_specific_examples/Teensy/Teensy4/bldc_driver_6pwm_standalone/bldc_driver_6pwm_standalone.ino
27+
28+
- name: PIO Run Teensy 4
29+
run: pio ci --lib="." --board=teensy41 --board=teensy40
30+
env:
31+
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
37+
38+
- name: PIO Run Teensy 3
39+
run: pio ci --lib="." --board=teensy31 --board=teensy30 --board=teensy35 --board=teensy36
40+
env:
41+
PLATFORMIO_CI_SRC: examples/hardware_specific_examples/Teensy/Teensy3/bldc_driver_6pwm_standalone/bldc_driver_6pwm_standalone.ino
42+
43+
- name: PIO Run Teensy 3
44+
run: pio ci --lib="." --board=teensy31 --board=teensy30 --board=teensy35 --board=teensy36
45+
env:
46+
PLATFORMIO_CI_SRC: examples/hardware_specific_examples/Teensy/Teensy3/open_loop_velocity_6pwm/open_loop_velocity_6pwm.ino

README.md

Lines changed: 26 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,13 @@
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)
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)
10+
511
![GitHub release (latest by date)](https://img.shields.io/github/v/release/simplefoc/arduino-foc)
612
![GitHub Release Date](https://img.shields.io/github/release-date/simplefoc/arduino-foc?color=blue)
713
![GitHub commits since tagged version](https://img.shields.io/github/commits-since/simplefoc/arduino-foc/latest/dev)
@@ -18,26 +24,25 @@ Additionally, most of the efforts at this moment are still channeled towards the
1824
Therefore this is an attempt to:
1925
- 🎯 Demystify FOC algorithm and make a robust but simple Arduino library: [Arduino *SimpleFOClibrary*](https://docs.simplefoc.com/arduino_simplefoc_library_showcase)
2026
- <i>Support as many <b>motor + sensor + driver + mcu</b> combinations out there</i>
21-
- 🎯 Develop a modular FOC supporting BLDC driver boards:
22-
- ***NEW*** 📢: *Minimalistic* BLDC driver (<3Amps) : [<span class="simple">Simple<b>FOC</b>Mini</span> ](https://github.com/simplefoc/SimpleFOCMini).
23-
- *Low-power* gimbal driver (<5Amps) : [*Arduino Simple**FOC**Shield*](https://docs.simplefoc.com/arduino_simplefoc_shield_showcase).
24-
- *Medium-power* BLDC driver (<30Amps): [Arduino <span class="simple">Simple<b>FOC</b>PowerShield</span> ](https://github.com/simplefoc/Arduino-SimpleFOC-PowerShield).
25-
- See also [@byDagor](https://github.com/byDagor)'s *fully-integrated* ESP32 based board: [Dagor Brushless Controller](https://github.com/byDagor/Dagor-Brushless-Controller)
26-
27-
> NEW RELEASE 📢 : <span class="simple">Simple<span class="foc">FOC</span>library</span> v2.3.1
28-
> - Support for Arduino UNO R4 Minima (Renesas R7FA4M1 MCU - note UNO R4 WiFi is not yet supported)
29-
> - Support setting PWM polarity on ESP32 (thanks to [@mcells](https://github.com/mcells))
30-
> - Expose I2C errors in MagneticSensorI2C (thanks to [@padok](https://github.com/padok))
31-
> - Improved default trig functions (sine, cosine) - faster, smaller
32-
> - Overridable trig functions - plug in your own optimized versions
33-
> - Bugfix: microseconds overflow in velocity mode [#287](https://github.com/simplefoc/Arduino-FOC/issues/287)
34-
> - Bugfix: KV initialization ([5fc3128](https://github.com/simplefoc/Arduino-FOC/commit/5fc3128d282b65c141ca486327c6235089999627))
35-
> - And more bugfixes - see the [complete list of 2.3.1 fixes here](https://github.com/simplefoc/Arduino-FOC/issues?q=is%3Aissue+milestone%3A2.3.1_Release)
36-
> - Change: simplify initFOC() API ([d57d32d](https://github.com/simplefoc/Arduino-FOC/commit/d57d32dd8715dbed4e476469bc3de0c052f1d531). [5231e5e](https://github.com/simplefoc/Arduino-FOC/commit/5231e5e1d044b0cc33ede67664b6ef2f9d0a8cdf), [10c5b87](https://github.com/simplefoc/Arduino-FOC/commit/10c5b872672cab72df16ddd738bbf09bcce95d28))
37-
> - Change: check for linked driver in currentsense and exit gracefully ([5ef4d9d](https://github.com/simplefoc/Arduino-FOC/commit/5ef4d9d5a92e03da0dd5af7f624243ab30f1b688))
38-
> - Compatibility with newest versions of Arduino framework for STM32, Renesas, ESP32, Atmel SAM, Atmel AVR, nRF52 and RP2040
39-
40-
## Arduino *SimpleFOClibrary* v2.3.1
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/)
30+
31+
> NEW RELEASE 📢 : <span class="simple">Simple<span class="foc">FOC</span>library</span> v2.3.3
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
4146

4247
<p align="">
4348
<a href="https://youtu.be/Y5kLeqTc6Zk">

examples/hardware_specific_examples/B_G431B_ESC1/B_G431B_ESC1.ino

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,7 @@ void setup() {
9696

9797
void loop() {
9898
// main FOC algorithm function
99+
motor.loopFOC();
99100

100101
// Motion control function
101102
motor.move();

examples/hardware_specific_examples/DRV8302_driver/6pwm_example/encoder/full_control_serial/full_control_serial.ino

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,7 +29,7 @@
2929

3030
// Motor instance
3131
BLDCMotor motor = BLDCMotor(11);
32-
BLDCDriver6PWM driver = BLDCDriver6PWM(INH_A,INH_A, INH_B,INH_B, INH_C,INL_C, EN_GATE);
32+
BLDCDriver6PWM driver = BLDCDriver6PWM(INH_A,INL_A, INH_B,INL_B, INH_C,INL_C, EN_GATE);
3333

3434
// encoder instance
3535
Encoder encoder = Encoder(2, 3, 8192);

0 commit comments

Comments
 (0)