Analysis of Gain-Scheduled PI Controller
This example analyzes gain-scheduled PI control of a linear parameter-varying system. This example is based on  and .
The plant 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 , gain-scheduled PI controller , and time delay sec, as shown in this interconnection figure.
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 is designed to achieve a closed loop damping ratio and natural frequency in the domain . You can construct this controller in two different forms.
Controller , with the integral gain at the integrator input.
Controller , with the integral gain at the integrator output.
These forms are equivalent when and 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
lpvss to construct the two controllers.
K1 = lpvss('rho',@k1FcnGSPI); K2 = lpvss('rho',@k2FcnGSPI);
Construct the closed-loop LPV models as shown in the interconnection figure with controllers and .
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);
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.
Generate closed-loop step responses from to along one specific parameter trajectory.
Specify the parameter trajectory.
t = linspace(0,30,1e3); rho = interp1([0 10 30],[2 7 7],t); plot(t,rho,'b'); grid on xlabel('Time (seconds)'); ylabel('\rho'); title('Parameter Trajectory for Step Response');
Plot the step responses.
step(CL1,CL2,t,rho) 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
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 = ; end
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 = ; end
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 = ; end
Tan, Shaohua, Chang-Chieh Hang, and Joo-Siong Chai. “Gain Scheduling: From Conventional to Neuro-Fuzzy.” Automatica 33, no. 3 (March 1997): 411–19. https://doi.org/10.1016/S0005-1098(96)00162-8.
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. https://doi.org/10.1002/rnc.3240.