Energy Diverter - PLL or the MK2

Is there a comparison between the two diversion techniques in terms of pros and cons?

Robert Wall's picture

Re: Energy Diverter - PLL or the MK2

I doubt you will see any significant differences. The Phase Locked Loop (PLL, not PPL) reads at defined points in the cycle on the voltage wave, whereas Robin's Mk2 is asynchronous, so the points at which measurements are made will drift along the wave over time. The PLL will measure an exact number of cycles for each reporting period, the Mk2 will have a small "end effect" where the number of cycles is not exact, but the fractional part of a cycle that contributes the error will be a very small fraction of a cycle anyway (less than about 1/50th) and very close to the zero crossing, so the energy it contains will be very small, and over the 10 s reporting period quite insignificant.

Martin's original PLL only reported the energy available for diversion, because in his original (unpublished) design, he used temperature measurements to control diversion (not the cylinder thermostat) so the number of cycles when the energy was diverted was an accurate measure of the energy diverted. In the published design, using only one CT, it counts energy diverted even when the 'stat is open. This can be solved in the same way as Robin does in the Mk2 units he markets by adding a second CT to perform an actual measurement of the diverted current.

Bramco's picture

Re: Energy Diverter - PLL or the MK2

Throwing in my three hapence worth, I personally found it a lot easier to work from Martin's PLL sketch which I adjusted to support a number of temperature sensors, in my case 5.

Actually thinking back I worked from a version of Martin's sketch modified by someone else to do the diversion based on 2 CTs.

bruce_miranda's picture

Re: Energy Diverter - PLL or the MK2

Easier in what sense?

 

Duplicate post deleted - BT

bruce_miranda's picture

Re: Energy Diverter - PLL or the MK2

@Bramco any chance you can point me to the sketch that you used as your starting point.

on another note, how do one figure out if the thermostat is open or closed? Are people doing it programmatically or via a simple switch locator neon. 

calypso_rae's picture

Re: Energy Diverter - PLL or the MK2

If a dump-load can draw no current because its thermostat has opened, the virtual energy state will rise to the maximum (when surplus power is available).  At this point, real energy will start leaking away to the grid via the meter. 

The energy state (aka "bucket") is continuously monitored in both types of Energy Diverter system (PLL and Mk2), so it would be easy to turn on an indicator or whatever when overflow occurs.  Some of my earlier Mk2 builds have an LED for this purpose.

bruce_miranda's picture

Re: Energy Diverter - PLL or the MK2

Excellent thanks. 

calypso_rae's picture

Re: Energy Diverter - PLL or the MK2

RW: ...the Mk2 will have a small "end effect" where the number of cycles is not exact, but the fractional part of a cycle that contributes the error will be a very small fraction of a cycle anyway (less than about 1/50th) and very close to the zero crossing, so the energy it contains will be very small, and over the 10 s reporting period quite insignificant.

Yes, I agree with all of that.  Any energy content that does not make it into the calculations for one mains cycle will always make it into the next one, so no data is lost. 

The rounding error comes about because of the variable number of sample sets (pairs) that can occur within each mains cycle. The average power is determined by summing all the instP values (V*I) and dividing by the number of sample sets.  If an extra sample set creeps in at the very end of one mains cycle, this will slightly reduce the calculated value, but the result for the following cycle will be corresponding increased. 

Back in the early days, I recall doing some spreadsheet checks on this detail, and found that this source of error was indeed insignificant in macro terms.

Bramco's picture

Re: Energy Diverter - PLL or the MK2

Bruce, I'm not sure why I found Martin's sketch easier to modify but from memory it was maybe because his sketch included the temperature readings and I'm also not sure whether Robin's sketch did the data transmission at the time. Might be mistaken on that though.

I actually worked from a version of Martin's sketch which had been modified by PB to handle 3 CTs. I did some other minor mods and included code to read 5 temperatures. I wanted to observe what was happening on my heat bank which takes in diverted energy from the PV as well as from solar thermal.

As i mentioned in a previous post I didn't bother with the id's of the sensors but simply take the readings from the sensors and pass the through to emoncms on a pi. In emoncms I have identified the sensors based on the temperature values, highest I called top of tank etc. This is a much simpler way of doing things than identifying each of the sensors by id and then putting them in the transmission in the right order. If you see what I mean.

I have attached the sketch which has been running for the last year or so without any hitches.

bruce_miranda's picture

Re: Energy Diverter - PLL or the MK2

In the MK2 sketch is there anything that is restricting the dump load? The reason I ask, is yesterday my PV was generating 3.6KW of which only 2.7KW was being diverted, when I actually have a 3KW immersion and the house load is about 400Ws.   

My sketch is running in normal mode, not anit-flicker. 

calypso_rae's picture

Re: Energy Diverter - PLL or the MK2

bruce_miranda, in the conditions that you describe, your dump-load should have been fully on, with no cycling of the power.  The 2.7 kW value that you have recorded for diverted power may be an inaccuracy of calibration.  How did you measure these power values?

When the supply of surplus power is greater than the rating of the dump-load, the Mk2's energy bucket will be sitting at its maxim value.  In these conditions, there is nothing in the Mk2's logic which would restrict power.

bruce_miranda's picture

Re: Energy Diverter - PLL or the MK2

Currently a CT is measuring the current passing through to the diverted dump load. All the CTs have been calibrated, so wouldn't have expected a 300w difference. I too found it odd and couldn't see anything in the code that could explain or assume the dump load being only 2.7k. Hence my question.

I will monitor this and see if this continues to be noticed. I was too excited to finally see 3.9k of solar being generated yesterday, to be bothered about anything else :-)

calypso_rae's picture

Re: Energy Diverter - PLL or the MK2

OK, but there's a big difference between the load being fully on, and it being cycled by the Router's logic to maintain an accurate balance between import and export.

I don't see how you can "calibrate" a CT.  Are the signals from your peripheral CTs being processed via a multi-channel sketch of mine, or by some other means?

I wish we could generate enough surplus power to keep our 3kW immersion fully on.  But even without this luxury, our panels generated 12 kWh today of which the DHW tank could use only 4.8 kWh.  This is probably the time of year where a secondary load becomes worth having.

bruce_miranda's picture

Re: Energy Diverter - PLL or the MK2

I think the cycling could explain the difference, but was just surprised to see the CT reading 2.7K going to the dump and over 1K being exported back. 

By calibrate the CT, I meant, that it reads correctly when I pass a known load through them. 

I am using a modified version of your multi-channel sketch. 

I wish I could use the surplus power on a secondary load. But we have no other resistive loads in the house. 

calypso_rae's picture

Re: Energy Diverter - PLL or the MK2

You could try running the PLL sketch, and see whether you get the same results.  Both sketches have similar output stages so they should have similar behaviour when your panels are in full sun.

I know you live in a warm part of the world (at this time of year), but in the interests of science and technology there must be something else in your house that you can dump your excess surplus power to!

 

bruce_miranda's picture

Re: Energy Diverter - PLL or the MK2

I'm open to suggestions to dump load to, seriously. Besides going out and buying a storage heater or some batteries, there is nothing else around the house that needs powering that itself. 

My wife is already loving our solar panels because the house has never been cleaner, thanks to me vacuuming, doing the laundry, running the dish washer etc whenever I see excess power on the monitor!.

But all those can't operate like a dump load.  

pb66's picture

Re: Energy Diverter - PLL or the MK2

Rather than making a purchase just to test you could do a couple of other tests, eg temporarily bypass the diversion circuit/code (either physically or by coding depending on which you are comfy with) to see what water heater element actually draws or more specifically what it is reported to draw when powered directly.

This will identify how much can be consumed by the heater or if the reported amount is inaccurate etc.

As for an additional load a kettle, washing machine or dishwashers heating phase should push you to the limit you require quite easily, you only need one "diversion load" to be switched or "mop up the surplus" as long as you can see the utility meter stationary during periods of high production that proves the diverting is working accurately.

If you can successfully divert all PV ( ie >3kw) AND the water heater circuit is both reporting accurately and able to burn 3KW then you do have a restriction in the diversion code but I would of thought that is the least likely outcome.

Paul

bruce_miranda's picture

Re: Energy Diverter - PLL or the MK2

I'll try shorting the outputs to switch the dump load on continuously and see what the CT reading looks like. I've not checked in the code if the diverted CT will only sense current if the code has diverted, or if all CTs are reading irrespective of the diversion logic.

I have another question about the diversion logic. 

The Mk2 is operating in Normal mode and there is not enough power from the solar for the dump to be continuously on and is rapidly cycling, how can I be absolutely sure that the meter is not moving forward very very slowly? I have a digital meter and I know that the LED is on constantly if I am exporting, but when the MK2 is working the LED is not On and that makes me nervous. Is it operating in the sweet_zone or not?

bruce_miranda's picture

Re: Energy Diverter - PLL or the MK2

I stared at the meter today for over 2 mins. There was a lot of solar power available and the MK2 was in full swing, but on this occasion the meter LED was off and the second decimal point value was incrementing. So I was buying power, although very very slowly.
I didn't think any calibration was needed when running in Normal mode. In any case the unit is calibrated and my KW/d values are within a few decimal places away from the meter.
So what do I change to increase the threshold. Also this doesn't happen every time.

calypso_rae's picture

Re: Energy Diverter - PLL or the MK2

In all Mk2 sketches that I have posted, each current sensor operates "continuously" and all ADC samples are used; the current sensors are never disabled.  If you bypass the output stage so that the load is consuming power constantly, the current sensor's reading will depend on where its associated CT is located.  If the CT is bypassed as well as the output stage, it will detect nothing.

I'm not an expert on Kiwi electric meters, but most meters in the UK have just one LED which is used to convey a number of states.  If the LED is fully "on", that can mean either:

1) minimal forward current has been detected within a certain timeframe, and the meter has gone into an "anti-creep" idle mode;

2) export has occurred to an extent that has exceeded the meter's ability to keep track.  Further exported energy is non-recoverable because the meter's Sweet-zone has been exceeded.

During periods of net consumption, the Mk2's energy bucket will be sitting at its minimal level.  When surplus power first appears, the energy bucket needs to fill to a certain level before diversion can commence.  In "normal" mode, the bucket only needs to fill to 50% of its capacity; in AF mode, it needs to fill to a greater level so that a longer burst of power can be authorised.

While the bucket is filling, energy is being exported.  During this initial period, your meter's LED may come on (on stay on), or it may remain off.  It all depends on the state of the meter's internal recording mechanism at the precise moment when surplus power appears.

An experiment:  When surplus power is available and your Mk2 Router is sitting there with its load, temporarily draw some extra baseload (e.g. kettle) so the the premises is consuming power from the grid.  Your supply meter should start to indicate consumption.  Now, just before the next pulse is due, turn off the kettle.  When this start-up sequence is followed, I think you will find that your meter's LED will remain off while the Mk2 is diverting surplus power.  If, instead, you were to turn off the kettle just after a consumption pulse had occurred, I would expect the meter's LED to come on almost immediately and remain on while the Mk2 is doing its thing.

If you're still not sure whether the Mk2 is working as claimed, just leave it to heat a tankful of water on a sunny day when nothing else is drawing power.  If you end up with a tankful of hot water and the meter's reading has not advanced, it must be doing its job OK.

bruce_miranda's picture

Re: Energy Diverter - PLL or the MK2

I am based in the UK too.

Like I said, if the LED was off and the meter was not advancing I wouldn't be bothered. But the meter IS advancing while diversion is taking place and that's the bit I'm trying to stop. 

I've not actually checked if the meter is advancing when the LED is On. But I am assuming that it won't. 

Update : I've now checked and the meter does not advance with the meter LED is On continuously. But it does advance if the LED is Off. I'll monitor this again the entire day and see if I can see what's happening. Today would have been a good day to check it out because the Solar power was always above the base load of the house, so I should have not seen the meter advance at all. But there were times when other stuff was switched on. So that would have added to the comsumption. 

calypso_rae's picture

Re: Energy Diverter - PLL or the MK2

Sorry, bruce, I'd not seen your latest message when I posted mine this afternoon. 

Have you run my RawSamplesTool on your hardware to make sure that your input sensors are scaled appropriately for the job that they need to do?  There's a link to this sketch on my Summary Page; it's the 4th item from the top.

Ideally, most of the ADC's range (for both V and I) will be in use when maximum generation is taking place.  This will require a burden resistor that's somewhat greater than the ones used on most of the emonTx channels.  With the default value of burden, the measurement system would be very insensitive, but I would not expect any inaccuracy to be enough to cause the type of problem that you're reporting.

 

bruce_miranda's picture

Re: Energy Diverter - PLL or the MK2

My emonTX 2.2 is using burdens of 24R with the shop CTs. I'll run the RawSamplesTool and report back the results. 

pb66's picture

Re: Energy Diverter - PLL or the MK2

Is it possible the meter has a different size (slightly smaller) "energy bucket"?

That could result in a slight "usage" whilst modulating and the discrepancies would increase (even with accurate reporting) on higher production days if potential loads consistently exceeded PV production.

Paul

calypso_rae's picture

Re: Energy Diverter - PLL or the MK2

Bruce, with burdens of 24R, the sensitivity will indeed be poor.  The working range will be probably be around 25 kW (100 Amps).  It will be most interesting to hear about the RawSampleTool results when using this setup, and to see how the system performs after any changes have been made.  My original design used a burden of 150R which gave a working range of approx 6 kW at 5V, or 4 kW if operating at 3.3V.

The amplitude of the AC voltage signal will have an effect too.  If this were to exceed the ADC's working range, your measurement system would then no longer be linear, so anything could happen.  Exceeding the range of the ADC has been the source of strange results from many systems.  Ideally, both of your sensors (V and I) should be using around 80% of the ADC's range for the maximum power flow that you will need to measure  

Paul, while operating in "normal" mode, the energy state should only be varying by around 100 Joules, so it would seem unlikely that the bucket's limits are being exceeded. 

There are many types of supply meter, and it's always possible to this is one that has not been tried before.  The phase-angle version of the Mk2 sketch has brought successful results for at least one user whose electricity meter has refused to work with a burst-mode diverter.

 

Robert Wall's picture

Re: Energy Diverter - PLL or the MK2

"There are many types of supply meter..."

And as I understand it - for the electronic ones of course, there can be variations even between outwardly identical units, as different energy suppliers can have them programmed differently.

pb66's picture

Re: Energy Diverter - PLL or the MK2

Robin - So is "normal" burst-mode or phase-angle ? I had believed burst-mode was the 'default' for all the Mk_2* sketches bar the Mk2_PV_phaseAngle as indicated on the "Choosing an energy diverter" page or is that not the case? 

My suggestion above was indeed based on the assumption the Mk_2* was operating a 3600 joule bucket in burst-mode as per Martin's PLL sketches, due to the opening Q&A plus this is what 'normal' conjures up in my mind, rightly or wrongly, re-reading Diverting surplus PV Power, by Robin Emley I think you would call this "anti-flicker" mode.

So would I be correct in thinking Bruce is running in burst mode with a 100 joule energy bucket? 

Paul

 

calypso_rae's picture

Re: Energy Diverter - PLL or the MK2

Our own Mk2 Router is working very nicely at this time of year.  By 11.20 this morning, our ESE-facing 2.8 kWp PV array had generated between 4 and 5 kWh, of which 3.5 kWh had been diverted to the DHW tank.  The tank had already reached its max temperature and the stat had opened. 

Now I need to find something to do with all this free hot water while the means of replacing it is still available :)
 

calypso_rae's picture

Re: Energy Diverter - PLL or the MK2

So is "normal" burst-mode or phase-angle ?

In my terminolgy, "normal" and "anti-flicker" (AF) are different settings of "burst-mode" control.  When running in burst-mode, the load is either 'on' or 'off' for entire mains cycles.  Transitions can only occur at the zero-crossing points of the voltage waveform.  The AF setting has two thresholds between which the energy state can see-saw at a relatively slow rate.  In the "normal" setting, these two thresholds are co-incident.  Transitions then occur at the maximum rate.

A 3kW appliance consumes 60 Joules per mains cycle.  When operating in burst-mode, the energy state will jump around by at least this amount, probably within a range of ~100 Joules.  Most meters should be OK with this level of jitter which, when operating in burst-mode, cannot be avoided.

The capacity of the "energy bucket" is of little consequence provided that it is big enough.  Providing that the calibration is roughly right, the standard size of 3600J should be fine.  The user needs to ensure that the system is not running out of range.  Some of the earlier Mk2 sketches had LEDs to indicate these limit conditions, but these extra features all consume valuable IO pins.

Phase-angle control allows the amount of power to be varied within each mains cycle.  In steady-state conditions, the energy state at the end of each mains cycle should be unchanged.  This method of control may be needed for certain types of meter which have very little tolerance of reciprocating power flow.

The only phase-angle Mk2 sketch that I have posted has a 1000 Joule range within which the diverted power can be gradually varied.  Such a system would need to be properly calibrated and have its V and I sensors correctly scaled to use most of the ADC's working range.  The distinction between "normal" and "AF" has no meaning within a phase-angle controlled system.

 

bruce_miranda's picture

Re: Energy Diverter - PLL or the MK2

"At 24R the working range will be probably be around 25 kW (100 Amps).  It will be most interesting to hear about the RawSampleTool results when using this setup, and to see how the system performs after any changes have been made.  My original design used a burden of 150R which gave a working range of approx 6 kW at 5V, or 4 kW if operating at 3.3V."

Robin you may be on to something here. But I need to understand better before I start replacing resistors. I'm using the standard emontx 2.2 which is running the chip at 3.3V, so I presume the CTs are also using 3.3V reference.

Newbie questions alert!

1. So with a 150R resistor am I bettering the resolution of the CTs or reducing the range? I currently have 3 CTs, one measuring the grid input, one measuring the solar output and one measuring the diversion circuit. If it's bettering the resolution, which is a good thing, then why was the emontx design made with an 18R - just for better battery life? If its the range, then I wouldn't think a 4kW range would be enough for the grid CT. 

2. Do I need to run the RawSampleTool on a known load? Or can I just run it against my current setup against the Grid input. 

3. How can I figure out if the amplitude of the ADC is being exceeded or not. 

Robert Wall's picture

Re: Energy Diverter - PLL or the MK2

A lesson on CTs and digital inputs coming up!

A CT is a current source. It will generate a secondary current proportional to the current in the wire it sits on (the primary winding - usually one turn). The burden resistor (18 Ω or whatever) turns this into a voltage. Yes, the ADC does use the supply as its reference and that too represents the maximum peak-peak amplitude that can be converted into a number. So the maximum p-p amplitude you can measure without clipping is 3.3 V (less some for component tolerances - see Building Blocks for the details), which works out to be around 100 A in the primary. The emonTx V2 was not specifically designed for PV inputs, so all were set to 100 A. If you increase the value of the burden, you increase the voltage, but you also increase the power that the CT has to transfer, and that worsens its errors (because CTs prefer to work into the closest possible approximation to a short circuit, in the same way that voltage transformers prefer to work into an open circuit).
I've not mentioned battery life - it doesn't come into it. The power dissipated in the burden comes from the primary circuit, in the form of an increased voltage drop across the CT (yes! for 1 V rms across the burden, you must have 0.5 mV drop across the primary - the voltage ratio is 1 : 2000 if the current ratio is 2000 : 1).

Now that 3.3 V p-p represents 1024 counts p-p, so if you have only 0.33 V p-p (10 A primary current in rough terms), you have only 100 counts (in rough terms) to describe the input wave. So resolution has suffered.

Therefore, for best performance, you need to decide the maximum current you want to measure, add some to allow for the wave shape not being a good sine wave and for component tolerances, and calculate a burden resistor based on that. And of course each channel can be different. Then of course you need to recalibrate.

Robin's sampling tools will show you the input amplitude - of course you'll use it on the maximum current you want to measure.

bruce_miranda's picture

Re: Energy Diverter - PLL or the MK2

I did read up on this, after I posted my silly questions!

And I think its the range that's what is probably causing the issue. Hence the hit and miss results. 

My burden of 24R on all the CTs is too low and that is resulting in not so accurate reading of the power which is a requirement for the diversion. It stems from my wish of doing both whole house and solar monitoring as well as excess power diversion. So now I need to rethink my priorities. Probably best to use 2 CTs to measure the grid, one for monitoring and the other more sensitive one for the diversion, and ditch monitoring the diverted power or solar power. 

Or add a 4th more sensitive CT on a separate break out board using one of the spare analogue inputs. 

I should have noticed the clue in Robin's comments about the V3 "The emonTx V3 has four CT inputs, but only CT4 has a sufficiently high sensitivity for control purposes.  This channel is therefore used to monitor the grid supply. "

calypso_rae's picture

Re: Energy Diverter - PLL or the MK2

It will still be well worth running the Raw Samples Tool.  I do so for every Mk2 system that I build.  If the voltage signal is not of a reasonable amplitude, this could seriously affect your results.  Here is a set of waveforms that I took a few days ago for a 3-channel system (with one sensor for voltage, and two for current):

millis() now = 18903
recordingMayStartAt 23903
4
3
2
1
0
No of cycles recorded = 1
cycleCount 552,  samplesRecorded 53
|                                    1 2v                                       |
|                                 1    2.    v                                  |
|                              1       2.          v                            |
|                            1         2.              v                        |
|                          1           2.                  v                    |
|                         1            2.                     v                 |
|                        1             2.                       v               |
|                         1            2.                       v               |
|                          1           2.                        v              |
|                            1         2.                      v                |
|                               1      2.                 v                     |
|                                  1   2.           v                           |
|                                     12.     v                                 |
|                                      2v1                                      |
|                                  v   2.   1                                   |
|                            v         2.      1                                |
|                        v             2.         1                             |
|                    v                 2.           1                           |
|                v                     2.            1                          |
|               v                      2.            1                          |
|              v                       2.            1                          |
|             v                        2.           1                           |
|              v                       2.          1                            |
|                   v                  2.       1                               |
|                        v             2.    1                                  |
|                              v       2. 1                                     |
|                                    v12.                                       |
min_V 188,  max_V 833
min_I1 331,  max_I1 689
min_I2 509,  max_I2 510

Channel 1 has 2 kW flowing which covers approx 1/3 of the ADC's range.  This is for a 5V system with a 150R burden.  With the 3.3V emonTx, the same sized signal would span approx 50% more of the ADC's range.  Channel 2 has the same value of burden resistor but no CT is present hence no signal is seen.

Robert Wall's picture

Re: Energy Diverter - PLL or the MK2

That's probably your answer. There's nothing preventing you from having two CTs on one wire. And with a bit of intelligence in the sketch, you should be able to switch so that you use the most applicable one for display and reporting.

One of the application note designs, on which I think the emonTx design is based, has a switched-gain amplifier in front of the ADC as a means of expanding the dynamic range. ("Atmel 2566A" will find it.)

bruce_miranda's picture

Re: Energy Diverter - PLL or the MK2

I was probably misled by all the comments saying the emontx could be used as is. But now I know that the hardware too needs to be tuned to work as a diversion unit. Funny that even Martin didn't refer to this fact in his PLL notes, and he too would have needed a high sensitive CT input. 

If I have a 3.3V system and my Solar is a 4KWh system should I use a 120R as per the emontx specs or a 150R as per Robin's (even though I know Robin uses 5V)? Also the CT measuring diverted power should never see more than 3KW, but I'm guessing Robin uses the same value just to reduce the BOM. 

There also appears to be 130R and 140R available now too, I'm guessing 0.25W power should be fine with the burdens. 

Also I doubt my whole house gets anywhere near the 25KW mark, so in fact even my monitoring CT burden can be increased a bit, I would have thought. Need to work out how much I ever expect to see as peak load on the grid. 

bruce_miranda's picture

Re: Energy Diverter - PLL or the MK2

Attached as my Rawsample outputs for all 3 CTs using both the single wave and triple wave sketches. CT 0 is my grid CT, CT 3 is my solar and CT 1 is my diverted.

I think we are most interested in the Grid CT. This is what is looks like at 3.3V with a 24R burden.

 

In NORMAL mode ...

SUPPLYVOLTAGE = 3403, V_RATIO = 0.98, I_RATIO = 0.26
millis() now = 11
recordingMayStartAt 5011
4
3
2
1
0
 <recording data ...> 

cycleCount 252,  samplesDuringThisMainsCycle 73
|                                     v c                                       |
|                                       c      v                                |
|                                       c           v                           |
|                                       c                v                      |
|                                       c                     v                 |
|                                       c                         v             |
|                                       c                             v         |
|                                       c                                v      |
|                                       c                                 v     |
|                                      c                                  v     |
|                                      c                                  v     |
|                                      c                                  v     |
|                                       c                               v       |
|                                       c                          v            |
|                                       c                      v                |
|                                      c                 v                      |
|                                      c            v                           |
|                                      c      v                                 |
|                                      cv                                       |
|                                v     c                                        |
|                           v          c                                        |
|                      v              c                                         |
|                 v                    c                                        |
|            v                         c                                        |
|        v                             c                                        |
|     v                                c                                        |
|    v                                 c                                        |
|    v                                 c                                        |
|    v                                  c                                       |
|   v                                   c                                       |
|    v                                 c                                        |
|        v                             c                                        |
|            v                         c                                        |
|                 v                    c                                        |
|                       v              c                                        |
|                            v          c                                       |
|                                  v    c                                       |
minVoltage 62,  maxVoltage 955,  minCurrent 498,  maxCurrent 524

 

bruce_miranda's picture

Re: Energy Diverter - PLL or the MK2

What happens if the current flowing through the CT is more than what the burden has been specified for? Will it just go beyond what the ADC can read but not damage anything, right? I guess that is right because otherwise Robin's Mk2s would not have a 150R as burden on the Grid CT. 

The reason I ask this is because the emontx 2.2 doesn't have the current limiting 1K or the protection diode to GND. So I'll be relying completely on the chip internal voltage clamping.

calypso_rae's picture

Re: Energy Diverter - PLL or the MK2

Bruce, with the various traces that you've shown, the voltage waveforms look OK.  Your waveforms for current are only using a small fraction of the available steps at the ADC so the quantisation distortion will be poor.  Whether this setup is OK depends entirely on how much current was flowing through your CT at the time. 

The Atmega processor seems pretty resilient to over-voltage from excessive current at the CT.  Adding a series resistor between the burden and the analogue input port can reduce the work that the internal protection has to do in such conditions.  But few existing designs include such a feature.

The Mk2 systems that I build can run at either 3.3V or 5V depending on the customer's preference.  There are pros and cons for both options. 

 

 

bruce_miranda's picture

Re: Energy Diverter - PLL or the MK2

Robin, I read your reassuring comment in the emontx 3.4 thread

"For much of the last year, a standard emonTx V2 has been doing sterling service in our garage, with nothing to supplement the processor's internal protection.  When our 8kW electric shower is turned on, the signal that the ADC sees will just be a max-amplitude square wave.  No harm has ever befallen the system, it always recovers in true Tom & Jerry style."

So the question is, do I go for a 120R on the grid CT and keep it in line with the emonTX v3 design or stretch it out a bit more and use a 150R on my emontx v2.2 operating at 3.3V? Given that I only need to know if there is more than a surplus for the dump load I could go with 150R. 

I can't see an easy way of putting a 1K protection resistor into the existing emonTx, unless I build a completely new input to it. 

bruce_miranda's picture

Re: Energy Diverter - PLL or the MK2

I think I am going to chicken out from trying to put an unprotected overvoltage CT into the existing emontx 2.2. So probably best to build a new input to the board for the grid CT. 

I notice that the emontx 3.2 doesn't have any protection diodes but the emontx 3.4 has. Do I need the diode or not? And if I do what through hole 3.3v version should I get?

Robert Wall's picture

Re: Energy Diverter - PLL or the MK2

"I notice that the emontx 3.2 doesn't have any protection diodes but the emontx 3.4 has."

Really?

bruce_miranda's picture

Re: Energy Diverter - PLL or the MK2

Atleast the schematics/bom doesn't have D2-D6. They are present on the V3.4 but not on the V3.2

So the question is do I need them? And if so what is a suitable thru-hole version that I should buy. 

dBC's picture

Re: Energy Diverter - PLL or the MK2

If you're building your own front end, consider the schematic sketch about half down the page in this thread:

http://openenergymonitor.org/emon/node/10203

You can use nice big beefy diodes.  Having them upstream of the series resistor means they'll start conducting well before you exceed the 1mA limit on the internal protection diodes.  That should give you fairly bullet-proof protection.

bruce_miranda's picture

Re: Energy Diverter - PLL or the MK2

Please give me an example of a 'beefy' diode I can use on my 3.3v emontx? I have some 1N4001 around, will those do, or should I get some special schottky or zeners?

dBC's picture

Re: Energy Diverter - PLL or the MK2

Yep, that'll probably be beefy enough.  The main thing is that it's able to shunt the worst case current you expect to arrive at that pin, and you're in a better place to calculate that than me.

Your Vcc doesn't matter as the diode is clamping how much higher than Vcc (whatever it may be) that input pin can get to (or how far below 0V).  If you just put those diodes directly onto the AVR input pins they wouldn't really achieve much because the AVR's internal diodes start conducting at just Vcc+0.5V, so the internal diodes would end up "protecting" your beefy external ones.  But you're not meant to exceed 1mA on the internal ones, so they wouldn't protect them for long.

When the AVR pin voltage is at Vcc+0.5V and the internal diodes are sinking 1mA, there'll be a 1V drop across that 1K series resistor, so your junction will be at Vcc+1.5V.  The other end of your diode is at Vcc, so your diode will be seeing Vcc+1.5V - Vcc  = 1.5V  (hence Vcc doesn't matter), which will be more than enough to get it conducting.

Of course, all of this assumes your power supply rail is low enough impedance to soak up anything you throw at it and maintain a steady Vcc throughout.  It will be to some extent, but there's not a whole lot you can easily do about that.  

bruce_miranda's picture

Re: Energy Diverter - PLL or the MK2

Getting back to this after my holidays. The emontx 2.2 was modified with two inputs using burdens of 120R for my solar and divert loads. And I went with a 39R on the whole house monitoring and control input. 

But I am still noticing that sometimes the meter is not got that export LED indication (continuously on), so it is moving forward very very slowly, when divertion is taking place. On other occasions, the LED is on which means that the meter is not moving forward. 

I have currently used theoretical values for the powerCal and its running in Normal mode, so didn't think I needed to calibrate accurately. 

So what is causing my meter to move forward. Do I raise the grid burden higher because even at 39R I am not getting the resolution the MK2 needs?

Robert Wall's picture

Re: Energy Diverter - PLL or the MK2

"But I am still noticing that sometimes the meter is not got that export LED indication (continuously on), so it is moving forward very very slowly, when diversion is taking place. On other occasions, the LED is on which means that the meter is not moving forward. "

I think that means two things. One, that there's a slight non-linearity in the measurements between imported and exported energy, and two, that the imbalance is so small that the meter is just on the edge of anti-creep, and sometimes the anti-creep kicks in and sometimes it doesn't.

It may well be that there's just a sniff of noise creeping in that's enough to add enough bias to just tip the dump load below the point at which it balances the excess PV. You should be able to test that by popping the CT off its cable (and well away from any current-carrying cable) and then monitoring the energy bucket. It should not of course move.

calypso_rae's picture

Re: Energy Diverter - PLL or the MK2

When no current is flowing, the level in the virtual energy reservoir can slowly creep.  This is because of tiny signals being encoded by the 10-bit ADC in a way that is similar to the effects of real power.  This situation is not normally apparent when the the system is in service because there is generally some current at the supply point, either import or export.  

Disc meters don't seem to work well with rapid changes of current flow.  If this kind of meter can be seen slowly drifting forward when the Router is active, a small amount of export bias can be easily introduced.  This acts like a leak in the energy bucket, so less real energy will be diverted.

In the Mk2_PV_Router_mini_3 sketch, the bias factor is called safetyMargin_Watts.  In my later sketches for the emonTx V3, it's called REQUIRED_EXPORT_IN_WATTS.  They both have exactly the same effect.

With a digital meter, the LED may be either on or off when the Router is operating correctly.  Maybe I should post a video to demonstrate this - it does seem to have caused a lot of confusion over the years.

bruce_miranda's picture

Re: Energy Diverter - PLL or the MK2

A video would definitely help. For my own piece of mind I would prefer to have the LED light constantly on, when diversion is taking place. At least that way I am reassured that there is no import happening. 1 watt of export is better than importing any amount. 

DaveTaylor's picture

Re: Energy Diverter - PLL or the MK2

Dont forget 3kW heater is only 3kW at 240V AC  at 220V AC  its only 2.7Kw

Re Dave

Robert Wall's picture

Re: Energy Diverter - PLL or the MK2

That comment smells like spam to me.

calypso_rae's picture

Re: Energy Diverter - PLL or the MK2

Bruce, if you want your diverter to have a bias towards export bias, you can very easily include this at the top of the sketch as detailed above.  Most people prefer their diverter systems to divert all of their surplus power rather than only some of it.

By means of a kettle, I can very easily arrange for our meter's LED to be either constantly on or constantly off while surplus power is being diverted.  If I were to post a video showing these two situations, would that satisfy you that the state of the LED really is not important providing that it is constant?

"One Watt", which implies one Joule per second, is not a helpful way to think about the Router's operation.  The Router is dealing with hundreds of Joules flowing first in one direction, then the other.  A 1 Watt bias towards export is the equivalent of having a 1 Watt "leak" in the energy bucket.  Whether the bucket is intact or leaky, its level will still ramp up and down as the load is turned off and on. 

The Router and meter are two independent measurement systems.  The Router will only divert energy that it knows would otherwise be lost.  When surplus power first becomes available, the Router may allow more energy to leak away to the grid than is strictly necessary, this being to ensure that the user is not penalised.  The random relationship between these two systems is what gives rise to the random state of the meter's LED while diversion is taking place.

 

 

 

bruce_miranda's picture

Re: Energy Diverter - PLL or the MK2

As I said, a video would definitely help. For me the state of the LED is not the main concern, it's just that when the LED is off I begin to stare at the digits of the meter (sad life, I know) and notice them going up. But when the LED is on, I never bother because I know the LED will never be on constantly in an import situation.

calypso_rae's picture

Re: Energy Diverter - PLL or the MK2

If the state of the LED is not your main concern, then I fail to see how any video from me would help.  Here's how to do the check for yourself:

While there is some surplus power, turn something on (e.g. a kettle) which will ensure that the premises is importing.  The LED at your meter will slowly pulse.  Then, immediately after a pulse has occurred, turn off the extra load.  While the energy bucket in your Mk2 Router is filling, the LED at the meter will almost certainly turn on.  This shows than a small amount of energy has been permanently lost to the grid during the start-up phase of the Router.

Then, repeat the test, but turn off the extra load just before the next pulse at your meter is expected.  This time, the Router will get to its operating point before the meter's "energy window" runs out of range.  Diversion of surplus power will continue with the LED off.  If the LED comes on after a few minutes, that will probably indicate that the meter has entered its anti-creep or 'sleep' mode because of the absence of any net flow.

With a standard single-LED meter, it is my understanding that a chargeable event only occurs when the LED goes from on to off.  If there is no visible activity at the meter's LED while diversion of surplus power is in progress, you need not worry about being charged.

 

bruce_miranda's picture

Re: Energy Diverter - PLL or the MK2

Ok I will try what you have suggested. But as I said, it was not the LED state that worries me. Its the fact that during excess solar (way above my house's base load) and diversion I see that my meter digits have moved forward. Yes it was the second decimal that increased and yes after a lot time but it did nevertheless. 

The one question I do have.

I have currently used theoretical values for the powerCal for the grid CT and its running in Normal mode, so didn't think I needed to calibrate accurately. Is that true?

I've calibrated the solar and divertion CTs using the solar generation meter as my fine tuning basis. But not yet gotten round to do so for the grid CT, which is infact the only one that the MK2 uses to determine everything. 

calypso_rae's picture

Re: Energy Diverter - PLL or the MK2

When running in its "normal" mode, the Mk2 PV Router does not require accurate calibration.  However, the front-end sensors for voltage and current do need to be scaled appropriately for the task at hand.

 

calypso_rae's picture

Re: Energy Diverter - PLL or the MK2

Video footage, to show that the LED on the meter may be either on or off when a burst mode router is diverting surplus power (Mk2 or PLL)

https://www.youtube.com/watch?v=WlR67L1hwYA&feature=youtu.be

bruce_miranda's picture

Re: Energy Diverter - PLL or the MK2

Robin, that video certainly helped. In the situation where the LED was off and mk2 was diverting, I have noticed times when the meter digits would advance, that is the bit I have been trying to avoid, or get my head around. There is a possibility that fact that digits advanced was that during my observation time the solar output drops below base load at times but quickly recovers.

calypso_rae's picture

Re: Energy Diverter - PLL or the MK2

Yes, I think that must be the correct explanation.  It would not seem feasible for the meter's digits to advance without any activity being visible at its LED.

As far as I am aware,  chargeable events only occur when the meter's LED goes from on to off, not the other way around.  If the LED is on continuously, it either means that some energy has been permanently lost to the grid or that the meter has gone to sleep.  In either case, no charge has been applied.

When the LED eventually goes off, that marks the first chargeable event, value ~15 millipence :)

bruce_miranda's picture

Re: Energy Diverter - PLL or the MK2

"value ~15 millipence"

​precisely why I stopped bothering about this and started enjoying the sunshine instead. Being stuck inside a garage waiting to see if digits were advancing while the sun was shining outside, was just sad!

calypso_rae's picture

Re: Energy Diverter - PLL or the MK2

Being stuck inside a garage waiting to see if digits were advancing while the sun was shining outside, was just sad!

Indeed, but you then have to have confidence in the kit that you are leaving unattended ...

Its the fact that during excess solar (way above my house's base load) and diversion I see that my meter digits have moved forward. Yes it was the second decimal that increased and yes after a lot time but it did nevertheless. 

But when exactly did this occur?  It should not be too difficult to devise a sketch which monitors the LED of your meter and records if a chargeable event ever occurs while the output stage has been instructed to be on.  With a properly setup Mk2 (or PLL) diverter system, such events should occur very infrequently.

With two completely independent measurement systems, some degree of drift must be expected between them.  The risk of incurring financial penalties can be minimised by not running too aggressive an AF regime (this will allow more room for drift before "slip" occurs).  Including a small bias towards export may also be helpful.  In practice, any small amount of import may be less that the anti-creep limit of the meter so will be ignored after the meter has gone to sleep.

bruce_miranda's picture

Re: Energy Diverter - PLL or the MK2

I did think of that and that's why I had bought the light sensor. But then I didn't want to overburden the chip by adding yet another interrupt just to catch the LED. So for the moment, ignorance is bliss. 

I am running in Normal mode rather than anti-flicker. I haven't noticed any negative effects around the house, so will just leave it at that. 

Haven't calibrated the grid CT, but that can wait. Currently the sketch is using the theoretical powercal value for a 56R burden. Am using it for diversion and whole house monitoring. 

calypso_rae's picture

Re: Energy Diverter - PLL or the MK2

The Mk2 Router can poll a passive optical detector every mains cycle very easily; there is no need to use either of the Atmega's interrupt pins.  Most of my early Mk2 Router sketches include this feature.

The "grid CT" at the supply point does not need to be calibrated.  Providing that the measurement system is linear, an accurate balance will always be maintained between import and export.   If using the grid sensor for whole house monitoring, it will be less sensitive than if a lesser range was used.

When using the standard YHDC SCT-013-000 CT, a 56R burden is likely to give a working range of around 10kW.  Each step of the ADC will therefore correspond roughly to a 10W change in signal size.  It is not reasonable to expect such an insensitive system to display a high degree of accuracy when only tiny signals are present. 

It's like parking the car in 5th gear ...

bruce_miranda's picture

Re: Energy Diverter - PLL or the MK2

I plan to build a new protected front end and then will put in a much higher burden probably will use a 120R on all CTs with my board running at 3.3V I guess that will be enough.

calypso_rae's picture

Re: Energy Diverter - PLL or the MK2

OK Bruce.  You may be interested in one of these boards - £24 in kit form plus postage.  This PCB includes the DC supply for the processor, and the AC supply for the voltage sensor.  It just needs a 230V AC source and a CT. 

I can include any burden resistor(s) of your choosing.  At 1p each, you're welcome to the full E20 E12 set from 39R to 150R (1/2 Watt).

euclapi's picture

Re: Energy Diverter - PLL or the MK2

Hello,

after a long time working the system now im thinking to implement an upgrade.

the divert energy was going to a water heater that had a resistance 2kw and efficiency below 100%. im thinking to install a heat pump of 700w efficiency over 300%, the problem is that it cannot work with triac so i need to switch on at least 30 min with relay

how could i reprogram the sketch to do that?

the second option is to import from grid when inyection divert is over 300w because is cheaper for me to spend 400w to get the 700w heat pump and warm the watter from it.

thanks.

Robert Wall's picture

Re: Energy Diverter - PLL or the MK2

I do not understand what you want to do. As designed, the energy diverters turn on your water heating load in short bursts - from 1 cycle (20 ms) to several seconds long - so that the average power delivered to the water heater exactly balances the surplus PV power that you would otherwise export to the grid.

I think you are saying that you want to use your heat pump to heat water. How does that affect how your PV diverter operates, or how you want it to operate? The only effect that I can see is that your heat pump consumes 700 W, therefore 700 W less is potentially available for water heating. The diverter will automatically balance the power delivered to your water heater to take account of that.

If you add a relay and change the sketch so that it turns on for a minimum period of 30 minutes when the PV generation is greater than 700 W, then there is no guarantee that at least 700 W will remain available for the whole of that 30 minutes, and it is just possible that you will be importing 700 W for 29' 59" before the relay turns the heat pump off.

Is that what you want to do?

calypso_rae's picture

Re: Energy Diverter - PLL or the MK2

As Robert has pointed out, a heat pump cannot be used as a conventional dump-load because it needs to remain fully on for a considerable period regardless of the amount of surplus power that is available.  In my terminology, your heat-pump would become part of your base-load.

18 months ago, I started a thread about how such loads could be incorporated into a control system for diverting surplus power, but have not heard of anyone putting these ideas into practice:

http://openenergymonitor.org/emon/node/5391

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.