You're right, I'd rather make an additional discrete circuit to limit the charging current pulse. I just fear that even in a PWM mode, in a short pulse (the average current will not exceed the maximum) high momentary current will cause some harm to the battery...
Reason of such strange solution - 3rd world country problems, mostly.
I'm not looking for a way to make an efficient charger, but i hoped PWM will be a little better than a heater in the form of a linear adjustable regulator (like it is done in cheap APC UPS).
The end device is customizable DC UPS + load control, it is based on ESP8266, so most of parameters will be adjusted in software.
Since probably underqualified electricians will install it, i am trying to make the device as simple as possible. Unfortunately LEGO from different modules will not work in such case.
A maximum of three connectors, a battery (protection against reverse polarity), a power supply (barrel jack wont allow such mistake), and load (barrel plug, no mistake possible as well).
One of the requirements to the device - inexpensive. Existing devices are excellent electronic waste generators, with lithium batteries that sometimes explode, and often just die very early, additionally there is no supply of good quality lithium batteries in this country.
I want to make a device that will work with an available common power supplies and an affordable, replaceable lead-acid battery (lead-acid batteries are recycled here). Maybe it will be some 9V supply + 6V battery. Or laptop power supply (19V mostly) and 12V battery.