| Author |
Message |
et.vinny
Joined: 15 Dec 2005 Posts: 3
|
15 Dec 2005 15:50 Measure RMS |
|
|
|
|
Heloo, this is my first post, excuse my bad English, therefore it is not my native language.
I am wanting to mount a measurer of tension AC, in the PIC.
My problem is in the account to calculate the RMS, therefore it is using much memory of the PIC, therefore it is in C. Somebody would have some code to calculate RMS, in ASM, or C but ligth?
Using PIC16F876 or PIC16F877
Thaks
ET
|
|
| Back to top |
|
 |
Google AdSense

|
15 Dec 2005 15:50 Ads |
|
|
|
|
|
|
| Back to top |
|
 |
Tohu
Joined: 09 Jun 2004 Posts: 97 Helped: 12
|
15 Dec 2005 18:33 Re: Measure RMS |
|
|
|
|
| What be type of the signal, you know the form /sin, square etc./or this is random AC signal ?
|
|
| Back to top |
|
 |
et.vinny
Joined: 15 Dec 2005 Posts: 3
|
15 Dec 2005 20:31 Re: Measure RMS |
|
|
|
|
Is sin, for eletric energy.
Thaks
ET
|
|
| Back to top |
|
 |
xxargs
Joined: 28 Jul 2002 Posts: 231 Helped: 44
|
16 Dec 2005 0:39 Re: Measure RMS |
|
|
|
|
| et.vinny wrote: |
Is sin, for eletric energy.
Thaks
ET |
if only one sinus carrier at AC-insignal, is easy (0.7071 * Up-p)/2 = voltage RMS
Up-p is measured voltage peak to peak.
---
but if measure complex multi frequency and noise signal is more difficult.
remember RMS means 'root mean square' and represent powers heat disspated from resistance with any wave form Voltage (from GHz to DC) equal as DC-voltage over same resistance for same power disppased.
In time discrete way, using square of input signal value (eg. make power-slice of sampel), integrate over the time (sum value of couple of power-slice, ex 256 sampel) and take out 1 sampel part of power in sum of power-slice (1/256 of sum value - ie median value) and take square root of this value and you have RMS voltage for this aktual 256 sampel window..
you need also take away exactly same amount of power from sum you put in 256 step before - ie need remember 256 sampel value ala fifo.. - or sum value run up like KWh-meter... or you need make discharge routin for sum as simular RC-circurits or higer order filter (lot of float-number calculate...)
- or using analog voltage to RMS-converter circurit before PIC input - is using analog quadratic circurit (and also handle very high frequency without aliasing problem compare to sampel rate ala PIC), RC-circurit/intergrator to make intergration of power and also discharge of this on 'natural' time-discrete way, and analog square root-circurit last step to give RMS-value out.
/xxargs
|
|
| Back to top |
|
 |
smxx
Joined: 18 Aug 2005 Posts: 188 Helped: 8 Location: iran(ahwaz)
|
18 Dec 2005 8:07 Measure RMS |
|
|
|
|
hi
for sine wave ,if you have 2 sample with 90 angle(y(Θ)and y(Θ+90))
you can calculate peek of signal
Ym˛=y(Θ)˛+y(Θ+90)˛ Yrms=Ym/√2
|
|
| Back to top |
|
 |
Eric Best
Joined: 03 Sep 2001 Posts: 57 Helped: 12
|
18 Dec 2005 21:14 Re: Measure RMS |
|
|
|
|
rms value can be measured beforehand by hardware using one of available rms converters from Maxim or Analog Devices like AD736, 737 etc. although in this case I think it would be luxury
Best Regards
Eric
|
|
| Back to top |
|
 |