Hi,
I am using FRDM-KV31F and FRDM-MC-LVPMSM boards to control a PMSM motor using Kinetis Motor Control, and I noticed that fixed point math is used for the FOC algorithm. Is it possible to use floating point math for the FOC algoritm? Why the fixed point math is used instead floating point, because as far as I know KV31 microcontroller has single precision floating point unit.
Thanks
Marius,
KMS on the KV31 is only available as a fixed-point solution. We have run benchmarks between fixed and floating point libraries and there is virtually no difference in performance or code size.
If you are interested in motor control libraries that are floating point we do have them:
Real Time Control Embedded Software Motor Control and Power Conversion Libraries|NXP
But please notice that those are not the same libraries that are used in KMS. Those libraries are essentially considered "advanced" or for advanced users.
Let me know if you have further questions or comments.
Eduardo
Thanks Eduardo. Do you have any specific data or white papers on the fix/floating point comparison? Any application code examples utilizing the floating point libraries?
Thanks!
Ben
Take a look at the Math Library Users Guide and other documents on the real time control libraries. HERE
RTCESL: Real Time Control Embedded Software Motor Control and Power Conversion Libraries.
The KMS specifics are covered in the KMS API Reference Manual in Chapter 24.
Best Regards,
Philip
Thanks Philip, does one of those have benchmarking data regarding performance?
I've done a limited amount of this benchmarking / comparison. Based on our limited testing we've found no meaningful difference between floating point and fixed point FOC on the KV31. Unfortunately, I don't have data that is shareable.
A single-precision floating point number is limited to 24 significand bits. The fixed-point type used for all calculations requiring precision in KMS is a Q24 which maintains the exact same precision as a single-precision float. We spent quite a bit of time optimizing the fixed point math library to improve the execution speed of the basic math operations, so that the math execution speed is on-par with the standard library floating point operations.
The only advantage you could gain by running in floating point is that everything can be done using engineering units instead or normalized units.
Great, thanks for the info.
Sorry, but I don’t see any benchmark comparisons.