From bb001e9cfeda9b657b220cd26996de5506aa8b41 Mon Sep 17 00:00:00 2001 From: Richard Unger Date: Fri, 7 Jul 2023 17:12:59 +0200 Subject: [PATCH 1/2] prepare README for next release --- README.md | 40 +++++++++++----------------------------- 1 file changed, 11 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 424f3cd7..47d7540f 100644 --- a/README.md +++ b/README.md @@ -24,34 +24,16 @@ 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.0 -> - Arduino Mega 6pwm more timers supported -> - Arduino boards - frequency change support either 32kHz or 4kHz -> - Arduino Uno - synched timers in 3pwm and 6pwm mode [#71](https://github.com/simplefoc/Arduino-FOC/issues/71) -> - Teensy 3.x initial support for 6pwm -> - Teensy 4.x initial support for 6pwm -> - Example for v3.1 SimpleFOCShield -> - RP2040 compatibility for earlehillpower core [#234](https://github.com/simplefoc/Arduino-FOC/pull/234) [#236](https://github.com/simplefoc/Arduino-FOC/pull/236) -> - More flexible monitoring API -> - start, end and separator characters -> - decimal places (settable through commander) -> - Added machine readable verbose mode in `Commander` [#233](https://github.com/simplefoc/Arduino-FOC/pull/233) -> - *Simple**FOC**WebController* - Web based user interface for SimpleFOC by [@geekuillaume](https://github.com/geekuillaume) - [webcontroller.simplefoc.com](webcontroller.simplefoc.com) -> - bugfix - `MagneticSensorPWM` multiple occasions - [#258](https://github.com/simplefoc/Arduino-FOC/pull/258) -> - bugfix - current sense align - added offset exchange when exchanging pins -> - bugfix - trapezoid 150 fixed -> - bugfix - 4pwm on ESP8266 [#224](https://github.com/simplefoc/Arduino-FOC/pull/224) -> - Additional `InlineCurrentSense` and `LowsideCurrentSense` constructor using milliVolts per Amp [#253](https://github.com/simplefoc/Arduino-FOC/pull/253) -> - STM32L4xx current sense support by [@Triple6](https://github.com/Triple6) (discord) [#257](https://github.com/simplefoc/Arduino-FOC/pull/257) -> - phase disable in 6pwm mode -> - stm32 - software and hardware 6pwm -> - atmega328 -> - atmega2560 -> - Lag compensation using motor inductance [#246](https://github.com/simplefoc/Arduino-FOC/issues/246) -> - current control through voltage torque mode enhancement -> - extended `BLDCMotor` and `StepperMotor` constructors to receive the inductance paramerer -> - can also be set using `motor.phase_inductance` or through `Commander` -## Arduino *SimpleFOClibrary* v2.3 +> NEW RELEASE 📢 : SimpleFOClibrary v2.3.1 +> - Support for Arduino UNO R4 Minima and UNO R4 WiFi (Renesas R7FA4M1 MCUs) +> - 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 +> - bugfix: KV initialization + +## Arduino *SimpleFOClibrary* v2.3.1

@@ -78,7 +60,7 @@ This video demonstrates the *Simple**FOC**library* basic usage, electronic conne - **Cross-platform**: - Seamless code transfer from one microcontroller family to another - Supports multiple [MCU architectures](https://docs.simplefoc.com/microcontrollers): - - Arduino: UNO, MEGA, DUE, Leonardo .... + - Arduino: UNO R4, UNO, MEGA, DUE, Leonardo, Nano, Nano33 .... - STM32 - ESP32 - Teensy From 0595b9f3f7890636c17fd13a85c299c0ef8f381b Mon Sep 17 00:00:00 2001 From: Richard Unger Date: Tue, 11 Jul 2023 12:39:33 +0200 Subject: [PATCH 2/2] fix bug in new sine for 8 bit machines --- src/common/foc_utils.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/common/foc_utils.cpp b/src/common/foc_utils.cpp index c6a77ae6..4cb09863 100644 --- a/src/common/foc_utils.cpp +++ b/src/common/foc_utils.cpp @@ -9,7 +9,7 @@ __attribute__((weak)) float _sin(float a){ // 16 bit precision on sine value, 8 bit fractional value for interpolation, 6bit LUT size // resulting precision compared to stdlib sine is 0.00006480 (RMS difference in range -PI,PI for 3217 steps) static uint16_t sine_array[65] = {0,804,1608,2411,3212,4011,4808,5602,6393,7180,7962,8740,9512,10279,11039,11793,12540,13279,14010,14733,15447,16151,16846,17531,18205,18868,19520,20160,20788,21403,22006,22595,23170,23732,24279,24812,25330,25833,26320,26791,27246,27684,28106,28511,28899,29269,29622,29957,30274,30572,30853,31114,31357,31581,31786,31972,32138,32286,32413,32522,32610,32679,32729,32758,32768}; - unsigned int i = (unsigned int)(a * (64*4*256 /_2PI)); + unsigned int i = (unsigned int)(a * (64*4*256.0 /_2PI)); int t1, t2, frac = i & 0xff; i = (i >> 8) & 0xff; if (i < 64) {