Briefly the project I'm working on is made up of a blue pill, rotary encoder, acs712 30 amp current sensor and an OLED display. Everything is in functional state. The aim is to provide a stable controllable voltage starting from a 4s (16.8v max) lithium, BMSed, battery. At start I tought I could just use a good MOSFET and smooth that out with a filter on the output. Later on I discovered these xl4016 modules around the web Xl4016 module(xl4016 datasheet) that give 8 amps (which is a good start, there's also a 12 amp model) and these seems to give a stable output without much hassle. So the plan now is to control the vari-volt which on the board is made by a potentiometer. Looking around for a solution I found some possibilities:
generate a pwm signal, smooth it out trought a low pass filter, and feed it to feedback pin trough an opamp in voltage follower mode.
use a digital potentiometer (don't know if there's one up to spec)
use a DAC such as mcp4275
So the question is which one is the right way?
Additionally, tapping in the feedback pin could interfere with the xl4016 feedback mechanism. So the aim would be also keep that voltage stable (between 0-12v) even though battery is discharging, so I somehow should sense the battery voltage and the output voltage? In the project every cell voltage is monitored trough voltage dividers. Can I just use an external ADC? Thanks for the attention, and just ask for whatever is needed to provide an answer.
Update: here in the datasheet I can see : Vout = 1,25 (FBK) * (1+R2/R1) ----> if we put a fixed 10k resistor instead of the pot, can I inject voltage somehow on the feedback pin, maybe with a DAC? To get let's say a 12 V out following the formula it should be 2.97 V.