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.

F28027 + DRV8301 motor power measurement

Other Parts Discussed in Thread: BOOSTXL-DRV8301

Hello,

 

I am trying to measure the power consumed by a motor. I am using a launchpadXL-F28027 with a boostXL-DRV8301 and a BLDC motor. I am using example project proj_lab05a. In the mainISR, I read back the currents:

// read Id and Iq vectors in amps

gMotorVars.Id_A = _IQmpy(CTRL_getId_in_pu(ctrlHandle), _IQ(USER_IQ_FULL_SCALE_CURRENT_A));

gMotorVars.Iq_A = _IQmpy(CTRL_getIq_in_pu(ctrlHandle), _IQ(USER_IQ_FULL_SCALE_CURRENT_A));

// calculate vector Is in amps

gMotorVars.Is_A = _IQsqrt(_IQmpy(gMotorVars.Id_A, gMotorVars.Id_A) + _IQmpy(gMotorVars.Iq_A, gMotorVars.Iq_A));

 

Eventually, I want to multiply this Is by gMotorVars.VdcBus_kV (divided by 1000 to get watts). The currents that are read vary a lot, so I apply a low-pass filter:

Is_lowpassed += _IQmpy(_IQ(0.001), gMotorVars.Is_A - Is_lowpassed);

Iq_lowpassed += _IQmpy(_IQ(0.001), gMotorVars.Iq_A - Iq_lowpassed);

 

The Iq_lowpassed matches the Iq_ref_A. The Is_lowpassed is slightly higher due to Id current.

The problem I am experiencing right now, is that the Is_lowpassed does not match the actual current as measured by a multimeter. Here are some measurements I have taken:

iq_ref  Actual   Is
0.5     0.082    0.64
1        0.216    1.27
1.5     0.429    1.9
2        0.75      2.53
2.5     1.216    3.16
3        1.757    3.79

If I use the Is values, and multiply it by the bus voltage, I get a power that's way more than what the PSU is delivering. What am I missing here?

PS I couldn't format this post properly as the inserting windows wouldn't load..

  • try also capturing and multiplying in the Vs factor. The voltage being applied to the motor for any given Is current is the Vbus * Vs / 1.33
    (this 1.33 factor is included because we normalized Vs to 1.0 for the peak of the sine wave; a value of 1.33 is "full" voltage).

    in your own design if this is something you care about you may want to add a bus current measurement which will make this easier
  • Thank you for your reply.

    The Vs you are talking about, is this the Vs out (before going into the SVM) or the Vs in (the output of the clarke transform)? How would I get these values?

    I have tried the following:
    _iq Vd = CTRL_getVd_out_pu(ctrlHandle);
    _iq Vq = CTRL_getVq_out_pu(ctrlHandle);
    _iq Vs = _IQsqrt(_IQmpy(Vd, Vd) + _IQmpy(Vq, Vq));
    Vs = _IQmpy(Vs, _IQmpy(gAdcData.dcBus,_IQ(USER_IQ_FULL_SCALE_VOLTAGE_V))); // multiply by bus voltage
    Vs = _IQmpy(Vs, _IQ(1/1.33));

    The result was at least proportional to the actual current usage as measured by PSU, but it was still quite a bit off. If I leave out the division by 1.33, the result is actually quite close to the expected value.

    Maybe I need to scale the Vd and Vq values?
  • gMotorVars.Vs
    is added in proj_lab09 and 10
    it will saturate to the limit set by
    gMotorVars.OverModulation
    in proj_lab10
    or to the user.h variable USER_MAX_VS_MAG_PU in lab09

    // calculate vector Vs in per units
    gMotorVars.Vs = _IQsqrt(_IQmpy(gMotorVars.Vd, gMotorVars.Vd) + _IQmpy(gMotorVars.Vq, gMotorVars.Vq));

    These are the outputs of the Iq and Id controllers going to the inverse Park module.
    The inverse Park feeds the SVM.


    "If I leave out the division by 1.33, the result is actually quite close to the expected value."

    Hmmm. Maybe I'm wrong about the 1.33 factor then...let me see if I can get clarification.
  • Sander,
    We discussed this and here is our recommendation.



    // Equations for input power
     

    float_t input_power_sf = _IQtoF(gAdcData.dcBus) * (float_t)(0.5 * USER_IQ_FULL_SCALE_VOLTAGE_V * USER_IQ_FULL_SCALE_CURRENT_A);

      float_t input_power_W = Input_power_sf * _IQtoF(_IQmpy(gPwmData.Tabc.value[0], gAdcData.I.value[0]) +
    _IQmpy(gPwmData.Tabc.value[1], gAdcData.I.value[1]) +
    _IQmpy(gPwmData.Tabc.value[2], gAdcData.I.value[2]));

    // Equations for motor power
    float_t motor_power_W = _IQtoF(gMotorVars.Torque_Nm) * _IQtoF(gMotorVars.Speed_krpm) * (float_t)(MATH_TWO_PI * 1000.0 / 60.0);

    We recommend using one of the floating point examples, like lab 3c of the 28069M to have these floating point operations execute faster.

  • It turns out your original suggestion of multiplying Is by Vs works fine (including the division by 1.33). The board I was using had the DC_CAL signal moved to another pin (because we needed UART on external pins). This caused the shunt measurements to be disabled, indirectly causing the behaviour I was seeing.

    I have also tried your second suggestion. I like that solution because it doesn't need two sqrt calculations. Are you sure about the input_power_sf though? The input_power_W is too high by a factor of almost 2.

    Anyway, I'm using the first solution now. I'll mark the question as awnswered. Thanks a lot for your help.

  • Sander Bosma said:
    I have also tried your second suggestion. I like that solution because it doesn't need two sqrt calculations. Are you sure about the input_power_sf though? The input_power_W is too high by a factor of almost 2.

    Good catch!  The maximum peak of the voltage waveform is 1/2 of Vbus.  It should be:

     

    float_t input_power_sf = _IQtoF(gAdcData.dcBus) * (float_t)(0.5 * USER_IQ_FULL_SCALE_VOLTAGE_V * USER_IQ_FULL_SCALE_CURRENT_A);

    and I've updated in my previous post for posterity.

    Sander Bosma said:
    It turns out your original suggestion of multiplying Is by Vs works fine (including the division by 1.33).

    This is probably true for steady state, but won't take into account what is happening during dynamic situations, especially if the field oriented angle is momentarily not aligned quite right.  But may be good enough for your uses.

  • Hey there, way to dredge up and old post but here we go.

    I am using the calculations, provided by you Chris, above, with a F28052F, running under lab 10e. With the 0.5* modifier, for the input power, the actual value is coming out at roughly half of what is expected. If I remove the modifier everything appears in line with the amount of power my bench PSU appears to be providing.

    Is this to be expected, when running the different lab, or more importantly, with the different chip?

    With the 0.5 scale factor in place, the motor power, which is so obviously easy to calculate, comes out significantly higher than the input power, obviously this isn't correct.

    Many thanks,

    Matt.