I found a post about power calculation: https://e2e.ti.com/support/microcontrollers/c2000/f/902/t/406263
// 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);
The data about motor power I got correct may seem right,but the data about input power was incorrect .
The bus voltage was 72V, the bus current was 0.2A and Iq_ref was 3A,but input power was -228.8316W The screenshot below:
Not only that,,but sometimes it became a positive value 351.1326: