Main Content

Analysis of Gain-Scheduled PI Controller

This example analyzes gain-scheduled PI control of a linear parameter-varying system. This example is based on [1] and [2].

The plant G(ρ) is a first-order system with dynamics depending on the parameter ρ.






The parameter ρ is restricted to the interval [2,7]. The closed-loop system consists of the plant G(ρ), gain-scheduled PI controller K(ρ), and time delay Td=0.5 sec, as shown in this interconnection figure.


LPV Plant

Use lpvss to construct a model of the LPV plant. The function plantFcnGSPI returns the state-space matrices and offsets as a function of time t and parameter rho. To see the code for this function, open the file plantFcnGSPI.m or enter type plantFcnGSPI at the command line.

G = lpvss('rho',@plantFcnGSPI);

Gain-Scheduled PI Controller

The gain-scheduled Proportional-Integral (PI) controller K(ρ) is designed to achieve a closed loop damping ratio ζd=0.7 and natural frequency ωd=0.25 in the domain ρ[2,7]. You can construct this controller in two different forms.

  • Controller K1, with the integral gain at the integrator input.



  • Controller K2, with the integral gain at the integrator output.



These forms are equivalent when ρ and Ki are constant. However, the two forms have different input/output response when the parameter varies in time. This example compares these two options in terms of closed-loop performance.

This example provides the code for these two controllers in the files k1FcnGSPI.m and k2FcnGSPI.m. Use lpvss to construct the two controllers.

K1 = lpvss('rho',@k1FcnGSPI);
K2 = lpvss('rho',@k2FcnGSPI);

Closed-Loop Models

Construct the closed-loop LPV models as shown in the interconnection figure with controllers K1 and K2.

Use a second-order Pade approximation of the delay.

Td = 0.5;
[n,d] = pade(Td,2);
H = tf(n,d);

Construct the closed-loop models.

CL1 = feedback(G*H*K1,1);
CL2 = feedback(G*H*K2,1);

LTI Analysis

Evaluate this closed-loop response for several frozen values of ρ.

Sample the LPV system for three values of rho.

Nvals = 3;
pvals = linspace(2,7,Nvals);
CL1vals = sample(CL1,[],pvals);
CL2vals = sample(CL2,[],pvals);

Plot the Bode response of complementary sensitivity at fixed values of ρ.


As expected, the location of the integral gain does not affect the controller when ρ is constant. Hence, the two closed-loop responses are identical in the LTI cases.

LPV Analysis

Generate closed-loop step responses from r to y along one specific parameter trajectory.

Specify the parameter trajectory.

t = linspace(0,30,1e3);
rho = interp1([0 10 30],[2 7 7],t);
grid on
xlabel('Time (seconds)')
title('Parameter Trajectory for Step Response')

Plot the step responses.

grid on
title('Step Responses for Parameter Trajectory');
legend('Ki at input (K1)','Ki at output (K2)','Location','Best');

The two closed-loop simulations are different. This indicates that the placement of the integrator in a gain-scheduled control makes a difference when the parameters vary.

Plant and Controller Data Functions

type plantFcnGSPI.m
function [A,B,C,D,E,dx0,x0,u0,y0,Delays] = plantFcnGSPI(t,rho) 
% LPV data for plant
rho = max(2,min(rho,7));  % keep rho in range [2,7]
tau = sqrt(133.6-16.8*rho);
A = -1/tau;
B = 1/tau;
C = sqrt(4.8*rho-8.6);
D = 0;
E = [];

% No offsets or delays
dx0 = [];  x0 = [];  u0 = []; y0 = [];
Delays = [];
type k1FcnGSPI.m
function [A,B,C,D,E,dx0,x0,u0,y0,Delays] = k1FcnGSPI(t,rho) 
% LPV data for PI controller K1
tau = sqrt(133.6-16.8*rho);
c = sqrt(4.8*rho-8.6);

% PI Gains
sigma = 0.7;
wcl = 0.25;
Kp = (2*sigma*wcl*tau-1)/c;
Ki = wcl^2*tau/c;

% State-space and offset data: Ki at the input
A = 0;
B = Ki;
C = 1;
D = Kp;
E = [];

% No offsets or delays
dx0 = [];  x0 = [];  u0 = []; y0 = [];
Delays = [];
type k2FcnGSPI.m
function [A,B,C,D,E,dx0,x0,u0,y0,Delays] = k2FcnGSPI(t,rho) 
% LPV data for PI controller K2
tau = sqrt(133.6-16.8*rho);
c = sqrt(4.8*rho-8.6);

% PI Gains
sigma = 0.7;
wcl = 0.25;
Kp = (2*sigma*wcl*tau-1)/c;
Ki = wcl^2*tau/c;

% State-space and offset data: Ki at the output
A = 0;
B = 1;
C = Ki;
D = Kp;
E = [];

% No offsets or delays
dx0 = [];  x0 = [];  u0 = []; y0 = []; % no offsets
Delays = [];


  1. Tan, Shaohua, Chang-Chieh Hang, and Joo-Siong Chai. “Gain Scheduling: From Conventional to Neuro-Fuzzy.” Automatica 33, no. 3 (March 1997): 411–19.

  2. Pfifer, Harald, and Peter Seiler. “Robustness Analysis of Linear Parameter Varying Systems Using Integral Quadratic Constraints.” International Journal of Robust and Nonlinear Control 25, no. 15 (October 2015): 2843–64.

See Also


Related Topics