solar-cluster

Solar cluster: An off-the-shelf workaround for the PicoPSU

Well, I’ve been researching the problem. I have a battery that could be floating anywhere from 10V to 14.6V, depending on the input from the charger.

I have a computer PSU, that is not happy with voltages outside of 10.5V—13.5V.

What are my options?

  • Linear regulator: the standard ones have a 1.5V drop across them, which at the full rated input current of the PSU, 8A is 12W. Per node.
  • Low drop-out regulators get a little lower, but I’d still lose a few watts per node.
  • Buck converters can do better, but a lot still need at least 1V difference.

So I really need to boost it first, then regulate down. One thing I was not looking forward to, was designing then winding the transformer/inductor needed. An off-the-shelf solution therefore seems attractive, even if I miss out on kudos points for a DIY solution.

Redarc make a couple, and this unit looks like it’ll do exactly what is needed. Not cheap, but it seems comparable to what I’ve seen elsewhere. I’ll have a look and see what else there is, but this might be the most time-economical way to solve the problem and the efficiency is pretty good.

Solar cluster: PicoPSU limitations

Of course, there’s always something there to throw a spanner in the works, and for me, it’s the PicoPSU.

It seems to work great, however, there is an Achilles heel with these things: they have a fairly narrow band of tolerable voltages they’ll operate at. Namely 10.5—13.5V.

Now, 10.5V is fair enough, but 13.5V? Typical lead acid batteries are 13.8V nominal voltage, and will get to 14.5V when charging. So I need some preregulator that will handle when the voltage is up around 13.5V or above, and drop it down just a little, passing through up to 2A (5A to be safe).

It still has to be stable when the current changes, “turned off” on these computers means a drain of about 200mA for the IPMI. So our operating parameters are summed up as 10.5—13.5V and 200mA—5A.

It needs to continue operating when the battery gets to ~11.5V.

So what are my options?

  • LM2576 simple switcher? 12V in will produce 10.5V out.
  • LM7812 has the same problem, and will chew more power.

A series regulator built on a zener/NPN might work. The voltage drop across the NPN ordinarily is going to be fairly low, however there will still be a drop of about 0.7V or so. That’s possibly “good enough”, since at 11.5V input, we should still see about 10.8V out which is within range.

Two diodes in series, with a relay to short them out when the voltage drops below 12V would work too. That’d need a comparator and voltage reference to drive the relay. It’s a cheap solution too.

Another prospect is a beefy DC-DC converter on the battery, so we don’t actually care what the battery voltage is, we boost it say to 15V then regulate it back down to 12V. A 30A-capable flyback or boost-buck converter would do it. This is more complex, and much more expensive to do off-the-shelf, so I think that’d be a method of last resort.

Solar cluster: Charge controller ponderings

I’ve been giving some thought to how to manage charging of the battery.

There’ll be two charge sources essentially, one will be mains power via a conventional battery charger, the other will be solar. Both are current-limited and will be below 24 volts.

The battery will not respond straight away to a step change in applied voltage, rather current will start flowing in and the battery voltage will begin to rise. There’ll be a delay in the voltage being applied and the observed battery voltage reaching that point. The only thing we really need to watch is that the current doesn’t exceed the inrush capabilities of the battery.

What we want to avoid is that, as we get close to charge, we do not “chatter” on the upper set-point. When the upper set point is reached, we should back off some minimum delay, before continuing to charge.

This is a possible implementation of that idea.

We consider 3 voltages:

Variable Notes
V_{CL} “Low” control voltage set-point. Charger should turn on near this point. Set by a potentiometer on a regulated supply.
V_{CH} “High” control voltage set-point. Voltages above this point are considered harmful and we should cut power when this voltage is reached. Set by a potentiometer on a regulated supply.
V_{CB} Battery control voltage. This is proportional to the battery voltage, set by a resistor divider or potentiometer across the battery.

We have two comparators that tell us when the battery is below the high set-point, telling us we’re “safe” to begin charging, and when the battery is below the low set-point, telling us the battery is “low” and needs charging. We use an SR latch to achieve this. The “safe” is inverted, and helps drive the “reset” side of the SR latch, the “low” signal drives the “set” side.

If the voltage gets above our high set point at any time, we must stop charging immediately. So we use an AND-gate to ensure that the power is shut off as soon as possible. We feed this into the SR latch reset pin via a NOT gate to the SR latch to reset the state.

If the voltage gets low, depending on our set-point and rate of discharge, we can tolerate some small delay in getting going. We ensure it is safe to do so by ANDing “LOW” with “SAFE”, then delay the rising edge pulse by a few seconds, possibly with an RC circuit or 555 timer, before passing that into the SR-latch.

The AND logic also prevents us from asserting “SET” and “RESET” on the SR latch simultaneously.

The graph I’ve drawn is a bit of an exaggeration, hopefully the discharge curves won’t be that steep. It’s possible I could do away with an op-amp and use hysteresis, however I feel using two means I can control the two set-points independently.

Two of these, and tweak the delays a bit so that the solar comes on first, and we should be able to run both in parallel to charge the same battery.

Solar cluster: Modding the switch for 12V operation

Probably going to be easier than expected. I popped open the cover to see whether it was like the much older Netcomm switch we have.

Sure enough, Linksys do it the same way in the LGS326AU:

This PSU is an open-frame PSU made by Asian Power Devices, Inc. Model NW-20A12-BAAB. Not sure if there’s someone here who knows more about this particular PSU.

It appears it’s the one 12V feed split in two. Red/Black are negative, green/yellow are positive. I’ll double check this. I think with a nice big inductor/capacitor as an in-line filter, this can be hooked straight up to the 12V line, perhaps with a small amount of zener overvoltage protection. It appears that the voltage is further rectified on the switch mainboard:

Solar cluster: Testing the nodes

Well, I managed to get some parts yesterday. The plugs I bought don’t quite fit, so I’ll have to buy some different ones. Apparently the ones I got are for a 2.1mm inner pin, the ones I need are a 2.5mm inner pin.

No problems there though, they sort-of jam in there, and I can use them for other projects. Jaycar have changed things around and most of the bits are behind the counter — might as well go through online crowds if I’m not able to inspect the part close up. That’ll be a Tuesday job.

I’ve just put up a photo of the last two nodes being tested and bootstrapped, along with a shot of the partially-wired up wiring loom. I sort-of whacked that together to prevent the wrong parts from coming into contact. There’s a 30A fuse on the battery feed and individual 10A fuses for each machine. I could use 5A fuses too.

So far, I’ve now built kernels on all 5 boxes, and all seem to be performing well, if there were going to be issues with a box, I think they’d have shown up by now.

I also cracked open one of my old 24-port switches (an unmanaged Netcomm 10/100Mbps), and was pleasantly surprised to see the PSU was a separate module, putting out 3.3V 4A. I’ll crack open the Linksys and see if the same is true there, if so, this could be a much better option than trying to convert 12V?240V?some low voltage. If the step to 240V can be avoided, I might as well.

Solar Cluster: Accumulating parts and planning the system

Well, figured I’d document this project here in case anyone was interested in doing this for personal amusement or for their workplace.

The list I’ve just chucked up is not a complete list, nor is it a prescribed list of exactly what’s needed, but rather is what I’ve either acquired, or will acquire.

The basic architecture is as follows:

  • The cluster is built up on discrete nodes which are based around a very similar hardware stack and are tweaked for their function.
  • Persistent data storage is handled by the storage nodes using the Ceph object storage system. This requires that a majority quorum is maintained, and so a minimum of 3 storage nodes are required.
  • Virtual machines run on the compute nodes.
  • Management nodes oversee co-ordination of the compute nodes: this ideally should be a separate pair of machines, but for my use case, I intend to use a virtual machine or container managed using active/passive failover techniques.
  • In order to reduce virtual disk latency, the compute nodes will implement a local disk cache using an SSD, backed by a Rados Block Device on Ceph.

I’ll be using KVM as the virtualisation technology with Gentoo Linux as the base OS for this experimental cluster. At my workplace, we evaluated a few different technologies including Proxmox VE, Ganeti, OpenStack and OpenNebula. For this project, I intend to build on OpenNebula as it’s the simplest to understand and the most suited to my workplace’s requirements.

Using Gentoo makes it very easy to splice in patches as I’ll be developing as I go along. If I come to implement this in the office, I’ll be porting everything across to Ubuntu. This will be building on some experimental work I’ve done in the past with OpenNebula.

For the base nodes themselves, I’ve based them around these components:

For the storage nodes, add to the list:

Other things you may want/need:

  • A managed switch, I ended up choosing the Linksys LGS-326AU which U-Mart were selling at AU$294. If you’ve ever used Cisco’s small business offerings, this unit will make you feel right at home.
  • DIN rail. Jaycar sell this in 1m lengths, and I’ll grab some tomorrow.

Most of the above bits I have, the nodes are all basically built as of this afternoon, minus the SATA adaptors for the three storage nodes. All units power on, and do what one would expect of a machine that’s trying to boot from a blank SSD.

I did put one of the compute nodes through its paces, network booting the machine via PXE/NFS root and installing Gentoo.

Power consumption was below 1.8A for a battery voltage of about 13.4V, even when building the Linux 4.4.6 kernel (using make -j8), which it did in about 10 minutes. Watching this thing tackle compile jobs is a thing of beauty, can’t wait to get distcc going and have 40 CPU cores tear into the bootstrap process. The initial boot also looks beautiful, with 8 penguins lined up representing the 8 cores — don’t turn up here in a tuxedo!

So hardware wise, things are more or less together, and it’ll mostly be software. I’ll throw up some notes on how it’s all wired, but basically the plan in the short term is a 240V mains charger (surplus from a caravan) will keep the battery floated until I get the solar panel and controller set up.

When that happens, I plan to wire a relay in series with the 240V charger controlled by a comparator to connect mains when the battery voltage drops below 12V.

The switch is a 240V device unfortunately (couldn’t find any 24-port 12V managed switches) so it’ll run from an inverter. Port space is tight, and I just got the one since they’re kinda pricey. Long term, I might look at a second for redundancy, although if a switch goes, I won’t lose existing data.

ADSL2+ will be managed by a small localised battery back-up and a small computer as router, possibly a Raspberry Pi as I have one spare (original B model), which can temporarily store incoming SMTP traffic if the cluster does go down (heaven forbid!) and act as a management endpoint. There are a few contenders here, including these industrial computers, for which I already maintain a modern Linux kernel port for my workplace.

Things are coming together, and I hope to bring more on this project as it moves ahead.