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.

BOOSTXL-DRV8305EVM: Instaspin torque estimate way too small, calculation of desired Iq

Part Number: BOOSTXL-DRV8305EVM


I am working with the F28069M Evalboard and the BOOSTXL-DRV8305EVM Motordriver which drive the wheel of a pedelec. The motor control works nice and is based on lab4a extended to include CAN for communication. Since the goal is to deliver a desired torque via the motor, it would be nice to have a good estimate of the generated torque. While testing on a roller with resistance, the measured mechanical torque is for example 5 Nm, while the Instaspin "User_computeTorque" - Function shows something in the range of 10^-7 to 10^-8, so it is way off.

The motorparameters are evaluated according to lab 2a as follows, the estimate didnt change in several trial runs:

#define USER_IQ_FULL_SCALE_FREQ_Hz        (500.0)
#define USER_IQ_FULL_SCALE_VOLTAGE_V      (42.0)   // 24.0 Set to Vbus
#define USER_ADC_FULL_SCALE_VOLTAGE_V       (44.30)  // BOOSTXL-DRV8305EVM = 44.30 V
#define USER_IQ_FULL_SCALE_CURRENT_A         (24.0) // BOOSTXL-DRV8305EVM = 24.0 A
#define USER_ADC_FULL_SCALE_CURRENT_A        (47.14)  // BOOSTXL-DRV8305EVM = 47.14 A

#elif (USER_MOTOR == elfkw)

#define USER_MOTOR_TYPE                 MOTOR_Type_Pm
#define USER_MOTOR_NUM_POLE_PAIRS       (23)
#define USER_MOTOR_Rr                   (NULL)
#define USER_MOTOR_Rs                   (0.2127705902)
#define USER_MOTOR_Ls_d                 (0.0005847931606)
#define USER_MOTOR_Ls_q                 (0.0005847931606)
#define USER_MOTOR_RATED_FLUX           (0.2603323162)
#define USER_MOTOR_MAGNETIZING_CURRENT  (NULL)
#define USER_MOTOR_RES_EST_CURRENT      (4.0)
#define USER_MOTOR_IND_EST_CURRENT      (-4.0)
#define USER_MOTOR_MAX_CURRENT          (24.0)
#define USER_MOTOR_FLUX_EST_FREQ_Hz     (10.0)

The function to get the torque estimate gets called like this:

gMotorVars.Torque_Nm = USER_computeTorque_Nm(handle, gTorque_Flux_Iq_pu_to_Nm_sf, gTorque_Ls_Id_Iq_pu_to_Nm_sf);

Is the resulting value maybe scaled in kNm? But even then the values are way too small in my opinion. What could be the reason for this?

Another question regards the setting of the Iq_ref value. Since i want to calculate the iq_ref value from the desired torque (as in desired torque / 1.5 / USER_MOTOR_NUM_POLE_PAIRS / gMotorVars.Flux_Wb) i would guess i just input the result into iq_ref, or should this value be converted to pu first?

  • The unit of this torque calculation function is N.m, and the calculation formula in this function is Tem (N.m) = (3P/2)* Rotor Flux (Webers) * Iq (Amps) since Ld=Lq of the motor. So you might monitor the Id and Iq to verify the calculation output.
    Btw, the unit of Rotor Flux is Webber that equal to USER_MOTOR_RATED_FLUX /(2*PI()) since its unit is V/Hz in user.h.
    Yes, you need to do this, all values will be converted to per units (pu) for control in instaSPIN-FOC.
  • First of all thanks for the quick reply. I guess the formula i use should then work.

    I finally found the problem which leads to the wrong torque estimation: Some functions where only implicitly declared (especially the calculation functions of the scaling factors seems to be a problem), which somehow produced a working motor controller but totally wrong torque readings. After adding matching declarations in my .c file the calculation now seems correct.