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.

TMS320F28027F: how to retrieve the instantaneous current reading with instaSPIN

Part Number: TMS320F28027F


My customer is trying to determine whether a phase is missing from the motor connections. The idea is to compare the readings of all three currents, account for the 120° phase shift, and establish a normal difference among them. If that difference is greater than expected, then a phase is missing. The question is: what is the variable to be monitored? Would it be Idq_in in the structure _CTRL_Obj_ ?

Thank you!

  • It's better to use the phase current to check whether a phase is missing connections by gAdcData.I. Customer can calculate the sum of absolute gAdcData.I.value[n] with motor speed frequency. If the sum of phase current is less than a threshold value, it means a connection missing.
  • Yanming,

    I played with different current readings, including the gAdcData.I, but could not reach anything conclusive. I tried summations, comparisons, and peak values. Do we have any experience detecting missing phases in a motor? If so, can you share a code example?

    Thank you!
  • Please refer to below codes for a simply phase lost detection, define global variables, and run these codes in ISR.

    gMotorVars.IadcSum[0] += (_IQabs(gAdcData.I.value[0])>>3); // gAdcData.I.value[n] without offset, so the value is _IQN(-1.0) to _IQN(1.0)
    gMotorVars.IadcSum[1] += (_IQabs(gAdcData.I.value[1])>>3);
    gMotorVars.IadcSum[2] += (_IQabs(gAdcData.I.value[2])>>3);

    gMotorVars.IadcCount++;

    if(gMotorVars.IadcCount > 4096) // Set a correct for different running frequency
    {
    gMotorVars.IadcCount = 0;

    gMotorVars.IadcAvg[0] = (gAdcData.I.value[0]) + gMotorVars.IadcSum[0])>>1;
    gMotorVars.IadcSum[0] = 0;

    gMotorVars.IadcAvg[1] = (gMotorVars.IadcAvg[1] + gMotorVars.IadcSum[1])>>1;
    gMotorVars.IadcSum[1] = 0;

    gMotorVars.IadcAvg[2] = (gMotorVars.IadcAvg[2] + gMotorVars.IadcSum[2])>>1;
    gMotorVars.IadcSum[2] = 0;
    }

    if( (gMotorVars.IadcAvg[0] < gMotorSets.IrmsLostPhaseSet)
    || (gMotorVars.IadcAvg[1] < gMotorSets.IrmsLostPhaseSet)
    || (gMotorVars.IadcAvg[2] < gMotorSets.IrmsLostPhaseSet))
    {
    if(gMotorVars.PhaseLostFaultTimeCnt > gMotorSets.PhaseLostSet) // 1000ms/1s
    {
    gMotorVars.FaultFlagNow.bit.MotorLostPhase = 1;
    }
    else
    gMotorVars.PhaseLostFaultTimeCnt++;
    }
    else if(gMotorVars.PhaseLostFaultTimeCnt > 2)
    gMotorVars.PhaseLostFaultTimeCnt -=2;
    else
    gMotorVars.PhaseLostFaultTimeCnt = 0;