TLE9879 FOC single shunt current sensing : How to know the real (physical) values

Announcements

Webinar: Integrated solutions for smaller, simpler low-voltage motor control design.
Join the webinar to experience!

Tip / Sign in to post questions, reply, level up, and achieve exciting badges. Know more

cross mob
User19528
Level 2
Level 2
First like received
Hello

In the BLDC sensorless FOC example the two phase current Ia & Ib are estimated base on the single shunt current sensing and by knowing commutation sector , the estimation is done inside Emo_CurrAdc1() function
Could you please tell me how to know the real value (in Amp) of the two phase current A & B ?
Emo_Svm.PhaseCurr.A (in Amp)
and
Emo_Svm.PhaseCurr.B (in Amp)
In the code we have only the scaled values in sint16

void Emo_CurrAdc1(void)
{
sint16 AdcResult0;
sint16 AdcResult1;
uint16 sector;
sint16 R0mioffs;
sint16 OffsmiR1;
sint16 R1miR0;
/*AdcResult[2] => 1st ADC Meas. **
**AdcResult[1] => 2nd ADC Meas. */
AdcResult0 = Emo_AdcResult[2u] & 0x0FFFu;
AdcResult1 = Emo_AdcResult[1u] & 0x0FFFu;
Emo_AdcResult[3u]=AdcResult0+AdcResult1;
/*result 0 minus CSA Offset*/
R0mioffs = AdcResult0 - Emo_Svm.CsaOffsetAdw;

/*CSA Offset minus result 1*/
OffsmiR1 =Emo_Svm.CsaOffsetAdw - AdcResult1;
/*Result 1 - Result 0*/
R1miR0 = AdcResult1 - AdcResult0;
/* Calculate currents according to sector number */
sector = Emo_Svm.StoredSector1;

switch (sector)
{
case 0:
{
Emo_Svm.PhaseCurr.A = R0mioffs;
Emo_Svm.PhaseCurr.B = R1miR0;
}
break;

case 1:
{
Emo_Svm.PhaseCurr.A = R1miR0;
Emo_Svm.PhaseCurr.B = R0mioffs;
}
break;

case 2:
{
Emo_Svm.PhaseCurr.A = OffsmiR1;
Emo_Svm.PhaseCurr.B = R0mioffs;
}
break;

case 3:
{
Emo_Svm.PhaseCurr.A = OffsmiR1;
Emo_Svm.PhaseCurr.B = R1miR0;
}
break;

case 4:
{
Emo_Svm.PhaseCurr.A = R1miR0;
Emo_Svm.PhaseCurr.B = OffsmiR1;
}
break;

case 5:
{
Emo_Svm.PhaseCurr.A = R0mioffs;
Emo_Svm.PhaseCurr.B = OffsmiR1;
}
break;
default:
{
/* unexpected error => halt motor, reset device */
Emo_StopMotor();
}
break;
}

/*prepare sector number for next period*/
Emo_Svm.StoredSector1 = Emo_Svm.Sector;
} /* End of Emo_HandleAdc1 */
0 Likes
3 Replies
Elettrograffiti
Employee
Employee
Hi! You can find this information in the UM:
https://www.infineon.com/dgdl/Infineon-TLE9879QXA40-UM-v01_04-EN.pdf?fileId=5546d4624e24005f014e52ca...

Using this formulas you can calculate back the value of the differential voltage VOP2-VOP1, which is what actually the ADC is going to measure. Then you can calculate back the value of the current through your sensing resistor by dividing VPO2-VPO1 by its resistance.
4418.attach
0 Likes
User19528
Level 2
Level 2
First like received
Hello,

Thank you for your feedback.
The formula allow as to deduce the value of the DC current. My question concerns the values of the two phase current in amp (EmoSvm.PhasCurr.A & EmoSvm.PhasCurr.B). I mean the sinusoidal currents
Thanks in advance for your support
0 Likes
Elettrograffiti
Employee
Employee
The formula gives you the value of the measured current flowing in the sense resistor at the time instant it was sampled by the ADC, regardless this current waveform.
You can read more about the phase A and B current reconstruction in this AppNote in chapter 4.1:
https://www.infineon.com/dgdl/Infineon-TLE987x-Sensorless-Field-Oriented-Control-ApplicationNotes-v0...
to convert these two sample current values in amperes you can use the same conversion formula s they are sampled by the same ADC channel.
0 Likes