Radian Posted July 15, 2022 Author Share Posted July 15, 2022 18 minutes ago, ProDave said: How are you managing to dump all your generation? Easy! I currently only have a couple of hundred Watts over my base load to dump as I'm testing using some temporary PV modules propped up against a fence 🤣 Still, they' currently easing the bills by around 4 units a day. We're due a visit to install some proper PV on the roof next month (hopefully). In the meantime I've been trying to minimise the slightly embarrassing leak into the grid. I'd do the G98 paperwork but I can't answer all the questions as I move it all around depending on the time of day and even the capacity changes depending on how much space I want for sunbathing on the deck. Link to comment Share on other sites More sharing options...
MikeSharp01 Posted July 16, 2022 Share Posted July 16, 2022 12 hours ago, Radian said: capacity changes depending on how much space I want for sunbathing on the deck Are you in danger of over thinking this! Perhaps choose an average methodology, worst case or even best case (from whoever's point of view.) and stick it in. Link to comment Share on other sites More sharing options...
SteamyTea Posted July 16, 2022 Share Posted July 16, 2022 (edited) 14 hours ago, Radian said: I have taken a leaf out of @SteamyTea's book and further refined the calibration of my power measurements by adding an optical sensor to time the pulses Did you use the same code as I do, or have you refined it more? I cast the LED and magnet into a bit of flexible gas pipe. Edited July 16, 2022 by SteamyTea Link to comment Share on other sites More sharing options...
MikeSharp01 Posted July 16, 2022 Share Posted July 16, 2022 5 hours ago, SteamyTea said: Did you use the same code as I do, or have you refined it more? Is it working OK if so not sure it needs refining but also not sure it is reliable - have all the bits now to build a WEMOS d1 mini pro based version but a think I will count pulses and return a figure in 1 minute lumps that means I can store a load of readings on the Wemos and upload the whole lot as needed. I can also just have a start time stamp and keep the whole lot lined up with a NTS so storing much less data. Anyway I will get to that next week. Today we party! Link to comment Share on other sites More sharing options...
SteamyTea Posted July 16, 2022 Share Posted July 16, 2022 10 minutes ago, MikeSharp01 said: will count pulses and return a figure in 1 minute lumps that means I can store a load of readings I initially tried to do that, but my programming skills are not good enough. I tested at 1 'flashes' a second and it seemed fine (3.6 kW I think). At 10 flashes a second (36 kW) it lost about 10% as it wrote the logfile. Been trying to find a good way to log the pulses directly and log the collected from the LED pulses on the same RPi. Not had much luck yet, seems to slow it down quite a lot i.e. a few seconds to write to both log files. Link to comment Share on other sites More sharing options...
kommando Posted July 16, 2022 Share Posted July 16, 2022 (edited) I looked at this flashing LED lark and decided it was a bit flaky. So I went for this meter as a supplementary meter which uses a CT clamp and exports the simple kwh usage on the S0 terminals and has more detail via an RS485 set of terminals. Cost is the same as the commercial LED flash readers. https://www.aliexpress.com/item/4000582989041.html?spm=a2g0o.order_list.0.0.1a68180223g7Sr I use it to feed a Solar-log 500 box and the diagnostics on the solar log show no signals are lost on a 5m shielded twin core cable. I ordered the 65A version but a 100A version showed up and as my main fuse is 100A I left it at that. The 65A would have worked as there are no major loads other than a 5HP motor on a lathe at 25A max used when nothing else but lights are on. It does import and export on the display but the S0 output is the same for both import and export so no differentiation between the two. The RS485 output does differentiate as they are reported separately. Edited July 16, 2022 by kommando spelling Link to comment Share on other sites More sharing options...
MikeSharp01 Posted July 16, 2022 Share Posted July 16, 2022 47 minutes ago, SteamyTea said: I tested at 1 'flashes' a second and it seemed fine (3.6 kW I think). At 10 flashes a second (36 kW) it lost about 10% as it wrote the I think you could use one of the GPIO counter timers to capture without reference to the software them just read the counter at whatever interval and work out the difference since last interval, and accounting for rollover of the counter at the top - not sure what that is 16 / 32 bits or some such. You don't really need the actual time of each pulse just a number at a given time. 1 Link to comment Share on other sites More sharing options...
MikeSharp01 Posted July 17, 2022 Share Posted July 17, 2022 23 hours ago, SteamyTea said: I initially tried to do that, but my programming skills are not good enough. I tested at 1 'flashes' a second and it seemed fine (3.6 kW I think). At 10 flashes a second (36 kW) it lost about 10% as it wrote the logfile. Been trying to find a good way to log the pulses directly and log the collected from the LED pulses on the same RPi. Not had much luck yet, seems to slow it down quite a lot i.e. a few seconds to write to both log files. So it looks like your code is not using interrupts and this means your counter will miss events if the Pi is busy. There are a number of solutions to this Multitasking or Threading using simple call back interrupts. I found this article which covers the latter case and is probably the easiest if you are wanting to stick with python. It has two call backs (your code could be put in any one of them as they both detect a falling edge.) on different pins (17 & 23) and a wait until pressed on pin 24 (which ends the programme). https://raspi.tv/2013/how-to-use-interrupts-with-python-on-the-raspberry-pi-and-rpi-gpio-part-3 So you set up you GPIO (My example uses Pin 17 and you need global counter variables etc as well) import RPi.GPIO as GPIO GPIO.setmode(GPIO.BCM) GPIO.setup(17, GPIO.IN, pull_up_down=GPIO.PUD_UP) Define a call back function def my_callback(channel): print "falling edge detected on 17" # Put you count code here. Load the trigger for the call back # when a falling edge is detected on port 17, regardless of whatever # else is happening in the program, the function my_callback will be run GPIO.add_event_detect(17, GPIO.FALLING, callback=my_callback) #You don't need bounce time for a photdiode it should be clean. Run the rest of the programme as a loop servicing the saving of the counts. As I am working with WEMOS device I will be using a similar approach but in C rather than python. Link to comment Share on other sites More sharing options...
SteamyTea Posted July 17, 2022 Share Posted July 17, 2022 @MikeSharp01 Any chance you can repost that in my blog (maybe a bit of editing for context), more appropriate there. Link to comment Share on other sites More sharing options...
MikeSharp01 Posted July 17, 2022 Share Posted July 17, 2022 10 minutes ago, SteamyTea said: Any chance you can repost that in my blog (maybe a bit of editing for context), more appropriate there. Yes - sorry should have done that. Link to comment Share on other sites More sharing options...
kommando Posted July 17, 2022 Share Posted July 17, 2022 In robotics they use Quadrature boards to slow the signals down so the pluses can be read by the computer chip running the programs. I use them on my lathe and milling machine DRO's so if I fast feed the slides or saddle the DRO computer can keep up with the pulses from the 5 micron graduated glass scales. When machining to 0.01mm you cannot be looking at a dimension on the DRO screen and wondering if the figure on the DRO is correct. Link to comment Share on other sites More sharing options...
Radian Posted July 18, 2022 Author Share Posted July 18, 2022 (edited) On 16/07/2022 at 07:55, SteamyTea said: Did you use the same code as I do, or have you refined it more? I cast the LED and magnet into a bit of flexible gas pipe. I've just strapped my sensor to the utility meter using tie-wraps: I use the same principle as you to convert impulses/time to watts but under interrupt. It's really quite annoying as the impulses obviously slow to halt at zero nett import/export - exactly where I'm trying to investigate. Apart from the confidence boost it gives me that my own power measurement is accurate, the really useful thing is detecting when the Joule bucket has over-topped and power is going to the grid. But I've really got to get a grip because everything I'm seeing indicates that this 'revenue grade' meter is misbehaving. The 'big picture' of unexplained behaviour looks like this example: The green trace labelled "meter" is the power as reported by the meter impulses. It occasionally lags my instantaneous power measurements (red trace labelled "import") because of the extended time between impulses at low power levels (9s apart at 100W). But the two generally agree i.e. at the start of recording when roughly 300W of import is taking place. The joule bucket trace, labelled "export" is in orange. It is expected to ramp up and down as generation exceeds consumption and is supposed to model the 3600J buffer in the utility meter. When it reaches the 3/4 point (2700J) it fires the dump load (2kW heater in this experiment) until it drops the buffer to 1/4 (900J). The utility meter impulses are not good at showing what goes on in the active region as the buffer is cycling, but my software identifies the impulse LED going on constantly - signalling that the buffer has overflowed and power is going to the grid. When I detect this I instantly max. the model of the Joule buffer in an attempt to re-sync it. You can see this happen three times. The first time is shortly after a tiny amount of generation has just managed to overcome the house load and barely started to fill the Joule bucket. The bucket must have started out empty as there was several minutes where ~300W was being drawn in from the grid. But in around 30s it appears to have reached 3600J implying it was filling at 120W. Nothing like what was going in. And once things got into the swing of slowly filling (at around 60W) and emptying (at 2kW) after five cycles the buffer overflows - twice in quick succession, despite no appreciable change in power going in. If anything the power was dwindling as the sun was on its way in behind a cloud again. None of this makes any sense and while I hear suggestions to just ignore it as it represents a tiny leak, it offends my sensibilities and is a good puzzle to get my brain around. Edited July 18, 2022 by Radian Link to comment Share on other sites More sharing options...
SteamyTea Posted July 18, 2022 Share Posted July 18, 2022 @Radian TL;DR. Shall have a look later when I get home. Going to have a go at rewriting my code with interrupts. Looks simple enough. What to add a temp sensor to my sensor as well. Sometimes I just want a rainy day and no car, only way I get things done at home. Link to comment Share on other sites More sharing options...
Radian Posted July 18, 2022 Author Share Posted July 18, 2022 I picked the perfect weather to be using an electric heater as a dummy load 🙄 1 Link to comment Share on other sites More sharing options...
SteamyTea Posted July 18, 2022 Share Posted July 18, 2022 (edited) 2 hours ago, Radian said: And once things got into the swing of slowly filling (at around 60W) and emptying (at 2kW) after five cycles the buffer overflows - twice in quick succession, despite no appreciable change in power going in. If anything the power was dwindling as the sun was on its way in behind a cloud again. Do we know how long the meters pulse the LED for, could that cause a multiple reading? 11 minutes ago, Radian said: picked the perfect weather to be using an electric heater as a dummy load @ProDave will be proud of you. He would sit in a sauna, on the hottest day of the year, just to save exporting 1p of electricity. Edited July 18, 2022 by SteamyTea Link to comment Share on other sites More sharing options...
markocosic Posted July 18, 2022 Share Posted July 18, 2022 Typically led != Joule bucket Led pulses for import (typically 1000 per kWh) Led goes solid when meter decides that there's zero load (try flipping main breaker) with some switch on and switch off delay Led may also go solid on export but that isn't a given. Not safe to assume that led = 3600J Probably not safe to assume that joules bucket is 3600J either Buy a secondary CT meter that reports live data on demand rather than faffing with LEDs? Link to comment Share on other sites More sharing options...
SteamyTea Posted July 18, 2022 Share Posted July 18, 2022 (edited) 6 minutes ago, markocosic said: Led pulses for import (typically 1000 per kWh) That is the number of pulses, I am interested in how long each pulse is. Trouble with the CT clamp only method is you have to assume a voltage and power factor. Edited July 18, 2022 by SteamyTea Link to comment Share on other sites More sharing options...
Radian Posted July 18, 2022 Author Share Posted July 18, 2022 25 minutes ago, markocosic said: Typically led != Joule bucket Hi markocosic. The impulse LED on my Elster AS300P is labelled 4000imp/kWh so I'm only expecting it to pulse once every 0.9s for a 1kW load (4000 flashes per hour for example). By observation it also continues to pulse identically irrespective of power flow direction, whether in or out of the Joule bucket region except for when the bucket overflows and the tamper flag comes on the display. Also on the display is a 4-quadrant arrow indicating power flow direction for both active/reactive power. Watching this shuttle back and forth confirms that there is a buffer (Joule bucket) before it overflows. 37 minutes ago, markocosic said: Probably not safe to assume that joules bucket is 3600J either Your'e right about that. I understand that some continental utility meters have such small buffers that burst firing isn't feasible with 3kW loads. I don't think mine is that bad but it sure is behaving strangely. 39 minutes ago, markocosic said: buy a secondary CT meter that reports live data on demand rather than faffing with LEDs? I think you're being led astray by @SteamyTea who is also monitoring power but exclusively using the LED blink method. I have a CT and sample it alongwith voltage to get a real power reading at around 128 samples per cycle. I have been monitoring the impulse LED in parallel to serve as a confidence boost for my measurement accuracy and also to re-sync the bucket when it overflows. This latter step is based on an assumption - having seen the LED sync with the anti-tamper icon on the LCD. I think this refers back to the concept of 'winding the clock backwards' which is analogous to pushing power back into the grid. Link to comment Share on other sites More sharing options...
SteamyTea Posted July 18, 2022 Share Posted July 18, 2022 13 minutes ago, Radian said: tamper flag comes on the display Does your meter have 2 LEDs, one for direction and one for quantity? I seem to remember that my neighbours smart meter has 2. My mother has a smart meter (broken as no display) but think it has two LEDs on it. Shall check when up there this weekend. I have an old one, so just the one LED I think. Should go and look. Many PV systems use a similar meter, so the reverse indication should come on at night. Has anyone checked? Link to comment Share on other sites More sharing options...
Radian Posted July 18, 2022 Author Share Posted July 18, 2022 28 minutes ago, SteamyTea said: Does your meter have 2 LEDs, one for direction and one for quantity? No, down in the bottom right corner of the LCD display, next to the anti-tamper "ratchet and pawl" symbol are the four quadrants showing active +/-A (real) and reactive +/-R (imaginary) power flow direction. The other impulse LED below the buttons is for reactive power. Can't see anyone having a use for that? Of course these "revenue grade" meters eschew the likes of CT's and use volt-drop across known resistances to quantify current. I'd do the same were it not for the invasive introduction of a suitable resistor after the main isolating switch in the Consumer Unit. CT's are a pita due to their non-linearity and phase errors. I compensate as much as I can for these but a direct measurement of current would be heaven. I already poke 240VAC (albeit resistor dropped) into my ADC to eliminate the distortion of a voltage transformer! Link to comment Share on other sites More sharing options...
SteamyTea Posted July 18, 2022 Share Posted July 18, 2022 2 minutes ago, Radian said: The other impulse LED below the buttons is for reactive power. Can't see anyone having a use for that Never really understood what that is. Is there a mechanical term, like there is for water. Pressure and Back Pressure. Though what you are meant to do with that knowledge. Think you end up with static and dynamic pressures. Link to comment Share on other sites More sharing options...
ProDave Posted July 18, 2022 Share Posted July 18, 2022 6 hours ago, Radian said: The joule bucket trace, labelled "export" is in orange. It is expected to ramp up and down as generation exceeds consumption and is supposed to model the 3600J buffer in the utility meter. When it reaches the 3/4 point (2700J) it fires the dump load (2kW heater in this experiment) until it drops the buffer to 1/4 (900J). I see a different approach there to mine. If I am reading that correctly you always wait until the joule bucket is 3/4 full then turn on your bump load for long enough to drain the bucket to 1/4. If I am reading that correctly it means your dump load will always be on for a fixed interval, with the time between bursts varying? I took a different approach. I had worked out that a nominally 3kW dump load (immersion heater) would empty an assumed size joule bucket in a little under 1 second. So I chose to work on a fixed time interval of half a second. So in each half a second, the dump load can be on for anything between 0% of the time and 100% of the time. The half second means the joule bucket should never over fill or over empty and should comfortably fill a bit them empty a bit without overflowing either way. I have not attempted the detailed analysis of how accurate it is performing, but I do have a separate export meter, and the only time I get significant export is when generation exceeds what the dump load can export, and on a sunny day the import meter does not count up so it can't be far out. 1 Link to comment Share on other sites More sharing options...
Radian Posted July 18, 2022 Author Share Posted July 18, 2022 11 minutes ago, ProDave said: I see a different approach there to mine. If I am reading that correctly you always wait until the joule bucket is 3/4 full then turn on your bump load for long enough to drain the bucket to 1/4. If I am reading that correctly it means your dump load will always be on for a fixed interval, with the time between bursts varying? Yes you read that right but the load may not always be on for a fixed time because other factors may affect the power flow during that period. In addition to the dump load there will be other changing house loads and the PV may be gong up or down as well. That's why I needed a low-latency link for the signal to turn on the Triac: the power flow is evaluated for every cycle, and the bucket model adjusted accordingly. 17 minutes ago, ProDave said: I took a different approach. I had worked out that a nominally 3kW dump load (immersion heater) would empty an assumed size joule bucket in a little under 1 second. So I chose to work on a fixed time interval of half a second. So in each half a second, the dump load can be on for anything between 0% of the time and 100% of the time. The half second means the joule bucket should never over fill or over empty and should comfortably fill a bit them empty a bit without overflowing either way. It seems to work for you but it sounds like you've 'locked-in' a certain amount of loading that may not be altogether appropriate. Probably evens out over the long term but I'd expect a touch of over/underflow. Although now I read that back I'm not so sure - depending on when you commit to dumping a certain amount of energy does that not mean you might be working in a 'virtual buffer' on the consumption side - albeit balanced out by half of the buffer in the meter? Link to comment Share on other sites More sharing options...
ProDave Posted July 18, 2022 Share Posted July 18, 2022 Yes I have made the assumption that the dump load is the same immersion heater which is in practice 2.8kW not 3. It seems to work okay, as house loads vary and the difference between generation and use changes then the duty cycle of the dump load is altered. There is no right or wrong way to do this and I am enjoying this thread reading about a different approach to the same "problem" Link to comment Share on other sites More sharing options...
Radian Posted July 18, 2022 Author Share Posted July 18, 2022 49 minutes ago, SteamyTea said: Never really understood what that is. Is there a mechanical term, like there is for water. Pressure and Back Pressure. Though what you are meant to do with that knowledge. Think you end up with static and dynamic pressures. Reactive power is being measured when the alternating current is not in phase with the supplied voltage. It's the component of complex power that's stored and retrieved from reactive loads like capacitors and inductors rather than actually performing useful work. Thank goodness we aren't currently billed for it! This is one trick the network operators have got up their sleeves to squeeze more revenue out of us. It makes the presence of all mentions of reactiveness around the meter a little bit worrying. Of course it's also the case that heavy industry pays for reactive power so the equipment is no doubt multi-purpose. If we were to be billed for reactive power, my fridges and freezers would be twice the price to run and your pound-shop LED lamps might be 10 times the cost to run as the power factor is approximately the ratio of mains voltage to output voltage across the LED's. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now