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.

PROJ_lab13C and FPU32

Genius 5910 points
Other Parts Discussed in Thread: CONTROLSUITE, MOTORWARE

Hi,

I changed to libraries and the compiler option from softlib to FPU32. And now I have a strange problem.

 I got the following warning:

This project contains unresolved buildable linked resources. It might not build as expected. 
That is a bit short on information.

If I run the problem the following occur:

gMotorVars.Kp_Idq    -128

gMotorVars.Ki_Idq   0

gMotorVars.VdcBus_kV  0

The motor doesn 't run and no error messages. Except 2002: Position error exceeds maximum

If I change it back to softlib everything work fine.

 What I have to do to make it run in FPU32?

 edit: Why do i need FPU32? Because Controlsuite only supplied  usblib.lib in FPU32.

 

 

 

  • Evs,

    Are you using SpinTAC.lib or SpinTAC_fpu32.lib?  We have not yet created floating point versions of the InstaSPIN-MOTION labs, but if you look at an InstaSPIN-FOC floating point lab (i.e. lab09 vs lab09a) you should be able to see the modifications that are required in order to make these projects work along side a floating point environment.

  • Adam,

    I changed all the libraries. 

    SpinTAC.lib -> SpinTAC_FPU32.lib

    IQmath.lib -> IQmath_fpu32.lib

    2806xRevB_FastSpinROMSymbols.lib -> 2806xRevB_FastSpinROMSymbols_fpu32.lib

    rts2800_ml.lib -> rts2800_fpu32.lib

    That isn't much different then in LAB9.

    It compiler and runs. But it doesn't run correctly.

  • Evs,

    Those libraries do not convert the code to run as floating point.  The InstaSPIN code is still fixed point code.  Those libraries allow it to be ran in a project that is compiled with floating point.  

    Did you change the MATH_TYPE in IQMath.h?

    I think the issue could be in the interfaces.  All of the values passed into InstaSPIN code needs to be in fixed point.  If you look at lab09a it does this conversion for floating point variables.

  • Adam,

     I did not change MATH_TYPE in IQMath.h.  I didn't read that in the documentation.

    I'm searching  hard  to find IQMath.h or MATH_TYPE  in lab9A. But I can't find it. can please point me where it is in the project.

     Thanks.

     

  • Hello Adam,

    You can count me in trying to run the Spintac labs with FPU, but unsuccesful up till now.

     

    http://e2e.ti.com/support/microcontrollers/c2000/f/902/t/361006.aspx

     

    Would it be to much to ask that you try yourself and report the steps necessary?

     

    Kind regards,

     

    Paul

  • I find this in IQMathLib.h

    #if MATH_TYPE == FLOAT_MATH
    #include <math.h>
    #include <stdlib.h>
    #endif

    But I didn't find any defines in Lab9A. So how is it done?

     I except to find something like:  --define="MATH_TYPE=1" in the C2000 compiler settings.

  • Evs,

    MATH_TYPE is defined in IQMathLib.h.  It should be set to IQ_MATH.  This is because all of the InstaSPIN code relies on fixed point math.

    I went and converted lab13c to support the fpu32.  I'm getting the same bug that you reported.  I believe there is an issue with the floating point version of a couple functions. 

    I have a workaround.  You need to comment out the USER_calcPIgains function.  This function is causing the current loop PI gains to be set incorrectly.

  • Adam,

     Thanks, I changed it, but no luck. Nothing happens.

    That solves the Pi loop. But not the gMotorVars.VdcBus_kV  0 problem. If I but gAdcData in the watch window it always display for all V and I values 0. So I think there are more problems.

     

     

  • Evs,

    During my process of switching the library over I also saw this issue.  It turns out that I was using the wrong rts library.  I've attached screenshots of the two changes I had to make to use the correct rts library.

  • Adam,

     I did change the RTS2800 to RTS2800_FPU32. But the link order is imported. I changed it to the top and it works.  Thanks.

     

  • Hello,

    After some time trying to get the FPU working together with motorWare, i think i now have the solution to the error in USER_calcPIgains.

    The solution seems to be the linking order of the math libraries. Don't ask me why or how. This was trail and error!

    regards,

    Paul

  • yes, the order of the libraries is important and should be kept how they are in the examples.
  • Thanks. I changed my program back from fpu to softlib to verify that wasn't the program. No luck in getting it back again. Till I saw your post.

    One small note: -l RTS2800-fpu.lib is an option after you change it in CCS general->runtime support library and do a compile.

    I think, I spend more time solving such issues than actually writing code.