solarvisor : opportunistically run heavy energy loads from your computer.

Started by danda, June 09, 2016, 08:24:58 PM

Previous topic - Next topic

danda

I have some loads I would like to run during daylight hours of sunny days, but not at night or on cloudy days.

In my case, I can start these loads via a linux command.  Let's name the command load.sh.  So starting load.sh starts the load and killing it ends the load.  great.  But how to tie that in with sun conditions and automate it?

That's where solarvisor come in.  It is a lightweight script that monitors battery voltage conditions and will automatically start and stop a load command  ( or any process/cmd actually ).   It also has a failsafe mode based on hour-of-day in case battery voltage cannot be read temporarily.  And it can prevent multiple start/stops per day, thereby preventing the load from running on cloudy days when all available power is needed for battery charging.

You can read all about it and download the script here:
https://github.com/dan-da/solarvisor

You will need to implement your load.sh command yourself, and for most external loads you will need a usb controlled electric outlet or some type of switching hardware and driver.  I'd be interested to hear what types of hardware and loads people use!

Also right now solarvisor reads the battery voltage via an http request to a blackboxproject webserver that I have setup, which reads it from a midnite classic via modbus.  There is a single function that does this, and it is easy enough to change it to read from other sources.   Anyway, in the next few days I plan to make it pluggable, so it can call an external script to retrieve the voltage and charge info via any available mechanism.

Westbranch

So are you using SoC and time spent in a specified State (Absorb ?) before you 'throw the switch' ?
What will kick it off when it's, say,  sunny morning and cloudy afternoon?
KID FW1811 560W >C&D 24V 900Ah AGM
CL150 29032 FW V.2126-NW2097-GP2133 175A E-Panel WBjr, 3Px4s 140W > 24V 900Ah AGM,
2 Cisco WRT54GL i/c DD-WRT Rtr, NetGr DS104Hub
Cotek ST1500 Inv  want a 24V  ROSIE Inverter
OmniCharge3024  Eu1/2/3000iGens
West Chilcotin 1680+W to come

danda

QuoteSo are you using SoC and time spent in a specified State (Absorb ?) before you 'throw the switch' ?

Right now it is not considering charge modes at all.  I plan to add that in the future, but this first script satisfies my immediate needs.  Also, I do not have the whizbang jr, so current flow info is not available to me, though it could be useful.

For my present application I want it to run all day unless it is a cloudy day.  With my setup this is just fine because my batteries normally charge by noon anyway, so the added load during bulk in the morning is no problem.

I just don't want the load to run all night, or actually below a certain voltage level.  So that I have plenty left for overnight.

So yeah, this is not truly opportunistic.   That would only occur in absorb/float and ensuring that voltage doesn't drop below charge controller limits.   But it should be easy enough to add now that the basics are working.

QuoteWhat will kick it off when it's, say,  sunny morning and cloudy afternoon?

Let's take a 48v nominal system, as mine is.  solarviser uses various settings, but the two most important are:
  volts_min = 51 and volts_start_min = 53. 

with default settings:  On a sunny morning, bulk mode starts and battery voltage starts rising.  When it reaches 53, the load is started.  The load will drop the voltage a bit, perhaps to 52.5, but not below 51.  If it did, then the load would be stopped.  Charging continues and by afternoon either we are in absorb/float or we are still in bulk.  But now it gets very cloudy and starts raining.   The load will continue running until voltage drops below 51, at which point it will stop, and will not restart even if voltage should rise above 53 again.

Admittedly this may not be right for all use cases.  Right now summer just started and I live in a location that will be sunny with few clouds for months.   When winter comes around, I'll probably add some algo tweaks to maximize charge in cloudy conditions taking into account charge mode, time of day, charge controller limits and current flow if available, etc.  solarvisor can only improve from here!

The present algo is pretty simple.  basically:

// these vary by nominal voltage or user override.
volts_min = 51              // stop if voltage is lower
volts_start_min = 53    // start if voltage is higher.   ( avoids flutter. )

daily_stop_limit = 1    // prevents flutter and shuts down load quickly on cloudy days.

while( 1 ):
   if load_stopped_today_count > daily_stop_limit:
      continue  (after_one_minute)

   volts = get_battery_volts()
   if volts:

      if volts < volts_min:
         stop_load_if_running()
     else if volts > volts_start_min:
         start_load_if_stopped()

   else:   // voltage could not be read

      if within daylight hours:
         start_load_if_not_running()
      else:
         stop load_if_running()
   

Thanks for your interest and I hope that answers your questions!   :)

Westbranch

Your charge time is similar to mine, ~ noon,  though I have AGMs and like a long Absorb to ensure a full charge especially in shoulder seasons and winter... so were I to implement the program I would be looking for that WBjr data that I get, to be used...  got it, use it... right now I am using Grahams Android App, a great  :)  8) bit of kit, especially the Live Chart tab.  I am next going to use it to follow using a higher EA number to see the week to week effect of .5% EA to 1% EA...  DHW from opportunity  energy is my next goal...

Hope some others chime in with their perspectives.  It only improves the development. Hats off to you...

KID FW1811 560W >C&D 24V 900Ah AGM
CL150 29032 FW V.2126-NW2097-GP2133 175A E-Panel WBjr, 3Px4s 140W > 24V 900Ah AGM,
2 Cisco WRT54GL i/c DD-WRT Rtr, NetGr DS104Hub
Cotek ST1500 Inv  want a 24V  ROSIE Inverter
OmniCharge3024  Eu1/2/3000iGens
West Chilcotin 1680+W to come

danda

So the data I get from blackbox does provide the State-of-Charge field, but for me it is always 100%, apparently because I don't have WBjr.  But at least it means I could code up an algo and simulate it, and expect that it might work for others.  I'll keep that in mind for next time I'm playing with the code.

Or maybe it will motivate me to buy/install WBjr.   One thing that's holding me back is that I already have a shunt that came with my DC disconnect box (trace 250) and it's wired to a tri-metric SoC meter that works fine but is not network connected.  It doesn't appear that WBjr will work with my existing shunt, and I'm not sure how much hassle and expense replacing it would be.

Anyone have experience putting a WBjr into one of those old trace DC disconnect boxes?

RossW

Quote from: danda on June 09, 2016, 08:24:58 PM
that monitors battery voltage conditions and will automatically start and stop a load command  ( or any process/cmd actually ).   It also has a failsafe mode based on hour-of-day in case battery voltage cannot be read temporarily.  And it can prevent multiple start/stops per day, thereby preventing the load from running on cloudy days when all available power is needed for battery charging.

I have a pyranometer to measure actual available power, a calculation that works out what theoretically SHOULD be available based on time of day and day of year, and compares that to what IS coming from my solar arrays, initially to confirm tracking is working and panels are performing. It also lets me look at the difference between what my "available" power is, and subtract what my actual demand is, to know my additional "opportunity" load.

Being all cbus, I've written some code that lets me talk to the house via ethernet, and to turn on and off things that will help - like fans, water pumps, chiller, etc.
3600W on 6 tracking arrays.
7200W on 2 fixed array.
Midnite Classic 150
Outback Flexmax FM80
16 x LiFePO4 600AH cells
16 x LiFePO4 300AH cells
Selectronics SP-PRO 481 5kW inverter
Fronius 6kW AC coupled inverter
Home-brew 4-cyl propane powered 14kVa genset
2kW wind turbine

danda

@rossw sounds nice.  is that code up on github or otherwise available?

RossW

Quote from: danda on June 11, 2016, 04:37:02 AM
@rossw sounds nice.  is that code up on github or otherwise available?

No, my only previous experience with "open source/sharing/github" etc was .... well, far from satisfactory. I'll not be going there again any time soon.
3600W on 6 tracking arrays.
7200W on 2 fixed array.
Midnite Classic 150
Outback Flexmax FM80
16 x LiFePO4 600AH cells
16 x LiFePO4 300AH cells
Selectronics SP-PRO 481 5kW inverter
Fronius 6kW AC coupled inverter
Home-brew 4-cyl propane powered 14kVa genset
2kW wind turbine

TomW

Quote from: RossW on June 11, 2016, 07:41:50 AM


No, my only previous experience with "open source/sharing/github" etc was .... well, far from satisfactory. I'll not be going there again any time soon.

Hmmm. Not everyone plays fair, eh?

And G'day down under!

Just wanted to poke you so you know I am still kicking. Or at least my AI machine is.

TomW
Do NOT mistake me for any kind of "expert".

( ͡° ͜ʖ ͡°)


24 Trina 310 watt modules, SMA SunnyBoy 7.7 KW Grid Tie inverter.

I thought that they were angels, but much to my surprise, We climbed aboard their starship and headed for the skies

RossW

Quote from: TomW on June 11, 2016, 09:49:13 AM
And G'day down under!

Just wanted to poke you so you know I am still kicking. Or at least my AI machine is.

G'day Tom! See the occasional post from you but I generally don't have anything intelligent to add - still, it's nice to see you're still active! You got that "new" place tamed yet?
3600W on 6 tracking arrays.
7200W on 2 fixed array.
Midnite Classic 150
Outback Flexmax FM80
16 x LiFePO4 600AH cells
16 x LiFePO4 300AH cells
Selectronics SP-PRO 481 5kW inverter
Fronius 6kW AC coupled inverter
Home-brew 4-cyl propane powered 14kVa genset
2kW wind turbine