Hello all:
In the MCSPTE1AK144-BLDC_6Step project, I saw the use of FRAC16() macro to convert floating-point to fixed-point number, but I did not find how to convert fixed-point to floating-point number. May I ask if it is not necessary to convert fixed-point to floating-point number in the motor control process?
For example, the following code:
NextCmtPeriod = MLIB_Mul_F16(NextCmtPeriod, FRAC16(mcat_startCmtAcceler));
The NextCmdPeriod is fixed-point number,why not convert to floating-point number?
Thanks for your help!
Best regards,
Fed.ora
Hi!
In the MCSPTE1AK144-BLDC_6Step project (and many motor control projects using fixed-point math), you often see conversions from floating-point to fixed-point using macros like FRAC16(). This is because the motor control algorithms and the underlying hardware (DSP or MCU) typically work most efficiently with fixed-point arithmetic for speed and resource constraints.