Hello guys. This is my newer schematic diagram
**broken link removed**
I decided to use LM338 (LM317 in the figure) to regulate voltage. It is rated 5 amperes
I replaced the FETs with BJTs so that less voltage is needed to switch them on.
R2 and R1 sets the regulator output to
Vreg = 1.25*(1+(R2/R1)) = 14.27 volts
Charging current is limited by R3, R4, and Q1.
Ichg = Vbe,sat/R3 = 0.8/0.25 = 3.2 amperes**
**asuming base current is very small. I got the circuit from
https://www.ti.com.cn/cn/lit/ds/symlink/lm138.pdf page 16. I recalculated but I am not sure of the values because Vbe,sat is in the range 0.7 volts to 2 volts depending on the collector current
Charging stops when the battery voltage reaches Vzener + Vbe,sat of D6 and Q2 again assuming that base current is very small.
Vzener + Vbe,sat = 13 + 0.8 = 13.8. Q2 shorts R2 which decreases the LM338 output which stops the charging.
Battery supplies power to the load through Q3, when V2 (POWER SOURCE) is open/short. V2 provides power to the load otherwise (it is not shown in the schematic but basically V2 is fed to another LM338).
The extra capacitors and diodes are for improving response time and protection of the LM338 regulator.
Please comment again. Thanks guys!