Open lijunru-hub opened 11 months ago
After testing, it seems that modifying it to use IQmath calculations does not accelerate the PID computation time. Using IQmath on the ESP32C3 is actually slower than not using it.
It's worth mentioning that with the same code, the computation speed on ESP32S3 is 11 times faster than on ESP32C3. Is there a way to make the computation on ESP32C3 faster?
On ESP32-C2, C6 and P4, there is an alternative floating point library (rvfplib) in ROM. You can try enabling it using CONFIG_COMPILER_FLOAT_LIB_FROM_RVFPLIB option in menuconfig.
(You can also post a link to your benchmarking code, if you don't have time to try rvfplib.)
If enabling this option helps, we can open a feature request in IDF to support rvfplib also on chips which don't have it in the ROM (C3, H2).
On ESP32-C2, C6 and P4, there is an alternative floating point library (rvfplib) in ROM. You can try enabling it using CONFIG_COMPILER_FLOAT_LIB_FROM_RVFPLIB option in menuconfig.
..., we can open a feature request in IDF to support rvfplib also on chips which don't have it in the ROM (C3, H2).
Yes, iggr, please do open that feature request (to support RVfplib on the C3, etc) ! Floating point operations are fundamental (i.e. this need goes way beyond any particular component, like pid_ctrl), so this makes so much sense given that chips like the C3 don't have it in ROM.
https://www.research-collection.ethz.ch/handle/20.500.11850/582612
Is your feature request related to a problem?
No response
Describe the solution you'd like.
Describe alternatives you've considered.
No response
Additional context.
In chips like the esp32c3 that lack a floating-point computation unit, using floating-point calculations can incur significant system overhead