Thanks for your explanation and I think I mostly understand what you said. Since the output should ideally be DC signal it would be 0Hz and anything above would be noise (theoretically). This means I need a low pass filter to the input to keep the signal as close to 0Hz as possible. I am measuring the output from the inductor so the large electrolytic capacitor (ripple control) also acts as a low-pass filter but would adding ceramic capacitor in parallel help the measured signal to noise ratio even further (there must be a reason why linear regulators use small ceramic capacitors in parallel)? If my output signal is very noisy but the MCU is getting a cleaner signal through a low-pass filter, does that mean the solutions lies hardware (increase capacitor, inductor or frequency) and not in software?
It's actually possible to use a software filter on the measured value of a PID controller. In fact many industrial controllers do this as a matter of course. (This simplest software filter is a first order lag, and this is what you will typically find. The nice thing about a first order lag is it only has one tuning parameter, the time constant. If you make a more complex filter it will have more parameters to tune and the average user will quickly give up on it.)
The reason for ceramic capacitors is different. They are used because large electrolytic capacitors don't work well at high frequencies. (I think the reason is the big roll of coiled up metal foil inside them. At higher frequencies the inductance of this coil starts to cancel out the capacitance.) Many practical circuits automatically parallel up a large electrolytic for low frequencies and a small ceramic for high frequencies.
Would my sampling rate/PID cycle depend on my desired performance of the system? If want my converter to respond (like settling time) within 1ms (1kHz) then should my sampling frequency be between 2-10kHz?
Yes, absolutely. Here I have no idea what kind of response a typical power supply is expected to have. I don't know whether the response to load changes (or supply voltage changes) is supposed to settle out in 1 ms, 10 ms or 100 ms in typical bench supplies. Maybe someone could educate me (please)?
For the model when I said Simulink, I was thinking about a block diagram. At university I learned to create a block diagram for a motor then add a PD and PI controller for position and velocity control. I thought that method may help but your suggestion is to treat the relation controller input/output as a black box and try to get a mathematical relationship between them and I like it. I am bit confused to what I would input and what I would measure. You said step inputs (that's all I need it to do), but did you mean to set a PWM duty and treat it as a step input? To actually measure the output, do you mean to make a model by using natural frequency and damping ratio that I would calculate from settling time and maximum overshoot? After I select the final frequency, inductor and capacitor would I be measuring the response to different amplitude steps or different loads? It would be great if you can provide some examples.
Your control system needs to respond to changes in load and also to changes in supply voltage. So one step change you could make is a step change in the supply voltage. You could for example apply a low frequency square wave to the input and record the output voltage in response. You would do this with no feedback control at a fixed PWM frequency, so the output voltage would go up and down in response to the input voltage. Another test would be to make step changes in load current while keeping the supply voltage fixed. Once again the output voltage will go up and down in response and you can record this waveform.
In every case where you do such a test you will have a step change input (up or down) and a curvy response on the output. The most pleasing and simplest response will look like a first order lag, but complex systems might not behave that way. Once you have your step response you can for example load it into Excel and fit model parameters to best fit an idealized simple model. (In order of complexity, simple models are: 1. pure first order; 2. first order plus dead time; 3. second order plus dead time.) If you have model parameters for a simple open loop response you can often find PID tuning guidelines in books. It's much more fun, however, to adjust the parameters by hand and watch what happens using a simulation.
Can you provide some examples of limitations of the simulation? All I can think of are that there is a minimum and maximum voltage possible, PWM duty can can only be set up 0.1%, the model is not perfect but it would still be close which is good enough for me. Is their anything else major that I have not considered?
Simulations always make assumptions, and always are only an approximation of real life. Old and wise electrical engineers know the only way to test whether a circuit is really going to work as expected is to build it and see. All sorts of things can get in the way, from components having non-ideal behaviours to parasitic inductances and capacitances to unplanned feedback loops and oscillation.