Search code examples
matlabcontrols

Designing PI controller


% Define the transfer function
num = [1e-6, 1.314e-9, 2.66e-13];
den = [1, 0.000163, 5.272e-7, 3.538e-11];
G = tf(num, den);
Kp = 10;
Ki = 20;

C = pid(Kp,Ki);
C = tunablePID('C','pi');

% Construct the PID controller
silas = feedback(G*C,1);
pidtune(silas)

I wanted to design a PI controller using the defined transfer function, and I wanted to be able to tune the values of kp and ki. A quick internet search told me to use tunablePID. I tested it, but it seems I used it wrongly. It runs alright, but it doesn't open in the PIDtunner app which would have allowed me to change the parameters.


Solution

  • You can try the PID Tuner App. In MATLAB, navigate to the Apps tab and select the PID Tuner. Import your plant G and set the controller to PI.