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.

Why USER_ErrorCode_ctrlFreq_Hz_Low error?

Other Parts Discussed in Thread: BOOSTXL-DRV8301

I tried to use the LAUNCXL-F28027F + BOOSTXL-DRV8301 to evaluate different motors. I found that for most motors, the system

works fine. But for one motor, I found that the identification results are always wrong. The parameters for the motor with

problem: rated voltage ~ 12 V, Rs ~ 0.62 ohm, Ls ~ 0.000034 H, rated current ~ 3 A, pole pairs ~ 3. No matter I use lab 2b

or lab 2c, the Ls identification results are always wrong (at least one order lower). Then I want to use lab03b and the

measured parameters to run the motor (though the motor can spin in lab2b or lab2c, but the phase current seems to be bad, I

want to see whether the phase current can improve with the proper motor parameters). But every time I run the system, an

error appeared as "USER_ErrorCode_ctrlFreq_Hz_Low". However, if I just change the USER_MOTOR (such as change the defined

USER_MOTOR from double_rotor to Maxon_EC_motor) in the user.h file, the system is OK. So it is only related to motor

parameters, but why motor parameters cause such error? I checked the source code that generate the error code, it seems

that only USER_MOTOR_MAX_CURRENT is used in determining the error, however, I used the same value for some other motors,

but why only this motor has such error?

Below are two motor parameter definitions (the first one has the problem and the second one is OK):

 #elif (USER_MOTOR == double_rotor) #define USER_MOTOR_TYPE                 MOTOR_Type_Pm #define USER_MOTOR_NUM_POLE_PAIRS       (3) #define USER_MOTOR_Rr                   (NULL) #define USER_MOTOR_Rs                   (0.636501) #define USER_MOTOR_Ls_d                 (0.000034) #define USER_MOTOR_Ls_q                 (0.000034) #define USER_MOTOR_RATED_FLUX           (0.025035) #define USER_MOTOR_MAGNETIZING_CURRENT  (NULL) #define USER_MOTOR_RES_EST_CURRENT      (0.8) #define USER_MOTOR_IND_EST_CURRENT      (-0.8) #define USER_MOTOR_MAX_CURRENT          (10.0) #define USER_MOTOR_FLUX_EST_FREQ_Hz     (20.0)

 

#elif (USER_MOTOR == Maxon_EC_motor) #define USER_MOTOR_TYPE                 MOTOR_Type_Pm #define USER_MOTOR_NUM_POLE_PAIRS       (1) #define USER_MOTOR_Rr                   (NULL) #define USER_MOTOR_Rs                   (0.7172008) #define USER_MOTOR_Ls_d                 (9.215553e-05) #define USER_MOTOR_Ls_q                 (9.215553e-05) #define USER_MOTOR_RATED_FLUX           (0.07852665) #define USER_MOTOR_MAGNETIZING_CURRENT  (NULL) #define USER_MOTOR_RES_EST_CURRENT      (0.8) #define USER_MOTOR_IND_EST_CURRENT      (-0.8) #define USER_MOTOR_MAX_CURRENT          (10.0) #define USER_MOTOR_FLUX_EST_FREQ_Hz     (20.0)

  • user.c has the error checking

    there are 2 sets of logic that can set this error

      if(((float_t)USER_CTRL_FREQ_Hz < USER_IQ_FULL_SCALE_FREQ_Hz) ||
        ((float_t)USER_CTRL_FREQ_Hz < USER_OFFSET_POLE_rps) ||
        ((float_t)USER_CTRL_FREQ_Hz < 250.0) ||
        ((float_t)USER_CTRL_FREQ_Hz <= (2.0 * USER_IQ_FULL_SCALE_FREQ_Hz * USER_MOTOR_MAX_CURRENT / (128.0 * USER_IQ_FULL_SCALE_CURRENT_A))))
        {
          USER_setErrorCode(pUserParams, USER_ErrorCode_ctrlFreq_Hz_Low);
        }

      if((USER_MOTOR_Rs != 0.0) && (USER_MOTOR_Ls_d != 0.0) && (USER_MOTOR_Ls_q != 0.0))
        {
          if(((float_t)USER_CTRL_FREQ_Hz <= (USER_MOTOR_Rs / (USER_MOTOR_Ls_d + 1e-9))) ||
            ((float_t)USER_CTRL_FREQ_Hz <= (USER_MOTOR_Rs / (USER_MOTOR_Ls_q + 1e-9))))
            {
              USER_setErrorCode(pUserParams, USER_ErrorCode_ctrlFreq_Hz_Low);
            }
        }

    your Rs / Ls = 18,720

    so your CTRL FREQ should be set to at least 19 KHz.  You are probably running at 15 KHz with the default settings.

    alternatively, most likely you can just // out this error and get reasonable performance.

  • actually, we found a little issue with this error checking logic. please change the 2nd one to the following and the error will disappear.

    Fixed Code:

    if((USER_MOTOR_Rs != 0.0) && (USER_MOTOR_Ls_d != 0.0) && (USER_MOTOR_Ls_q != 0.0))
    {
    if(((float_t)USER_CTRL_FREQ_Hz <= (USER_MOTOR_Rs / (USER_MOTOR_Ls_d + 1e-9) / MATH_TWO_PI)) ||
    ((float_t)USER_CTRL_FREQ_Hz <= (USER_MOTOR_Rs / (USER_MOTOR_Ls_q + 1e-9) / MATH_TWO_PI)))
    {
    USER_setErrorCode(pUserParams, USER_ErrorCode_ctrlFreq_Hz_Low);
    }
    }