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.

TMS320F280025C: General motor control laboratory speed ring problem

Part Number: TMS320F280025C
Other Parts Discussed in Thread: LAUNCHXL-F280025C

I used the General motor Control lab example and I saw that the example needed to reach a certain RPM to enable the speed ring as follows:

if(fabsf(obj->speed_Hz) > obj->speedStart_Hz)
{
    TRAJ_setMaxDelta(obj->trajHandle_spd,
      (obj->accelerationMax_Hzps / objUser->ctrlFreq_Hz));

#if defined(MOTOR1_ISBLDC)
    ISBLDC_updateThresholdInt(obj->isbldcHandle, obj->speed_int_Hz);
    #if (DMC_BUILDLEVEL >= DMC_LEVEL_4)
    PI_setMinMax(obj->piHandle_spd, -obj->maxCurrent_A, obj->maxCurrent_A);
    #else
    PI_setMinMax(obj->piHandle_spd, -1.0f, 1.0f);
    #endif  // DMC_BUILDLEVEL <= DMC_LEVEL_3
#else  // !MOTOR1_ISBLDC
    PI_setMinMax(obj->piHandle_spd, -obj->maxCurrent_A, obj->maxCurrent_A);

    SVGEN_setMode(obj->svgenHandle, obj->svmMode);
#endif  // !MOTOR1_ISBLDC

    if(obj->motorState == MOTOR_CL_RUNNING)
    {
        obj->stateRunTimeCnt++;

        if(obj->stateRunTimeCnt == obj->fwcTimeDelay)
        {
            obj->Idq_out_A.value[0] = 0.0f;
            obj->motorState = MOTOR_CTRL_RUN;
            obj->mctrlState = MCTRL_CONT_RUN;
        }
    }
}
else
{
    TRAJ_setMaxDelta(obj->trajHandle_spd,
      (obj->accelerationStart_Hzps / objUser->ctrlFreq_Hz));

#if defined(MOTOR1_ISBLDC)
    #if (DMC_BUILDLEVEL >= DMC_LEVEL_4)
    if(obj->speed_int_Hz > 0.0f)
    {
        PI_setMinMax(obj->piHandle_spd, 0.0f, obj->startCurrent_A);
    }
    else
    {
        PI_setMinMax(obj->piHandle_spd, -obj->startCurrent_A, 0.0f);
    }
    #else   // (DMC_BUILDLEVEL < DMC_LEVEL_3)
    PI_setMinMax(obj->piHandle_spd, -1.0f, 1.0f);
    #endif  // DMC_BUILDLEVEL < DMC_LEVEL_3
#else  // !MOTOR1_ISBLDC
    if(obj->speed_int_Hz >= 0.0f)
    {
        PI_setMinMax(obj->piHandle_spd, 0.0f, obj->startCurrent_A);
    }
    else
    {
        PI_setMinMax(obj->piHandle_spd, -obj->startCurrent_A, 0.0f);
    }
#endif  // !MOTOR1_ISBLDC
}

I wonder why? What's the point? Can I start the motor and just use the speed ring? I tried to modify it like this:

//if(fabsf(obj->speed_Hz) > obj->speedStart_Hz)
//{
    TRAJ_setMaxDelta(obj->trajHandle_spd,
      (obj->accelerationMax_Hzps / objUser->ctrlFreq_Hz));

#if defined(MOTOR1_ISBLDC)
    ISBLDC_updateThresholdInt(obj->isbldcHandle, obj->speed_int_Hz);
    #if (DMC_BUILDLEVEL >= DMC_LEVEL_4)
    PI_setMinMax(obj->piHandle_spd, -obj->maxCurrent_A, obj->maxCurrent_A);
    #else
    PI_setMinMax(obj->piHandle_spd, -1.0f, 1.0f);
    #endif  // DMC_BUILDLEVEL <= DMC_LEVEL_3
#else  // !MOTOR1_ISBLDC
    PI_setMinMax(obj->piHandle_spd, -obj->maxCurrent_A, obj->maxCurrent_A);

    SVGEN_setMode(obj->svgenHandle, obj->svmMode);
#endif  // !MOTOR1_ISBLDC

    if(obj->motorState == MOTOR_CL_RUNNING)
    {
        obj->stateRunTimeCnt++;

        if(obj->stateRunTimeCnt == obj->fwcTimeDelay)
        {
            obj->Idq_out_A.value[0] = 0.0f;
            obj->motorState = MOTOR_CTRL_RUN;
            obj->mctrlState = MCTRL_CONT_RUN;
        }
    }
//}
//else
//{
//    TRAJ_setMaxDelta(obj->trajHandle_spd,
//      (obj->accelerationStart_Hzps / objUser->ctrlFreq_Hz));

//#if defined(MOTOR1_ISBLDC)
//    #if (DMC_BUILDLEVEL >= DMC_LEVEL_4)
//    if(obj->speed_int_Hz > 0.0f)
//    {
//        PI_setMinMax(obj->piHandle_spd, 0.0f, obj->startCurrent_A);
//    }
//    else
//    {
//        PI_setMinMax(obj->piHandle_spd, -obj->startCurrent_A, 0.0f);
//    }
//    #else   // (DMC_BUILDLEVEL < DMC_LEVEL_3)
//    PI_setMinMax(obj->piHandle_spd, -1.0f, 1.0f);
 //   #endif  // DMC_BUILDLEVEL < DMC_LEVEL_3
//#else  // !MOTOR1_ISBLDC
//    if(obj->speed_int_Hz >= 0.0f)
//    {
//        PI_setMinMax(obj->piHandle_spd, 0.0f, obj->startCurrent_A);
//    }
//    else
//   {
//        PI_setMinMax(obj->piHandle_spd, -obj->startCurrent_A, 0.0f);
//    }
//#endif  // !MOTOR1_ISBLDC
//}

But when I set flagEnableRunAndIdentify to true, after a while I get the moduleOverCurrent error and the motor doesn't respond?

So I want to know the purpose of TI engineer's design? And how to modify the code to start the speed ring directly like LAB5B?

Thanks technologist, best regards.

  • Which motor control algorithm and hardware kit are you using in this lab? Do you have a look at the lab user's guide and follow it to run the lab for a new motor?

    Universal Project and Lab User’s Guide: https://www.ti.com/lit/spruj26

    More information much better for us to understand your questions.

  • I use LaunchXL-F280025C and DRV8323RS for development, my motor is a permanent magnet motor, which has been identified by DMC_LEVEL_4, and the parameters of the motor are obtained. Then, I will modify the code to appeal, my purpose is to directly enable the speed loop without transition, and as a result I get the error for moduleOverCurrent.

  • If you are using FAST based motor control algorithm, you don't need to change anything, the lab meets your requirement mentioned above. You just need to follow the lab guide to set the right motor parameters according the specification of the motor.

  • Yes, I am using the FAST algorithm, I have identified the motor and got the parameters of the motor, but when I start to set the speed to run, the actual motor speed is not as fast as speed_Hz:

    And I will see an alarm that there is phase current imbalance or phase loss, I don't understand what that means, I think my connection is ok because it successfully completes the identification of the motor.

    The motor has no load and my supply voltage is 30v, how can I solve this problem?

  • You may disable phase current imbalance or phase loss fault protections, or change the setting threshold value for phase current imbalance or phase loss fault protections, and try to run the motor again.

    Please try to change/tune the following parameters according to the specification of your motor as well.

    #define USER_MOTOR1_RES_EST_CURRENT_A       (1.0f)            // A - 10-30% of rated current of the motor

    #define USER_MOTOR1_IND_EST_CURRENT_A       (-1.0f)            // A - 10-30% of rated current of the motor, just enough to enable rotation

    #define USER_MOTOR1_FLUX_EXC_FREQ_Hz          (40.0f)          // Hz - 10~30% rated frequency of the motor

     

    #define USER_MOTOR1_STARTUP_CURRENT_A     (3.0f)             // A - 30-100% of rated current of the motor

    #define USER_MOTOR1_MAX_CURRENT_A             (6.0f)              // A - 50-150% of rated current of the motor

    #define USER_MOTOR1_OVER_CURRENT_A           (6.5f)              // A - 50-150% of rated current of the motor

  • The actual speed (as seen in the video) does not have speed_ Hz display so fast, how to solve this problem?

  • Please follow the lab user's guide to run the lab project. Seems like there is no the issue your reported. Or please have a detailed dec scription of the operation steps you did.

  • I first tested DMC_LEVEL_1 according to the test guide, which was normal. Then I prepared a motor with level 15 logarithm, changed DMC_LEVEL_1 to DMC_LEVEL_4, and the power supply voltage was 30V. I first identified the parameters of the motor and filled them into USER_mtr1.h. And then I started running the complete closed loop, the algorithm is FAST, the default speed of the universal lab is 40 Hz, I set flagEnableRunAndIdentify to true, and the system started running, and I noticed that the actual motor speed was not 40 RPM, as in the video, This is my complete operation process. I also tried to change speedRef_Hz to be faster, such as 100Hz. I saw that the motor rotation speed was indeed faster, but far from reaching my target speed, but the feedback value of speed_Hz was almost the same as speedRef_Hz, which made me confused. Can you tell me why?

  • I noticed that the actual motor speed was not 40 RPM

    You should know that the reference and feedback speed is the electrical frequency of the motor, it's not the mechanical speed. Seems like the value of speed_Hz is close to the value of speedRef_Hz that means the motor is running correctly.

    the mechanical speed = speed_Hz * 60 / pole_pairs

  • I follow the formula of speed n = 60*speed_Hz /pole_pairs. The default frequency of theoretical example is 40Hz. For the motor of my class 15 pair, the speed should be 160RPM. Can you give me a hint?

  • Correct. mechanical speed (rpm) = electrical frequency (Hz) * 60 / pole_pairs. You should know there is no any variables to show the mechanical speed in the example lab, all speed are based on the electrical frequency with Hz unit.

    Close the thread since there is no issue as you mentioned above. You may have a look at some textbooks that should have a more details about these motor control electronic knowledge if possible.