Martin Jäger 4aa51fbe25 DMA for ADC implemented, mbed Ticker removed, files restructured
- DMA partly uses ST HAL API (to be improved in further versions)
- When using mbed ticker to trigger ADC, the program might stall --> use own timer instead
- C++ libraries changed to more simple C-style functions and files (better compatibility with plain C environments)
2018-03-10 14:21:49 +01:00
2016-08-02 14:02:09 +02:00
2016-08-02 14:05:23 +02:00
2017-04-14 18:04:13 +02:00

MPPT Charger Software

Software based on ARM mbed library for the LibreSolar 20 A MPPT solar charge controller

Important remarks

  • Do not use mbed Ticker class, as it disturbs the timer settings and might cause the charge controller to crash. In addition to that, it contains a lot of overhead and is not very efficient. Timers should be programmed bare metal. Currently, TIM1 is used for PWM generation and TIM15 to trigger ADC readings.

State machine in class ChargeController

The charge management is implemented using a state machine with the following states:

Standby

Initial state of the charge controller. If the solar voltage is high enough and the battery is not full, charging in CC mode is started.

CC / bulk charging

The battery is charged with maximum possible current (MPPT algorithm is active) until the CV voltage limit is reached.

CV / absorption charging

Lead-acid batteries are charged for some time using a slightly higher charge voltage. After a current cutoff limit or a time limit is reached, the charger goes into trickle or equalization mode for lead-acid batteries or back into Standby for Li-ion batteries.

Trickle charging

This mode is kept forever for a lead-acid battery and keeps the battery at full state of charge. If too much power is drawn from the battery, the charger switches back into CC / bulk charging mode.

Equalization charging

This mode is only used for lead-acid batteries after several deep-discharge cycles or a very long period of time with no equalization. Voltage is increased to 15V or above, so care must be taken for the other system components attached to the battery. (currently, no equalization charging is enabled in the software)

Text

DC/DC controller using class HalfBridge

The PWM signal generation for the DC/DC controller inside the charge controller is done by a separate class HalfBridge. Most of the dangerous functions which could blow up your MOSFETs are implemented here.

S
Description
Firmware for Libre Solar MPPT/PWM charge controllers
https://libre.solar/charge-controller-firmware/
Readme
5.7 MiB
Languages
C++ 77.6%
C 18.1%
CMake 1.6%
Python 1.4%
Shell 0.7%
Other 0.6%