Generator Charging Surge

I have some node red code that dynamically reduces the charge current as the voltage rises i posted an example for another poster. I do this for one of my systems, so the solar finishes off the charging. You might be able to see how I do it and use some of the code. Just change the values to a 12v for example, start reducing at 13.6V and have the min current at 14V. This works really well because as you reduce the current, the voltage also drops.