The Leaf also has a finish by X setting. An algorithm shouldn't be particularly hard.
1. The driver sets minimum start time (for TOU), stop time, ideal SOC, and ideal amps.
2. The car starts charging at the minimum start time and calculates when the finish will happen based on ideal amps and ideal SOC.
3. If the calculation in #2 is prior to the stop time, ideal amps are reduced (or increased if it appears that it won't finish in time).
4. At regular intervals the car checks the SOC and remaining time and adjusts the amps as required.
5. Car stops charging at the stop time.
FWIW, I've normally charged at less than the maximum--more to prevent overheating of the UMC than anything else. After the recent discussion about cell equalization, I reduced that to 16 amps. I'll see how it goes.
We've been working on something like this for the roadster, in the OVMS project. Looking at thousands of charging logs, from hundreds of cars, in a wide variety of environments.
The ramp-up and main charging parts of the curve are relatively easy to predict, with the variable being ambient / pack temperature (primarily accounting for cooling losses). The issue is predicting the ramp-down tail at the end of the charge - we are seeing a lot of variance there. The car controls that based on a bunch of factors hard to model (and even harder to predict). Changing charge limit at that point will have zero impact (as the limit is being controlled by the car during ramp-down). But, getting to within 30 minutes seems to be feasible, so that is what we are trying to do.