The topology shown uses a half-bridge converter to take DC photovoltaic panel voltage to DC battery voltage. The panel we are using is the Canadian Solar CS6P-235P, 235W solar panel. The maximum voltage range for this panel is 0-36.9V, and a short circuit current of 8.46A.
We are using 8 Panasonic CGR18650CG 2200mAh 3.6V nominal lithium-ion batteries, 2 in parallel and 4 in series to store excess energy from the solar panel for later use by the load connected to the inverter. Each cell varies between 4.2V and 3.2V, resulting in a total voltage needed across the batteries from 12.8V to 16.8V.
In order to bring the panel output voltage to the battery voltage, we used a PWM-controlled buck converter. The voltage required across the batteries during charging mode needed to be higher than the total series terminal voltage of the battery packs. Instead of calculating this overpotential for every point along the charging curve, we determined a safe charging current of 0.5 amps (C/4.4), and implemented a feedback controller to ensure that current would not deviate from this chosen charge rate. Because of this, building an accurate current sensor was critical.
After the constant current charging regime, the batteries would be held at constant voltage to avoid overcharging, while the remainder of the PV output was sent to the inverter.
Constant-current, constant-voltage charging

We decided to build the circuit using PCBs and surface mount components, and had to start very early on the design in order to get the boards printed in time. The circuit was quickly built in LTSpice using MOSFETS for resistive cell balancing, but ultimately built the schematic and board layout in EAGLE. The cell-balancing was then achieved using BQ29209DRBR cell balancers from Texas Instruments that are able to automatically balance 2 cells in series and 2 in parallel between 4V and 10V using external resistors. This simplified the control of overvoltage and undervoltage protection.
Battery charger LTSpice schematic

EAGLE PCB schematic

Component selection
For the benefit of future battery charger builders, here are the components we used in the construction of the battery charger stage.
1x STM Discovery microcontroller board
2x NMOS transistors
1x half-bridge driver
22x 150nF ceramic capacitors
3x 33uF aluminum capacitors
2x 470uf aluminum capacitors
1x 22uH inductor
2x IC cell balancers
1x 5-20V input, 3V output LDO
2x 15A diodes
1x instrumentation amp for current sensing
10x resistors for voltage sensing for 4 battery modules and PV input
2x 4.7 ohm resistors for gate signal
1x 1 ohm resistor for gate driver Vcc
1x 4 pin header for gate driver PWM inputs
1x 3 pin header for gate driver supply inputs
1x 6 pin header for voltage and current sensing
8x 2 pin headers for battery inputs
8x 3.7V nominal 18650 Li-ion batteries
1x LCD screen
Final EAGLE PCB Layout

Control Algorithm Test Circuit
While we were waiting for our PCBs to arrive, with our stomachs full of Thanksgiving Turkey, we built a circuit using the gate drivers and MOSFETs in the lab to test our duty control algorithm. The first goal was to use the current and voltage sensing circuit we had built while constructing the energy meter earlier in the course with the control algorithm. The algorithm used P-D control with current as the input, and duty was adjusted accordingly to achieve the desired current. The goal for these simulations was to keep current at .5A. While current and voltage were sensed correctly, the batteries had not arrived and we could not try our hand at cell balancing before the PCBs arrived, so we simulated our batteries with a resistive load, and were able to adjust current accordingly.
The PC Boards arrived on the last day of class!
PC Board without Components (Front)

PC Board without Components (Back)

PC Board with Components


The Circuit
After mounting our components, we assembled a circuit simulating the inverter load with a resistive load. We only used four batteries for the initial setup so it would be easier to monitor our control algorithm. Our Discovery Board was able to sense and then report on an LCD the current through the batteries and the voltage across each battery.

The PWM Signal Controlling the Buck Converter

Batteries Charging

Final Stages
We were never able to successfully connect the battery charger with the inverter PCB. Complications with gate drivers slowed down progress considerably. The final circuit was one that allowed for the charging of a battery based on the current provided by the power source, and so only the power path was ever truly tested on the PCB in the limited time that we had to test it. Some debugging of the instrumentation amp circuit also needs to happen in order to end up with a very dependable current reading for the control algorithm. In the future, we would like to better tune the hardware and control so that the rate at which the batteries charge can be set through the user interface. We would also like to connect the two PCBs into one circuit and connect this to a solar panel, creating a scalable off-grid system with 1 solar panel, 8 Li-ion cells and a small load.
If you would like to see, synthesize, manipulate the files used in this project: