Low cost buck SMPS with IC AOZ1284 - 5V x 4A - values for COMP pin
As I said in the comments, before attempting to stabilize a converter of any type, you need its control-to-output transfer function. The problem here is that the data-sheet of this Alpha &amp; Omega chip is eloquently empty so difficult to figure out what its internals are. Anyway, I have captured a schematic using Elements, the SIMPLIS free demo version in which I included the output caps. ESRs and the inductor resistance:



The chip can switch up to 6 A with a 0.22-\$\Omega\$ internal sense resistance and there is probably some internal slope compensation but there are no details. To compensate this guy, I have automated calculations as shown in the book I wrote a while back:



From the simulation, you first verify the operating point is ok, meaning the converter regulates and delivers 5 V from the 12-V input source:



The circuit switches at 1 MHz and delivers 4 A to the load. The feedback voltage is around 900 mV and we can extract the control-to-output transfer function now:



If we pick a 10-kHz crossover frequency, we extract the following data from the graph: the magnitude at \$f_c\$ is -5.8 dB while the phase is -82°. Enter these data in the automated sheet and run the simulation again. Look at the compensated look gain and check it is ok:



Oui ! Perfect, a 10-kHz 0-dB crossover frequency with the wanted 70° phase margin. A rock-stable design for this operating point. You must now explore various situations (load changes, input voltage changes, output cap. value and ESR spread etc.) to make sure the stability is not at a stake in any of these situations but for a simple project it should do well. The calculated components values for the COMP pin are: \$R_2=76.4\;k\Omega\$, \$C_2=55\;pF\$ and \$C_1=835\;pF\$. You can round these values to the closest normalized values of course. Good luck with this design!