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.

TMS320F280041C: Switching from InstaSPIN ROM to software library

Part Number: TMS320F280041C

Hi,

We have a project using InstaSPIN ROM on TMS320F280041C for a sensorless FOC PMSM

It is originally based on MotorControl SDK v3.00.01.00

 

Now we want to use a CPU without ROM code (supply chain problems…)

In MotorControl SDK v4.00.00.00 there is a linkable library to replace the ROM functions: libraries\observers\est_lib\lib\fast_full_lib.lib

We used this library instead of libraries\observers\fast\lib\f28004x\f28004x_fast_rom_symbols_fpu32.lib

Small changes in application code were necessary due to differences in structs, namely USER_Params in userParams.h, _FULL_FAST_LIB predefined

 

However, the following two functions are missing in the software lib vs. ROM lib:

void EST_setupTraj(EST_Handle handle, CTRL_Handle ctrlHandle, const float32_t targetValue_spd_Hz, const float32_t targetValue_Id_A);

void EST_configureCtrl(EST_Handle handle,CTRL_Handle ctrlHandle);

Notably, these are the only functions in est/include/est.h that need CTRL_Handle. They are missing in est_lib/include/est.h

 

They are needed for motor ID only, so we replaced them with dummies, the motor is now running fine with the software lib, but motor ID is not yet working properly.

 

We looked at example universal_motorcontrol_lab_f28002x:

EST_setupTrajState() seems to be used in a similar way to EST_setupTraj()

For EST_configureCtrl() there is no similar function. 

 

Q1: Is there a migration guide from ROM to linked libraries?

 

Q2: How to replace the missing EST_ functions?

 

Q3: Is there a description of the differences or characteristics of the different FAST libs?

fast_flash_lib.lib

fast_full_lib.lib

fast_pmsm_lib.lib

fast_simple_lib.lib


Regards,

Wolfgang

  • Q1: Is there a migration guide from ROM to linked libraries?

    Take a look at the Universal Project and Lab User’s Guide: https://www.ti.com/lit/ug/spruj26/spruj26.pdf that has a chapter about the migration.

    Q2: How to replace the missing EST_ functions?

    Please refer to the Universal Lab example code.

    Q3: Is there a description of the differences or characteristics of the different FAST libs?

    Please use the fast_flash_lib.lib or fast_full_lib.lib as the Universal Lab.

  • Thanks for your response. However, the questions remain:


    Q1: Which chapter exactly are you referring to? I can't find one telling how to migrate an existing ROM project to the linkable library.

    Q2: See above. 

    Q3: Can I read your answer as "No, there is no such description"? We're using "fast_full_lib.lib".

    Again: We already have a project with lots of application code using the ROM lib.
    It is not an option for us to start a new project based on example code. Instead, we need to integrate the linkable library into our EXISTING project.

  • Q1: Which chapter exactly are you referring to? I can't find one telling how to migrate an existing ROM project to the linkable library.

    You just need to add/link the driverlib files for F28004x based on the motor control universal lab with F28002x, and change the device configuration codes in hal.c and hal.h according to Chapter 3 (Building a Custom Board).

    Q3: Can I read your answer as "No, there is no such description"? We're using "fast_full_lib.lib".

    You can use "fast_full_lib.lib".

    BTW, you can keep using the ROM lib, and don't need to switch to software library since you are using the F280041C device.

  • Sorry, please see my original post:
    The point is: "Now we want to use a CPU without ROM code".
    (Namely '41 or '49 instead of '41C, but the exact part does not matter).

    Our problems are not in hal.c, not in device configuration, this is all solved, the motor is running.

    Our problem is two missing ROM functions in the software lib (see Q2 above), probably the reason why motor ID does not work properly:

    void EST_setupTraj(EST_Handle handle, CTRL_Handle ctrlHandle, const float32_t targetValue_spd_Hz, const float32_t targetValue_Id_A);
    void EST_configureCtrl(EST_Handle handle,CTRL_Handle ctrlHandle);
    


    Any hints how to substitute these would be highly appreciated.
    Most probably they just initialize or copy some member variables of the EST_handle object, so it shouldn't be a big deal.

  • If you want to use the software library with F28004x, please refer to the universal lab and just change the files of drivelib for F28004x, and hal.c, hal.h and user.h as mentioned above.

    You can't use the software library to replace the ROM library directly since the software library is optimized without using the controller (CTRL) object. So the identification will call different functions with different control flow.

  • Your 1st paragraph is what we did already - successfully.

    Your 2nd paragraph describes the problem we need a solution for.
    So far we couldn't find any documentation about what the differences are in functions and control flow, and how to overcome them.
    Sifting through thousands of lines of code in examples also didn't help us a lot.

    We must support both ROM and software lib with the same codebase. Our motor control code is used in several projects. It is quite mature and has several enhancements and workarounds to the original TI code. So we do not have the option to use example code or rewrite large parts of our motor control code for the software lib.

    IOW: We need to UNDERSTAND what the differences are between ROM and software lib, and substitute the missing parts. Which appear to be only the 2 simple functions mentioned above. In a perfect world we could simply get their sources. Is this possible (NDA no problem)?

  • Sorry. There is no a document to show the different since the software library is for the devices without FAST ROM and there is an example project to show how to use the software library.

    You may refer to the Universal Motor Lab to support different control algorithm like FAST and eSMO, but you can't support both ROM and software library at the same time, and you can just select either one in a project.

  • We don't want to support "both ROM and software library at the same time".
    We want to be able to build for either of it, by the usual means of predefined macros, different linker cmd files, build configurations.
    As for now I can see no reason why this wouldn't work. In fact, it does already work - apart from motor ID.
    est_lib/include/est.h even supports "ROM_Compatible" mode (lines 5442 ff).

    We replaced f28004x_fast_rom_symbols_fpu32.lib with fast_full_lib.lib and switched header files.
    Our project did build, only 2 functions were missing: EST_setupTraj() and EST_configureCtrl()
    So we provided stubs for them just to satisfy the linker: tadaa - Motor is running.

    We are confident that if we can properly substitute EST_setupTraj() and EST_configureCtrl() motor ID will be working as well.

    Question: Is TI able to provide us with the source code of EST_setupTraj() and EST_configureCtrl() ROM functions?
    My guess is that they are quite simple and just copy or init some struct members.


    BTW: We are in this situation only because TI cannot provide the C variants with ROM code. So it'd be nice if they could at least help us fix this problem on the software side.

  • Question: Is TI able to provide us with the source code of EST_setupTraj() and EST_configureCtrl() ROM functions?
    My guess is that they are quite simple and just copy or init some struct members.

    Sorry. We can't provide the source code for these two functions separately. Seems like the source code is not necessary for using both libraries in your project.

    BTW: We are in this situation only because TI cannot provide the C variants with ROM code. So it'd be nice if they could at least help us fix this problem on the software side.

    The InstaSPIN lab for F28004xC has provide the example code to use the ROM library and the Universal Motor Control Lab also provided the example code to use the software library. You just need to use the macro definition symbol to select which library will be used in your project as shown in the Universal Motor Control Lab.

    The EST_setupTraj() and EST_configureCtrl() need to use the CTRL object which is not supported in the software library for saving the memory usage. Please refer to the the Universal Motor Control Lab to implement the software library as mentioned above.

  • Yes, we did "use the macro definition symbol to select which library will be used", I mentioned this already in my very first post (_FULL_FAST_LIB predefined).

    I see this is getting us nowhere, we're running in circles. I'll have to escalate this.

    Thanks for your efforts so far.

  • Yes, you have to use the predefined symbols in your project if you want to implement the program code on F28004xC using the ROM library. Or you may just need to use the software library since you want to use the F28004x without FAST mask ROM. 

  • Sure, this is what we did and also what we want to do. ROM library works, software library not fully. Hence this thread.