Arduino FOC Versions Save

Arduino FOC for BLDC and Stepper motors - Arduino Based Field Oriented Control Algorithm Library

v2.3.3

4 weeks ago

SimpleFOClibrary v2.3.3

Some of the most important features:

  • STM32 MCUs
    • support for center aligned pwm (even across multiple timers and motors/drivers) #374, #388
    • support for DMA based low-side current sensing: #383,#378
    • support for F7 architecture #388,#394
  • Teensy4 MCUs
    • support for low-side current sensing #392
    • support for center aligned 6pwm and 3pwm (optional) #392
  • KV rating calculation fix #347
  • Much more performant Park/Clarke calculation #340
  • And much more - see the complete list of bugfixes and new features of v2.3.3 fixes and PRs

What's Changed

New Contributors

Full Changelog: https://github.com/simplefoc/Arduino-FOC/compare/v2.3.2...v2.3.3

v2.3.2

5 months ago

SimpleFOClibrary v2.3.2

  • Improved space vector modulation code thanks to @Candas1
  • Bugfix for stepper motor initialization
  • Bugfix for current sensing when only 2 phase currents available - please re-check your current sense PID tuning
  • Bugfix for teensy3.2 - #321
  • Added teensy3/4 compile to the github CI using platformio
  • Fix compile issues with recent versions of ESP32 framework
  • Add ADC calibration on STM32 MCUs thanks to @Candas1
  • Bugfix for crash when using ADC2 on ESP32s - thanks to @mcells
  • Bugfix for renesas PWM on UNO R4 WiFi - thanks to @facchinm
  • And more bugfixes - see the complete list of 2.3.2 fixes and PRs

v2.3.1

7 months ago

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)
  • Expose I2C errors in MagneticSensorI2C (thanks to @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
  • Bugfix: KV initialization (5fc3128)
  • And more bugfixes - see the complete list of 2.3.1 fixes here
  • Change: simplify initFOC() API (d57d32d. 5231e5e, 10c5b87)
  • Change: check for linked driver in currentsense and exit gracefully (5ef4d9d)
  • Compatibility with newest versions of Arduino framework for STM32, Renesas, ESP32, Atmel SAM, Atmel AVR, nRF52 and RP2040

v2.3.0

1 year ago

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
  • 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 #236
  • More flexible monitoring API
    • start, end and separator characters
    • decimal places (settable through commander)
  • Added machine readable verbose mode in Commander #233
  • SimpleFOCWebController - Web based user interface for SimpleFOC by @geekuillaume - webcontroller.simplefoc.com
  • bugfix - MagneticSensorPWM multiple occasions - #258
  • bugfix - current sense align - added offset exchange when exchanging pins
  • bugfix - trapezoid 150 fixed
  • bugfix - 4pwm on ESP8266 #224
  • Additional InlineCurrentSense and LowsideCurrentSense constructor using milliVolts per Amp #253
  • STM32L4xx current sense support by @Triple6 (discord) #257
  • phase disable in 6pwm mode
    • stm32 - software and hardware 6pwm
    • atmega328
    • atmega2560
  • Lag compensation using motor inductance #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

v2.2.3

1 year ago

SimpleFOClibrary v2.2.3

  • stm32 low-side current sensing
    • g4 supported
    • thoroughly tested f1/f4/g4 - #187
    • bg431b: added support for VBAT and TEMPERATURE readings #222
  • bugfixing
    • leonardo
    • mega2560 #190
    • inline current sense without driver #188
    • bg431b support current sense fix #210
    • StepperDriver4PWM wrong init #182
    • open loop back-emf voltage issue #219
    • SAMD51 compile issue #217
    • ESP32-S3 compile issue #198
    • ESP32 compile issue #208, #207
    • magnetic sensor direction finding more robust #173, #164
    • StepDirListener improved timing #169, #209
    • HallSensor velocity calculation fix #192
  • API changes
    • setPhaseVoltage is now public function
    • getVelocity can now be called as many times as necessary - see in docs
      • it recalculates the velocity if the time between calls is longer then min_elapsed_time - default 0.1ms
    • HallSensor velocity calculation outlier removal using max expected velocity velocity_max - see in docs
    • BG431 board can be used only with LowsideCurrentSense class! - see in docs
    • initFOC fails if current sense not initialised - see in docs
      • driver and current sense have to be well initialised for initFOC to start - see in docs
      • cs.init() and driver.init() return 1 if well initialised and 0 if failed

v2.2.2

2 years ago

SimpleFOClibrary v2.2.2

  • GenericCurrentSense bugfix and testing
  • bugfix leonardo #170
  • bugfix - no index search after specifying natural direction
  • Low level API restructuring #153
    • Driver API
    • Current sense API
  • New debugging interface - see in docs #158
    • Static class SimpleFOCDebug
  • CurrentSense API change - added method linkDriver() - see in docs
  • Low-side current sensing - see in docs
    • ESP32 generic support for multiple motors
    • Added low-side current sensing support for stm32 - only one motor #6
      • f1 family
      • f4 family
      • g4 family
  • New appraoch for current estimation for torque control using voltage - see in docs
    • Support for motor KV rating - back emf estimation
    • Using motor phase resistance
  • KV rating and phase resistance used for open-loop current limiting as well - see in docs

v2.2.1

2 years ago

SimpleFOClibrary v2.2.1

  • Sensor class init bugfix #121
  • Voltage/current limit handling bugs #118
  • Added the new motion control interface to the commander see docs
    • New target setting - possible to set the position, velocity and torque target at once
    • Separated the motion control interface from full motor callback - only motion control and torque control type, enable disable and target setting
  • New MCU support see docs
    • NRF52 series mcus support by @Polyphe
    • esp32 arduino package transfer to v2.0.1+ - helpful PR#149 by samguns
    • Initial support for esp32s2 and esp32s3 - separation of the esp32 mcpwm and led implementation
  • Generic sensor class - to implement a new sensor only implement one function see docs
  • Motor class initialisation status tracking by @runger1101001

v2.2

2 years ago

SimpleFOClibrary v2.2

  • Sensor floating point error bugfix (initial solution) #83, #37
  • Sensor class restructuring - slight API change - docs
  • Restructured the generic code and simplified adding new mcus: IMPORTANT: an additional compiler flag needed for PlatformIO see issue and PlatformIO docs
  • Removed initial jump #110, #111
  • Double to float transformation of the code - performance increase by @sDessens (#100), @KaSroka (#100)
  • Docs webiste translated to Chinese! 🎉: Awesome work 😃 by @MINQING1101, @Deng-ge-open-source and @mingggggggg
  • New MCU support
    • Support for arduino leonardo #108 - docs
    • Initial support for portenta h7 board in collaboration with Arduino - docs
    • Initial support for esp8266 - docs
  • Low side current sensing initial support - docs
    • Initial support for stm32 B_G431B_ESC1 by @sDessens: PR #73
    • Initial support for samd21 by @maxlem: PR #79
    • Initial support for esp32 by @byDagor

v2.1.1

3 years ago

SimpleFOClibrary v2.1.1

  • bugfixes commander monitoring get values
  • bugfix voltage_limit when provided phase_resistance @byDagor
  • bugfix hall_sensor examples @owennewo
  • full support of the SimpleFOCStudio @JorgeMaker
  • added examples for the PowerShield
  • added initial support for MagneticSensorPWM
    • interrupts - nonblocking
    • blocking mode pulseln
  • SAMD51 support by @runger1101001
  • initial support for Raspberry pi Pico 🎉 @runger1101001
  • added examples to find the raw max and min of the analog and pwm sensor
  • extension of the Commander interface
    • added pwm centering option WC
    • added pwm modulation cmd WT
    • issue #46: commander end of line character - by @maxlem
  • improved esp32 implementation to avoid the need for mcpwm.h changes by @tschundler
  • issue #62: motor.shaft_angle setting in the motor.initFOC()
  • issue #76: esp32 division by zero
  • community fix AS5600 register value
  • renamed Pullup::EXTERN and Pullup::INTERN to Pullup::USE_EXTERN and Pullup::USE_INTERN

v2.1

3 years ago

SimpleFOClibrary v2.1

  • Initial current sensing support🎉
    • Inline current sensors
    • adaptive zero finding and shunt direction
  • Implemented real torque control
    • using voltage
    • using current magnitude (one current)
    • using FOC currents ( d-q currents ) - real foc control
  • SVPWM full implementation d+q axis
  • Simplified sensor implementation📢
    • For new sensor implementation only one function necessary getAngle()
  • Upgrade of the HallSensor implementation by @owennewo
  • Support for Arduino DUE - everything except the 6PWM mode
  • Support for ATMega328pb
  • bugfix for the Teensy boards ( setting 3pwm )
  • extended support for 2PWM stepper drivers - by @zjor
  • pull request #52
  • included F macro for shrinking string memory usage - moved to programming memory
  • disable phase support for 3pwm driver
    • not yet for 6pwm
  • rewritten initFOC()
    • can be skipped and outputs much more info
    • align sensor: direction + zero offset + pole pair check
    • align current sense
  • sensor offset supported (motor.sensor_offset)
  • refactored motor commands interface
    • much more flexible and easy to extend
    • very easy to add new commands and function callbacks
    • implemented motor+pid+lpf commands of-the-shelf
  • Added step/dir interface
    • integrated as an optional communication channel
  • Added support for samd21 boards by @runger1101001
    • pull request #56

BEWARE 📢 slight API changes included

  • ControlType renamed into MotionControlType
  • ControlType::voltage does not exist any more now - MotionControlType::torque