How can I calculate the PI controller gain valuesfrom a transfer function?

75 Views Asked by At

I am doing a project where I am using a synchronous bidirectional buck-boost converter too handle to powerflow between a battery and a dc bus. I have spend some time figuring out and understanding how to find the transfer function of my converter with state space modelling and have think I finally understand the whole process. My next step is to use that transfer function to calculate some gain values for the PI controller which i want to control converter with.

I have found my transfer function with state space modelling by following the example in a guide from texas instruments Guide (at the bottom of the guide they have attached a matlab script to copy in order to get the transfer function yourself). I have some other values for the components than texas, but taking initiative in the result from the guide is a good start, I think.

In the guide the following transfer function fro the converter is:

   1.699e06 s^5 + 6.499e09 s^4 + 1.813e13 s^3 + 2e16 s^2 + 1.032e18 s + 1.351e19
 ---------------------------------------------------------------------------------
 s^6 + 4395 s^5 + 1.894e07 s^4 + 3.143e10 s^3 + 5.071e13 s^2 + 2.9e15 s + 4.221e16

I think my biggest problem is that i don't know where to start. I know these definitions for PI controller, but I just can't see how it is connected.

omegaK = 1/ti

Gs = Kp *(1+1/ti) (PI controller)

Sorry for maybe not being too specific, I am not the strongest in control theory and really hope someone have time to give me an answer or show how to do it.

Best regards Mads

clear all;
clc;
s = tf('s');
% Values below is from an example made by texas instruments
% Input Voltage
Vp= 200;
% Input resistance
Rp=2.75*10^-3*200;
% Input capacitance
ci=1*10^-3;
% Input capacitance ESR
Rci=74*10^-3;
% DCR of the inductor
Rl=9.6*10^-3;
% Inductance
l=130*10^-6;
% Output Capacitance
co=15*10^-3;
% Output Capacitance ESR
Rco=5*10^-3;
% Output Load
Io=80;
% Duty cycle
D=0.5;
% The matrice for solving of inductor current transfer function
C = [0 0 1];
Dm = 0;
% This is the expresisons for the state vector values and they are
% verified.
iL=Io/(1-D);
vci=Vp-Io*Rp/(1-D);
vco=(Vp/(1-D))-((Io*(Rp+Rl+D*(1-D)*Rco))/(1-D)^2);

% determining the state and input matrices for the converter in ON and OFF
A1 = [0 0 0; 0 -1/(ci*(Rp+Rci)) -Rp/(ci*(Rp+Rci)); 0 Rp/(l*(Rp+Rci)) (-(Rl*Rp+Rl*Rci+Rci*Rp))/(l*(Rp+Rci))];
B1 = [-1/co 0; 0 1/(ci*(Rp+Rci)); 0 Rci/(l*(Rp+Rci))];
A2 = [0 0 1/co; 0 -1/(ci*(Rp+Rci)) -Rp/(ci*(Rp+Rci)); -1/l Rp/(l*(Rp+Rci)) (-(Rl*Rp+Rl*Rci+Rci*Rp+Rp*Rco+Rco*Rci))/(l*(Rp+Rci))];
B2 = [-1/co 0; 0 1/(ci*(Rp+Rci)); Rco/l Rci/(l*(Rp+Rci))];
% Determining the state and input vectors
X = [vco; vci; iL];
U = [Io; Vp];
A_avg = A1*D+A2*(1-D);
B_avg = B1*D+B2*(1-D);

% Finding the transfer function
% (sI-A)
SIminusA = s*eye(3)-A_avg;
% (sI-A)^-1
inv_SIminusA = inv(SIminusA);
% (A1-A2)X+(B1-B2)U
A1minusA2XPlusB1minusB2U = (A1-A2)*X+(B1-B2)*U;
% Inductor current to duty cycle Trasnfer Function
% C*((sI-A)^-1*((A1-A2)X+(B1-B2)U))
y_IL = C*(inv_SIminusA*A1minusA2XPlusB1minusB2U)

y_IL1 = minreal(y_IL)
% pole-zero-gain model
zpk(y_IL1)
% Display poles
pole(y_IL1)
% Display zeros
zero(y_IL1)

% Bodeplot af TF
figure;
hold on;
bode(y_IL1)
grid on;
title('Bidirectional Buck-Boost converter transfer functions');
legend('TF');