2025-03-11 5:39 AM
Hello ST Community,
I'm working on an application using the STM32F103C8T6 microcontroller that implements a Sliding Mode Observer (SMO) and Park/Clarke transformations. I'm facing significant performance challenges due to the computational overhead of the floating-point trigonometric functions atan2f.
My system requires a 50us loop execution time, but the SMO alone is taking approximately 20us, largely due to these trigonometric functions. I need to optimize this to meet my timing requirements.
Here's a breakdown of my current implementation:
Please tell me solution
2025-03-11 5:44 AM
Perhaps move to fixed point and use the precompiled DSP library.
https://github.com/ARM-software/CMSIS-DSP/tree/main/Source/FastMathFunctions
Floating point calculation on a chip without an FPU are going to be incredibly slow. Plenty of inexpensive chips out there with an FPU.
2025-03-11 5:48 AM
Lookup tables?
2025-03-11 8:43 AM
Not the first to have these types of problems, perhaps consider Google, et al
https://gist.github.com/volkansalma/2972237