hello friends,
A buck converter with a PID controller has a transfer function.
.By applying three different scenarios, the figure below is obtained, the blue line is the solution to the problem after three scenarios. In the first stage, the transfer function is applied by applying a Vref=12v from t=0 to 2e-6. In the second scenario, from the t= 2e-6 to 4e-6, the reference voltage has decreased to 6 volts(Vref=6v), and in the third scenario, a disturbance voltage of 1 volt has been applied the system. I wrote the step response for a reference voltage of 12V, but I don't know how to apply the next two scenarios to form the graph.
% Define the numerator and denominator coefficients of the transfer function
umerator_coeffs = [0.3571 605.8 42.27]; % Adjust coefficients as per your scaling factor
denominator_coeffs = [0.0000001 0.3573 606.8 42.27]; % Adjust coefficients as per your transfer function
% Create a transfer function object
sys = tf(numerator_coeffs, denominator_coeffs);
step(12*sys); % Simulate step response
xlabel('Time');
ylabel('Step Response');
title('Step Response');