maltepöggel.de

Solar MPPT FOCV tracker

Add-on board for MPP tracking using the Fractional Open Circuit Voltage (FOCV) method

If the maximum power should be gained from a solar panel, a regulation is necessary due to its characteristic curve. This is called maximum power point tracking. When experimenting with the CN3722 Solar MPPT charge controller, I noticed that it will only start charging when the set MPP voltage is reached. This is actually the intended behavior of most simple charge controller ICs, but basically does not meet the requirements of real tracking, in which maximum power is regulated by measuring voltage and current on the input side.

The actual MPP point is not only dependent on the ambient temperature, but most importantly on the light intensity. On a cloudy day, the battery may not be charged at all. Can the existing setup be upgraded to add such a tracking method?

Picture: Charge controller with additional boards of the FOCV MPP Tracker

In addition to complex algorithms that continuously monitor and regulate the input current and voltage, I came across the Fractional Open Circuit Voltage (FOCV) method. This assumes that the MPP voltage is always in a roughly fixed ratio (around a factor of 0.7-0.8) to the open-circuit voltage of the panel. The open-circuit voltage is in turn dependent on ambient light and temperature, so that this fairly simple method offers clear advantages over a fixed input voltage. This is why the tiny additional circuit board described below was developed.

Picture: Schematic

Circuit description

The additional board replaces the precision potentiometer of the charge controller by an MCP4151 digital potentiometer (IC3) with 257 steps. The input voltage is measured using the voltage divider consisting of R1 and R2. The ATTiny412 microcontroller (IC2) has an integrated analog-to-digital converter and performs the measurement, calculation and output by controlling the digital potentiometer. The UPDI programming interface of the controller is led out on pin header K3. The 5V power supply is realized with a low-drop voltage regulator MCP1804 (IC1) directly from the input voltage. This is tapped with a bodge wire at the input capacitor of the charge controller board. The operating status is indicated by the red LED (D1). The port pin used for this is also the UART interface, which can therefore still be used for debug outputs.

Firmware

The microcontroller measures the open-circuit voltage of the solar panel at defined intervals of 2 seconds. To switch off the charge controller, the digital potentiometer is set to the position with the highest possible MPP voltage. After the measurement, the target voltage is calculated using the specified factor. In the first version, the controller uses a lookup table (the ratio is not linear) to determine the required position of the digital potentiometer. In the case of the CN3722, however, there was a deviation of up to one volt from the pre-calculated values. The explanation for this was found in the data sheet: A temperature coefficient is applied to the MPPT pin, which is actually intended to compensate for the panel's coefficient. With this IC, it is therefore not possible to assign a fixed position of the potentiometer to an MPP voltage. Hence, the code was updated by a control loop. It constantly measures the input voltage and increases or decreases the position of the potentiometer in the event of deviations from the target voltage. This approach achieves a sufficiently high level of accuracy. The code allows switching between the two variants using a compiler switch. There is also an optional debug output with 9600 baud 8N1 via UART, which outputs the measured open-circuit voltage, setpoint voltage and potentiometer position. The interface converter is soldered to the LED connection and ground.

The firmware is written in C and uses the Arduino libraries in the PlatformIO build system. The installation of PlatformIO Core is sufficient for use on the console; those who prefer a complete development environment can use VS Code with PlatformIO as a plugin. All other dependencies are downloaded automatically.

After downloading the firmware from Github, we first change to the corresponding directory on the console:

git clone https://github.com/MalteP/solar-mppt-focv.git
cd solar-mppt-focv

The fuse bits must now be burned. These determine the basic settings such as the clock frequency of the ATTiny412. To do this, the UPDI programmer is connected to the 3-pin connector K3. A power supply >6V (e.g. laboratory power supply) is also required. If the board is not installed, the ground connection can be established via K2 and the operating voltage can be supplied via VIN / K1. When installed, the voltage is simply applied to the input of the charge controller. The programming process is performed with the following command:

platformio run -t fuses

In the next step, the firmware must be compiled and transferred to the flash memory of the microcontroller. Any adjustments to the voltage factor or changes to the debug output are made prior to that in the src/main.cpp file. The upload is then done as follows:

platformio run -t upload

If the LED now lights up and flickers every 2 seconds, the Solar Tracker program is running.

Assembly

To give the additional board some space from the components underneath, I printed a fitting spacer out of ABS, which is pushed onto the angled pin header. The pin header is soldered to the charge controller board instead of the precision potentiometer and an additional wire is hooked up to the V_SOLAR test point or positive pin of the capacitor in the voltage input.

First start

The easiest way to check the device's function is to use a laboratory power supply unit. This is first set to the desired open-circuit voltage and the current limit is set below the possible charging current, as this is when the MPP control takes effect. A temperature sensor and a suitable, not fully charged battery must be connected to the charge controller. The limited input voltage can now be measured. Ideally, measuring points with different voltages should be made for testing purposes. Each of these must be below the open-circuit voltage by the factor defined in the code. This test is also possible with a solar panel. To measure the open-circuit voltage, the charge controller must be temporarily disconnected.

Conclusion

The project is currently in an experimental status. Long-term data will show whether the charging behavior improves in low light conditions.

Links
Downloads