Roman Black wrote... >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....). >>=20 >> RMS would give you a *more number. >>=20 >> 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=BA. = 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) Half the power and half the average absolute voltage, but not half the rms voltage: you get 0.707 x the original rms voltage. >So now i'm confused! Isn't RMS just calculating the >AC average??=20 Absolutely not. >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. I don't think he understood the significance of rms, then. >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 These two processes produce TOTALLY different results. The first calculates the rms value of an AC signal, the second calculates the average absolute voltage. >Or have I missed something?? Does anyone think we >MUST do square and square-root calcs in our PICs >and why?? You do if you want to actually calculate rms; if all you want to find is the average of the absolute value, then no. Several companies make analog ICs that process an input waveform and produce a DC output voltage proportional to the rms value of the input; the Analog Devices AD736 is one of these, and if you go to their website and read the datasheet for that part it has a simple, but good discussion of the math. Dave -- http://www.piclist.com hint: PICList Posts must start with ONE topic: [PIC]:,[SX]:,[AVR]: ->uP ONLY! [EE]:,[OT]: ->Other [BUY]:,[AD]: ->Ads