From 9eb30f80261feb7bf78e37aebb2b6581299ce6d7 Mon Sep 17 00:00:00 2001 From: Richard Unger Date: Sun, 29 Oct 2023 19:26:47 +0100 Subject: [PATCH 01/10] fix init bug with SimpleFOC library version 2.3.1 --- src/DCMotor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/DCMotor.cpp b/src/DCMotor.cpp index e16f1f7..451e13a 100644 --- a/src/DCMotor.cpp +++ b/src/DCMotor.cpp @@ -56,7 +56,7 @@ void DCMotor::init() { enable(); _delay(50); - if (!_isset(sensor_direction)) { + if (sensor_direction==Direction::UNKNOWN) { sensor_direction = Direction::CW; SIMPLEFOC_DEBUG("MOT: Sensor Dir: CW"); } From 52919644f29fb31c44bfe711f8144bbbff4f9d41 Mon Sep 17 00:00:00 2001 From: Richard Unger Date: Sun, 29 Oct 2023 19:29:47 +0100 Subject: [PATCH 02/10] prepare next release version --- README.md | 2 +- library.properties | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index b9ec1a9..4de87a4 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ ![Release](https://www.ardu-badge.com/badge/SimpleDCMotor.svg?) -Release 1.0.1 for SimpleFOC 2.3.1 +Release 1.0.2 for SimpleFOC 2.3.1 :warning: code in development! Please help us test it! diff --git a/library.properties b/library.properties index 1dd34fd..4754ea2 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=SimpleDCMotor -version=1.0.1 +version=1.0.2 author=Simplefoc maintainer=Simplefoc sentence=A library enabling DC motor control with SimpleFOC. From 233e8154d9365403eacfb3d02456db3873b22d4b Mon Sep 17 00:00:00 2001 From: Richard Unger Date: Mon, 30 Oct 2023 12:18:48 +0100 Subject: [PATCH 03/10] fix examples including incorrect header --- examples/dc-open-loop/dc-open-loop.ino | 2 +- examples/dc-torque-voltage/dc-torque-voltage.ino | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/examples/dc-open-loop/dc-open-loop.ino b/examples/dc-open-loop/dc-open-loop.ino index 10f4ab5..7a51ac9 100644 --- a/examples/dc-open-loop/dc-open-loop.ino +++ b/examples/dc-open-loop/dc-open-loop.ino @@ -13,7 +13,7 @@ #include #include "SimpleFOC.h" -#include "SimpleFOCDCMotor.h" +#include "SimpleDCMotor.h" // DCDriver object - this is the only thing needed for open-loop control. // There are different types to choose from, please select the correct one diff --git a/examples/dc-torque-voltage/dc-torque-voltage.ino b/examples/dc-torque-voltage/dc-torque-voltage.ino index e69fcad..82e570b 100644 --- a/examples/dc-torque-voltage/dc-torque-voltage.ino +++ b/examples/dc-torque-voltage/dc-torque-voltage.ino @@ -16,7 +16,7 @@ #include #include "SimpleFOC.h" -#include "SimpleFOCDCMotor.h" +#include "SimpleDCMotor.h" // DCMotor object @@ -46,6 +46,7 @@ void setup() { // if you want, you can limit the voltage used by the driver. // This value has to be same as or lower than the power supply voltage. driver.voltage_limit = 10.0f; + // often, you will want to set a lower PWM frequency than the default driver.pwm_frequency = 5000; // init driver driver.init(); From 9f2cda0f84e174ad220a39984493fa1574448a9e Mon Sep 17 00:00:00 2001 From: Richard Unger Date: Mon, 30 Oct 2023 12:34:09 +0100 Subject: [PATCH 04/10] update README --- README.md | 1 + 1 file changed, 1 insertion(+) diff --git a/README.md b/README.md index 4de87a4..50f5915 100644 --- a/README.md +++ b/README.md @@ -130,6 +130,7 @@ void setup() { driver.voltage_power_supply = 10.0f; driver.voltage_limit = 10.0f; + driver.pwm_frequency = 5000; motor.torque_controller = TorqueControlType::voltage; motor.controller = MotionControlType::torque; From 6084b5e0179ded7fafa8a39ceadf2ebc76989c36 Mon Sep 17 00:00:00 2001 From: Richard Unger Date: Mon, 30 Oct 2023 12:52:40 +0100 Subject: [PATCH 05/10] fix old driver name in open loop example --- examples/dc-open-loop/dc-open-loop.ino | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/examples/dc-open-loop/dc-open-loop.ino b/examples/dc-open-loop/dc-open-loop.ino index 7a51ac9..9e8ab12 100644 --- a/examples/dc-open-loop/dc-open-loop.ino +++ b/examples/dc-open-loop/dc-open-loop.ino @@ -18,7 +18,7 @@ // DCDriver object - this is the only thing needed for open-loop control. // There are different types to choose from, please select the correct one // that matches your motor driver hardware. -DCDriverSpeedDir driver = DCDriverSpeedDir(2, 3); +DCDriver1PWM1Dir driver = DCDriver1PWM1Dir(2, 3); /** * Setup function, in which you should intialize the driver. From cd4b10f6d30c5ae947220446265a836990e92244 Mon Sep 17 00:00:00 2001 From: Richard Unger Date: Mon, 30 Oct 2023 14:16:21 +0100 Subject: [PATCH 06/10] add SimpleFOCDrivers to test case libs --- .github/workflows/ccpp.yml | 18 +++++++++--------- 1 file changed, 9 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index fc16dff..d1dd6d7 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -26,32 +26,32 @@ jobs: - arduino:mbed_rp2040:pico # rpi pico include: - arduino-boards-fqbn: arduino:avr:uno - required-libraries: Simple FOC + required-libraries: Simple FOC, SimpleFOCDrivers - arduino-boards-fqbn: arduino:sam:arduino_due_x - required-libraries: Simple FOC + required-libraries: Simple FOC, SimpleFOCDrivers - arduino-boards-fqbn: arduino:samd:nano_33_iot - required-libraries: Simple FOC + required-libraries: Simple FOC, SimpleFOCDrivers - arduino-boards-fqbn: arduino:mbed_rp2040:pico - required-libraries: Simple FOC + required-libraries: Simple FOC, SimpleFOCDrivers - arduino-boards-fqbn: adafruit:samd:adafruit_metro_m4 platform-url: https://adafruit.github.io/arduino-board-index/package_adafruit_index.json - required-libraries: Simple FOC + required-libraries: Simple FOC, SimpleFOCDrivers # - arduino-boards-fqbn: esp32:esp32:esp32doit-devkit-v1 # platform-url: https://dl.espressif.com/dl/package_esp32_index.json # required-libraries: Simple FOC # sketch-names: '**.ino' - arduino-boards-fqbn: esp32:esp32:esp32 # esp32 platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json - required-libraries: Simple FOC + required-libraries: Simple FOC, SimpleFOCDrivers - arduino-boards-fqbn: esp32:esp32:esp32s2 # esp32s2 platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json - required-libraries: Simple FOC + required-libraries: Simple FOC, SimpleFOCDrivers - arduino-boards-fqbn: STMicroelectronics:stm32:GenF1:pnum=BLUEPILL_F103C8 platform-url: https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json - required-libraries: Simple FOC + required-libraries: Simple FOC, SimpleFOCDrivers - arduino-boards-fqbn: STMicroelectronics:stm32:Nucleo_64:pnum=NUCLEO_F411RE platform-url: https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json - required-libraries: Simple FOC + required-libraries: Simple FOC, SimpleFOCDrivers # Do not cancel all jobs / architectures if one job fails fail-fast: false steps: From 1b69655e7eb76530b8a44b5bf4e64533afdfc4b3 Mon Sep 17 00:00:00 2001 From: Richard Unger Date: Mon, 30 Oct 2023 16:37:56 +0100 Subject: [PATCH 07/10] fix workflow file --- .github/workflows/ccpp.yml | 36 +++++++++++++++++++++++++++--------- 1 file changed, 27 insertions(+), 9 deletions(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index d1dd6d7..4564229 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -26,32 +26,50 @@ jobs: - arduino:mbed_rp2040:pico # rpi pico include: - arduino-boards-fqbn: arduino:avr:uno - required-libraries: Simple FOC, SimpleFOCDrivers + required-libraries: + - Simple FOC + - SimpleFOCDrivers - arduino-boards-fqbn: arduino:sam:arduino_due_x - required-libraries: Simple FOC, SimpleFOCDrivers + required-libraries: + - Simple FOC + - SimpleFOCDrivers - arduino-boards-fqbn: arduino:samd:nano_33_iot - required-libraries: Simple FOC, SimpleFOCDrivers + required-libraries: + - Simple FOC + - SimpleFOCDrivers - arduino-boards-fqbn: arduino:mbed_rp2040:pico - required-libraries: Simple FOC, SimpleFOCDrivers + required-libraries: + - Simple FOC + - SimpleFOCDrivers - arduino-boards-fqbn: adafruit:samd:adafruit_metro_m4 platform-url: https://adafruit.github.io/arduino-board-index/package_adafruit_index.json - required-libraries: Simple FOC, SimpleFOCDrivers + required-libraries: + - Simple FOC + - SimpleFOCDrivers # - arduino-boards-fqbn: esp32:esp32:esp32doit-devkit-v1 # platform-url: https://dl.espressif.com/dl/package_esp32_index.json # required-libraries: Simple FOC # sketch-names: '**.ino' - arduino-boards-fqbn: esp32:esp32:esp32 # esp32 platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json - required-libraries: Simple FOC, SimpleFOCDrivers + required-libraries: + - Simple FOC + - SimpleFOCDrivers - arduino-boards-fqbn: esp32:esp32:esp32s2 # esp32s2 platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json - required-libraries: Simple FOC, SimpleFOCDrivers + required-libraries: + - Simple FOC + - SimpleFOCDrivers - arduino-boards-fqbn: STMicroelectronics:stm32:GenF1:pnum=BLUEPILL_F103C8 platform-url: https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json - required-libraries: Simple FOC, SimpleFOCDrivers + required-libraries: + - Simple FOC + - SimpleFOCDrivers - arduino-boards-fqbn: STMicroelectronics:stm32:Nucleo_64:pnum=NUCLEO_F411RE platform-url: https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json - required-libraries: Simple FOC, SimpleFOCDrivers + required-libraries: + - Simple FOC + - SimpleFOCDrivers # Do not cancel all jobs / architectures if one job fails fail-fast: false steps: From 6dbd536f5ee3f65844e1ad5ae679d0f0b0722f20 Mon Sep 17 00:00:00 2001 From: Richard Unger Date: Mon, 30 Oct 2023 20:05:49 +0100 Subject: [PATCH 08/10] fix incorrect workflow template --- .github/workflows/ccpp.yml | 36 +++++++++--------------------------- 1 file changed, 9 insertions(+), 27 deletions(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 4564229..239c176 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -26,50 +26,32 @@ jobs: - arduino:mbed_rp2040:pico # rpi pico include: - arduino-boards-fqbn: arduino:avr:uno - required-libraries: - - Simple FOC - - SimpleFOCDrivers + required-libraries: Simple FOC,SimpleFOCDrivers - arduino-boards-fqbn: arduino:sam:arduino_due_x - required-libraries: - - Simple FOC - - SimpleFOCDrivers + required-libraries: Simple FOC,SimpleFOCDrivers - arduino-boards-fqbn: arduino:samd:nano_33_iot - required-libraries: - - Simple FOC - - SimpleFOCDrivers + required-libraries: Simple FOC,SimpleFOCDrivers - arduino-boards-fqbn: arduino:mbed_rp2040:pico - required-libraries: - - Simple FOC - - SimpleFOCDrivers + required-libraries: Simple FOC,SimpleFOCDrivers - arduino-boards-fqbn: adafruit:samd:adafruit_metro_m4 platform-url: https://adafruit.github.io/arduino-board-index/package_adafruit_index.json - required-libraries: - - Simple FOC - - SimpleFOCDrivers + required-libraries: Simple FOC,SimpleFOCDrivers # - arduino-boards-fqbn: esp32:esp32:esp32doit-devkit-v1 # platform-url: https://dl.espressif.com/dl/package_esp32_index.json # required-libraries: Simple FOC # sketch-names: '**.ino' - arduino-boards-fqbn: esp32:esp32:esp32 # esp32 platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json - required-libraries: - - Simple FOC - - SimpleFOCDrivers + required-libraries: Simple FOC,SimpleFOCDrivers - arduino-boards-fqbn: esp32:esp32:esp32s2 # esp32s2 platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json - required-libraries: - - Simple FOC - - SimpleFOCDrivers + required-libraries: Simple FOC,SimpleFOCDrivers - arduino-boards-fqbn: STMicroelectronics:stm32:GenF1:pnum=BLUEPILL_F103C8 platform-url: https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json - required-libraries: - - Simple FOC - - SimpleFOCDrivers + required-libraries: Simple FOC,SimpleFOCDrivers - arduino-boards-fqbn: STMicroelectronics:stm32:Nucleo_64:pnum=NUCLEO_F411RE platform-url: https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json - required-libraries: - - Simple FOC - - SimpleFOCDrivers + required-libraries: Simple FOC,SimpleFOCDrivers # Do not cancel all jobs / architectures if one job fails fail-fast: false steps: From 0d6301e91b8036bea3ddf8c2997cae5daab6a9f6 Mon Sep 17 00:00:00 2001 From: Richard Unger Date: Mon, 30 Oct 2023 23:35:14 +0100 Subject: [PATCH 09/10] change esp32 workflow, don't use dev platform --- .github/workflows/ccpp.yml | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index 239c176..4310a32 100644 --- a/.github/workflows/ccpp.yml +++ b/.github/workflows/ccpp.yml @@ -41,10 +41,10 @@ jobs: # required-libraries: Simple FOC # sketch-names: '**.ino' - arduino-boards-fqbn: esp32:esp32:esp32 # esp32 - platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json + platform-url: https://espressif.github.io/arduino-esp32/package_esp32_index.json required-libraries: Simple FOC,SimpleFOCDrivers - arduino-boards-fqbn: esp32:esp32:esp32s2 # esp32s2 - platform-url: https://raw.githubusercontent.com/espressif/arduino-esp32/gh-pages/package_esp32_dev_index.json + platform-url: https://espressif.github.io/arduino-esp32/package_esp32_index.json required-libraries: Simple FOC,SimpleFOCDrivers - arduino-boards-fqbn: STMicroelectronics:stm32:GenF1:pnum=BLUEPILL_F103C8 platform-url: https://github.com/stm32duino/BoardManagerFiles/raw/main/package_stmicroelectronics_index.json From 11917d89be5c90b53bb9455e21c081697792f53e Mon Sep 17 00:00:00 2001 From: Richard Unger Date: Tue, 28 Nov 2023 22:27:50 +0100 Subject: [PATCH 10/10] update README --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 50f5915..98d5e76 100644 --- a/README.md +++ b/README.md @@ -6,7 +6,7 @@ ![Release](https://www.ardu-badge.com/badge/SimpleDCMotor.svg?) -Release 1.0.2 for SimpleFOC 2.3.1 +Release 1.0.2 for SimpleFOC 2.3.1 or later :warning: code in development! Please help us test it!