Im Planning of building a AVR based DC power supply.
for the sake of discussions let us assume that a output range of 5v-30v is required(lets call it V_Desired), Current not exceding 1 Amp(Imax), Input voltage after rectification about 50V(V_in) and ofcourse the V_out, which should be equal to the V_Desired
The circuit i plan to build will output a pwm signal which will switch on a Mosfet to drive the load.
Now, what should be the strategy to control V_out
1) Read V_in, change pwm to match V_desired by calculation
2) Read V_in, Read V_out, accordingly increase or decrease pwm to match V_desired
I have no idea how would i limit the current by varrying the pwm. Can someone explain this relation