Jun 09, 2020
06:08 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 09, 2020
06:08 AM
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 */
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 */
- Tags:
- IFX
3 Replies
Jun 10, 2020
06:21 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 10, 2020
06:21 AM
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.
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.
Jun 11, 2020
01:05 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 11, 2020
01:05 AM
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
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
Jun 16, 2020
04:47 AM
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Jun 16, 2020
04:47 AM
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.
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.