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.

Lab12b and FPU

Other Parts Discussed in Thread: MOTORWARE

Hello,

I want to start using the FPU on F28069M MCU with lab 12b. Is it feasible ? In the lab projects that are included in Motorware 13, none of projects that use Spintac are using the FPU. Is that with a reason?

What problems will I face in manually including the FPU libraries?

Best regards,

Paul 

  • Paul,

    I'm pretty sure that we just haven't included FPU versions of more of the MOTION labs due to time / priorities. 5g is a MOTION lab that works with FPU enabled, you could add the necessary items from 12b if that is the one you want to use as a starting point.

    The motor control libraries in ROM on the F2802x/5x/6x series are done in Fixed Point / IQmath only.  You can use floating point in your own code on the 6x, but note some of the "tricks" done in code because the library needs values in fixed point.

  • Hello Chris,


    Thank you for your response. So you suggest to add encoder related code to lab 5g instead of adding FPU libraries (and code changes) to lab 12b? What if I want to do the latter?

     

    A couple of observations / questions:

    enc.h has the following include :

    #include "sw/modules/iqmath/src/32b/IQmathLib.h"


    This will have to be changed the IQmath_fpu32, i suppose?


    Also in the modules folder there are many modules that are both 32b and float. Lab 5g is using 32b modules where there are float modules as well. Can you explain?

    Lab 5g does not include the spinTAC.lib which is used in lab 12b. I noticed that there is a spinTAC_fpu32.lib as well. Should this be used with the FPU enabled?


    Thank you for your help.

    Best regards,

    Paul

  • Paul,

    Chris is correct.  We have not included FPU versions of the MOTION labs due to time & priority constraints.

    It should be straight forward to add FPU support into lab 12b.  I think this would be easier than adding SpinTAC support into lab 05g.

    We have compiled a library with FPU support enabled which should make this work.  In the SpinTAC modules directory there are two versions of the library, SpinTAC.lib and SpinTAC_fpu32.lib.  The SpinTAC_fpu32.lib has been compiled with fpu32 support enabled.  

  • Hello Adam,

    Thank you for your response. For the moment i can not say that it is straight forward, but that is probably caused by some area's of misunderstanding by myself.

    Would you be so kind to answer some of my questions and / or explain in a little more detail the things in my previous mail?

    (About the spinTAC version is answered and understood)

    Thanks,

    Paul

  • Paul,

    For the encoder module, I think it should be left as IQMathLib.h, because this is a key motor control component and should be done in fixed point rather than floating point.  In Chris' comment he mentions that the motor control libraries are all done in fixed point so we need to make sure the supporting encoder module is also fixed point.

    I believe that the float modules were added prematurely.  See this post for more information: http://e2e.ti.com/support/microcontrollers/c2000/f/902/t/350468.aspx

  • Hello Adam,

    Thank you for the clarification. I will give it another try and will report back about the results.

    Best regards,

    Paul

  • 1768.project_files.zip

    Hello Adam,

    I'm not getting much succes with adding fpu to lab12b. My steps are following:

    1) Copy lab12b as described in : http://e2e.ti.com/support/microcontrollers/c2000/f/902/p/332326/1159207.aspx#1159207

    2) Replacing FastSpinROMSymbols, IQmath and spinTAC with the fpu32 version.

    3) changing the properties according to lab5g

    The lab compiles without errors, but it will not work. First indication is that the bus voltage is not showing (value stays 0) with sysENABLE set to one. also lsd_H and lsq_H show wrong values when setting Run_Identify to one.

  • Paul,

    There are some special considerations that are done in the FPU example labs (like 5g) that will convert from the fixed point motor control code into floating point code.  You should do a code comparison between your lab and lab 5g to see how those variables are handled.

  • Thank you for your response. I think you are taking about the changes in

    void updateGlobalVariables_motor(CTRL_Handle handle)

    These have been copied from lab5g (6 variables from the Estimator). By the way the bus voltage is not one of them, there is no change from lab5g to lab12b.

    // Get the DC buss voltage
      gMotorVars.VdcBus_kV = _IQmpy(gAdcData.dcBus,_IQ(USER_IQ_FULL_SCALE_VOLTAGE_V/1000.0));

    I think there is some setting in the project properties not right, but i can't find what.

    Your help is appreciated.

    Regards,

    Paul