Home
JAQForum Ver 24.01
Log In or Join  
Active Topics
Local Time 05:45 28 Nov 2024 Privacy Policy
Jump to

Notice. New forum software under development. It's going to miss a few functions and look a bit ugly for a while, but I'm working on it full time now as the old forum was too unstable. Couple days, all good. If you notice any issues, please contact me.

Forum Index : Electronics : mains voltage variation during the day

Author Message
poida

Guru

Joined: 02/02/2017
Location: Australia
Posts: 1419
Posted: 02:40am 30 Nov 2018
Copy link to clipboard 
Print this post

Resulting from another project, I have data of the mains voltage measured
at the wall outlet at my office where I work.
This is 240V AC single phase. We have a 50 or 100A 3 phase feed coming into the factory.
Which phase this is I can not tell you and it would not make any sense.
I record the voltage every 2 seconds.
Data exists for November 2018

I find it surprising how much variation there is minute by minute and day by day.
Some days there is little disturbance from 240V
Other days it's madness.
I thought we might we interested to see what voltages you get from
a "normal" 240V outlet.
It makes you wonder how important it is to set our inverter's AC output voltage.

The web page takes about 17 seconds to load, so please give it time.
this is last Tuesday's data

drag the lower small rectangle to chose the zoomed in upper data view.
Just choose a different date from the drop down list.


Edited by poida 2018-12-01
wronger than a phone book full of wrong phone numbers
 
brac321
Regular Member

Joined: 30/11/2016
Location: Slovenia
Posts: 54
Posted: 05:29am 30 Nov 2018
Copy link to clipboard 
Print this post

Very interesting. I'm interested how much variations we do have here on the other side of the globe.

What are you using to collect data, Raspberry PI or something else? Database on external drive? Edited by brac321 2018-12-01
OffGrid 24/7: 250w black mono solar panels 6.4kWp, 1x Midnite Classic 150, 1x MorningStar MPPT 60, battery bank 840 Ah @ 48v, modified LF-8K inverter, DC/DC, hot water harvesting, etc.
 
poida

Guru

Joined: 02/02/2017
Location: Australia
Posts: 1419
Posted: 06:50am 30 Nov 2018
Copy link to clipboard 
Print this post

brac321:

I use an Arduino Due, to sample the voltage. It also is recording the frequency.
The Due sends out the USB serial port continuous records of frequency and AC voltage.
I have a python script running, receiving this data and each 2 seconds
it inserts a new record into a mysql database by fetching a php script.

The AC voltage sample is prepared by taking the 9V AC output of a small 240V-9V transformer, then into a DC restorer circuit such as this

This places the entire waveform within about 1 to 3.5 V DC which is exactly
what I need for ADC conversion.

I sample the DC restored AC waveform 100 times per 50Hz wave.
I calculate the average value, which is used as the offset, which is
subtracted from all 100 samples. Then I get RMS sum of these samples.
Scale it to become equivalent to AC volts street supply and the job is done.
Both the AC volts number and the frequency are low pass filtered to remove
random noise.

When I was determining the scale factor, I had a Fluke 87 meter connected to mains AC and it was hard to see a settled reading that persisted for more than 1/2 a second.
The variance in the reading was nearly continuously random movements +/- 1.5 V AC RMS

The system is ridiculously reliable. Only time I had to restart it was due to street power loss. It has run non stop for a month.Edited by poida 2018-12-01
wronger than a phone book full of wrong phone numbers
 
Revlac

Guru

Joined: 31/12/2016
Location: Australia
Posts: 1026
Posted: 09:29am 30 Nov 2018
Copy link to clipboard 
Print this post

That is a good example of grid voltage fluctuations
some time back before we went offgrid we where getting nasty voltage spikes and over/under voltage 275vac to 160vac and possibly further out than that. (wont fit on your data sheet), this went on day after day for nearly a week.
The voltage would build up higher towards midday then blackout then come back on a bit later at low voltage then sag some more.
Must have been hell for the grid tie inverters, likely they cut out with all this going on.
some appliances blew up, lights and a tv other people had compressors and fans that would not start or run properly.
The fridge and freezer were making horrible groaning sounds trying to keep running, ended up starting the Genny up and running the house off that all afternoon just to keep everything happy.
Apparently there was some problems at the local substation.
And don't get me started on lightning and power lines.
Glad I'm off the grid, and away from all that.

These off grid inverters, I reckon you could draw pretty straight line for the voltage output and frequency.
No blackouts (at least very rare) except for some user intervention, no more blown up appliances and seldom use the generator now, it used to get a lot when we had the grid connection
Got to love these inverters.

The old generator we have would make an interesting graph, with some voltage and frequency drop, we mostly run it up to full load when charging batteries and running the house and other things at the same time.

Lost my net connection for a bit, surprised this is still here
Cheers Aaron
Off The Grid
 
brac321
Regular Member

Joined: 30/11/2016
Location: Slovenia
Posts: 54
Posted: 12:38pm 30 Nov 2018
Copy link to clipboard 
Print this post

poida:

is this project published anywhere? (hardware and software)
It might be interesting to some of us


OffGrid 24/7: 250w black mono solar panels 6.4kWp, 1x Midnite Classic 150, 1x MorningStar MPPT 60, battery bank 840 Ah @ 48v, modified LF-8K inverter, DC/DC, hot water harvesting, etc.
 
poida

Guru

Joined: 02/02/2017
Location: Australia
Posts: 1419
Posted: 08:28am 01 Dec 2018
Copy link to clipboard 
Print this post

brac321:
I can help you get this thing going, but it will be a long journey if you
have no idea of what I am talking about when I say "php", "python", "linux", "mysql",
"platformio" (linux commandline way to program Aurduino and other uCs), etc.
Oh, and "html".
This thing uses 4 programming languages.
first, set up a mysql server with a database named "mainsfreq",running under linux.
(get an unused box, load ubuntu v16 server, stand back, admire the power..)
install LAMP (apache2, php, mysql)
create a table freq.
make this so:

mysql> describe freq;
+-----------+-----------+------+-----+-----------------------------------+
| Field | Type | Null | Key | Default | Extra |
+-----------+-----------+------+-----+-------------------+---------------+
| id | int(11) | NO | PRI | NULL | auto_increment|
| fnfreq | float | YES | | NULL | |
| fnrawfreq | float | YES | | NULL | |
| ts | timestamp | NO | MUL | CURRENT_TIMESTAMP | |
| fnvolts | float | YES | | NULL | |
+-----------+-----------+------+-----+-------------------+---------------+
5 rows in set (0.00 sec)

install platformio (google it)
get an Arduino Due from ebay
from the attached zip use the "due" folder as a project, "platformio -run" to compile, read commandline docs for more to load program into Due.

2018-12-01_182207_freq.zip

have freq.py (from zip file) running at all times, particularly when you detach from session. (tmux is my best friend)
Connect the Due to the linux box via a USB cable.
The device name for then USB serial port may be different in your case. (isn't linux fun?)
freq.py requires a web resource ".../freqlog/freq.php"
(freq.py)
import serial
import urllib2
from apscheduler.schedulers.background import BackgroundScheduler
cfreq = "0.0"
rfreq = 0.0
cvolts = "0.0"
rvolts = 0.0

def tick():
global rfreq
print (rfreq)
contents = urllib2.urlopen("http://10.100.1.51/freqlog/freq.php?v=" + str(rfreq) + "&volts=" + str(rvolts)).read()
print (contents)

scheduler = BackgroundScheduler()
scheduler.add_job(tick, 'interval', seconds=2)
scheduler.start()

ser = serial.Serial('/dev/ttyACM0',115200,timeout=5)
print (ser.name)
while(1):
line = ser.readline()
print (line)
ll = line.split(" ")
if (len(ll) > 4):
cfreq = ll[4]
rfreq = 0.1 * float(cfreq)
cvolts = ll[5]
rvolts = float(cvolts)


This takes serial data from Due and calls php url to insert data into database every 2 seconds.
freq.php
<?php
error_reporting(E_ALL);
include_once "ez_sql_core.php";
include_once "ez_sql_mysqli.php";
$db = new ezSQL_mysqli("root","something_or_other","mainsfreq","localhost");
parse_str($_SERVER['QUERY_STRING']);
$s = "insert into freq (fnfreq, fnrawfreq,fnvolts) values (".$v.",".$v.",".$volts.")";
$db->query($s);

?>


The Zip file contains entire html directory of mains freq and voltage logging.
You will need to install a few python packages (apscheduler for one, dunno others)

Of course you will need to have apache2 and php running happily. and have mysql accepting connections from localhost, which is very likely. In the zip file you will see my connection credentials, you will need to use yours.
Find and install ez_sql a php mysql helper package. OR roll your own if you want. This is needed in my html files.

Electronics:
find a 240V to 9V transformer, make DC restorer circuit, use an oscilloscope to prove with zero doubt,
the signal is only ever between 0 and 3.5V, prefer 0.5 to 3.0 V.
Apply this signal to two inputs of the Due, with the ground of the signal output applied to the Due ground pin.

Circuit is series 4.7 uF electrolytic, parallel diode, two wires then lead to Due, with 100nF Ceramic across both wires to absorb high frequency rubbish, this close to Due input pins.
I can't recall which pins you use, certainly ADC channel 0 for voltage, but the mains freq interrupt pin...
I need to read the cortex M3 manual again and it's too late on a Saturday.
I'll help with this later next week if you want.

f5.php is the client web page to show frequency data for entire 24 hrs of selected day
v5.php is same, but for voltage.
You might want to roll your own view of the data.

You will need to calibrate the voltage, somehow. Got a decent DMM?
Frequency will be really, really close due to the crystal osc. on the Due.
To calibrate, look at main.cpp and find
Serial.println(smag/52.1);
in my case I had to divide ADC value by 52.1 to give AC volts.

Good luck and may the force be with you.




Edited by poida 2018-12-02
wronger than a phone book full of wrong phone numbers
 
shallowal
Regular Member

Joined: 26/07/2018
Location: Australia
Posts: 58
Posted: 02:16am 10 Dec 2018
Copy link to clipboard 
Print this post




This a typical day on the mid north coast NSW. Sometimes it ranges from 236 to 262, but in general stays in the mid 240's to high 250's.
A little while back a local had their TV soundbar go on fire, presumably from over voltage in this area.
Allan
 
HankR
Senior Member

Joined: 02/01/2015
Location: United States
Posts: 209
Posted: 04:26am 07 Jan 2019
Copy link to clipboard 
Print this post

  poida said   Resulting from another project, I have data of the mains voltage measured
at the wall outlet at my office where I work.

Ever measure the approximate source resistance at that wall outlet?

Any big (heavy electrical load) machines at your factory that may kick on and off either completely or partially?

I may get around to measuring my residential mains regulation in the US, but will measure effectively at the service entrance, thus eliminate fluctuations caused by wiring resistance between service entrance and the wall outlets. I think I'll also use just stepped down rectified voltage with 10 bit resolution and full span sampling (no offset).

Your location does experience greater percentage variation than my home voltage for sure.

HankEdited by HankR 2019-01-08
 
poida

Guru

Joined: 02/02/2017
Location: Australia
Posts: 1419
Posted: 06:33am 07 Jan 2019
Copy link to clipboard 
Print this post

  HankR said  
Ever measure the approximate source resistance at that wall outlet?
Hank


No, and I have no idea how I would. Can you tell how one would go about this,
assuming I want to do it and don't. Too dangerous.

The short term fluctuations are likely due to "local" load changes.
objects within the building switching on or off, and objects in nearby buildings, including objects that are sharing the same 415V 3 phase trunk but are located streets
away. All these can impact the local voltage.

My other project aims to get an idea of long term voltage movements due to small scale solar array feed in.

So how to measure source resistance...
wronger than a phone book full of wrong phone numbers
 
Chopperp

Guru

Joined: 03/01/2018
Location: Australia
Posts: 1057
Posted: 11:22am 08 Jan 2019
Copy link to clipboard 
Print this post

  HankR said   Ever measure the approximate source resistance at that wall outlet?

Reminds me of when we were issued with our analogue multimeters as Techs in Training (TIT's) back in 1970 (40 odd of us).
At least of the group just had to try to find out what the resistance of the mains was with them.
The only readings obtained were flashes & lots of smoke & accompanying sound effects.
Instructor not impressed.

Brian
ChopperP
 
HankR
Senior Member

Joined: 02/01/2015
Location: United States
Posts: 209
Posted: 06:38pm 08 Jan 2019
Copy link to clipboard 
Print this post

  poida said  
  HankR said  
Ever measure the approximate source resistance at that wall outlet?
Hank

No, and I have no idea how I would. Can you tell how one would go about this,
assuming I want to do it and don't. Too dangerous.

[snipped text]


I have the feeling you must have misunderstood my question. This is a safe and simple measurement.

Perhaps just saying measuring voltage drop at the outlet would have been better.

One simply plugs in a load of known wattage and measures with due care the voltage drop (unloaded to loaded) with any sort of multimeter.

Dividing the voltage drop by the load current (determined by the load nameplate wattage) gives the mains source resistance at the outlet. For a good voltage drop a high current device like a space heater or toaster oven can be used.

In my home before we insisted the utility run a bigger gauge mains feed from the local pole to the service entrance, there was a significant drop in the utility's cable causing properly installed air conditioners to not carry out a cooling cycle since the air conditioner motor protection device would sense too low a voltage when the compressor started (due to normal motor start surge current). This caused periodic cycling attempts for the compressor to first start, and then about a second in time later to stop. After three or four minutes the cycle would repeat. This cycling was a harmful situation for the compressor motor in addition to preventing any air cooling.

The fan motor, being smaller power and having essentially no start surge current, would run normally. The appearance to a lay person was that the air conditioners were defective; no cooling was achieved, just air circulation.
 
Ralph2k6

Senior Member

Joined: 24/09/2017
Location: Australia
Posts: 129
Posted: 09:53am 09 Jan 2019
Copy link to clipboard 
Print this post

We generally use the phrase volt-drop ( seeing as voltage will sag/drop under load).
(Ready to be corrected here).
So maybe the question was just lost in translation.


Ralph
 
poida

Guru

Joined: 02/02/2017
Location: Australia
Posts: 1419
Posted: 10:39pm 22 Jan 2019
Copy link to clipboard 
Print this post

  HankR said  
One simply plugs in a load of known wattage and measures with due care the voltage drop (unloaded to loaded) with any sort of multimeter.


Ah, ok. I can see how it's easy to do now.

The measurement point I sample the voltage is in my office. This is wired with 1.5mm2 240V cabling, with a 20A breaker. Looking backwards, this feed comes from a large switch box taking the 3 phase 415V that is input into the factory.
Pretty much all 240V fan out is taken from the large 3 phase bus bars, with a CB in series. The 3 phase supply cables are approx 18mm diameter each.

I think you are wondering which parts of the variability is due to changing loads within the factory and which is due to changing loads and supply external to the building.

I don't know and can't help, beyond saying that after 5pm, the factory closes and very little changes in (my building's) loading until the next morning.


wronger than a phone book full of wrong phone numbers
 
Print this page


To reply to this topic, you need to log in.

© JAQ Software 2024