Author Topic: Power-company voltage waveform measurement  (Read 2553 times)

0 Members and 1 Guest are viewing this topic.

Online jonpaul

  • Super Contributor
  • ***
  • Posts: 3366
  • Country: fr
Re: Power-company voltage waveform measurement
« Reply #25 on: January 25, 2023, 05:57:34 pm »
You can never locate the few ms of bad line V with a PC and sound card.

Needs a power quality analyzer that monitors 24/7 dfor weeks.

These cost 1000s$.

Easier to think

Time of day of occurence?
Weather?

Had similar issue years back, was a buried utility 240V 4/0 feeder, damged by diggers, insulation cut partially.

Over the years it corroded the Co[per or Al conductors.

Result was intermittet cutout and imiing a few seconds on on side of the 120/240 feed to the meter box.

Called local util, they checked and sent a lineman, was hard to locate the break, feeder needed replacement.

CLEWL It  was worse with damp weather...

Look over the poles, line, underground util boxes for signs of work.

Ask the uil workers if any around

Ask neighbors if they have had simialr.

Jon
Jean-Paul  the Internet Dinosaur
 

Offline Doctorandus_P

  • Super Contributor
  • ***
  • Posts: 3358
  • Country: nl
Re: Power-company voltage waveform measurement
« Reply #26 on: January 25, 2023, 11:48:14 pm »
Mains transformers are not very good fit for voltage measurements because they are usually made as cheap as possible, and are therefore driven to near saturation and this causes non-lineairities. If your wall socket delivers 120Vac, and your transformer has a 230Vac winding, then use that for the primary. The output voltage will also be halved, but as you are still using a voltage divider after the transformer that is easy to correct for. You can also put the windings of two (identical) transformers in series, so they each see only half the mains voltage.

As for the clipping. It does not look "normal". What happens if you swap the connections along the way. does the clipping also reverse polarity?

Alternatively: Increase the voltage divider to give a lower output voltage. Does the clipping go away?
And a soundcard is also far from optimal. Maybe you're using a microphone input (or the input is set to microphone)
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: Power-company voltage waveform measurement
« Reply #27 on: January 26, 2023, 12:28:48 am »
Sometimes the utility company will install recording equipment and they know very well how to detect the problem and they have the equipment.  You might have to call more than once to raise the annoyance level.
 

Offline rstofer

  • Super Contributor
  • ***
  • Posts: 9890
  • Country: us
Re: Power-company voltage waveform measurement
« Reply #28 on: January 26, 2023, 12:36:03 am »
There are some fairly inexpensive DMMs with data logging to a PC.  I'm sure details vary.
 

Offline MrAl

  • Super Contributor
  • ***
  • Posts: 1438
Re: Power-company voltage waveform measurement
« Reply #29 on: January 26, 2023, 02:34:40 am »
Not so much how you feed it but something is wrong with your sound card.

The sound card is working correctly in general, and the soundcard waveform problem was fixed by further increasing the ratio of the voltage divider (R1=88k, R2=2.2k) per Terry Bites' suggestion.


extreme overload of PC audio input.

Indeed, further reducing the voltage being fed to the soundcard fixed the problem.


Maybe we need to go back to the beginning. You say you have power fluctuations, how do you know? where do you see this? what happens?

Ahh, yeah, good point; I had not mentioned what _kind_ of fluctuations I had been having and wanting to measure.

The electric power in my neighborhood is fairly unreliable. This usually manifests itself in frequent prolonged total outages, or in brief (3-5 second) total outages during which a temporary fault presumably trips a protective relay which is then closed after a few seconds by an automatic recloser.

In the past two days, however, I have been seeing a brand-new-to-me type of power problem. The new problem has not occurred again (yet) since setting up the soundcard based monitor, so all I can go by to describe what's happening are my own observations.

What happens is that for a period of somewhere around 4 seconds, the lights in my house flicker deeply and rapidly, at what appears to be a steady pace (maybe somewhere around 8-10 Hz, but again, this is estimated from my visual observation, not measured). At the end of the event, power returns to normal. Further observations:

* This affects lights on multiple branch circuits, on both legs of the 120/240 V, 60 Hz split-phase service

* When I say the lights "flicker deeply", I mean they (visually) appear to turn all or almost-all of the way off during the flicker cycle. This gives a strobe light-like appearance, quite unlike the momentary brightness fluctuation you might see if you turned on a large motor or other non-resistive load in the house. 

* When this happens, it causes both of my double-conversion UPSes to transfer their loads to battery and record "ConditionInputFrequencyDeviation" and "Input Power Supply Fail" messages to their logs. This seems notable because these UPSes are quite tolerant of variations in input voltage and frequency. Their spec sheets indicate that they can accept input voltages between 70-140 V and input frequencies between 40-70 Hz without having to transfer the load to battery.

I have never seen a power problem like this before, and I have no idea what conditions on the distribution system might cause something like this. This is my reason for wanting to measure the utility voltage waveform. If this particular problem happens again, I would like to be able to characterize what is happening in more detail than my "the lights flickered deeply and rapidly" observation above.

At present, I am using Audacity to record the waveform on an ongoing basis after you all helped me correct my soundcard input circuit yesterday. But if I could get the Digilent Waveform software to do the needed type of capture, I could almost certainly get a better analysis out of the captured waveform if the problem happens again in that software than I can in Audacity.

Thanks again for everyone's input and help; I truly appreciate it.

Hello there,

I was going to suggest getting a UPS system but apparently you already did that.
The only other thing you can do really is call the power company and report the problem.  See what they can do about it.

You can get a scope for monitoring the power line for something like $25 these days that run on batteries so are completely isolated.  You'll need a probe too. To record though you would have to aim a web cam at the scope and keep it running so you can record the wave as it changes.  I dont think you will get much out of this though because then all you will know is how the waveform changes it still wont be fixed.
The scopes that are that cheap are Arm based and they have a sampling rate of 1MS/s and that's enough for a power line of 50Hz or 60Hz.
I used one on the car for a while and it was able to show the different waveforms when looking across the battery while the car engine is running and that's a higher frequency than the line.
 

Offline shapirus

  • Super Contributor
  • ***
  • Posts: 1333
  • Country: ua
Re: Power-company voltage waveform measurement
« Reply #30 on: January 26, 2023, 08:38:24 pm »
So I finally came across an interesting topic that warrants going through the registration procedure to be able to contribute :).
Hello, everyone.

Needs a power quality analyzer that monitors 24/7 dfor weeks.

These cost 1000s$.
It can actually be DIY'ed much cheaper, as long as you are not after officially certified measurements and just want something for personal use to satisfy your curiosity and possibly decide whether there is an actual reason to contact your power company's customer support.

This is exactly what happened in my case. Initially I wanted to simply log mains voltage values over time and plot a graph, which I did, and it was quite easy to do using what could be grabbed from my computer's UPS over the RS232 connection, but its data update rate was really slow, the readings were a few volts off, and it worked only when the computer was turned on, so I decided to implement a dedicated 24/7 ADC-based data acquisition and logging system.

It required a lot of reading, learning and simulating to implement (and I'm still not sure I did everything properly, but it works). Schematics is really simple and it basically follows the typical application circuits from the datasheets.



(it's a simplified diagram: passives etc. aren't shown)

Fuctional parts are as follows:

1) Input: a divider made of 5W resistors, them being 5W to both meet the necessary voltage rating and avoid any noticeable heating that would cause an uneven temperature drift. It's not easy and possibly doesn't make much sense to obtain proper low-tempco resistors of the necessary values with proper voltage rating where I live, so I just throw in some thicker ones and call it a day.
The values shown allow to register input values up to about +/-650 V peak before hitting the max values at the ADC output.
The symmetrical arrangement of the 2x240K resistors (instead of using a single 480K) allows to avoid direct contact between any of the mains wires, be it line or neutral, and the low-voltage side (but this still doesn't provide proper isolation, which requires separate attention).

2) Input protection 1: a low-value fast-acting fuse in series and an appropriately valued varistor after the fuse across the mains input. At the varistor's value shown, the fuse is expected to blow before the ADC readings reach their maximum, which is probably not good (we lose resolution for nothing), but safe.

3) Input protection 2: an 11V rated bidirectional TVS diode across the outputs of the 240K resistors to blow the input fuse should any of the 240K resistors fail short. The 11V value seems to be the first at which the diode has a steep enough voltage vs current curve "shoulder" and draws negligible, if any, current at the working input voltage, thus not affecting the readings. At the same time, reaching 11V across the inputs will still not be enough to damage the op amp, see below.

4) A decent op amp that provides sufficient output current and slew rate. Defining "sufficient" is difficult for me, I just found what works experimentally, in my case it's a nice RRIO quad-channel AD8608 that allows to use a single 5V supply to power everything, rather than having to make dedicated power rails for the op amp. There's no strict requirement for a RR op amp, however, and something like a good old TL084 can be used, provided that it's powered in such a way that the input/output voltage swing specs are met. But then it's necessary to make sure that the ADC inputs aren't overdriven which happens automatically with a 5V-powered op amp.

Another advantage of this AD8608 is that its inputs are allowed to receive voltage higher than VCC+0.6V if the input current stays below 5 mA, which is the case, unless the input protection components (or the circuit designer) fail. It may be possible with other ICs that have integrated input clamping diodes, but in this case the 5 mA limit is explicitly specified in the datasheet.

Two channels are used to buffer the differential input signal, the other two buffer the common mode and ADC Vref references. For these I used MCP1525 and MCP1541, respectively.

5) ADC: SPI-compatible MCP3304 (MCP3302 will work as well -- whatever is cheaper/easier to get) working in fully-differential mode and providing a 13-bit output value from -4096 to +4095. MCP3202/3204/3208 will also work, but it cannot into fully-differential mode and signed output, providing lower effective resolution.

6) Galvanic isolation between the ADC and the SPI digital data receiver: ADuM2401BRWZ. A nice little IC working no questions asked at the ADC's max clock of 2MHz and beyond. Beware, the "AR[W]Z" version works up to 1MHz only, so need to get the "B". Zero hassle compared to optical isolation, which is still possible, but wastes more power and is fiddly in getting it right (which I however did successfully) in terms of choosing proper high-speed optocouplers and resistor values for them, not to mention the number of components and board space used, considering one optocoupler plus the passives per each SPI pin (4 total).

7) Digital SPI signal receiver and processor: Orange Pi Zero LTS single-board computer, which has been collecting dust in a drawer for several years. Nice little thing. Rather slow (~20ksps max) with the WiringOP library, but with DMA access to GPIO registers* it can easily reach the 2.1MHz/100ksps speed that the MCP3304 can work at, and do all the necessary math in real time.
Providing uninterruptible power for it is a separate topic. There are multiple possibilities.

(*in case anyone's interested, I published a basic proof-of-concept implementation.)

8) (not shown on the schematics) Power supply for the op amp, ADC, voltage references and the "unsafe" side of the ADuM2401: a 5V-5V isolated DC-DC converter from AliExpress.
Nice and cheap thing, comes in a variety of input and output voltages, can be used to make dual supply rails etc., really useful to have a handful of them in the components bin. Input is powered from the OPi 5V rail, output goes to a MIC5205YM5 LDO regulator set for 5.1V output, thanks to the fact that my DC-DC converter gives about 5.2V on the output when input is 5V. It's really better to use a 5V-9V model and use a plain old jelly bean LM317 instead, but all I had at the time was the 5V in, 5V out model.
The "safe" side of the ADuM2401 is powered from the 3.3V rail of the SBC, which is the logic level of its GPIO pins.


At this point we have the original (save for the effects of the input resistors' parasitic capacitance and inductance) input waveform sampled 100000 times per second which is more than enough for the 50/60 Hz mains voltage.

Simple math calculations (but we have to implement zero-crossing detection to process complete periods, which, however, is easy enough on the software side) will yield us real-time timestamp, RMS, DC offset, frequency and crest factor values, which can be used as a measure of distortion of the input signal relative to the ideal sine wave at the measured amplitude. The raw values received from the ADC chip will need their DC offset and gain corrected, which is easily done on the software side. Calibration is done with any TRMS multimeter you trust. It only remains then to implement some graphing of the results which is usually the least pleasant part of the job.

This is likely as much as any hobbyist would ever want to have. Well, I also wanted to perform FFT on my samples to properly calculate THD in real time, but unfortunately this is where I hit my lack of knowledge and fail to understand how to use the FFT libraries to do this. So I ended up simply calculating the crest factor deviation as a measure of quality of the input voltage.

Finally, it's dirt cheap, all parts combined probably under $30 or maybe $20, which includes the Orange Pi SBC. Far below any factory-made data logger.
« Last Edit: January 26, 2023, 08:53:02 pm by shapirus »
 

Offline BeBuLamar

  • Super Contributor
  • ***
  • Posts: 1199
  • Country: us
Re: Power-company voltage waveform measurement
« Reply #31 on: January 26, 2023, 09:07:58 pm »
There are some fairly inexpensive DMMs with data logging to a PC.  I'm sure details vary.

I think the OP wanted to see what the wavform looks like when the voltage drops not so much how far it drops.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf