> Edson Brusque wrote: > > > > As to RMS vs averaging, that's what the original question was > > > about. I > > just > > > didn't know if doing an RMS calculation had any benifits over just > > averaging the > > > input signal (better noise immunity, more accurate, more linear, > > > etc....). > > > > RMS would give you a *more number. > > > > Let's say you have a dimming application, where your circuit is > > connected to mains power @ 220V and you're firing the triac at 90:. > > You're measuring the voltage going to the load. If you average your > > measuring, it will say 110V. RMS will say about 155V. Now, if you > > rectify and "regulate" the energy going to the load (with full-cycle > > rectifying, 4 diodes and a capacitor) and measure it with a > > voltmeter, it will give you a value very close to that 155V. > > > This is wrong, with 90' switching there is exactly > half the voltage average and half the rms voltage. > (and how do you make that "degrees" symbol??) :o) > > So now i'm confused! Isn't RMS just calculating the > AC average?? I was taught that the only point to > squaring this and then doing a square root is that > this is only math way of making negative values > positive for averaging. > > As programmers we have more power than mathematicians, > we are not limited to: > 1. square it > 2. average it > 3. unsquare it > > We can just do the following: > 1. convert - values to + > 2. average it > > Or have I missed something?? Does anyone think we > MUST do square and square-root calcs in our PICs > and why?? > -Roman > > -- This was also my assumption in an earlier mail on this thread. This simplification only works with a DC value, which is of little use when calculating RMS. A simple example will show the difference: Given 5 samples of a rectified voltage: 2, 5, 5, 2, 1. Which gives the average value of (2+5+5+2+1)/5=3. But the RMS value of this is: sqr((2^2+5^2+5^2+2^2+1^2)/5)=3.435. This has to do with the fact that the RMS value for a voltage is the same value that a DC voltage would have to be to produce the same power over the same load. Power is the key word here, since increasing the voltage gives a squared increase in power over the same load. ============================== Ruben Jvnsson AB Liros Elektronik Box 9124, 200 39 Malmv, Sweden TEL INT +46 40142078 FAX INT +46 40947388 ruben@pp.sbbs.se ============================== -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads