diff --git a/.github/workflows/ccpp.yml b/.github/workflows/ccpp.yml index fc16dff..4310a32 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 + 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 - required-libraries: Simple FOC + 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 - 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: diff --git a/README.md b/README.md index b9ec1a9..98d5e76 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 or later :warning: code in development! Please help us test it! @@ -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; diff --git a/examples/dc-open-loop/dc-open-loop.ino b/examples/dc-open-loop/dc-open-loop.ino index 10f4ab5..9e8ab12 100644 --- a/examples/dc-open-loop/dc-open-loop.ino +++ b/examples/dc-open-loop/dc-open-loop.ino @@ -13,12 +13,12 @@ #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 // 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. 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(); 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. 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"); }