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.

TMS320F28062: PU calculation in application Note

Part Number: TMS320F28062


Hi,

Can anyone explain how below conversation works? 

clarke1.As =_IQ15toIQ((AdcResult.ADCRESULT0<<3)-_IQ15(0.50))<<1;

Piccolo devices have 12-bit ADC and 16-bit ADC registers. The AdcResult.ADCRESULT registers are right justified for Piccolo devices; therefore, the measured phase current value is firstly left shifted by three to convert into Q15 format (0 to 1.0), and then converted to ac quantity (± 0.5) following the offset subtraction. Finally, it is left shifted by one (multiplied by two) to normalize the measured phase current to ± 1.0 pu.

How do I get -1 to +1 range for given 0 to 2^12 counts? 

  • Daniel,

    I believe you already answered your question

    Piccolo devices have 12-bit ADC and 16-bit ADC registers. The AdcResult.ADCRESULT registers are right justified for Piccolo devices; therefore, the measured phase current value is firstly left shifted by three to convert into Q15 format (0 to 1.0), and then converted to ac quantity (± 0.5) following the offset subtraction. Finally, it is left shifted by one (multiplied by two) to normalize the measured phase current to ± 1.0 pu.

    I am not sure what exactly you want us to explain, the above explaination is accurate... you get +/-1.0 by assuming the AC signal is centered at 0.5, and hence you subtract by 0.5.

    regards
    Manish