Other Parts Discussed in Thread: C2000WARE
Tool/software: Code Composer Studio
Hi,all
I got a adc value buffer with 20points, the range of each value is 0-4095, so current I = (ADVALUE*3.3/4095)*5, 5 is current-adVoltage ratio ,below is how I calculate it.
1. Calculate the current value for each data in the array, I = (ADVALUE*3.3/4095)*5
2. calculage RMS ,Irms = sqrt((I1^2 + I2^2 + I3^2 +...)/20)
There is also a method i can think of,
1.Calculate the RMS of ADrms = sqrt((buff[1]^2 + buff[2]^2 + buff[3]^2 +...)/20)
2.Multiply by a coefficient,Irms = k* ADrms, k = sqrt(3.3*5/4095)
Through debugging, i found It takes up too many clock cycles.
I don't know how to handle these formulas with IQmath libraries.
Can anyone provide a reference method?
thanks in advance