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.

TMS320F280049C: Dynamic Resistance Calibration for Custom Motor

Part Number: TMS320F280049C
Other Parts Discussed in Thread: C2000WARE, TMDSHVMTRINSPIN

Hi Team,

We are Working on sensor Based FOC using TMS320F280049C.

I am using Example project path: C:\ti\c2000\C2000Ware_MotorControl_SDK_3_00_01_00\solutions\tmdshvmtrinspin\f28004x\ccs\sensorless_foc\is10_rs_recalc

We tested the Lab-10 example with HVKIT and AC Servomotor & It is working as expected.

KIT:  t
mdshvmtrinspin (HVKIT)
MOTOR: AC Servomotor. Parameters defines as follows.

#elif (USER_MOTOR == Estun_EMJ_04APB22_B)
#define USER_MOTOR_TYPE                    MOTOR_TYPE_PM
#define USER_MOTOR_NUM_POLE_PAIRS         (4)
#define USER_MOTOR_Rr_Ohm                 (0.0)

// HV Kit with external OPA
#define USER_MOTOR_Rs_Ohm                 (2.98774099)
#define USER_MOTOR_Ls_d_H                 (0.008926632)
#define USER_MOTOR_Ls_q_H                 (0.008926632)
#define USER_MOTOR_RATED_FLUX_VpHz        (0.445965141)

#define USER_MOTOR_MAGNETIZING_CURRENT_A  (NULL)
#define USER_MOTOR_RES_EST_CURRENT_A      (1.0)
#define USER_MOTOR_IND_EST_CURRENT_A      (-1.0)
#define USER_MOTOR_MAX_CURRENT_A          (3.82)
#define USER_MOTOR_FLUX_EXC_FREQ_Hz       (20.0)
#define USER_MOTOR_NUM_ENC_SLOTS          (2500.0)
#define USER_MOTOR_INERTIA_Kgm2           (3.10002e-05)

#define USER_MOTOR_FREQ_MIN_HZ             (5.0)           // Hz
#define USER_MOTOR_FREQ_MAX_HZ            (400.0)         // Hz

#define USER_MOTOR_FREQ_LOW_HZ            (10.0)          // Hz
#define USER_MOTOR_FREQ_HIGH_HZ           (200.0)         // Hz
#define USER_MOTOR_VOLT_MIN_V             (20.0)          // Volt
#define USER_MOTOR_VOLT_MAX_V             (200.0)         // Volt



Now we need to test same Lab-10 example with HVKIT and PMSM Motor (Custom Motor) with beelow parameters.


KIT:  tmdshvmtrinspin (HVKIT)
MOTOR: PMSM Motor (Custom Motor). Parameters defines as follows.

#if (USER_MOTOR == Estun_EMJ_04APB22_B)
#define USER_MOTOR_TYPE                    MOTOR_TYPE_PM
#define USER_MOTOR_NUM_POLE_PAIRS         (20)
#define USER_MOTOR_Rr_Ohm                 (0.0)
#define USER_MOTOR_Rs_Ohm                 (NULL)
//#define USER_MOTOR_Rs_Ohm                 (3.80093718)
#define USER_MOTOR_Ls_d_H                 (NULL)
#define USER_MOTOR_Ls_q_H                 (NULL)
#define USER_MOTOR_RATED_FLUX_VpHz        (0.0)
#define USER_MOTOR_MAGNETIZING_CURRENT_A  (NULL)
#define USER_MOTOR_RES_EST_CURRENT_A      (1.0)
#define USER_MOTOR_IND_EST_CURRENT_A      (-1.0)
#define USER_MOTOR_MAX_CURRENT_A          (7.4)
#define USER_MOTOR_FLUX_EXC_FREQ_Hz       (20.0)
#define USER_MOTOR_NUM_ENC_SLOTS          (2500.0)
#define USER_MOTOR_INERTIA_Kgm2           (3.10002e-02)

#define USER_MOTOR_FREQ_MIN_HZ             (10.0)           // Hz
#define USER_MOTOR_FREQ_MAX_HZ            (48.0)         // Hz  120%of rated //increased to 48 from 30
#define USER_MOTOR_FREQ_LOW_HZ            (4.0)          // Hz   //increased to 4 from 2.5
#define USER_MOTOR_FREQ_HIGH_HZ           (40.0)         // Hz   //increased to 40 ffrom 25
#define USER_MOTOR_VOLT_MIN_V             (35.0)          // Volt
#define USER_MOTOR_VOLT_MAX_V             (260.0)         // Volt



Can I use same procedure to test our application? Will that work as expected or Do I need to change Procedure? Because we need to use this Resistance Calibration in our end application.


Help me to resolve the problem

Thanks in advance.

  • The features is only supported by the InstaSPIN-FOC with FAST. You can refer to the lab10 to implement the procedure with FAST in your application.

  • Thank you for the reply @Yanming Luo,

    1. We are following the Lab10 process as per your suggestion to calculate the Dynamic resistance, we have some doubts in that

    a)


    b)


    2. In the above image we didn’t get the #6 and #7. How that RsonlineCurrent_A will effect the Rs?

        I am new to this could you please explain how INSTASPIN  FOC will calculate the Change of resistance?



    Any help would be very thankful



  • More details about Rs Online Recalibration can be found in Chapter 15 of InstaSPIN-FOC and InstaSPIN-MOTION User's Guide (Rev. I) http://www.ti.com/lit/ug/spruhj1h/spruhj1i.pdf

    You can follow this guide to set the current of Rs Online Recalibration.

  • Thank you for the reply,

    I have referred the document you suggested, i.e.,
    http://www.ti.com/lit/ug/spruhj1h/spruhj1i.pdf. And, ran the motor successfully (without any load on the motor). I have taken the log of "RsOnlineCurrent_A" and "RsOhm". The log values(Min, Max) are also attached with this message. They are varying within 5% difference. The "RsOnlineCurrent_A" value is increasing and decreasing continuously (swinging). 

    Is that the expected behavior? Have we followed the correct method?

    How to consider this continuously changing value for further processing?

    RsOnLineCurrent_A: 3.853408   to  RsOnLineCurrent_A: 6.285507    to  RsOnLineCurrent_A: 3.853408
    Rs(Ohms):                 3.853438   to  Rs(Ohms):                 6.285487    to   Rs(Ohms):                3.853438

    Continuing above readings while motor is running..


    Any help would be very thankful

  • The RsOnLineCurrent_A is a constant value set in the lab by you as the code below. Do you make any changes in the example lab? Do you mean motorVars.RsOnLine_Ohm, not   motorVars.RsOnLineCurrent_A? You may try to increase motorVars.RsOnLineCurrent_A  to see what happens.

      motorVars.RsOnLineCurrent_A = USER_MOTOR_RES_EST_CURRENT_A;

  • Thank you for the reply

    "Do you make any changes in the example lab?"
         - No, the code is not changed. Only the motor parameters are changed as per our motor.

    = = =


    The RsOnLine_Ohm and Rs_Ohm are elements of the structure 'motorVars', as shown below.


    We have set motorVars.RsOnLineCurrent_A  = 2.0, which can be seen in the above image.

    Observation: The "motorVars.RsOnLine_Ohm & motorVars.Rs_Ohm" values are continuously varying (increasing and decreasing). 


    Clarification Required: Which value to be considered from these continuously changing values as Rs (Resistance) for further processing?

    With fixed motorVars.RsOnLineCurrent_A  = 2.0, the values of motorVars.RsOnLine_Ohm and motorVars.Rs_Ohm are changing from 3.853408 to 6.285507. And, these values not stable while running.

    But please suggest on this to proceed for further processing.

    = = =

    Okay, as you suggested, I will check again by increasing motorVars.RsOnLineCurrent_A value.


    = = =

    Any help would be very thankful.

  • Any load is adding the motor? You may try to add a load on the motor with a higher speed, and then enable the RsOnline function. Seems like the RsOnline in this lab can't work well at the light load and low speed.

  • Thank you for the reply 

    "You may try to increase motorVars.RsOnLineCurrent_A  to see what happens"
    -
    First We have set motorVars.RsOnLineCurrent_A  = 2.0, in 1 Amp load. Getting loud sounds from motor while running.

     Then we set motorVars.RsOnLineCurrent_A  = 1.0, with the same 1 Amp Load. Because as per the document "spruhj1i" 

     USER_MOTOR_RES_EST_CURRENT_A to be 10-20% of motor max current in the section 4.6.9, In our case motor max current is 7.4 Amps. So, we 
     
     tested 
    with motorVars.RsOnLineCurrent_A  = 1.0 and motor running without any sound at 30RPM.

    -Enabled RsOnline function and took a log of "motorVars.RsOnLine_Ohm & motorVars.Rs_Ohm" while running motor in 1 Amp Load.

    Observation: The "motorVars.RsOnLine_Ohm & motorVars.Rs_Ohm" values are continuously varying (increasing and decreasing). But not exactly same as previous test results. 


    Our motor parameters

    #if (USER_MOTOR == Estun_EMJ_04APB22_A)
    #define USER_MOTOR_TYPE                    MOTOR_TYPE_PM
    #define USER_MOTOR_NUM_POLE_PAIRS         (20)
    #define USER_MOTOR_Rr_Ohm                 (0.0)
    #define USER_MOTOR_Rs_Ohm                 (3.80093718)
    #define USER_MOTOR_Ls_d_H                 (0.033496008015)
    #define USER_MOTOR_Ls_q_H                 (0.033496008015)
    //#define USER_MOTOR_RATED_FLUX_VpHz        (1.0)
    #define USER_MOTOR_RATED_FLUX_VpHz        (5.5)
    #define USER_MOTOR_MAGNETIZING_CURRENT_A  (NULL)
    #define USER_MOTOR_RES_EST_CURRENT_A      (1.0)
    #define USER_MOTOR_IND_EST_CURRENT_A      (-1.0)
    #define USER_MOTOR_MAX_CURRENT_A          (25.0)
    #define USER_MOTOR_FLUX_EXC_FREQ_Hz       (20.0)
    #define USER_MOTOR_NUM_ENC_SLOTS          (2500.0)
    //#define USER_MOTOR_INERTIA_Kgm2           (1.4852)
    #define USER_MOTOR_INERTIA_Kgm2           (3.10002e-02)
    
    #define USER_MOTOR_FREQ_MIN_HZ             (10.0)           // Hz
    #define USER_MOTOR_FREQ_MAX_HZ            (24.0)         // Hz //120% of rated
    
    #define USER_MOTOR_FREQ_LOW_HZ            (2.0)          // Hz // 10% of rated
    #define USER_MOTOR_FREQ_HIGH_HZ           (20.0)         // Hz // rated
    #define USER_MOTOR_VOLT_MIN_V             (35.0)          // Volt
    #define USER_MOTOR_VOLT_MAX_V             (260.0)         // Volt
    

    Below are the observed results I have shown here few values from the full log for understanding

    motorVars.RsOnLine_Ohm 
      

    4.510139
    4.508787
    4.565033
    4.570541
    4.580755
    4.662916
    4.670927
    4.680490
    4.700517
    4.761750
    4.816675
    4.957566
    5.088443
    5.383283
    5.499501
    5.511567
    5.645449
    5.775725
    5.783436
    5.841865
    5.972592
    6.136214
    6.234447
    6.332731
    6.496453
    6.529297
    6.627380
    6.701281
    6.856581
    6.701281
        -
        -
        -
        -
        -
        -
        -
    4.510139

    motorVars.Rs_Ohm  
         
    4.510089
    4.508737
    4.565073
    4.570591
    4.580805
    4.662966
    4.670977
    4.680540
    4.700517
    4.761750
    4.816725
    4.957616
    5.088483
    5.383343
    5.499551
    5.511607
    5.645489
    5.775765
    5.783476
    5.841915
    5.972632
    6.136254
    6.234498
    6.332771
    6.496493
    6.529337
    6.627430
    6.701331
    6.856641
    6.701331
        -
        -
        -
        -
        -
        - 
        -
    4.510089

    Clarification Required: Which value to be considered from these continuously changing values as Rs (Resistance) for further processing?

    Thank you..

  • You can try to run the motor to a higher speed with a load, and increase the motorVars.RsOnLineCurrent_A to 2.0A to see what happens.

    And also you may try to change the RsOnline parameters as below in user.c, and tune these parameters if needed. The value should be near the default values in the user.c.

    pUserParams->RsOnLine_DeltaInc_Ohm = (float32_t)0.00002f;
    pUserParams->RsOnLine_DeltaDec_Ohm = (float32_t)0.00002f;

    pUserParams->RsOnLine_angleDelta_rad = (float32_t)0.0005f;
    pUserParams->RsOnLine_pole_rps = MATH_TWO_PI * (float32_t)0.1f;