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.

CCS/TMS320F28035: RMS calulation with unknown AC input voltage frequency

Part Number: TMS320F28035
Other Parts Discussed in Thread: C2000WARE-DIGITALPOWER-SDK, C2000WARE

Tool/software: Code Composer Studio

hello sir/madam,

i want to calculate the AC input voltage RMS which frequency range is from 40-65HZ.

the sampled signal to ADC is a sine wave from 0 -3V.

previously i implemented this by detecting a max value, but when is system is running(our product is a high power related), there maybe some noise and the result precision is not good.

so i think to get RMS maybe lead to a better result.

do you have some suggestion on 

1. how many samples and sample rate should be used, since the frequency of the input signal is variable?

2. in order to calculator the RMS. the operation of *, / , and squr() will be used which is time consuming. Does TI have some library function to support this?

thank you in advance for the relay.

  • 1. The most calculation expensive solution is to filter source signal with FIR or PLL, then calculate RMS over the cycle on zero crossing.

    2. Another option is to append zero crossing insensivity region, as it made in POWER_MEAS_SINE_ANALYZER.h

    As you use MCU without FPU, you can either use IQMath (TI has well documented library for fixed point math), or move calculations to CLA (CLAmath library has its own implementations of most math functions). 

    Anyway, please look at C2000Ware Digital Power SDK, you may find some of its libraries helpful.

  • hello sir,

    could you provide more information on the POWER_MEAS_SINE_ANALYZER.h?

    where i can find the reference for it?

    thank you very much

  • >where i can find the reference for it?

    1. Download and install C2000Ware Digital Power SDK ti.com/tool/c2000ware-digitalpower-sdk

    2. In product folder, library is found at C2000Ware_DigitalPower_SDK_xx_xx_xx_xx/libraries/power_measurement (where xx_xx_xx.. is version currently installed)

    3. In product folder documentation can be found at C2000Ware_DigitalPower_SDK_xx_xx_xx_xx/docs/Digital_Power_Library_Users_Guide-x.xx.xx.xx.pdf