One cycle 50/60Hz RMS Calculation

Why not sample at your 6 KHz and software lowpass filter? Output a new smoothed value every ADC sample, 6K times a second. That may well be more representative of whatever process you have that matters. It's easy, too.

--

John Larkin         Highland Technology, Inc 

Science teaches us to doubt. 

  Claude Bernard
Reply to
jlarkin
Loading thread data ...

Low pass filtering on the most recent N values and trip if above some threshold might be one easy way to go. It seems you don't actually care about RMS values so much as a trigger condition that is not susceptible to noise spikes. A humble boxcar average over a cycle would probably do and you can implement that as a cyclic buffer and an accumulator.

BTW if this is for something safety critical beware of the possibility that the code gets itself into a non-executing state due to a mains glitch or other electrical interference. I once saw a control system where the only process left working was the one that pumped the dead man's handle. It didn't realise it needed to reboot so it didn't :(

In another example arc welding work in a neighbouring bay caused a CNC machine to ram a tool right through the job, bending the lathe bed.

--
Regards, 
Martin Brown
Reply to
Martin Brown

Watchdogs are frequently misunderstood and done poorly. Many years ago I w orked on a project where we discovered a great many ways to do it wrong. O n another project the software team made the watchdog pump an interrupt bas ed routine that could continue to function when everything else was dead. That didn't survive design review.

That's just poor design on many levels. The first level is a PSU that didn 't detect the poor incoming power and shut everything down. Another big pr oblem was designing a tool in a way that did not protect the tool from itse lf.

Mains "glitches" should never cause a problem. Either detect the "glitch" and shut down the process safely, or better... build the PSU so "glitches" don't disrupt the power, in proportion to the importance of a problem. In other words, don't design a CNC tool with the same methodology you would ap ply to a home router.

--

  Rick C. 

  + Get 1,000 miles of free Supercharging 
  + Tesla referral code - https://ts.la/richard11209
Reply to
Ricketty C

So, which one AC cycle do you want to measure ?

All of them ? Or just one particular cycle ?

Should be simple as measuring any AC cycle as long as you start and stop from:to the same point in the cycle.

Square samples, average, take the square root.

Reply to
boB

ElectronDepot website is not affiliated with any of the manufacturers or service providers discussed here. All logos and trade names are the property of their respective owners.