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.

CCS/TMS320F280049: Current max Instaspin

Part Number: TMS320F280049
Other Parts Discussed in Thread: BOOSTXL-DRV8320RS, DRV8320

Tool/software: Code Composer Studio

Helloeverybody,

I am currently using Instaspin to control a BLDC motor with lab05.

I succeeded to control the motor but I didn't succeed to use my parameters from the lab05 in ccs composer.

I followed the quick start guide but my parameters still stay the same as in default.

Could you help me to update my parameters in instaspin (specially the current max)?

Thank you in advance.

  • Lab 05 is used to identify the motor parameters. You should record the watch window values with the newly defined motor parameters in the file of user.h as follows.

    USER_MOTOR_Rs = motorVars.Rs_Ohm’s value

    USER_MOTOR_Ls_d = motorVars.Ls_d_H’s value

    USER_MOTOR_Ls_q = motorVars.Ls_q_H’s value

    USER_MOTOR_RATED_FLUX = motorVars.flux_VpHz’s value

    You change the maximum current in the file of user.h also as below also.

    b#define USER_MOTOR_MAX_CURRENT_A          (6.0)

    And then rebuild the lab07 to spin the motor.

  • Hello,

    Thank you for your answer.

    I opened the lab07 and used motorcontrol SDK Instaspin lab to parametrize the lab but it didn't work. 

    When I put motorVars.flagEnableOffsetCalc at 0, it stops for a few seconds then restarts. 

    Do you know how to correct this? 

    Thank you. 

  • Did you identify the motor parameters successfully using lab05? And then copy the identified parameters to the file of the user.h for running lab07?

    Can you post the user.h with the identified parameters?

  • Hello, 

    Here it is my identified parameters:

    #define USER_MOTOR my_motor_1
    //#define USER_MOTOR my_motor_2

    #if (USER_MOTOR == my_motor_1)
    #define USER_MOTOR_TYPE MOTOR_TYPE_PM
    #define USER_MOTOR_NUM_POLE_PAIRS (4)
    #define USER_MOTOR_Rr_Ohm (0)
    #define USER_MOTOR_Rs_Ohm (0.0585)
    #define USER_MOTOR_Ls_d_H (0.0397)
    #define USER_MOTOR_Ls_q_H (0.0397)
    #define USER_MOTOR_RATED_FLUX_VpHz (0.0113)
    #define USER_MOTOR_MAGNETIZING_CURRENT_A (0)
    #define USER_MOTOR_RES_EST_CURRENT_A (2.0)
    #define USER_MOTOR_IND_EST_CURRENT_A (-2.0)
    #define USER_MOTOR_MAX_CURRENT_A (10.0)
    #define USER_MOTOR_FLUX_EXC_FREQ_Hz (40.0)

    // Number of lines on the motor's quadrature encoder
    #define USER_MOTOR_NUM_ENC_SLOTS (1000)

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

    #define USER_MOTOR_FREQ_LOW_HZ (10.0) // Hz
    #define USER_MOTOR_FREQ_HIGH_HZ (600.0) // Hz
    #define USER_MOTOR_VOLT_MIN_V (4.0) // Volt
    #define USER_MOTOR_VOLT_MAX_V (24.0) // Volt

  • Rebuild and load lab07 to spin the motor with the newly identified parameters.  And make sure that "userParams.flag_bypassMotorId = true;" before calling EST_setParams() function.

  • Thank you for your answer, it helped a lot. 

    I have another problem about current max. 

    So now I can control my motor with the lab07 but when I go above a certain speed, the motor stops. 

    The over-current protection is activated whereas I put it at 20A and it did not exceed it (or maybe only for a few seconds?). 

    Moreover, my motor is able, according to the datasheet, to go well beyond this speed. 

    Do you know how to resolve this problem?

    Thank you in advance.

  • What board are you using? Is it the TI EVM board? Which EVM? What's the USER_ADC_FULL_SCALE_CURRENT_A in the file of user.h?

    If you are using the boostxl-drv8320rs + launchPad-f280049x,  change the below settings.

    1. drvSPI8320Vars.Ctrl_Reg_05.VDS_LVL = DRV8320_VDS_LEVEL_1P300_V;

    2. Incear motorVars.dacValH (mo greater than 4095), and decrese motorVars.dacValH (no less than 1).

  • Thank you for your answer.

    For the first advice Ctrl_Reg_05.VDS_LVL is already equal to it. 

    For the second part I am not sure of what I must do, increase or decrease motorVars.dacValH?

    Moreover, could you explain me to what correspond these values? 

    I succeeded to rise my speed limit by changing the value type, I used uint16_t type. Do you know why it worked? 

    Thank you for your help. 

  • Sorry, a type. The phase current is bidirectional, 4096 means the positive maximum peak current, 0 means the negative maximum peak current. Increase motorVars.dacValH for changing the positive peak limitation value, and decrease motorVars.dacValL for a negative one.