switching fixed load on when surplus pv passes programmed amount.

Hi.

I've acquired some lead acid batteries and want to experiment with PV storage. I understand someone on here has used a robin mk2 diverter to operate a number of battery chargers in sequence to charge his storage.

I'm not looking for something as complicated as this at this stage, and would like a simple on or off load when surplus power passes a fixed amount. My thinking is to use say 400w charger, when surplus power passes say 450w it will switch the charging load on until it drops below this level.

I have had a look for some type of current monitoring with programmable switching, but unable to find something suitable.

Does anyone have any ideas I could use.

 

thanks

Robert Wall's picture

Re: switching fixed load on when surplus pv passes programmed amount.

If you're measuring nett grid power, there's an immediate problem with your algorithm. You need to add hysteresis, i.e. you can switch the charger on at 450 W or greater export, but you must turn it off when the export falls below 0 W (Otherwise, as soon as your charger switches on, export will fall to 50 W and it will promptly switch off again.)

All you need for that is to calculate nett grid power - using emonLib and calcVI(...), something like:

Grid_CT.calcVI(no_of_half_wavelengths,timeout);
if (Grid_CT.realPower > 450) digitalWrite(CHARGERPIN, ON);
if (Grid_CT.realPower < 0) digitalWrite(CHARGERPIN, OFF);

Assuming of course you've declared/defined everything properly - see the demo sketches for that. In fact, you can pretty much use the demo sketch as-is, and just add that bit in the appropriate place.

You can still use Robin's/Martin's triac output stage to switch the charger on and off. What other hardware did you have in mind?

firefox7518's picture

Re: switching fixed load on when surplus pv passes programmed amount.

It all depends how you can measure it. I can't use the clamps on my installation so I use a LED/S0 sensor which counts the pulses. My meter for example does stop to pulse the LED/S0 and therefore just shows 0 if you are delivering into the grid. If you want to achieve the, of course correct, way of Robert you will need to know if your meter stops pulsing or if you are able to use a modbus or RS485 (which my house meters don't support) connection to get all the information you need. A nett calculation in that case is almost impossible as you don't have all the info to do the calculation.

In that case I would propose to install an SDM630 or similar into the PV AC line to that you know the input of the PV and use the house meter to check if it is still 0 after switching it on. Of course in this situation the things are a little bit more complex using this. If money is not the issue (it never is, I know) then you could install two SDM630 meters and one is for the house grid and the other is just connected to the PV grid. Then of course you always know how much the house is consuming and how much the PV is delivering. Doing then the math is easy to get the nett grid delivery.

So it really depends on how to get the data from the meter.

I'm using FHEM to control my house. FHEM is using the feeds from EmonCMS to switch on Fan's or pumps for the pont for example. I also let FHEM send information about what device is on and what not. So you can even build a dashboard which then tells you if the e.g. pont pump is working or not :-) Cool new world :-)

Robert Wall's picture

Re: switching fixed load on when surplus pv passes programmed amount.

firefox7518: Can you explain what you're referring to here? What relevance does Modbus and an invasive 3-phase meter that has to be connected by a registered electrician have to the original question?

firefox7518's picture

Re: switching fixed load on when surplus pv passes programmed amount.

In Switzerland I'm not allowed to  use CT Clamps or similar on the house installation from the meter to the installation panel. Often also the meters and the fuse panels are sealed and you even can't use RS485/Modbus or an S0 output on the house meters to get the power information.

So how should one measure the total power consumption or pv production when there is no CT Clamp possibility or a direct Meter read out?

That's why I just showed how I did it (had to do it) with a SDM630 meter. This unit has RS485/Modbus connection. Putting that in the line from the original meter to the house installation fuse panel gives you this possibility to get the information. Of course it has to be done by an electrician. All changes to the electrical installations have to be done AND documented by an electrician here anyway. It's really annoying but it is our law.

No all country are that easy when it comes to electrical installations or changes to it. CT clamps maybe are invasive for you but still not allowed here ;-) So I just showed an other way, knowing that it is more complex but will achieve the same.

Is it forbidden to show other possible solutions here? The forums entries are indexed by search machines. Maybe someone wants to achieve the same thing like the OP but has the limitations I have. I will stop posting from now on if its that big of an issue.....

calypso_rae's picture

Re: switching fixed load on when surplus pv passes programmed amount.

If you have a pair of meters which can detect when fixed amounts of energy are imported or exported from the premises, then some control mechanism could no doubt be devised which would divert surplus energy tolerably well. 

Unfortunately, the performance could never be as good as when using a clip-on CT sensor because information via the meters' LEDs would always be just too late.  The CT allows the load to be adjusted in advance of any charge or penalty being applied by the meter.

 

Robert Wall's picture

Re: switching fixed load on when surplus pv passes programmed amount.

firefox7518:

"if its that big of an issue....."

The issue is not that you posted an alternative suggestion, but that you omitted to explain the background that gave rise to your suggestion "In Switzerland I'm not allowed to use CT Clamps or similar on the house installation from the meter to the installation panel. Often also the meters and the fuse panels are sealed and you even can't use RS485/Modbus or an S0 output on the house meters to get the power information."

I happen to know that the O.P. is in the UK where Swiss law does not apply, and the clue that you could have picked up was him mentioning the MK2 PV Router. As he asked for something simpler than that, then in fairness that is what he wanted. I don't think (and one of my moderator colleagues thinks likewise) that wiring in a 3-phase meter, then a Modbus connection to some other piece of hardware that actually performed the switching operation, without an explanation for why it might be needed, was very helpful. In fact, I felt it was quite confusing. My colleague's comment was rather more forthright.

saggers's picture

Re: switching fixed load on when surplus pv passes programmed amount.

Hi, sorry for the long delay.

I was initially thinking of taking the battery charger off before the main consumer unit and ct clamp so it wouldn't effect the reading, but if I was to use a program like mentioned above this would not be an issue.

My brief plan was to power a small grid tied inverter maybe 200-300w. At dusk the inverter would turn on until the batteries ran low. This would cover my background electrical consumption.

I only currently have 100A at 24v of storage but this would just be an experiment and could be increased later along with charging capacity.

I guess I would need to limit the current into the inverter or would the inverter limit its self?

If I used Robins diverter would this be able to also run excess power to the immersion as well as the charging side, or would I need 2 separate units?

Robert Wall's picture

Re: switching fixed load on when surplus pv passes programmed amount.

"I was initially thinking of taking the battery charger off before the main consumer unit..."
I wouldn't advise that unless you know exactly what you're doing. It could give you some interesting protection problems.

"This would cover my background electrical consumption"
It would also export your valuable stored energy to the grid if your consumption was less than the inverter output. Do you want to allow that? (The alternative is likely to be a complicated and possibly expensive change-over arrangement.)

"would the inverter limit its self?"
The inverter will draw whatever current its load demands, up to its maximum. In this case, I think it will produce its maximum output until the battery is exhausted.

"If I used Robins diverter..."
You would need two independent output stages, and you would need to adjust the control algorithm to do as you require, which implies modifications to the sketch.
What you'd do is let the immersion heater mop up surplus energy below 450 W (say), then switch on the charger. The surplus would immediately fall to 50 W and the immersion feed would adjust to absorb that. When the batteries were fully charged, the charger would draw only its quiescent power (say 10 W) and the immersion would still adjust to take whatever surplus was available. If you haven't spotted the problem, you'd need to change the rules so that the charger switches off at a very small import (say -5 W surplus) and you'd probably need to adjust that to get stable operation.

calypso_rae's picture

Re: switching fixed load on when surplus pv passes programmed amount.

This is my take on how to operate battery chargers on (mostly) surplus power

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

saggers's picture

Re: switching fixed load on when surplus pv passes programmed amount.

I've had a little attempt at programming using the help above, and other sketches and the fact the compiler points out errors. Can anyone see any errors as I can't test it as currently away from home. The idea is to turn a charger on above 450w export, then turn off when export hits 0w, i've added a 30 second delay on turning off.

 

#include "EmonLib.h"

EnergyMonitor ct1, ct2, ct3, ct4;

int chargerPin = 13;                 // Charger connected to digital pin 13

void setup()
{
  pinMode(chargerPin, OUTPUT);      // sets the digital pin as output
 
   // Calibration factor = CT ratio / burden resistance = (100A / 0.05A) / 33 Ohms = 60.606
  ct1.current(1, 60.606);
 
  // (ADC input, calibration, phase_shift)
  ct1.voltage(0, 300.6, 1.7);
}

void loop() {

  ct1.calcVI(20,2000);
  if (ct1.realPower > 450) digitalWrite(chargerPin, HIGH);
if (ct1.realPower < 0) digitalWrite(chargerPin, LOW);
delay(30000);

}

Robert Wall's picture

Re: switching fixed load on when surplus pv passes programmed amount.

I think it stands a chance - provided your charger draws less than 450 W. Incidentally, there's no need to define ct2, ct3 & ct4 if you're not using them. They're doing you no good - but not doing any harm either.

calypso_rae's picture

Re: switching fixed load on when surplus pv passes programmed amount.

The idea is to turn a charger on above 450w export, then turn off when export hits 0w, i've added a 30 second delay on turning off.

With the code as above, the 30-second delay will occur in every loop.  To make it work as described, an extra pair of brackets would be needed to make the "action to be taken" into a single block.

Robert Wall's picture

Re: switching fixed load on when surplus pv passes programmed amount.

Robin, I understand what you're saying - the delay occurs every time you measure the current, whether the load is turned on, off or nothing changes is irrelevant. But does it matter? If that's all the sketch is doing, it makes no difference. If Saggers wants to other things as well, or perhaps a more sophisticated approach like making sure the availability (or absence) of power is consistent before making the decision, then a totally different approach is necessary.

calypso_rae's picture

Re: switching fixed load on when surplus pv passes programmed amount.

Agreed, Robert, I was just pointing out that the code as posted will not behave as the author has described.  Whilst the absence of brackets does not upset the compiler in this case, unintended consequences can all too easily result.

Happy New Year to one and all!

Comment viewing options

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