From 5ecb58b2bd09ccfd045900a35eefe664c725bdcf Mon Sep 17 00:00:00 2001 From: Richard Unger Date: Sat, 23 Sep 2023 20:12:51 +0200 Subject: [PATCH 1/3] prepare README and version for next release --- README.md | 19 +++++-------------- library.properties | 2 +- 2 files changed, 6 insertions(+), 15 deletions(-) diff --git a/README.md b/README.md index 747b0f34..756bf854 100644 --- a/README.md +++ b/README.md @@ -24,20 +24,11 @@ Therefore this is an attempt to: - *Medium-power* BLDC driver (<30Amps): [Arduino SimpleFOCPowerShield ](https://github.com/simplefoc/Arduino-SimpleFOC-PowerShield). - See also [@byDagor](https://github.com/byDagor)'s *fully-integrated* ESP32 based board: [Dagor Brushless Controller](https://github.com/byDagor/Dagor-Brushless-Controller) -> NEW RELEASE 📢 : SimpleFOClibrary v2.3.1 -> - Support for Arduino UNO R4 Minima (Renesas R7FA4M1 MCU - note UNO R4 WiFi is not yet supported) -> - Support setting PWM polarity on ESP32 (thanks to [@mcells](https://github.com/mcells)) -> - Expose I2C errors in MagneticSensorI2C (thanks to [@padok](https://github.com/padok)) -> - Improved default trig functions (sine, cosine) - faster, smaller -> - Overridable trig functions - plug in your own optimized versions -> - Bugfix: microseconds overflow in velocity mode [#287](https://github.com/simplefoc/Arduino-FOC/issues/287) -> - Bugfix: KV initialization ([5fc3128](https://github.com/simplefoc/Arduino-FOC/commit/5fc3128d282b65c141ca486327c6235089999627)) -> - 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) -> - 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)) -> - Change: check for linked driver in currentsense and exit gracefully ([5ef4d9d](https://github.com/simplefoc/Arduino-FOC/commit/5ef4d9d5a92e03da0dd5af7f624243ab30f1b688)) -> - Compatibility with newest versions of Arduino framework for STM32, Renesas, ESP32, Atmel SAM, Atmel AVR, nRF52 and RP2040 - -## Arduino *SimpleFOClibrary* v2.3.1 +> NEW RELEASE 📢 : SimpleFOClibrary v2.3.2 +> - Improved [space vector modulation code](https://github.com/simplefoc/Arduino-FOC/pull/309) thanks to [@Candas1](https://github.com/Candas1) +> - And more bugfixes - see the [complete list of 2.3.2 fixes here](https://github.com/simplefoc/Arduino-FOC/issues?q=is%3Aissue+milestone%3A2.3.2_Release) + +## Arduino *SimpleFOClibrary* v2.3.2

diff --git a/library.properties b/library.properties index 69043875..7242d57c 100644 --- a/library.properties +++ b/library.properties @@ -1,5 +1,5 @@ name=Simple FOC -version=2.3.1 +version=2.3.2 author=Simplefoc maintainer=Simplefoc sentence=A library demistifying FOC for BLDC motors From a373714ed1f21d864f8438a0534d7bb13d9fcce5 Mon Sep 17 00:00:00 2001 From: Richard Unger Date: Tue, 26 Sep 2023 09:04:37 +0200 Subject: [PATCH 2/3] fix initialization error for StepperMotors --- src/StepperMotor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/StepperMotor.cpp b/src/StepperMotor.cpp index 491a20ee..a22496ba 100644 --- a/src/StepperMotor.cpp +++ b/src/StepperMotor.cpp @@ -134,7 +134,7 @@ int StepperMotor::alignSensor() { SIMPLEFOC_DEBUG("MOT: Align sensor."); // if unknown natural direction - if(!_isset(sensor_direction)){ + if(sensor_direction == Direction::UNKNOWN){ // check if sensor needs zero search if(sensor->needsSearch()) exit_flag = absoluteZeroSearch(); // stop init if not found index From 7499e3032e74426a9715df3e42e94290d08250a5 Mon Sep 17 00:00:00 2001 From: Richard Unger Date: Wed, 27 Sep 2023 21:10:18 +0200 Subject: [PATCH 3/3] renesas driver improvements --- src/drivers/hardware_specific/renesas/renesas.cpp | 15 +++------------ 1 file changed, 3 insertions(+), 12 deletions(-) diff --git a/src/drivers/hardware_specific/renesas/renesas.cpp b/src/drivers/hardware_specific/renesas/renesas.cpp index f90a4c56..ff0ebb80 100644 --- a/src/drivers/hardware_specific/renesas/renesas.cpp +++ b/src/drivers/hardware_specific/renesas/renesas.cpp @@ -144,7 +144,7 @@ bool configureTimerPin(RenesasHardwareDriverParams* params, uint8_t index, bool uint8_t timer_channel = GET_CHANNEL(pinCfgs[0]); // check its not used if (channel_used[timer_channel]) { - SIMPLEFOC_DEBUG("DRV: channel in use"); + SIMPLEFOC_DEBUG("DRV: channel in use: ", timer_channel); return false; } @@ -258,26 +258,17 @@ bool configureTimerPin(RenesasHardwareDriverParams* params, uint8_t index, bool t->ext_cfg.gtior_setting.gtior_b.gtiob = 0x03 | (active_high ? 0x00 : 0x10); t->ext_cfg.gtior_setting.gtior_b.obdflt = active_high ? 0x00 : 0x01; } - - // lets stop the timer in case its running - if (GPT_OPEN == t->ctrl.open) { - if (R_GPT_Stop(&(t->ctrl)) != FSP_SUCCESS) { - SIMPLEFOC_DEBUG("DRV: timer stop failed"); - return false; - } - } - memset(&(t->ctrl), 0, sizeof(gpt_instance_ctrl_t)); err = R_GPT_Open(&(t->ctrl),&(t->timer_cfg)); if ((err != FSP_ERR_ALREADY_OPEN) && (err != FSP_SUCCESS)) { SIMPLEFOC_DEBUG("DRV: open failed"); return false; } - #if defined(SIMPLEFOC_RESENSAS_DEBUG) if (err == FSP_ERR_ALREADY_OPEN) { SimpleFOCDebug::println("DRV: timer already open"); + return false; } - #endif + err = R_GPT_PeriodSet(&(t->ctrl), t->timer_cfg.period_counts); if (err != FSP_SUCCESS) { SIMPLEFOC_DEBUG("DRV: period set failed");