Maker Pro
Maker Pro

AC circuit (120v single phase) smooth to a10 sec. average voltage sine wave

hevans1944

Hop - AC8NS
Jun 21, 2012
4,880
Joined
Jun 21, 2012
Messages
4,880
You will already have the "live" and "averaged" values (as digital representations) in the two FILO buffers. All you need to do is subtract the first buffer (inverting the sine wave) from the second buffer, point by point, to obtain what you seek. All in real time of course.
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
Hi again all,
Wow, thanks for all the interest, and for all your considerations. And yes Bob, you have correctly explained my initial question. And Hevans, thank you,... a LOT of good info there I'm sure, but I am disappointed to hear it is not as simple as I'd hoped.. I'm really trying to keep this as simple as possible.
It seems though, there is a great amount of interest in the overall purpose of this endeavor.
This first "AC averaging" is just step 1. After this is done (however decided), I want to invert the live (realtime) AC, and add the two together (averaged & realtime). --A very small voltage now. Ultimately this summed AC is what I want to measure.
So it'd end up with just the realtime voltage fluctuation. Now you see why I can't use a UPS or clean power-- I want the unclean power-fluxes to measure. The mention above of an integrator made me wonder if I could use a Differentiator--since this is ultimately what I want. But I dont think you can do this with AC, since it's varying all the time.

Any more thoughts, insights, suggestions ??
And thanks again for all your help,

David K
Bob your just too good :)
 

David Kimbley

Jun 3, 2015
16
Joined
Jun 3, 2015
Messages
16
Hi Hevans, I do see what you're suggesting, and eventually I did want it to go digital, but I was hoping this first part could also be done in analog. For instance, I'm not real particular about the time period the "averaging" is over.. anything 5-10 secs would be fine. And does not a capacitor tend to "Smooth"/"Average" an AC current? So that some size capacitor might do the same averaging over some time interval? I know, I'm looking for something simple (maybe too simple). And Kudos on your Einstein quote. Dont want to use a resistor as this would contaminate the voltage fluxuations I'm after.

Does this sound reasonable?
David K
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
An inductor will take out some of the harmonics you are after. Do you have any information on the sort of noise you want to filter out?
Adam
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
Is this the sort of thing you are after? Here is a simple circuit showing a noisy sine wave and a sort of filtered version producing 3 Amps.
Adam

mainsfluck.PNG

mainsfluck2.PNG

mainsfluckI.PNG

mainsfluck_sch.PNG
 

David Kimbley

Jun 3, 2015
16
Joined
Jun 3, 2015
Messages
16
Hi Adam, I actually dont really want to filter out any of the noise--probably not common of a goal.

I only want to preserve the "non-average" (noise), and to record it temporarily. The initial "averaging" is only done to identify the "non-average" fluxuations. So, two questions, 1) would a capacitor give some sort of "average" voltage? and 2) if so, how do you know what size would give what type of average?

"Is this the sort of thing you are after? Here is a simple circuit showing a noisy sine wave and a sort of filtered version producing 3 Amps.
Adam"
Perhaps that would do for the step 1 wave form. But it is those little glitches in the first waveform I am ultimately after.
David K
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,880
Joined
Jun 21, 2012
Messages
4,880
Any passive linear network involving capacitors and inductors will change the original waveform after "smoothing" it, making it impossible to meaningfully subtract the original waveform from the "smoothed" waveform. Again, I ask, what is the end-game here? Why do you want to do this?
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,880
Joined
Jun 21, 2012
Messages
4,880
... it is those little glitches in the first waveform I am ultimately after.
David K
That's easy. Just build a very low distortion sine wave generator and phase-lock it to your "glitchy" sine wave. Now subtract the two waveforms, leaving only the "glitches" to record.

If the "glitchy" input also varies in amplitude (power line surge and sag) you will also need an automatic level control circuit for the pure sine wave, applied before subtracting the two.
 

Arouse1973

Adam
Dec 18, 2013
5,178
Joined
Dec 18, 2013
Messages
5,178
Hi Adam, I actually dont really want to filter out any of the noise--probably not common of a goal.

I only want to preserve the "non-average" (noise), and to record it temporarily. The initial "averaging" is only done to identify the "non-average" fluxuations. So, two questions, 1) would a capacitor give some sort of "average" voltage? and 2) if so, how do you know what size would give what type of average?

"Is this the sort of thing you are after? Here is a simple circuit showing a noisy sine wave and a sort of filtered version producing 3 Amps.
Adam"
Perhaps that would do for the step 1 wave form. But it is those little glitches in the first waveform I am ultimately after.
David K

Well I am lost, what the bloody hell do you want to do . You said easier than a surge suppressor? You need to draw something I think. And explain what you want to do.
Adam
 

BobK

Jan 5, 2010
7,682
Joined
Jan 5, 2010
Messages
7,682
I think you are trying to get a signal that is the variation of the line voltage from the ideal sine wave. What Hop suggested in post #28 is the way to do this.

Another possibility is that you know the input is not a perfect sine wave, even without the glitches, and you want to isolate the glitches from the normal, distorted sine wave. To do that, you would have to do what Hop originally suggested, sample over a long period and average (or better yet, run through a digital filer) to get the exact shape of the distorted wave, then subtract this ideal from the input to get the glitches. I would use a microcontroller if that is actually what you want.

Bob
 

David Kimbley

Jun 3, 2015
16
Joined
Jun 3, 2015
Messages
16
OK guys, Sorry if I am still unclear, but again Bob, you are spot on with your "Another possibility..." Yes, to obtain just the glitches from the normal distorted sine wave (of course, any household current is going to be somewhat distorted, and that is exactly why I cant use an ideal sinewave generator). This is exactly what I want to do. Yes Bob, I want just the "Glitches"--whatever they may be from the distorted sinewave (whatever that may be). I do realize this is not a "normal" kind of project--yes this project is somewhat peculiar.
And Adam, you are funny-- I mean in a good way,.. your "I am lost, what the bloody hell do you want to do" let's me know you are now well on your way to understanding my meaning. It is as Bob said on his last explanation--to find just the glitches. (not the variation from an ideal waveform).
And if Hop's original suggestion (to do it in digital via a microcontroller) is the best way to do it, I accept the professionals' recommendation. But it seems like a lot of work to actually design and implement,.. and that is why I was hoping to find an elegant short-cut if one is possible. After all, theoretically it is simple-- Take the average waveform, subtract it from the real-time waveform, and presto. But I do understand often theory gets bogged down by practical considerations upon implementation. I am more just the mathematician type, and you are the actual engineers.
Many thanks to you all-- Adam, Hop, and especially to Bob for picking up on my meaning--however peculiar it is.
If anyone has another analog idea--that would be great, otherwise it looks like Bob's digital approach is what I will try.

Thanks again, and God bless,
David K
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,880
Joined
Jun 21, 2012
Messages
4,880
Well, David K, as a mathematician you can look at this in the frequency domain instead of the time domain. The distorted input sine wave has frequency components centered on the power line frequency with some nearby "sidebands" caused by distortion, plus some higher frequency components caused by glitches. Pass the distorted sine wave through a "brick wall" high-pass filter that will remove all the low-frequency components and pass only the high-frequency glitch components. Voila! There be your glitches. This is easier said than done of course. Brick-wall filters don't exist with real circuits using a finite number of elements. But you can digitize the signal, way over-sampling to capture the high-frequency components, and then run the samples through a digital filter, as @BobK suggested, that closely approximates a high-pass brick wall filter. There will be artifacts you will need to interpret and you must decide whether an Infinite Impulse Response (IIR) or Finite Impulse Response (FIR) filter is best suited to your needs. If you want to process in real time, consider using a digital signal processor to implement the IIR or FIR algorithm.

If you get this to work, what are you going to do with it?
 

David Kimbley

Jun 3, 2015
16
Joined
Jun 3, 2015
Messages
16
Hi Hop,
Thanks for your in-depth consideration and interest. The distortion "Sidebands" I hadn't considered. You are right, these would probably need to be filtered out. I see what you mean. First, let me correct my last post, I incorrectly said "Bob's digital approach", but It was actually your digital approach Hop, glad you were not offended by that error of mine.
The application should be at least 'close' to realtime. So, likely a "digital signal processor". Yes Hop, considerations in the 'frequency domain' allow me to appreciate your point. Do you not think these distortion sidebands will drop out (at least mostly) when subtracting the 'averaged sine wave'? -- are they not systemic? -- (repeating)?
And, another question, How do you convert 120v ac to digital? Most DACs expect much lower voltages don't they?
The lower voltage (after subtraction) was another advantage to keeping it analog (in my mind anyway).

You asked, "If you get this to work, what are you going to do with it?" -- I don't want to ignore, this is a good question.
But also, I don't want to give the whole project away, unless you were in on it.
Thanks again, David K
 

hevans1944

Hop - AC8NS
Jun 21, 2012
4,880
Joined
Jun 21, 2012
Messages
4,880
@David Kimbley :

It is not easy converting signals from the frequency domain back into the time domain. Depending on how the DSP implements the digital filtering, you must preserve the phase information to re-construct the time-domain signal that produced the frequency domain signal you are processing. If you do convert your glitchy, distorted, sine wave to the frequency domain and remove everything except the glitches with digital "brick wall" (high pass) filtering, there is nothing left to subtract from the original waveform. The filtering has done that for you, leaving nothing but the glitches. What you do after that is up to you.

Signal conditioning is a whole 'nother ball game. To preserve the glitchy "information" signal you reduce the amplitude of 120 V AC with a wide-band, frequency-compensated, voltage divider such as are typically found on 10X, 100X and 1000X oscilloscope probes. These probes are designed to work into a specific input impedance, typically one megohm shunted by a few picofarads of capacitance, depending on the particular oscilloscope the probe is designed for. A small variable capacitor in the probe adjusts it for maximally flat frequency response. You can build your own frequency-compensated voltage divider to suit whatever input impedance the analog-to-digital converter exhibits, but usually all this voltage dividing and signal conditioning is done way ahead of the actual A/D converter so as to provide adjustable scaling, and possibly bandwidth filtering, of the input signal. You want to limit the bandwidth to satisfy the Nyquist sampling theorem or your digitized samples will experience aliasing, whereby the high-frequency components are "folded back" into the baseband and become indistinguishable.

Don't worry about accreditation with regard to my posts. Everything I post here is mostly based on "stuff" I learned from others. I think the only "original" idea I had was in 1972 when I "invented" a programmable waveform generator based on static RAM memory chips and a digital-analog multiplier (a digital attenuator, really). These were new devices for the commercial market at the time. I used them to variably attenuate a photomultiplier signal as a function of monochrometer wave selection (grating position, as determined by a potentiometer attached to the grating sine-bar drive mechanism, and digitized to address the RAM). This was used to "linearize" the response of the system as a function of wavelength. Never thought about trying to get a patent, which would have been assigned to my employer, a private university here in Dayton. Years later, programmable arbitrary waveform generators became available as products and I lost interest in further pursuing the idea.

The entire field of digital signal processing is "old school" technology now that DSP chips have become widely available. But back in the day... you had to roll your own code, maybe build some hardware, and run everything on a minicomputer like a DEC PDP-11. The SOSUS hydrophone network used to track Soviet "boomers" (still in use today) pioneered DSP efforts and was highly classified at the time. You had to really dig deep to find any openly published, peer-reviewed, papers on DSP in the 1960s. Today it's all available on the Internet, mostly free but sometimes hidden behind a paywall. But it's still there for inspection.
 
Top