simplefoc / Arduino-FOC

Arduino FOC for BLDC and Stepper motors - Arduino Based Field Oriented Control Algorithm Library
https://docs.simplefoc.com
MIT License
2.03k stars 521 forks source link

Faster atan2 #329

Closed Candas1 closed 11 months ago

Candas1 commented 11 months ago

Shamelessly copied, even the credits (see the comments)

Before: RAM: [= ] 9.0% (used 4444 bytes from 49152 bytes) Flash: [=== ] 26.9% (used 70592 bytes from 262144 bytes)

up to 48us

After: RAM: [= ] 9.0% (used 4444 bytes from 49152 bytes) Flash: [=== ] 26.7% (used 69912 bytes from 262144 bytes)

up to 28us

Reduces memory usage and almost twice as fast on a STM32F1 It's not used in the SVPWM anymore but can be useful for other features. I am using it in the flux observer sensor.

runger1101001 commented 11 months ago

Hmmm...

/home/runner/Arduino/libraries/Arduino-FOC/src/current_sense/hardware_specific/esp32/esp32_adc_driver.cpp:9:10: fatal error: esp_intr.h: No such file or directory
    9 | #include "esp_intr.h"
      |          ^~~~~~~~~~~~
compilation terminated.

That doesn't really look like it has to do with your change...

So I will merge this, it is compiling for all other platforms except ESP32.