PI controlled linear voltage regulator with overcurrent protection
The problem you have is that you've got different things that you want to have control of your system depending on your system state.  I'm not sure if it fits the exact definition of a variable structure problem, but that may be the right key phrase.

The solution I like, which looks wacky on paper but has proven to work nicely in practice, is to take each of the relevant error signals and feed a proportional-derivative controller.  Then (assuming that you've already effected the sign change in calculating the error or implementing the PD controllers) take the minimum of all those PD controller outputs, and apply it to an integrator.  The overall effect when either error predominates is that you're controlling just on that error signal, with a PI controller.  

The nice thing about using such a wacky arrangement is that if you're controlling in one mode but approaching the other rapidly is that the corresponding PD output will kick in early, helping to kill the overshoot you'd otherwise get, AND because the final element in the controller is an integrator you're pretty much guaranteed that the control signal will be nice and smooth.

Figuring out how to apportion gains between the PD controllers and the integrator, where to allow sign inversions, and how to apply a pair of precision rectifiers so that they form a minimizer (or maximizer) circuit, is, of course, left as an exercise to the reader (or for follow-on questions).







simulate this circuit &ndash; Schematic created using CircuitLab