Battery manager and generator start

NorthGuy
NorthGuy Solar Expert Posts: 1,913 ✭✭
I'm finally installed my battery manager. Here are the pictures - it occupies the Generac switch box, which is stripped of most of its content. It is mostly working, but few minor bugs remain to sort out.

It measures voltages, currents, and power on both AC and DC sides, quite accurately, monitors consumption, counts amper-hours, and make charging decisions.

It controls XW-SCC-60-150 through XanBus. It may decide to skip absorption for the day. It also terminates absorption when enough AHs were returned and current is low enough, to make sure that if absorption started it did charge the batteries fully.

Every evening, an hour before sunset, when all the production data is already available, it decids whether there is enough charge in the batteries to live another day. If not, it sarts generator and runs it until it reaches absorption. If there were no absorption for a long time, it may decide to go through the full absorption. After the charge, the battery are left to discharge during the night, which makes room for new solar production the next day.

As a side effect, it also controls climate in the garage by opening/closing garage door and by starting/stopping furnace.

It logs some information and aslo transmits it wirelessly to the house where it may be logged by a computer, and if needed the computer may notify my cell phone about emergency condition so that I could intervene. Although this part is not done yet.

It also can collect very interesting data. I'll post when I gather enough.

This is how it looks inside the Generac box. You can see a transfer switch on top right, which is under control of the board, and current sensors on the bottom. The little box attached on the left side is simply a holder for connectors and wireless antenna which supports communications with the house:

attachment.php?attachmentid=5828

This is a close-up of the board:

attachment.php?attachmentid=5829

The closed cover and my laptop with a programmer and USB link connected. It's hard to see, but it's a bunch of data on the computer screen:

attachment.php?attachmentid=5830
«1

Comments

  • mike95490
    mike95490 Solar Expert Posts: 9,583 ✭✭✭✭✭
    Re: Battery manager and generator start

    Wow. Like. Want.
    Powerfab top of pole PV mount | Listeroid 6/1 w/st5 gen head | XW6048 inverter/chgr | Iota 48V/15A charger | Morningstar 60A MPPT | 48V, 800A NiFe Battery (in series)| 15, Evergreen 205w "12V" PV array on pole | Midnight ePanel | Grundfos 10 SO5-9 with 3 wire Franklin Electric motor (1/2hp 240V 1ph ) on a timer for 3 hr noontime run - Runs off PV ||
    || Midnight Classic 200 | 10, Evergreen 200w in a 160VOC array ||
    || VEC1093 12V Charger | Maha C401 aa/aaa Charger | SureSine | Sunsaver MPPT 15A

    solar: http://tinyurl.com/LMR-Solar
    gen: http://tinyurl.com/LMR-Lister ,

  • Blackcherry04
    Blackcherry04 Solar Expert Posts: 2,490 ✭✭✭
    Re: Battery manager and generator start

    Now you need to teach it to read a Weather Forecast and it'd have everything you need. It looks nice, good work.
  • Vic
    Vic Solar Expert Posts: 3,208 ✭✭✭✭
    Re: Battery manager and generator start

    WOW NorthGuy,

    Very nice project! Have wanted to do something fairly similar for a few years now, but reality still is setting in ... must do any of this stuff manually, every day, still.

    Thanks, Vic
    Off Grid - Two systems -- 4 SW+ 5548 Inverters, Surrette 4KS25 1280 AH X2@48V, 11.1 KW STC PV, 4X MidNite Classic 150 w/ WBjrs, Beta KID on S-530s, MX-60s, MN Bkrs/Boxes.  25 KVA Polyphase Kubota diesel,  Honda Eu6500isa,  Eu3000is-es, Eu2000,  Eu1000 gensets.  Thanks Wind-Sun for this great Forum.
  • David and Laura
    David and Laura Solar Expert Posts: 139
    Re: Battery manager and generator start

    Wow, and with a single-sided PCB, no less! I'm assuming that you've soldered the SMT devices for the USB interface on the rear side of the board?

    Impressive.
    House: 2x SMA SI 6048 w 24x 2V DEKA Unigy II; 2x SMA SB 3000TL-US w 24x Sharp ND-H235Q2
    Cabin: 1x Magnum MS4024 w 24x 2V DEKA Unigy II; 1x Morningstar TS-MPPT-60 w 6x Sharp ND-H235Q2; 1x 200 Watt Harris microhydro
    Intertie: 1x SMA WB 3800; 1x Lambda GEN-600 DC Supply; 2x PSL pQube
  • ChrisOlson
    ChrisOlson Banned Posts: 1,807 ✭✭
    Re: Battery manager and generator start
    NorthGuy wrote: »
    Every evening, an hour before sunset, when all the production data is already available, it decids whether there is enough charge in the batteries to live another day. If not, it sarts generator and runs it until it reaches absorption. If there were no absorption for a long time, it may decide to go through the full absorption. After the charge, the battery are left to discharge during the night, which makes room for new solar production the next day.

    NG - that's a really nice unit! I think I would've done the absorb thing different though. I never absorb batteries with the generator and inverter charger.

    With the ComBox I will look at loads and consumption history, and make a decision based on weather as to running the prime generator. If I figure the loads are going to run 20 kWh for the day, the weather forecast and current conditions says we'll only get 15 kWh usable to loads from solar thru the inverter, and that all agrees with my gut instincts - I'll run the prime generator at a specific load (usually 6 amps @ 240V or 1.4 kVA) until the ComBox Generator Screen says I got 5 kWh from it to loads, then I'll shut it down. That basically maintains the battery at a static SOC where it ends the day at the same SOC as it started out the day at.

    I will continue doing the above until one day we get decent RE and then the battery gets absorbed. I run the little diesel at very light load so it never puts out more power than what the loads are using, so it never charges the battery during its run. I've found that at 6 amp Gen Support setting I get just shy of 8 kWh/gallon of fuel from it, which I'm pretty happy with.

    So I would design a battery manager to do that same sort of thing. Except it's really hard to do it automatically because it sometimes takes a human to look at the current conditions and make the decision to run or not to run. And sometimes my predictions are a little off. When I'm off I usually err on the low side so the battery ends up leaving the day at lower SOC than it started the day. But for the most part, using my daily logged data to make the decision on how much to run the prime set on a bad day, I hit it pretty close.
    --
    Chris
  • zoneblue
    zoneblue Solar Expert Posts: 1,220 ✭✭✭✭
    Re: Battery manager and generator start

    Interesting, i havent been round long enough to understand the background. What made you build this from scratch, as opposed to doing something with a microcontroller and some stock add on interfaces and sensors? Also how to you manage doing too many writes to the controllers eprom?
    1.8kWp CSUN, 10kWh AGM, Midnite Classic 150, Outback VFX3024E,
    http://zoneblue.org/cms/page.php?view=off-grid-solar


  • NorthGuy
    NorthGuy Solar Expert Posts: 1,913 ✭✭
    Re: Battery manager and generator start
    Wow, and with a single-sided PCB, no less! I'm assuming that you've soldered the SMT devices for the USB interface on the rear side of the board?

    Impressive.

    Thanks.

    I wish I could make two-sided PCBs :D You can order PCBs now, but if you want only one copy the price is really high.

    Yes, there are lots of SMT chips on the bottom - including USB controller (MCP2200), CAN driver, isolators, op amps for amplifying shunt voltage, RF module.
  • NorthGuy
    NorthGuy Solar Expert Posts: 1,913 ✭✭
    Re: Battery manager and generator start
    ChrisOlson wrote: »
    NG - that's a really nice unit! I think I would've done the absorb thing different though. I never absorb batteries with the generator and inverter charger.

    Thank you Chris.

    Normally, it won't do absorptions with a generator, unless there's a real bad spell of cloudy weather for 2-3 weeks, which never happened before. However, it is time in around Christmas when I get shades on the panels, so I only get in average 3kWh/day. Generator is the only choice at this time.
    ChrisOlson wrote: »
    With the ComBox I will look at loads and consumption history, and make a decision based on weather as to running the prime generator. If I figure the loads are going to run 20 kWh for the day, the weather forecast and current conditions says we'll only get 15 kWh usable to loads from solar thru the inverter, and that all agrees with my gut instincts - I'll run the prime generator at a specific load (usually 6 amps @ 240V or 1.4 kVA) until the ComBox Generator Screen says I got 5 kWh from it to loads, then I'll shut it down. That basically maintains the battery at a static SOC where it ends the day at the same SOC as it started out the day at.

    I see that your generator usage patterns are constantly involving for the better.

    Essentially, it is doing very similar thing. It looks at the rolling average of daily consumption. If it sees a danger of batteries dipping below 20% SoC next day, it'll run the generator. I decided that generator runs should go to the point where the absorption would start. If I only go to the very minimum, I would get 20 to 60% SoC cycling in the winter, which may cause sulphation. Currently, I don't use the weather forecast, but it shouldn't be hard to get it from the Internet as BC4 suggested. I need to live with it for a while to see how it goes first.
    ChrisOlson wrote: »
    I will continue doing the above until one day we get decent RE and then the battery gets absorbed. I run the little diesel at very light load so it never puts out more power than what the loads are using, so it never charges the battery during its run. I've found that at 6 amp Gen Support setting I get just shy of 8 kWh/gallon of fuel from it, which I'm pretty happy with.

    When I was designing the system, I thought of generator longevity in terms of hours. I though that a generator can run cerain number of hours before it dies. So, my idea was to get a generator that can do charging as quickly as batteries allow. Looking how it actually works, I start thinking that high loads may be actually bad for generator life, and the generator may live longer if I run it at lesser load. Therefore, I abandoned the idea of 100A charging and switched to 80A. It has an added benefit that during a longer run it can pick up much more loads, which actually lessens the amount of battery discharge and therefore generator will need to run less next time. So, now I'm thinking about switching to 70A or 60A. This way generator will run longer, but with lesser load. This may be more beneficial for prolonging its service life than running it for shorter periods at higher load. My only concern that I'm going to dip below 50% rated capacity and this may be not good from the efficiency viewpoint.
    ChrisOlson wrote: »
    So I would design a battery manager to do that same sort of thing. Except it's really hard to do it automatically because it sometimes takes a human to look at the current conditions and make the decision to run or not to run. And sometimes my predictions are a little off. When I'm off I usually err on the low side so the battery ends up leaving the day at lower SOC than it started the day. But for the most part, using my daily logged data to make the decision on how much to run the prime set on a bad day, I hit it pretty close.

    Machine can never beat people at such things, but it can get close to it :D
  • NorthGuy
    NorthGuy Solar Expert Posts: 1,913 ✭✭
    Re: Battery manager and generator start
    zoneblue wrote: »
    Interesting, i havent been round long enough to understand the background. What made you build this from scratch, as opposed to doing something with a microcontroller and some stock add on interfaces and sensors?

    I do have the microcontroller and some add-on interfaces. For example, I have USB controller, RF transceiver and integrated temperature sensor. Some things I had to do by myself. For example, there were no good modules for shunt measurements, so I had to do my own assembly.
    zoneblue wrote: »
    Also how to you manage doing too many writes to the controllers eprom?

    I don't write EEPROM too many times, only when I make changes to the program. It is rated for 10,000 writes, so it should be enough. For logs, I have a separate EEPROM chip which records critical data every hour. It is rated for 1,000,000 writes, so it will outlive me.
  • ChrisOlson
    ChrisOlson Banned Posts: 1,807 ✭✭
    Re: Battery manager and generator start
    NorthGuy wrote: »
    Machine can never beat people at such things, but it can get close to it :D

    Well, I'll tell you what, despite all the fine points - that battery manager is so cool that I'm amazed it don't have icicles hanging on it. Could you make it do something like provide a 12V output signal to one of the temp sensor inputs on the AGS? So let's say we have the following scenario:

    Assume the Battery Manager can operate the generator by providing that two wire signal to the AGS to start and stop the generator. It "sees" that the MPPT's are only putting out 8 kWh by noon and normal would be more like 12 kWh. We're going to run about 8 kWh sort for day so we need to run the prime genset for 8 kWh during the afternoon so the limited solar output can get the job done on putting some amp-hours into the battery to make it thru the night.

    At noon it evaluates the solar production for the day so far, sends the two-wire signal the AGS Temp1 input and starts the generator. Runs it until it produces 8 kWh, then shuts it off.

    And the thing speaks Xanbus?

    If it can that, or similar, you just let know where to send the check because I want one :D
    --
    Chris
  • NorthGuy
    NorthGuy Solar Expert Posts: 1,913 ✭✭
    Re: Battery manager and generator start
    ChrisOlson wrote: »
    Well, I'll tell you what, despite all the fine points - that battery manager is so cool that I'm amazed it don't have icicles hanging on it. Could you make it do something like provide a 12V output signal to one of the temp sensor inputs on the AGS? So let's say we have the following scenario:

    Assume the Battery Manager can operate the generator by providing that two wire signal to the AGS to start and stop the generator. It "sees" that the MPPT's are only putting out 8 kWh by noon and normal would be more like 12 kWh. We're going to run about 8 kWh sort for day so we need to run the prime genset for 8 kWh during the afternoon so the limited solar output can get the job done on putting some amp-hours into the battery to make it thru the night.

    At noon it evaluates the solar production for the day so far, sends the two-wire signal the AGS Temp1 input and starts the generator. Runs it until it produces 8 kWh, then shuts it off.

    That certainly is not a problem. You can program anything in it. It does measure the AC from the generator so it knows how much it produces.

    I converted my Generac to a two wire start. So to start Generac it only uses one relay (as opposed to three relays to control the Generac transfer switch). I thought that I may have some other generator in the future, so I put in few extra relays in case I need more complex generator start.

    One of these can certainly be used to send 12V signal to the AGS. Or, you can use it instead of AGS.
    ChrisOlson wrote: »
    And the thing speaks Xanbus?

    It reads all the broadcasted information, but since it has its own measurements, it only uses very little - states of SCCs and XW6048, battery temperature, absorption setpoints. As the control goes, I only needed to put SCCs to float when necessary, so that's the only thing that it does. It is not hard to mimic SCP and do parameter changes, but I didn't need it so far.
    ChrisOlson wrote: »
    If it can that, or similar, you just let know where to send the check because I want one :D

    It's very hard to make them this way because my eyes are not so good any more :D

    After I'm done with the testing, I may order few units from a real PCB manufacturer for sale.
  • mike95490
    mike95490 Solar Expert Posts: 9,583 ✭✭✭✭✭
    Re: Battery manager and generator start
    NorthGuy wrote: »
    .....After I'm done with the testing, I may order few units from a real PCB manufacturer for sale.

    I would be glad to help you lay out a board (thru hole or surface mount) and come up with some sort of "kit" people could put together, or have built. I've only had about 34 years of prototype PCB layout and fab under my belt.

    ( simple production run of 48-12 DC-DC converters $100, 120 watt 48-12V DC-DC converter slideshow. A 94% efficient converter, used to down-convert a 48V solar battery bank.
    Powerfab top of pole PV mount | Listeroid 6/1 w/st5 gen head | XW6048 inverter/chgr | Iota 48V/15A charger | Morningstar 60A MPPT | 48V, 800A NiFe Battery (in series)| 15, Evergreen 205w "12V" PV array on pole | Midnight ePanel | Grundfos 10 SO5-9 with 3 wire Franklin Electric motor (1/2hp 240V 1ph ) on a timer for 3 hr noontime run - Runs off PV ||
    || Midnight Classic 200 | 10, Evergreen 200w in a 160VOC array ||
    || VEC1093 12V Charger | Maha C401 aa/aaa Charger | SureSine | Sunsaver MPPT 15A

    solar: http://tinyurl.com/LMR-Solar
    gen: http://tinyurl.com/LMR-Lister ,

  • NorthGuy
    NorthGuy Solar Expert Posts: 1,913 ✭✭
    Re: Battery manager and generator start
    mike95490 wrote: »
    I would be glad to help you lay out a board (thru hole or surface mount) and come up with some sort of "kit" people could put together, or have built. I've only had about 34 years of prototype PCB layout and fab under my belt.

    ( simple production run of 48-12 DC-DC converters $100, 120 watt 48-12V DC-DC converter slideshow. A 94% efficient converter, used to down-convert a 48V solar battery bank.

    Thank you Mike.

    That's a very nice project that you have. Why did you use all the SMD parts? They're apparently much harder to solder than through hole.
  • mike95490
    mike95490 Solar Expert Posts: 9,583 ✭✭✭✭✭
    Re: Battery manager and generator start

    Surface mount is very cheap, and part of the price for PCB's is the #'s of holes needed to be drilled. And with a small magnifier, all the SMD parts I used, were very easy. Just a different learning curve than thru-hole.
    Powerfab top of pole PV mount | Listeroid 6/1 w/st5 gen head | XW6048 inverter/chgr | Iota 48V/15A charger | Morningstar 60A MPPT | 48V, 800A NiFe Battery (in series)| 15, Evergreen 205w "12V" PV array on pole | Midnight ePanel | Grundfos 10 SO5-9 with 3 wire Franklin Electric motor (1/2hp 240V 1ph ) on a timer for 3 hr noontime run - Runs off PV ||
    || Midnight Classic 200 | 10, Evergreen 200w in a 160VOC array ||
    || VEC1093 12V Charger | Maha C401 aa/aaa Charger | SureSine | Sunsaver MPPT 15A

    solar: http://tinyurl.com/LMR-Solar
    gen: http://tinyurl.com/LMR-Lister ,

  • zoneblue
    zoneblue Solar Expert Posts: 1,220 ✭✭✭✭
    Re: Battery manager and generator start

    My eyes are going too, but i used to use a set of locking tweezers to hold them in place while soldering. Reflow for any qty i guess though.

    It appears that there as many monitoring/mgmt systems as there are hackers who own RE systems. We use the skills we have i guess.

    A few of us at the midnite forum are attempting to create a collaboration of sorts. Our design uses an arm dev board, linux and a web app. With an addtional cai webcontrol unit, shunts and other analog sources can be read, and relays activated. Total cost under $100 for both boards. There should be something to see in the next week or so.
    1.8kWp CSUN, 10kWh AGM, Midnite Classic 150, Outback VFX3024E,
    http://zoneblue.org/cms/page.php?view=off-grid-solar


  • NorthGuy
    NorthGuy Solar Expert Posts: 1,913 ✭✭
    Re: Battery manager and generator start

    I usually can solder big IC (with some difficulties), even with small pitch, but those little things just keep jumping out of my table for no apparent reason, even if I don't touch them.
  • unicornio
    unicornio Solar Expert Posts: 217 ✭✭
    Re: Battery manager and generator start
    NorthGuy wrote: »
    I usually can solder big IC (with some difficulties), even with small pitch, but those little things just keep jumping out of my table for no apparent reason, even if I don't touch them.

    hehehehe!...those little things just keep jumping out of my table for no apparent reason, even if I don't touch them!...like fleas or lice! ...;-)))))
    very good description of this issue!...:-))))

    I've always been able to do very good work with hand made surface mount soldering,
    but now my eyes will not let me get to see what I do, and my clumsy leaves me alone reserved to do now only "great things"! ...hehehehe
  • zoneblue
    zoneblue Solar Expert Posts: 1,220 ✭✭✭✭
    Re: Battery manager and generator start

    On the subject, i was doing some baord assembly, and i left the room for 5 minutes, came back and a tub of smds was upended onto the floor. Turned out a duck had wandered in the shed, got caught in the weller power lead, and drag everything onto the floor. Took ages but we managed to recover enough to finish the job.
    1.8kWp CSUN, 10kWh AGM, Midnite Classic 150, Outback VFX3024E,
    http://zoneblue.org/cms/page.php?view=off-grid-solar


  • NorthGuy
    NorthGuy Solar Expert Posts: 1,913 ✭✭
    Re: Battery manager and generator start

    I completed the communication unit which allows computers on my home network to communcate wirelessly with the battery manager:

    Here it is prior to installation.

    attachment.php?attachmentid=6020

    Here it is installed in the junction box instde a wall.

    attachment.php?attachmentid=6021

    A server receives informatuion from the battery manager through the communication unit, and if there's something important, it sends a text message to my phone. Here's the screenshot (don't pay attention to times, for some reason, Android displays the time when I actually read the message):

    attachment.php?attachmentid=6022

    We've got some cloudy weather, and you can see how DoD was dropping every day until the battery manager decided that it's time to run the generator and did so for 3 hours 50 minutes.

    Prior to that, I spent two weeks in Europe and I could see what is happening with my power. Very handy.
  • jcheil
    jcheil Solar Expert Posts: 722 ✭✭✭
    Re: Battery manager and generator start
    ChrisOlson wrote: »
    Except it's really hard to do it automatically because it sometimes takes a human to look at the current conditions and make the decision to run or not to run.
    Chris

    (kind of a joke, but...) How about having logic that goes to a weather website for your daily weather prediction?
    Off-Grid in Central Florida since 2005, Full-Time since June 2014 | 12 X Sovello 205w panels, 9 X ToPoint 220w panels, 36x ToPoint 225w panels (12,525 watts total) | Custom built single-axis ground mounts | Complete FP2 Outback System: 3 x FM80, 2 x VFX3648, X240 Transformer, FLEXnet-DC, Mate-3, Hub-10, FW500 AC/DC | 24 x Trojan L16RE-B Batteries 1110ah @ 48v | Honda EU7000is Generator and a pile of "other" Generators | Home-Made PVC solar hot water collector | Custom data logging software http://www.somewhatcrookedcamp.com/monitormate.html
  • zoneblue
    zoneblue Solar Expert Posts: 1,220 ✭✭✭✭
    Re: Battery manager and generator start

    Northguy, would you be interested in collaborating on this at all?

    Theres a sub forum at midnite, called the blackbox project. It was initially a software project, but its recently grown to hardware aswell, incorperating a system of modular hardware devices to talk to different aspects to RE systems, such that with the right combination of modules itll work for just about anyone.

    Might be a way to get more value out of your excellent work?
    1.8kWp CSUN, 10kWh AGM, Midnite Classic 150, Outback VFX3024E,
    http://zoneblue.org/cms/page.php?view=off-grid-solar


  • NorthGuy
    NorthGuy Solar Expert Posts: 1,913 ✭✭
    Re: Battery manager and generator start
    jcheil wrote: »
    (kind of a joke, but...) How about having logic that goes to a weather website for your daily weather prediction?

    BC4 suggested this in post #3 :D

    That's easy to do, but their predictions are often no good. I sort of go with the worst case, assuming no production and average consumption. In real life, there could be more than average consumption, but it's always going to be some production. So, the chance of over-discharging the batteries is small, and overdischarge cannot be significant.

    If I relied on the weatherman, and the predictions went wrong, I would put myself in a situation where I need to severely overdischarge batteries or run the generator at bad time. In addition, I thought that if batteries are already 50-60% discharged, it might be better to re-charge them right away (to prevent sulphation) even though there's a good chance of sunny weather next day.

    Therefore, I decided not to mess with weather. Although, if I decide to reconsider, it's very easy to get forecast from the web. I think some of the forum members already use weather forecast from the web to manage their system.
  • NorthGuy
    NorthGuy Solar Expert Posts: 1,913 ✭✭
    Re: Battery manager and generator start
    zoneblue wrote: »
    Theres a sub forum at midnite, called the blackbox project. It was initially a software project, but its recently grown to hardware aswell, incorperating a system of modular hardware devices to talk to different aspects to RE systems, such that with the right combination of modules itll work for just about anyone.

    Could you post a link to this project?
  • Vic
    Vic Solar Expert Posts: 3,208 ✭✭✭✭
    Re: Battery manager and generator start

    Hi NG,

    Am not zoneblue, but to get you started, here is a Link:
    http://midniteforum.com/index.php?board=47.0

    I am not contributing to that endeavor, but it is interesting. FWIW, Vic
    Off Grid - Two systems -- 4 SW+ 5548 Inverters, Surrette 4KS25 1280 AH X2@48V, 11.1 KW STC PV, 4X MidNite Classic 150 w/ WBjrs, Beta KID on S-530s, MX-60s, MN Bkrs/Boxes.  25 KVA Polyphase Kubota diesel,  Honda Eu6500isa,  Eu3000is-es, Eu2000,  Eu1000 gensets.  Thanks Wind-Sun for this great Forum.
  • NorthGuy
    NorthGuy Solar Expert Posts: 1,913 ✭✭
    Re: Battery manager and generator start
    Vic wrote: »
    Hi NG,

    Am not zoneblue, but to get you started, here is a Link:
    http://midniteforum.com/index.php?board=47.0

    I am not contributing to that endeavor, but it is interesting. FWIW, Vic

    I looked at the project and read many posts. Looks like an interesting idea. My battery manager does essentially the same.

    In the beginning, I was going to get all my data from Xantrex, which would make for much simpler device. The reason I went with my own measurements because I suspected that the data produced by Xantrex may not be very accurate. Increase in accuracy comes with exponentially growing costs and efforts. So, I aimed for 0.1% precision for most of my measurements.

    For the beginning, to measure something, you need to have a voltage reference to measure against. Even with my modest requerements, a reference chip along with high precision resistors to create voltage points for reference and dynamic calibration, costed me over $50 in parts. I also had to get good power source for amplifiers and ADCs. With all this overhead, I had to put all the measuring circuits together, so that voltage references and power sources could be shared.

    I had to use very precise op amps (and also precise resistors) for shunt measurements, because voltages to be measured are very low, and also fast changing. I couldn't even use any over-voltage protection on the inputs because it would introduce too much noise. Had to put in some low pass filters to filter out possible high frequency ripple from CCs, but keep 120Hz ripple from the inverter intact. I built 4 channels, perhaps $40 each. This resulted in very accurate DC current measurements.

    For AC current, I just went with CT with as many turns as I could. That worked out Ok, but still resulted in about 1.5 degrees of phase-angle errors which I had to correct. Fortunately, CTs were cheap - only $20/piece. I could get better ones for $100/piece, but it was too much for me.

    I had to keep everything together because to calculate power you need perfectly synchronized high frequency measurements of voltage and current. Also, had to work on microcontroller code to make sure that data are processed in real time without loosing any data points.

    I don't thing accurate measurements can be achived in a distributed system with low cost sensors. Something around 2 to 5% accuracy may be reasonable, however any RE system has charge controllers and inverters, which already have these measurements.

    IMHO, there's no reason to duplicate measurements from charge controllers and inverters. It is easier to get the data directly from these devices. BTW, it would be nice to have support for different charge controllers, not only Classic.

    For temperature and humidity, I built my own sensors, but this wasn't a good idea. I went through a tedious calibration process with humidity sensors, but still couldn't achieve anything better than standard 5%, which I could get with stock sensors. Environmental sensors doesn't have to be fast, so I separated them from the main board and stuck them where I believe measurements would be more representative. Will have to add remote outside weather sensors to measure outdoor conditions. For this sort of sensors the distributed approach is definitely the best.
  • zoneblue
    zoneblue Solar Expert Posts: 1,220 ✭✭✭✭
    Re: Battery manager and generator start
    NorthGuy wrote: »
    In the beginning, I was going to get all my data from Xantrex, which would make for much simpler device. The reason I went with my own measurements because I suspected that the data produced by Xantrex may not be very accurate. Increase in accuracy comes with exponentially growing costs and efforts. So, I aimed for 0.1% precision for most of my measurements.

    0.1% is surberb. Agreed, that theres an interest factor in cross checking the RE gear numbers. But not really essential for most folk. As an example midnite have never produced efficiency curves for the classic, and we can only guess at efficiency at diff input voltages. Would be interesting for someone to run shunts on input and output for a period and publish the dataset, power in v power out. But not something we all need to do.

    Midnite numbers seem to better than industry std maybe.
    For the beginning, to measure something, you need to have a voltage reference to measure against. Even with my modest requerements, a reference chip along with high precision resistors to create voltage points for reference and dynamic calibration, costed me over $50 in parts. I also had to get good power source for amplifiers and ADCs. With all this overhead, I had to put all the measuring circuits together, so that voltage references and power sources could be shared.

    I had to use very precise op amps (and also precise resistors) for shunt measurements, because voltages to be measured are very low, and also fast changing. I couldn't even use any over-voltage protection on the inputs because it would introduce too much noise. Had to put in some low pass filters to filter out possible high frequency ripple from CCs, but keep 120Hz ripple from the inverter intact. I built 4 channels, perhaps $40 each. This resulted in very accurate DC current measurements.

    For AC current, I just went with CT with as many turns as I could. That worked out Ok, but still resulted in about 1.5 degrees of phase-angle errors which I had to correct. Fortunately, CTs were cheap - only $20/piece. I could get better ones for $100/piece, but it was too much for me.

    Makes sense. Sounds like you know what your doing. Do you work in that industry?
    I had to keep everything together because to calculate power you need perfectly synchronized high frequency measurements of voltage and current. Also, had to work on microcontroller code to make sure that data are processed in real time without loosing any data points.

    Yeah that occured to me as well. Midnite datapoints are mostly 1sec averages. What sample rate did you end up achieving?
    IMHO, there's no reason to duplicate measurements from charge controllers and inverters. It is easier to get the data directly from these devices. BTW, it would be nice to have support for different charge controllers, not only Classic.

    Suuport for other devices is built in, just not coded. The first person that shows an interest in any particular mainstream device will get my help to write a module for it.
    For temperature and humidity, I built my own sensors, but this wasn't a good idea. I went through a tedious calibration process with humidity sensors, but still couldn't achieve anything better than standard 5%, which I could get with stock sensors. Environmental sensors doesn't have to be fast, so I separated them from the main board and stuck them where I believe measurements would be more representative. Will have to add remote outside weather sensors to measure outdoor conditions. For this sort of sensors the distributed approach is definitely the best.

    The thing that interests me most is the pv reference panel. To know exactly what the system is capable of producing at each moment is the single most lacking datapoint there is. Small PV, radio link to microcontroller, cant be very hard, just beyond my skillset at present. I could probably learn but itll take time.

    Heres one of the screens that includes new support for the Whizbang Jr.

    Attachment not found.
    Attachment not found.

    The methodology i use isnt that flash. Sample once a minute and assume that data is representative of the entire 60sec period. The limit at the moment is the classic itself, its ethernet implemention is buggy and still defying faster sample rates. But using the technology above, mS rates like yours arent really practical i dont think. For one thing theres multiple devices to be queried in sequence and data to be written, that all takes time. I dont think ill be aiming at much less once per 10 seconds.

    Well at least the classic has an ethernet port. For that we can be thankful.

    On another subject, do you know anything about calculating SOC?
    1.8kWp CSUN, 10kWh AGM, Midnite Classic 150, Outback VFX3024E,
    http://zoneblue.org/cms/page.php?view=off-grid-solar


  • Vic
    Vic Solar Expert Posts: 3,208 ✭✭✭✭
    Re: Battery manager and generator start

    Hi zoneblue,

    A few years ago, a member here -- nsaspook -- made some comments on a battery monitor that he was working on. Believe that he has knowledge of, and has researched some battery SOC models.

    Just poked around a bit here is one link, FWIW:
    http://forum.solar-electric.com/showthread.php?7396-DIY-battery-monitor-charger

    Mr spook was last active a couple of days ago, so mabe he will have something to add(?).

    Have fun, and many of us are following the work of you chaps who are rolling your own monitoring/control widgets. Vic
    Off Grid - Two systems -- 4 SW+ 5548 Inverters, Surrette 4KS25 1280 AH X2@48V, 11.1 KW STC PV, 4X MidNite Classic 150 w/ WBjrs, Beta KID on S-530s, MX-60s, MN Bkrs/Boxes.  25 KVA Polyphase Kubota diesel,  Honda Eu6500isa,  Eu3000is-es, Eu2000,  Eu1000 gensets.  Thanks Wind-Sun for this great Forum.
  • NorthGuy
    NorthGuy Solar Expert Posts: 1,913 ✭✭
    Re: Battery manager and generator start
    zoneblue wrote: »
    Makes sense. Sounds like you know what your doing. Do you work in that industry?

    No. I don't.
    zoneblue wrote: »
    Yeah that occured to me as well. Midnite datapoints are mostly 1sec averages. What sample rate did you end up achieving?

    I sample at 50kHz. There are 16 channels, so every channel gets sampled at 3.1kHz. I then aggregate everything, and once per 8192 samples (about 2.5 sec), do analyzing, post numbers on LCD etc.
    zoneblue wrote: »
    The thing that interests me most is the pv reference panel. To know exactly what the system is capable of producing at each moment is the single most lacking datapoint there is. Small PV, radio link to microcontroller, cant be very hard, just beyond my skillset at present. I could probably learn but itll take time.

    The very simple methiod is to put a resistor accross the panel. Then measure the voltage accross the resistance. You will have to compensate for the temperature to get an idea of available production.

    Evaluate maximum possible current, say Imax = Isc * 1.2, then the range of your ADC = Vmax. The resistor you need is R = Vmax/Imax. You need to make sure that the Vmp rating of the panel is at least 1.5 times more than Vmax, so if you use 5V ADC, you need a panel with Vmp of 7.5V or more. That's relatively big panel. You can get away with smaller panel, but then you need to amplify the voltage.

    You can get fancy and measure the actual MPPT, but this is more involved. Put a capacitor accross the panel. Discharge the capacitor into a dump load, then watch it charging. Measure voltage accross it and simultaneosly the current between the panel and the capacitor. Repeat these measurements quickly ans simultaneously while the capacitor charges. Calculate power as V*I. The point with maximum V*I is the MPPT point, and V*I at this point is the estimate of available power. Obviously, you need to do it fast to get many samples while the capacitor charges, so you may need a relatively big capacitor to slow it down.

    Of course, none of this matters if there's a shade (however small) on main panels.
    zoneblue wrote: »
    The methodology i use isnt that flash. Sample once a minute and assume that data is representative of the entire 60sec period. The limit at the moment is the classic itself, its ethernet implemention is buggy and still defying faster sample rates.

    Xantrex sends measurements twice a second and works like a charm without any bugs.
    zoneblue wrote: »
    Well at least the classic has an ethernet port. For that we can be thankful.

    I bought a Chinese Internet RS232 to Ethernet adapter on eBay for about $10 and it works extremely well.
    zoneblue wrote: »
    On another subject, do you know anything about calculating SOC?

    I use straight AH counting. The only drawback is that during absorption (float to some extent?) some of the AH go to bubbling. I empirically estimated this part for my batteries. Of course, this is just an estimate, but it seems to work. I did a handful charge cycles already, watched the estimated DoD at the end to see if it's 0. Despite my cycles were diverse and lasted from 1 day to more than a week, all but one measurements fell within 1% of sum of discharges.

    There are lots of information on the Internet that there must be corrections for Peukert effect, for temperature, other conditions. This stuff just self-propagates through the Internet, so it eventually becomes popular. IMHO, there's no scientific base for that. An amp is an amp. So I didn't use any of this stuff.
  • zoneblue
    zoneblue Solar Expert Posts: 1,220 ✭✭✭✭
    Re: Battery manager and generator start
    NorthGuy wrote: »
    No. I don't.
    I sample at 50kHz. There are 16 channels, so every channel gets sampled at 3.1kHz. I then aggregate everything, and once per 8192 samples (about 2.5 sec), do analyzing, post numbers on LCD etc.

    For an open project black box does have to be modular, so it fits various peoples needs. But the essence of your kit, sounds like a very good ADC implementation, and if that could be made to report on some std coms protocol, then the board will work alone, wont it?

    If you have proprietary goals in mind, then well fine, thats another story. But my thinking is that the best thing you can do at this point, is tidy up and publish your circuit diagram, eagle files, code etc. Theres no point in all of us reinventing the wheel.
    The very simple methiod is to put a resistor accross the panel. Then measure the voltage accross the resistance. You will have to compensate for the temperature to get an idea of available production.

    Evaluate maximum possible current, say Imax = Isc * 1.2, then the range of your ADC = Vmax. The resistor you need is R = Vmax/Imax. You need to make sure that the Vmp rating of the panel is at least 1.5 times more than Vmax, so if you use 5V ADC, you need a panel with Vmp of 7.5V or more. That's relatively big panel. You can get away with smaller panel, but then you need to amplify the voltage.

    Agree so long as the sense resister is capable of using the entire Isc, then isc can be measured and isc being proportional enough to imp for most purposes.
    You can get fancy and measure the actual MPPT, but this is more involved. Put a capacitor accross the panel. Discharge the capacitor into a dump load, then watch it charging. Measure voltage accross it and simultaneosly the current between the panel and the capacitor. Repeat these measurements quickly ans simultaneously while the capacitor charges. Calculate power as V*I. The point with maximum V*I is the MPPT point, and V*I at this point is the estimate of available power. Obviously, you need to do it fast to get many samples while the capacitor charges, so you may need a relatively big capacitor to slow it down.

    Of course, none of this matters if there's a shade (however small) on main panels.

    Interesting idea. What order of accuracy difference are we talking compared to scaling of isc?
    Xantrex sends measurements twice a second and works like a charm without any bugs.
    I bought a Chinese Internet RS232 to Ethernet adapter on eBay for about $10 and it works extremely well.

    The issue with the classic is that in order to allow local app in you have to open and close a connection. If you leave it open you can happily query it every 50mS. Something in the new modbus connection is buggy.

    The inverter has an ethernet inerface, or an addon to that effect? Lately i realised every plugged ethernet port draws 0.6W. I supose it cant be avoided in this situation though...
    I use straight AH counting. The only drawback is that during absorption (float to some extent?) some of the AH go to bubbling. I empirically estimated this part for my batteries. Of course, this is just an estimate, but it seems to work. I did a handful charge cycles already, watched the estimated DoD at the end to see if it's 0. Despite my cycles were diverse and lasted from 1 day to more than a week, all but one measurements fell within 1% of sum of discharges.

    Can you say more about handling absorption, and charge efficency? What would that look like in practice... Do you have any code?

    How to account for the aging battery? Many linux laptop battery monitors have some kind of logic built in that learns from each charge cycle and can tell you how much less capacity the Li ion has than new. No idea how it works, but at a guess it compares amp counting to voltage. I guess it has a predictable discharge rate to work with which helps.
    There are lots of information on the Internet that there must be corrections for Peukert effect, for temperature, other conditions. This stuff just self-propagates through the Internet, so it eventually becomes popular. IMHO, there's no scientific base for that. An amp is an amp. So I didn't use any of this stuff.

    Ok point taken. Thanks for your thoughts.
    1.8kWp CSUN, 10kWh AGM, Midnite Classic 150, Outback VFX3024E,
    http://zoneblue.org/cms/page.php?view=off-grid-solar


  • NorthGuy
    NorthGuy Solar Expert Posts: 1,913 ✭✭
    Re: Battery manager and generator start
    zoneblue wrote: »
    For an open project black box does have to be modular, so it fits various peoples needs.

    That is not necessarily true. The overhead of unneeded parts on a single board might be less than the communication overhead. Also, if you want to deal with other people, it is easier for them to have a single universal unit than several modules with associated wires.
    zoneblue wrote: »
    But the essence of your kit, sounds like a very good ADC implementation, and if that could be made to report on some std coms protocol, then the board will work alone, wont it?

    I didn't really want to do ADC. I wanted to control my system, primarily run generator when I want, and control the charger through XanBus. I had to add ADC because XanBus numbers were not accurate enough for me. Of course, you can make an ADC-only board with communication protocol. There are some out there already - Victron monitor is probably the best of the kind.
    zoneblue wrote: »
    If you have proprietary goals in mind, then well fine, thats another story. But my thinking is that the best thing you can do at this point, is tidy up and publish your circuit diagram, eagle files, code etc. Theres no point in all of us reinventing the wheel.

    I'll think about that. I designed it for personal use. I didn't think of selling or publishing it. It is designed for my level of current, my equipment etc. To make it useable to other people, quite a bit of changes need to be done first.
    zoneblue wrote: »
    Agree so long as the sense resister is capable of using the entire Isc, then isc can be measured and isc being proportional enough to imp for most purposes.

    It won't be exact Isc because resistor is not short and have some resistance, but it'll be close if the voltage accross the resistor at full power is substantially less than Vmp.
    zoneblue wrote: »
    Interesting idea. What order of accuracy difference are we talking compared to scaling of isc?

    Power is V*I. The Isc measurement will only give you the I part. You would have to estimate V, which varies with temperature etc. Apparently, you can measure I more accurately than you can estimate V. It all depends on how accurate your V estimates are.

    If you do MPPT method, you measure what you want directly, so you can get better results. However, if your V estimates in Isc method are good, I wouldn't expect much difference between these methods.
    zoneblue wrote: »
    The issue with the classic is that in order to allow local app in you have to open and close a connection. If you leave it open you can happily query it every 50mS. Something in the new modbus connection is buggy.

    Perhaps you can bypass the faulty Ethernet interface and connect directly to the Modbus with RS-232 or RS-485 (whatever Classic supports).
    zoneblue wrote: »
    Can you say more about handling absorption, and charge efficency? What would that look like in practice... Do you have any code?

    It is very simple. Back in winter, I did a lot of experimenting with my batteries. I looked at the charging current over time, and I noticed that at constant voltage it goes down and finally settles at some value, which I call end amps. I figured that when the end amps level is reached the battery is charged and all the amps go to bubbling. I just built a table of end amps depening on voltage. Say at 64V, there's 15A. Then it sharply goes down as the voltage decreases and is practically 0 at 52V. I use my table to figure out end amps during the charge and then subtract them from real amps. Say, if I charge at 64V and 80A, my program thinks that only 65A goes to charge batteries and 15A goes to bubbling (65+15=80). Other than that, it's straight AH counting.

    Over time, I noticed that end amps may vary for the same voltage. Say, at 64V I may get anything between 12A and 19A. My program uses 15A. At my typical 1000AH swing between full charges this doesn't produce big difference.

    Not counting the bubbling effect, batteries are 100% efficient in term of AH. The energy efficiency is less because you charge at higher voltage than you discharge, but this doesn't affect AH counting.

    Of course, each battery bank will have its own table of end amps. So, if you want to make it universal, you need a way to guess or measure the end amps.
    zoneblue wrote: »
    How to account for the aging battery?

    I think that my table may change as the battery ages, but there's no way to tell.
    zoneblue wrote: »
    Many linux laptop battery monitors have some kind of logic built in that learns from each charge cycle and can tell you how much less capacity the Li ion has than new. No idea how it works, but at a guess it compares amp counting to voltage. I guess it has a predictable discharge rate to work with which helps.

    I measure AH only. I don't know if you can measure capacity. I know my battery can discharge 520AH, which is 77% of 673A (published 20-hour rate). How much deeper can they go? I don't want to find out because deep discharges can damage the batteries beyond repair.

    If I notice a big voltage drop by the end of discharge, I will know that it's getting close to the end of the life for my batteries. I'll lower the discharge settings and start shopping for new batteries.