I have a source with variable power output during the time because it is shared with another devices and this source has not enough power to feed my load (a battery charger for a 1 cell 4.2V lipo) so when battery charger try to get a lot of current it downs de voltage of the source sometimes. To improve efficiency, I converted the source voltage with a buck dc-dc converter to a lower value, so current can be higher at the load, but this is not enough because load keeps asking for more current so source current increases also.
The ideal solution was a circuit so I can say "let pass all the current you can without dropping more than xx mV"(being this mV are setted by DAC).
¿what is the best way to solve this issue?
This is what I have now:
-SMPS buck power supply to convert 9 to 30Vin to 5Vout.
-PNP limiter programmed by non volatile DAC
Drawbacks of this:
-Non linear current selection. Only the first V select the gain of the circuit (amplification of the transistor). But even this first V doesn't have linear relationship with current.
-Digital feedback: Slow and not precise. I need to read the ADC at the input to know if voltage is dropping to extract a little bit less.
-Max current: with 1R at R1, the max current I can have is around 25mA. Can be enough for many of the situations, but it is reduced. I tried with different R1 values and circuit lost precision and I can't select only a few mA, wich is the main goal.
Edit:
This is how looks like after some improvements:
Edit 2: Go back to an easy solution. Need to fix the feedback loop of the operational amplifier. If at the input of R2 connects DAC directly works well, but it is needed to use digital loop (DAC/ADC) to maintain voltage at the input.