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.

calculate supply current from InstaSpin FOC signals

Other Parts Discussed in Thread: TMS320F28069M

Hello,

I am using TI InstaSpin FOC software on a TMS320F28069M, integrated in a high voltage board with PMSM motor.

Actually I am faced to the task, to calculate the current, which my board sinks from the supply.

Because there is no current sensor in the supply line, the idea is to do the calculation from given signals of TI InstaSpin FOC software.

Following the thread

https://e2e.ti.com/support/microcontrollers/c2000/f/902/p/470634/1693712#1693712

there is given the approach over calculating motor-power and divide this by the supply voltage:

motor power + inverter losses = buss power.

P_motor = (Vd * Id + Vq * Iq) * 1.5

P_buss = P_Motor * 1.04 (assuming 4% inverter losses)

I_buss(avg) = P_buss / V_buss

 

After I implemented this calculations in a cyclic task and did some tests I found out, that it works in principal, but that there is a systematical mismatch dependant from supply voltage.

I.e. on the test rig, when the motor is operating in a constant load situation (speed, torque= constant) and the supply voltage is increased from min. to max. supply level, the calculated power (P_motor) is decreasing.

Monitoring the input signals for the P_motor calculation, I found out, that the signals Iq and Id stay constant during the test, but the signals Vq and Vd decrease with increasing supply voltage. In effect the calculated motor power decrease, instead staying constant.

From my understanding, the Vq and Vd signals should not vary, when Iq and Id are constant (at constant motor speed and torque).

In fact, the power which is delivered from the supply does not vary, but the calculated motor power varies with changing supply voltage.

 

Below some results from the measurement.

First 3 columns show the values from the power supply.

Next 4 columns show the InstaSpin FOC signal values.

The last 2 columns show the calculated power and supply current (losses ignored).

calculated
Power
Supply
[W]
measured
Power
Supply
[V]
measured
Power
Supply
[A]
InstSpin
I_q
[A]
InstSpin
I_d
[A]
InstaSpin
V_q
[V]
InstSpin
V_d
[V]
calculated
Motor
Power
[W]
calculated
Input
current
[A]
ratio
motor
power
calc./
input
 
3150 250 12,6 18 4,8 173,16 93,24 5346,648 21,39 0,58915418
3164 280 11,3 18 4,8 155,4 79,92 4771,224 17,04 0,6631422
3180 300 10,6 18 4,8 142,08 75,48 4379,616 14,60 0,72609105
3185 325 9,8 18 4,8 128,76 71,04 3988,008 12,27 0,79864434
3185 350 9,1 18 4,8 119,88 62,16 3684,312 10,53 0,86447619
3225 375 8,6 18 4,8 115,44 62,16 3564,432 9,51 0,90477249
3200 400 8 18 4,8 106,56 57,72 3292,704 8,23 0,97184563
3239 410 7,9 18 4,8 102,12 53,28 3140,856 7,66 1,03124753
3234 420 7,7 18 4,8 97,68 48,84 2989,008 7,12 1,08196432

 

What is the fundamental mistake in this scenario ?

 

Friendly regards

Martin

  • Calculate the input and output power of motor as below

    Pin_motor = (Vrms*Irms)*sqrt(3) = (Va_rms*Ia_rms + Vb_rms*Ib_rms + Vc_rms*Ic_rms)/sqrt(3), need to calculate the RMS of phase voltage and current first.
    Pout_motor = Torque(N.m)*Speed(rpm)/9550

    And then calculate supply current as below
    Iin_dcbus = Pin_motor/Vin_dcbus/k, k is the inverter efficiency which is about 0.94~0.98.

  • Hello Yanming,

    thanks for your proposal, but the description is a very generally way to calculate the motor power from  AC signals.

    I would use this, if I had 'traditional' measurement equipment in the motorlines (like currentclamps and voltage meters) .

    And I think, I would need to consider although the phase between current and voltage, when I am using AC signals.

       

    I am looking for a solution, using the TI InstaSpin FOC signals, which are already transformed into 'steady' signals, like  Iq, Id and so on.

    Friendly regards

    Martin

  • Three phase Voltage and Current have been sensed in InstaSPIN, so you could using these signal to calculate Vrms and I rms. As you said, this is a generally way, but it is more precise, and is often used in industry inverter and automotive.
    Another way, you may try to use motor output power to estimate the input current
    Pout_motor(w) = Torque(N.m)*Speed(rpm)/9.549, Torque can be get from InstaSPIN-FOC.
    Iin_dcbus = Pout_motor/Vin_dcbus/k1/k2, k1 is the inverter efficiency which is about 0.94~0.98, k2 is the motor output efficiency which is about 0.6~1.0(k2 is lower with light load, and is higher with heavy load).
  • Hello Yanming,

    from my understanding, one big advantage of TI InstaSpin FOC software is, that currents and voltages are transformed from AC scope to DC scope. So you can control the machine like a DC Motor.

    I walked through the software and found no spots, where Vrms or Irms are calculated or used.
    It seems to me to go a step back, if I would recalculate AC signals from DC scope.
    Another disadvantage of power calculation with AC signals is, that the phase information between voltage and current is needed.

    Or am I completely wrong, when interpreting your Vrms and Irms as AC signals ? (supposing rms does mean 'root mean square')


    Starting supply current calculation from motor output power (speed,torque) will not be accurate enough, due to operating point dependant efficiency of the motor.


    So maybe you can provide a solution closer to the issue of my first post ?


    Friendly regards

    Martin
  • Please refer to below solution using InstaSPIN-FOC as your first post, the current is not very accurate, but may is close to input current.

    // calculate inverter output power in kW
    gMotorVars.Power_coef = _IQmpy(_IQ(1.0*1.5/0.96), gMotorVars.VdcBus_kV); // _IQ(1.0*1.5/0.96) for MW16

    gMotorVars.Power_kW = _IQmpy((_IQabs(_IQmpy(gMotorVars.Vd, gMotorVars.Id_A)) + _IQabs(_IQmpy(gMotorVars.Vq, gMotorVars.Iq_A))), gMotorVars.Power_coef);

    gMotorVars.Iin_A = _IQdiv(gMotorVars.Power_kW, gMotorVars.VdcBus_kV);
  • Hello Yanming,

    the proposal seems to me unplausible, because regarding the physical types
    - the variable 'gMotorVars.Power_coef ' is from type 'voltage'
    - the variable 'gMotorVars.Power_kW ' is from type 'power*voltage'
    - in result the variable 'gMotorVars.I_in_A ' is from type 'power'


    Friendly regards

    Martin
  • In InstaSPIN-FOC lab projects, gMotorVars.Vd and gMotorVars.Vq as below is a scale voltage from _IQ(-0.5)~_IQ(0.5) for MW15 or _IQ(-1.0)~_IQ(1.0) for pre-MW15, not a real voltage value, so need to multiply the dc bus voltage to get the real value. Use the variable 'gMotorVars.Power_coef ' to convert Vd&Vq from the scale value to kV.

    // read Vd and Vq vectors per units
    gMotorVars.Vd = CTRL_getVd_out_pu(ctrlHandle);
    gMotorVars.Vq = CTRL_getVq_out_pu(ctrlHandle);

      // 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));

  • Hello Yanming,

    thank you for your support.

    With latest information, the issue is clear.

    I implemented the current calculation as suggested and everything works fine now.

    Friendly regards

    Martin Bayer

  • Hi Martin,

    Great. Thanks for your information.