You could connect your battery string directly to the solar panel: the voltage is about right. However, your VRLA batteries are sealed, so you should never over-charge them.
Your "24V" panels probably have a peak power point around 36V, and an open circuit voltage around 48V. This is a suitable voltage range for running a "24V" power system, which actually runs at around 28V, charges at 30V, needs around 32V before losses, and needs some overhead so that it works in low-light conditions.
Running a "36V" system at about 42V, with charging around 44V, you wouldn't get very good solar efficiency out of your "24V" panel, and you wouldn't get peak charge current out of them, so they would not be 200W each (400W total) except perhaps under exceptional conditions when cold and new, running into a flat battery.
A normal charge controller can "handle" this situation, that is, it won't die, it will charge your battery, it won't overcharge your battery, it won't destroy the UPS. *Assuming the charge controller voltage levels can be configured for sealed batteries
The question is, can you "handle" the fact that you won't get 200W (each) out of your 200W (each) panels if you configure it that way?
Having said that, it's a UPS. You may never use it. You probably won't need 400W. And it's a stop-gap: your expectations don't have to be high.
Don't even think about creating the setup you just described. It is bloody dangerous.
If you wire the "solar cell pack" and the two battery packs in parallel without connecting the Raspberry Pi, you'll get a loop. Kirchhoff's second law explains that the sum of voltages around a loop must be zero. In this case, if you start going around the loop in one direction, you'll encounter the two power sources with opposite directions, so now their difference must be zero - so they must be at an equal voltage. Will this be 6V (dictated by the solar panels) or 3.7V (dictated by the battery packs)? The following will happen:
- Initially, without sunlight, the common voltage will be 3.7V. No current flows, since the solar panel does not let current flow backwards (its resistance goes near infinity). All is well for now.
- Then you apply sunlight. The solar panels try to increase the voltage to 6V, but at this voltage the batteries would allow through much more current than they can supply. So the panels drop their voltage to 3.7V, but still begin to charge the batteries with the couple hundred milliamps they can supply, until the voltage in the battery packs reaches 6V. And there's a pretty good reason the batteries are rated at 3.7V.
- If I learned anything about Li-ion and Li-polymer batteries is that they are very easy to upset. And they especially don't like being overcharged. If they are indoors, they will blow up your desk and burn your house down. If they are oudoors, they'll happily ignite the grass around them. Then burn your house down. Li-ion and Li-polymer batteries are not toys. Don't even think about putting them in a circuit where there's even a slight chance they'll get overcharged.
Connecting the Raspberry Pi before the detonation wouldn't work out well either. The 3.7V combined power supply is not enough for the Pi, which will then do one of the following (I'm not familiar with the Pi's power supply circuit):
- Pull a lot of current overheating the battery, the solar panel and maybe even its own on-board voltage regulator. It will not boot, or even if it does, it will frequently crash and reboot because of the inadequate voltage. This goes on until one of the components fail: if it's the solar panel, you're safe. If it's the Pi, it's the time bomb scenario all over again. The battery packs also don't like being over-discharged, but as far as I know, they don't burst out in flames then. They just don't work anymore.
- Don't pull any current at all. Then it's like you didn't connect it at all. Time bomb again.
Creating a circuit which safely combines solar and battery power requires advanced electronics skills and dedicated circuitry. In your case, I would follow S.J. Becker's advice (+1) and buy a (solar powered) power bank from eBay. The circuitry is there, pre-made for you and it can power your Raspberry Pi longer than your setup would have even if it worked. I know they are not as cheap as using things from your parts bin, but they are definitely cheaper than replacing your burnt furniture.
Additionally, does the thing have to be solar powered?
Edit: Some battery packs have built-in protection circuitry that shuts the power off if the battery is overcharged, so there's a chance your setup won't actually ignite but just not work at all.
Best Answer
Basically, all the power is merged, and you are billed for the difference between the output from your solar panels and the power used in your house.
Simplified, the power grid's transmission lines are inductors, so when the voltage rises on one end, a current needs to get going through the line. If you simultaneously raise the voltage on your end, that current can be smaller, so the network sees your area as needing less power (the local substation serves multiple houses that at least for now will still have a net draw). When solar becomes widespread enough that you and your neighbours produce more than you consume, then indeed the current may flow in the other direction.
When more solar power is produced, then this means less load on the other generators. The power companies will then turn off some water turbines (because these can react quickly) and leave the big power plants online. If more power is produced than consumed (regardless of the source) they start pumping water uphill, which they can then run through generators at times of high demand (basically, using a lake as a huge capacitor).