Please find the attached for a simple closed-loop buck converter design.

You can compared it between PI and type 2 from my simulation.

Type 2 compensator:

P=7 and I=285.

However this is just a simple example so the system may not be robustness, but you can tuned by your own based on its power converter transfer function.

So the output voltage regulation is converted from 24V to 12V and sudden change in the load current from (2.3A to 14.3A) by changing accordingly from the resistor value.

Hope this will help you.

Regards

John