This thread has been locked.

If you have a related question, please click the "Ask a related question" button in the top right corner. The newly created question will be automatically linked to this question.

CCS/TMS320F28377S: Doubt regarding Clarke

Part Number: TMS320F28377S

Tool/software: Code Composer Studio

I was trying to use the clarke transformation.These were the initializations i made

clarke1.As=1.0L;

clarke1.Bs=50.1L;

clarke1.Cs=-51.0L;

CLARKE_MACRO (clarke1);

 but  when i ran the code i found the values to be floored.Is there a way to do it without flooring

  • Please make sure you use the floating point version of the clarke module, 

    As I can see in the watch window you have "long" which means the fixed point version of the lib is being used.

    To use the floating point version make sure you define the math type as floating point 

    if you go to the IQmath.h header file the project is referring to, you will find the below

    #define FLOAT_MATH 1
    #define IQ_MATH 0

    #ifndef MATH_TYPE
    #define MATH_TYPE IQ_MATH
    #endif

    To use float math you can edit this file and  use

    #ifndef MATH_TYPE
    #define MATH_TYPE FLOAT_MATH
    #endif

    or before including IQmath.h define the MATH TYPE 

    #define MATH_TYPE 1

    #include "IQmathLib.h"