diy solar

diy solar

Power analysis & monitoring

svetz

Works in theory! Practice? That's something else
Joined
Sep 20, 2019
Messages
7,274
Location
Key Largo
Does anybody monitor the frequencies & voltage on their AC continuously via an API? If so, what do use or what would you recommend if you don't like yours?

Probably everyone with a grid-tied system has had the grid go outside of specs where their inverter stops exporting. My question is always, is that really the grid, or is the noise/harmonic something from the home?

Anyway, it would be nice to compare log messages from the inverter against a frequency analysis.
 
Not with an API I've put in place but I monitor voltage on my grid tie system via Home Assistant as well as via the inverter brand's own online monitoring system (Fronius Solarweb) and via a data push to PVOuput.org. My off-grid PIP clone is monitored via Solar Assistant.

I don't monitor grid frequency much as it's rarely an issue for us (don't think we've ever had a grid frequency fault), but voltage definitely is an issue. I get high voltage error status all the time.

In recent months I've been experiencing an increasing number of grid tied inverter shut downs due to grid over voltage threshold being exceeded, and the normal daytime mode sees the inverter using Grid Voltage Dependent Power Reduction (GVDPR) in an effort to reduce voltages from hitting the shutdown point.

I know this is a bit of a funny way to show it, but this chart shows the error status from my grid tied inverter over 90 days up to a week or so ago. Each inverter error has a numeric error code, so I just show them on this plot. Many error codes are not of any significance (e.g. those ones ~320 are low DC voltages at sunrise/sunset). The two which I look out for are state 567 (GVDPR active) and state 102 (Grid over voltage shut down). Can see that GVDPR is pretty much a daily occurrence, while shutdowns are rarer, 24 shut downs in that period is 24 too many as far as I'm concerned.

pPupElQ.png


Last Sunday I made a change to my grid tied inverter settings to use the volt-var mode, where the inverter responds to grid voltages by introducing some reactive power into the output, IOW some phase shift in the output. This has really helped as I suspect our power lines have quite a bit of impedance (we are on rural power lines).

This is an example chart over past two weeks. The red, white and blue dots are grid feed in point voltage samples.
Red = phase 1, White = phase 2, Blue = phase 3.
The thin yellow columns are net real power flow, where negative = export to the grid.

Screen Shot 2022-02-11 at 10.51.55 am.png

The daily cycle is, if sunny, then grid voltages rise sharply as much power is being fed back to the grid by all the local solar PV systems (my local transformer has ~50kW of PV feeding in). In the evening with a large load voltage can also be dragged down. If the weather is rainy/heavy cloud, then voltages don't rise much.

Can see how before volt-var mode was installed we regularly saw voltages >258V and this has been problematic. Since volt-var was installed the grid feed in point voltages have been contained under 258V.

In general you can see I deal with a very large spread of voltage, with a 20-30V daily swing not unusual.

I also plotted longer term voltage trends, for instance here is the longer term trend in voltage on my white phase for calendar years 2020 and 2021:
BHOoXxd.png
 
I know my power monitor measures frequency, I haven't set up anything to graph or track it, but definitely could. The historical data for the last few months should be available.

I'm only watching voltage in one leg, I could definitely graph that.

Since I added my back up battery, the grid has been pretty stable. I think we've lost power for less than 20 minutes in total.
 
I don't monitor grid frequency much as it's rarely an issue for us (don't think we've ever had a grid frequency fault)
It's impressive the Fronious can report those. The Envoy reports it as a 15 minute average which is useless for finding noise. My digital voltmeter does the same thing. I'd really like to see the data capture at a microsecond level, then analyze the data and spit out the frequencies and magnitudes, then combine all those samples from a day into a frequency report like this:

1644687303705.png

In recent months I've been experiencing an increasing number of grid tied inverter shut downs due to grid over voltage threshold being exceeded
I wonder how frequently this happens to everyone and people don't realize it due to system averaging.

Like you, I can only detect it throught the event logs.

I know this is a bit of a funny way to show it
That's clever! I like it!


Last Sunday I made a change to my grid tied inverter settings to use the volt-var mode, where the inverter responds to grid voltages by introducing some reactive power into the output, IOW some phase shift in the output. This has really helped as I suspect our power lines have quite a bit of impedance (we are on rural power lines).
Wow! Sure did from the graph. That's interesting!

In general you can see I deal with a very large spread of voltage, with a 20-30V daily swing not unusual.
Wow! That's an insane spread... have to wonder how many of the sags are from equipment starting and spikes from equipment stopping.
Have you run that with everything turned off to see what the grid looks like solo?

Really makes me wonder more what my system is actually doing....
 
...I don't monitor grid frequency much as it's rarely an issue for us (don't think we've ever had a grid frequency fault)...
Forgot to mention, I do monitor Voltage & frequency at the 15 minute average...but it's because I want to know if the utility is purposely curtailing power export from my system. But it's usually a boring:

JSON:
"voltage": 246.783,
"current": 44.041,
"freq": 60.000,
 
It's impressive the Fronious can report those.
For reference, you can reasonably poll the Fronius at intervals of ~1 second but not down to millisecond level.

Here's a sample return of data from a basic poll request to the inverter's IP address (I blanked out my serial ID number):

Inverter data:
Code:
{
   "Body" : {
      "Data" : {
         "Inverters" : {
            "1" : {
               "DT" : 232,
               "E_Day" : 272.60000610351562,
               "E_Total" : 12560.0556640625,
               "E_Year" : 1796624.375,
               "P" : 1070
            }
         },
         "Site" : {
            "E_Day" : 272.60000610351562,
            "E_Total" : 12560.055555555555,
            "E_Year" : 1796624.375,
            "Meter_Location" : "grid",
            "Mode" : "meter",
            "P_Akku" : null,
            "P_Grid" : -432.43000000000001,
            "P_Load" : -637.56999999999994,
            "P_PV" : 1070,
            "rel_Autonomy" : 100,
            "rel_SelfConsumption" : 59.585981308411206
         },
         "Version" : "12"
      }
   },
   "Head" : {
      "RequestArguments" : {},
      "Status" : {
         "Code" : 0,
         "Reason" : "",
         "UserMessage" : ""
      },
      "Timestamp" : "2022-02-13T07:30:05+11:00"
   }
}


Meter data:
Code:
{
   "Body" : {
      "Data" : {
         "2" : {
            "Current_AC_Phase_1" : 1.21,
            "Current_AC_Phase_2" : 0.62,
            "Current_AC_Phase_3" : 1.1399999999999999,
            "Details" : {
               "Manufacturer" : "Fronius",
               "Model" : "Smart Meter 63A",
               "Serial" : "XXXXXXXX"
            },
            "Enable" : 1,
            "EnergyReactive_VArAC_Sum_Consumed" : 5797820,
            "EnergyReactive_VArAC_Sum_Produced" : 91990950,
            "EnergyReal_WAC_Minus_Absolute" : 39315432,
            "EnergyReal_WAC_Plus_Absolute" : 11819101,
            "EnergyReal_WAC_Sum_Consumed" : 11819101,
            "EnergyReal_WAC_Sum_Produced" : 39315432,
            "Frequency_Phase_Average" : 50,
            "Meter_Location_Current" : 0,
            "PowerApparent_S_Phase_1" : 290.279,
            "PowerApparent_S_Phase_2" : 149.792,
            "PowerApparent_S_Phase_3" : 275.31,
            "PowerApparent_S_Sum" : 525,
            "PowerFactor_Phase_1" : -0.60999999999999999,
            "PowerFactor_Phase_2" : -0.69999999999999996,
            "PowerFactor_Phase_3" : -0.56999999999999995,
            "PowerFactor_Sum" : -0.60999999999999999,
            "PowerReactive_Q_Phase_1" : -159.75999999999999,
            "PowerReactive_Q_Phase_2" : -65.560000000000002,
            "PowerReactive_Q_Phase_3" : -190.36000000000001,
            "PowerReactive_Q_Sum" : -415.68000000000001,
            "PowerReal_P_Phase_1" : -123.88,
            "PowerReal_P_Phase_2" : -65.989999999999995,
            "PowerReal_P_Phase_3" : -132.59999999999999,
            "PowerReal_P_Sum" : -322.47000000000003,
            "TimeStamp" : 1644697861,
            "Visible" : 1,
            "Voltage_AC_PhaseToPhase_12" : 417,
            "Voltage_AC_PhaseToPhase_23" : 418.39999999999998,
            "Voltage_AC_PhaseToPhase_31" : 416.89999999999998,
            "Voltage_AC_Phase_1" : 239.90000000000001,
            "Voltage_AC_Phase_2" : 241.59999999999999,
            "Voltage_AC_Phase_3" : 241.5
         }
      }
   },
   "Head" : {
      "RequestArguments" : {
         "DeviceClass" : "Meter",
         "Scope" : "System"
      },
      "Status" : {
         "Code" : 0,
         "Reason" : "",
         "UserMessage" : ""
      },
      "Timestamp" : "2022-02-13T07:31:02+11:00"
   }
}
 
The Envoy reports it as a 15 minute average which is useless for finding noise.
The online Fronius Solarweb data is in 5-min intervals, as are the reports I get sent daily.

Power data in the data/charts they provide is an average however voltage data is not an average for the interval. It is a sample taken at 5-min intervals.

I would look into your Enphase system a little more to work out whether the voltage data is actually an interval average or a sample taken once every 15-min.

My Home Assistant is polling the Fronius inverter at 1-minute intervals.

The Solar Assistant system monitoring my off-grid inverter polls at 10-second intervals.
 
I'd really like to see the data capture at a microsecond level
That's not going to happen directly from the inverter. It'll require a different level/type of data logger. I have no suggestions - sounds like more of an electrical engineer's tool.

I wonder how frequently this happens to everyone and people don't realize it due to system averaging.
Most will be oblivious.

Wow! Sure did from the graph. That's interesting!
The volt-var settings I enabled are now the standard required for all new grid tied PV inverters in Australia (other than WA & NT). That change came into effect on 18 December 2021.

But it would be a good idea for many existing systems to also implement them. It both enhances local grid system strength and will also ensure people's systems are better protected from shutdown events, and importantly it also supports more rooftop solar PV being added to the grid.

There are already 3 million rooftop PV systems in Australia and there is in many areas quite a lot of daytime high voltage pressure on the grid. In some places rooftop solar alone is at times supplying >100% of grid demand (with excess power being exported on interstate interconnects). Think about that, at times no demand for power from any centralised generation source is now happening in some locations in Australia. Grid supply paradigms are changing rapidly here.

Wow! That's an insane spread... have to wonder how many of the sags are from equipment starting and spikes from equipment stopping.
Have you run that with everything turned off to see what the grid looks like solo?
At night with little demand the voltages look pretty normal hovering around 240V. In the daytime, if sunny with not much load, voltages go high pretty easily. That's a function of the amount of solar PV feeding the local transformer and lots of solar PV on the local grid.

But because of the nature of our rural supply transmission infrastructure, voltage can also drop quite a lot with load. In general I will see voltages changes in the order of 2.7V/kW, which is a lot.

Part of my strategy to manage my daytime high voltages will be some phase load rebalancing.

My single phase ducted aircon system used to be on the white phase but accidentally got swapped over to the red phase last June. It was because I was doing all the historical real power flow and voltage assessment trying to work out why my inverter was starting to shut down that I picked it up. It's more obvious when looking at the long term real power flow plot for my red and white phases (negative = export to grid):

6EnLfZx.png

Qe4QRee.png


Can see above how in June there was a sudden drop in load on one phase and a corresponding increase on the other phase. Sparky made an honest mistake, while working on another project he reconnected my two aircon systems but must have swapped over their phases in the process. Technically that is still "balanced" but one system is used regularly, the other infrequently. And since the white phase is the one we experience the highest voltages (because of a neighbour's single phase PV array being on that phase), it's better to have regularly used load on that phase.

I'm arranging to have the load phase assignments swapped back when my sparky comes in a couple of weeks from now (along with another interesting project).
 
Does anybody monitor the frequencies & voltage on their AC continuously via an API? If so, what do use or what would you recommend if you don't like yours?

Probably everyone with a grid-tied system has had the grid go outside of specs where their inverter stops exporting. My question is always, is that really the grid, or is the noise/harmonic something from the home?

Anyway, it would be nice to compare log messages from the inverter against a frequency analysis.
yes, but from my inverter, as i can easily load those in home assistant for dashboarding and node-red for triggering some actions
 
Forgot to mention, I do monitor Voltage & frequency at the 15 minute average...but it's because I want to know if the utility is purposely curtailing power export from my system.
In what way would they be doing that?

I can't imagine frequency control as that's very hard to move at grid level. A LOT of system inertia behind that. Local voltage adjustment perhaps but that seems a bit of a blunt instrument. Here the voltage rises naturally during the day as a consequence of solar PV output, and if voltage gets high enough then inverters will invoke GVDPR (volt-watt mode) and reduce output in an effort to reduce voltage but volt-watt mode can only do so much (hence the addition of volt-var mode which is much more effective).

In general we have no controlled curtailment. Our systems do have system size and grid export approval limits.

But there are new inverter standards in some locations (e.g. South Australia and soon Western Australia) which will give the local authority the ability to wind back exports in specific areas if it's really required for ensuring grid stability (see my above comment on rooftop solar alone being > 100% of grid demand on occasions). This requires the inverter be connected to the internet as it's a direct adjustment of the inverter's settings rather than any indiscriminate change of local grid frequency or voltage.
 
In what way would they be doing [power curtailment from your solar system]?
Not an expert... but. you're right there are a bunch of "must-trip"/"ride-through"
requirements around voltage. But frequency is a thing too in the states.

California, Hawaii, and Puerto Rico passed laws (e.g., CA Rule 21) years ago that
allow utilities to curtail renewable power by altering the frequency.

UL 1741 is a testing standard to ensure that inverters comply and just about all
inverters meet this nowadays. As I understand it, the frequency starts to drop
naturally as there's a brown-out and rises when there is surplus. There's a change
coming to this standard that allows the grid to request more power (from ESSes)
by dropping the frequency.

I suspect Australia has (or had) something similar planned as Enphase has an
"EN-AU" document describing it (see image right).
1644755265144.png


But there are new inverter standards in some locations (e.g. South Australia and soon Western Australia) which will give the local authority the ability to wind back exports in specific areas if it's really required for ensuring grid stability (see my above comment on rooftop solar alone being > 100% of grid demand on occasions).
Possibly that's the Australian equivalent of UL1741?
 
I suspect Australia has (or had) something similar planned as Enphase has an
"EN-AU" document describing it (see image right).
That's pretty standard for grid tied inverters here - but I think it's less to do with grid response than it is to enable micro-grid formation when a solar PV + battery system isolates from the grid during outages and you still want your solar PV to remain available to service the household loads and battery.

The battery inverter takes over the provision of grid frequency signal and the PV inverter adjusts power output accordingly. e.g if battery is full and household loads are low then the battery inverter will raise the frequency high enough to curtail or turn off PV output completely. When battery SOC drops low enough then it lowers frequency enough to permit the PV inverter to supply some limited power.

There's a change
coming to this standard that allows the grid to request more power (from ESSes)
by dropping the frequency.
A home's solar PV can't generate more output in response to a drop in grid frequency. The only way a home can usefully respond in that instance is to dump load (e.g. via DRED control of aircon).

For a rooftop solar PV inverter it'll be just a case of staying online to keep power flowing during low frequency events as in those periods the grid needs all the power it can get.

But a home inverter can curtail output when frequency rises.

In that Enphase chart you'll see curtailment isn't happening until frequency rises about 0.3Hz above normal. That's a lot. That would indicate a large grid scale load unexpectedly went off line, or maybe a large interconnector carrying exported energy went offline. In our grid, Frequency Control and Ancillary Services (FCAS) and Fast Frequency Response (FFR) services are grid scale markets in themselves. Most frequency management is provided at that level.

Possibly that's the Australian equivalent of UL1741?
I've no idea what UL1741 is.
 
Looks like there are a number of tools that can be used to measure voltage over time.

I see some inexpensive (e.g., <$20) smart-plugs that monitor power, but I don't think they're volts/frequency amps and probably not fast enough for my use case.

What about an MCU with a voltage divider on an analog pin?
How fast would it need to be? The sampling rate is like FPS (Frames-per-second) in a game, the higher it is the better the resolution.

Power in the U.S. cycles around 60 Hz, or one cycle every 16 milliseconds. So, if you wanted 100 divisions (e.g., data samples) across one cycle, you'd want to measure at .16 milliseconds or 160 microseconds intervals. But as shown to the right, a power spike might last less than 1 millisecond.
1644761860164.png

So possibly we want 10 or 100 divisions per millisecond? 1 ms / 100 * 1000 μs / ms = 10 μs. If it takes 15 cpu cycles to read an analog pin, then we need 10 μs / 15 x 1000 ns / μs = 660 ns. So, that's at least a 2 Mhz CPU just to collect the data. Possibly if the MCU has multiple analog pins you could fire them with offsets to reduce the wait time? Divide by 10 for 10 samples per ms.

It's a lot of data to transmit continuously, so the frequency analysis and spike information should probably be done on the chip. A frequency analysis could be done by a Fast Fourier transform, which is about 60 cycles per sample. As we're talking 100 samples per millisecond, that's 100,000 samples per second or 6 million cycles, so another 6 Mhz. So, a 16 Mhz MCU (e.g., Arduino) might be enough, but I doubt it. Two MCUs in parallel might work (one collecting and one processing) for 100 samples per second. Probably okay at 10 samples per ms.

A teensy at 600 Mhz might be up to the task.

That's pretty standard for grid tied inverters here - but I think it's less to do with grid response than it is to enable micro-grid formation when a solar PV + battery system isolates from the grid during outages and you still want your solar PV to remain available to service the household loads and battery.
Some AC coupled inverters do use frequency shifting to control microinverters.

Enphase doesn't use frequency shifting to throttle back its inverters for Ensemble, they consider it too slow with their battery management.

Enphase still has to support throttling back watts based on frequency as specified in UL 1741 (it's a testing standard to ensure grid-coupled inverters are compliant) so the utility can throttle them back though. It's not the law in Florida yet, but it is in other places (e.g., California, Hawaii).

...request more power (from ESSes) by dropping the frequency...
A home's solar PV can't generate more output in response to a drop in grid frequency.
Correct, note above it says that's for "ESS", which is an acronym for "energy storage solutions", not solar.
 
Last edited:
Supposedly this is a 200 kHz scope for under $23 which has the source available and can be used for data-logging. 200 kHz should be possible with the CPU they use (the STM32F103C8 is 72 MHz max). That's a sample every 5 μs!

Of course, for $70 you can get a new dual channel 20 Mhz scope (oohhh... it supports FFT and has an SDK). There's always the $50 Oscilliscope Game too.
 
Last edited:
Correct, note above it says that's for "ESS", which is an acronym for "energy storage solutions", not solar.
Ah, yes.

There are Virtual Power Plant (VPP) programs people with home batteries can join. These are occasionally called upon by the VPP operator to export additional energy to the grid. Tesla has their own.

But VPP offerings suck, IMO. You have to tie yourself into one retailer, commit to handing over control of your battery while the returns are minimal and seem to be heavily in favour of the retailer.
 
Back
Top