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.

TMS320F28379S: Sliding Mode Observer Library

Part Number: TMS320F28379S
Other Parts Discussed in Thread: C2000WARE

Hello all,

I am working on migrating the legacy project based on the TMS320F28335 family to the TMS320F28379S.  The project is FOC-based control of two motors (one sensorless and the other encoder based) in a 50kHz loop.  During migration, I encounter an issue with esmo_float.lib.  I believe the library is obtained from this thread https://e2e.ti.com/support/microcontrollers/c2000-microcontrollers-group/c2000/f/c2000-microcontrollers-forum/434527/controlsuite-s-esmo-and-f28335/1578710#1578710.  My issue is that the call to  eSMO_MODULE((ESMOPOS *)&gSlidingModeObserver) is taking over 15us to execute while the rest of the FOC algorithm is around 5us.  This presents an issue since my loop is 20us.  I am assuming that the call inside the library is not taking advantage of TMU or FPU hardware accelerator.  Would I be able to obtain the source code for this library?  I know that C2000Ware_MotorControl_SDK_4_02_00_00 has a newer version of the sliding observer but the object seems to be different and because of the tight time deadline I would prefer not to have to modify the code and tune the parameters.

  • Hi Ljubisa,

    Let me consult my senior colleague and reply to you by next Monday.

    Thanks,

    Jiaxin

  • Thanks, Jiaxin. I am looking forward to your reply. 

  • Hi Ljubisa,

    Unfortunately the contents inside the .lib file are not public. It is highly recommended to leverage the "C2000Ware_MotorControl_SDK_4_02_00_00" for the development with recent released devices. The eSMO implementation is transparent in the MotorControl SDK.

    Thanks,

    Jiaxin

  • Hi Jiaxin,

    i understand that the library is not public but we can sign any NDA agreement that you need. Please let me know if that is possible. 

  • Hi Ljubisa,

    You will need to request this through your TI FAE if you have one. We only release source for supported business opportunities.

    Thanks,

    Jiaxin

  • Hi Jiaxin,

     

    While I am waiting to hear from our FAE, I started porting a new observer from the SDK.  However, I run an issue running the motor with the new observer.  If I start the motor using an observer from the library, I can tune the new observer to match the speed of the library observer but if I attempt to start the motor just using a new observer the motor stops when switching from the open to closed-loop control.  I also tried using an example in the universal library and the motor stops there as well when switching to a closed loop.  Is there any documentation similar to DMC MATH_eSMOlib.pdf that describes all the inputs, outputs, and parameters? 

    Also, it seems that the Kslf parameter in the older library was getting updated based on the current speed but that is not happening anymore.  I am not sure whether that is a critical part or not.  Also, it seems that there are 3 different methods to obtain the speed, using the arc tangent method, and the PLL output but also the TI example is using SPDFR_run function for estimating speed.  What are the advantages/disadvantages of using these?  Also from some other TI documentation (tidube5a.pdf equation 57), the back emf calculator is adding Zalpha and beta terms but the code is subtracting.  Which one is correct?

  • Hi Ljubisa,

    To better help you with your problems, please answer the following questions.

    I started porting a new observer from the SDK.  However, I run an issue running the motor with the new observer.

    Is this observer the eSMO from the universal motor lab in the motor control SDK?

    If I start the motor using an observer from the library, I can tune the new observer to match the speed of the library observer but if I attempt to start the motor just using a new observer the motor stops when switching from the open to closed-loop control.

    I am confused about this experiment process, could you please explain more?

    Please see the following responses.

    Is there any documentation similar to DMC MATH_eSMOlib.pdf that describes all the inputs, outputs, and parameters? 

    Unfortunately, there is no similar document. 

    Also, it seems that the Kslf parameter in the older library was getting updated based on the current speed but that is not happening anymore

    Kslf is not necessary to change.

    Also, it seems that there are 3 different methods to obtain the speed, using the arc tangent method, and the PLL output but also the TI example is using SPDFR_run function for estimating speed.

    SPDFR_run() calculates the speed through PLL, it is part of the enhanced SMO algorithm.

    Also from some other TI documentation (tidube5a.pdf equation 57), the back emf calculator is adding Zalpha and beta terms but the code is subtracting.  Which one is correct?

    Please follow the example code, the documentation will be updated later.

    Thanks,

    Jiaxin

  •  

    Jiaxin Teng replied to TMS320F28379S: Sliding Mode Observer Library.

    Hi Ljubisa,

    To better help you with your problems, please answer the following questions.

    Ljubisa Milojevic said:

    I started porting a new observer from the SDK.  However, I run an issue running the motor with the new observer.

     

    Is this observer the eSMO from the universal motor lab in the motor control SDK?  Yes, I followed the example from the motor control SDK.

    Ljubisa Milojevic said:

    If I start the motor using an observer from the library, I can tune the new observer to match the speed of the library observer but if I attempt to start the motor just using a new observer the motor stops when switching from the open to closed-loop control.

    I am confused about this experiment process, could you please explain more?

    As I stated in my first post, I am porting the legacy project that is utilizing esmo_float.lib.  Is that the previous version of the eSMO observer?  The library works perfectly but the execution time is taking too long probably because it was compiled for a different processor family.  I added the eSMO from the universal motor lab just to observe behavior while the original esmo_float.lib is used to estimate the rotor angle and speed.  I can tune the SDK eSMO parameters to match the running speed of the motor but it is very unstable to any step changes in speed and it seems after running for a second or two it starts downward drift.  If I attempt to run the motor with just an SDK observer, the motor stops when transitioning from the open to closed loop.  I also noticed while the motor is stalled, the observer is estimating the speed that is very close to the referenced speed.

    Please see the following responses.

    Ljubisa Milojevic said:

    Is there any documentation similar to DMC MATH_eSMOlib.pdf that describes all the inputs, outputs, and parameters? 

    Unfortunately, there is no similar document. 

    Ljubisa Milojevic said:

    Also, it seems that the Kslf parameter in the older library was getting updated based on the current speed but that is not happening anymore

    Kslf is not necessary to change.

    Ljubisa Milojevic said:

    Also, it seems that there are 3 different methods to obtain the speed, using the arc tangent method, and the PLL output but also the TI example is using SPDFR_run function for estimating speed.

    SPDFR_run() calculates the speed through PLL, it is part of the enhanced SMO algorithm.

    Ljubisa Milojevic said:

    Also from some other TI documentation (tidube5a.pdf equation 57), the back emf calculator is adding Zalpha and beta terms but the code is subtracting.  Which one is correct?

    Please follow the example code, the documentation will be updated later.

     I followed the example code.  I tried running an example from the library enabling MOTOR_ESMO but the result is the same and the speed estimate is all over the place. I have a very low inductance motor that might be causing the stability issue with this observer.  

    Thanks,

    Jiaxin

     

  • Hi Ljubisa,

    The eSMO in the current motor control SDK is migrated from the legacy one. It seems that the observer is not stable, as the estimated speed has an issue in converging to the real speed after step changes. Please make sure your motor model is accurate and refer to section 3.3.4.6 in tidube5a.pdf to tune the FOC parameters.

    Thanks,

    Jiaxin