Prof. Dr. Ing. Frank Allgöwer

Similar documents
MIMO analysis: loop-at-a-time

[k,g,gfin] = hinfsyn(p,nmeas,ncon,gmin,gmax,tol)

MAE 143B - Homework 7

Under assumptions (A1), (A2), (A3), the closed-loop system in figure() is stable if:

Control Systems. Root Locus & Pole Assignment. L. Lanari

IMPACT OF PLANT COUPLING ON DECENTRALIZED PI CONTROL LAW. Date: 08/30/2016

ECE382/ME482 Spring 2005 Homework 7 Solution April 17, K(s + 0.2) s 2 (s + 2)(s + 5) G(s) =

SEL 382 Controle Robusto Departamento de Engenharia Elétrica USP São Carlos

A Comparative Study on Automatic Flight Control for small UAV

From the multivariable Nyquist plot, if 1/k < or 1/k > 5.36, or 0.19 < k < 2.7, then the closed loop system is stable.

Robust Performance Example #1

MEM Chapter 2. Sensitivity Function Matrices

Robust Control. 8th class. Spring, 2018 Instructor: Prof. Masayuki Fujita (S5-303B) Tue., 29th May, 2018, 10:45~11:30, S423 Lecture Room

Learning MATLAB by doing MATLAB

Robust Multivariable Control

State Feedback Controller for Position Control of a Flexible Link

Statistical methods. Mean value and standard deviations Standard statistical distributions Linear systems Matrix algebra

6.245: MULTIVARIABLE CONTROL SYSTEMS by A. Megretski. Solutions to Problem Set 1 1. Massachusetts Institute of Technology

Experiment 1: Linear Regression

Today (10/23/01) Today. Reading Assignment: 6.3. Gain/phase margin lead/lag compensator Ref. 6.4, 6.7, 6.10

ECE382/ME482 Spring 2005 Homework 6 Solution April 17, (s/2 + 1) s(2s + 1)[(s/8) 2 + (s/20) + 1]

CDS 101/110a: Lecture 8-1 Frequency Domain Design

Math 515 Fall, 2008 Homework 2, due Friday, September 26.

Chapter 5. Standard LTI Feedback Optimization Setup. 5.1 The Canonical Setup

Problem Set 4 Solution 1

Lecture 6. Chapter 8: Robust Stability and Performance Analysis for MIMO Systems. Eugenio Schuster.

Lecture 7 : Generalized Plant and LFT form Dr.-Ing. Sudchai Boonto Assistant Professor

FEL3210 Multivariable Feedback Control

Linear Matrix Inequality (LMI)

Laboratory 11 Control Systems Laboratory ECE3557. State Feedback Controller for Position Control of a Flexible Joint

] [ 200. ] 3 [ 10 4 s. [ ] s + 10 [ P = s [ 10 8 ] 3. s s (s 1)(s 2) series compensator ] 2. s command pre-filter [ 0.

A brief introduction to robust H control

APPLICATIONS FOR ROBOTICS

Control Design of Mixed Sensitivity Problem for Educational Model of Helicopter

9. Two-Degrees-of-Freedom Design

Bfh Ti Control F Ws 2008/2009 Lab Matlab-1

Stability of CL System

A Singular Value Decomposition Based Closed Loop Stability Preserving Controller Reduction Method

ROBUST STABILITY AND PERFORMANCE ANALYSIS OF UNSTABLE PROCESS WITH DEAD TIME USING Mu SYNTHESIS

Getting Started with LPVTools

Overview of Bode Plots Transfer function review Piece-wise linear approximations First-order terms Second-order terms (complex poles & zeros)

Suppose that we have a specific single stage dynamic system governed by the following equation:

Exercise 1 (A Non-minimum Phase System)

Lecture 10: Powers of Matrices, Difference Equations

ECSE 4962 Control Systems Design. A Brief Tutorial on Control Design

ECE 3793 Matlab Project 3

LMI Based Model Order Reduction Considering the Minimum Phase Characteristic of the System

Chapter 9 Robust Stability in SISO Systems 9. Introduction There are many reasons to use feedback control. As we have seen earlier, with the help of a

Exercise 1 (A Non-minimum Phase System)

MAE 143B - Homework 9

9. Introduction and Chapter Objectives

Riccati Equations and Inequalities in Robust Control

Homework Assignment 3

Principles of Optimal Control Spring 2008

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP

ECE382/ME482 Spring 2005 Homework 8 Solution December 11,

Engraving Machine Example

ROBUST STABILITY AND PERFORMANCE ANALYSIS* [8 # ]

Control Systems 2. Lecture 4: Sensitivity function limits. Roy Smith

Root Locus. Motivation Sketching Root Locus Examples. School of Mechanical Engineering Purdue University. ME375 Root Locus - 1

Problem 1 (Analysis of a Feedback System - Bode, Root Locus, Nyquist) Consider the feedback system defined by the open loop transfer function 1.

OKLAHOMA STATE UNIVERSITY

CDS 101/110a: Lecture 10-1 Robust Performance

CDS 101/110: Lecture 3.1 Linear Systems

1 Steady State Error (30 pts)

Inverted Pendulum: State-Space Methods for Controller Design

Positioning Servo Design Example

Closed Loop Transfer Functions

Classify a transfer function to see which order or ramp it can follow and with which expected error.

AMS 27L LAB #6 Winter 2009

Raktim Bhattacharya. . AERO 422: Active Controls for Aerospace Vehicles. Basic Feedback Analysis & Design

(Refer Slide Time: 2:11)

Übersetzungshilfe / Translation aid (English) To be returned at the end of the exam!

Systems Analysis and Control

EL2520 Control Theory and Practice

Robust control for a multi-stage evaporation plant in the presence of uncertainties

Rotary Motion Servo Plant: SRV02. Rotary Experiment #01: Modeling. SRV02 Modeling using QuaRC. Student Manual

EXPERIMENTALLY DETERMINING THE TRANSFER FUNCTION OF A SPRING- MASS SYSTEM

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP

Course Outline. FRTN10 Multivariable Control, Lecture 13. General idea for Lectures Lecture 13 Outline. Example 1 (Doyle Stein, 1979)

CONTROL SYSTEMS ENGINEERING Sixth Edition International Student Version

Massachusetts Institute of Technology Department of Mechanical Engineering Dynamics and Control II Design Project

Automatic Control II Computer exercise 3. LQG Design

Feedback Control part 2

2D Plotting with Matlab

ON QFT TUNING OF MULTIVARIABLE MU CONTROLLERS 1 ABSTRACT

Design Methods for Control Systems

EEE 480 LAB EXPERIMENTS. K. Tsakalis. November 25, 2002

Entering Matrices

Robustness Analysis and Controller Synthesis with Non-Normalized Coprime Factor Uncertainty Characterisation

Robust Control. 2nd class. Spring, 2018 Instructor: Prof. Masayuki Fujita (S5-303B) Tue., 17th April, 2018, 10:45~12:15, S423 Lecture Room

January 18, 2008 Steve Gu. Reference: Eta Kappa Nu, UCLA Iota Gamma Chapter, Introduction to MATLAB,

Computer Exercise 0 Simulation of ARMA-processes

The requirements of a plant may be expressed in terms of (a) settling time (b) damping ratio (c) peak overshoot --- in time domain

MAT 275 Laboratory 4 MATLAB solvers for First-Order IVP

1 (20 pts) Nyquist Exercise

CDS 101/110: Lecture 3.1 Linear Systems

Lab 6a: Pole Placement for the Inverted Pendulum

Chapter 7 - Solved Problems

State Regulator. Advanced Control. design of controllers using pole placement and LQ design rules

Transcription:

Prof. Dr. Ing. Frank Allgöwer 1 Introduction H -control in Matlab Typically the concept of H controller design is fairly easy to grasp. However, as controller synthesis is done numerically, a major problem for people new to the subject is how to write the Matlab code. I will here try to give a short overview of some useful Matlab functions. Hopefully this will help you when trying to design your first H -controller. There are many H related functions available in Matlab and its toolboxes. The important toolboxes are, in addition to the Control System Toolbox, the mu-analysis and Synthesis Toolbox (mu-tools), the Robust Control Toolbox (RCT) and the LMI Control Toolbox. LMI and mu-tools are both included in RCT v.3.0.1 which comes with Matlab 7, in earlier versions they are separate. I have also prepared an m-file where I have tried to use as many of the functions discussed here as possible. The m-file is included in the appendix and can also be downloaded from the robust control webpage. A mixed S/KS synthesis problem will be used to illustrate the use of a handful of useful functions. Let s take a look at the this problem first. 2 Shaping closed loop transfer functions The mixed S/KS problem can be illustrated with the block diagram shown in Figure 1. The closed loop transfer function T = F l (P, K) from w to z can be found by visual inspection as [ z1 z 2 ] [ = W s S W ks KS The generalized plant P(s) (see Figure 2) is z 1 W s W s G z 2 = 0 W ks e I G ] r. (1) [ r u ]. (2) If we have the state space realizations [ ] [ G = s A B, W s As B C D s = s C s D s ] [, W s Aks B ks = ks C ks D ks ], 1

r K e u W z 1 s W z 2 ks y G w u P K z v Figure 1: Mixed S/KS problem. Figure 2: General control problem. it can be shown that a possible state space realization for P(s) is given by A s 0 B s C B s B s D 0 A ks 0 0 B ks P = s 0 0 A 0 B C s 0 D s C D s D s D. (3) 0 C ks 0 0 D ks 0 0 C I D (I leave this as an exercise for you.) The weights W s and W ks are your tuning parameters, and it typically requires some iterations to obtain weights which will yield a good controller. That being said, a good starting point is to choose W s = s/m + ω 0 s + ω 0 A ; W ks = const. (4) where A < 1 is the maximim allowed steady state offset, w 0 is the desired bandwidth and M is the sensitivity peak (typically A = 0.01 and M = 2). For the controller synthesis, the inverse of W s is an upper bound on the desired sensitivity loop shape, and W 1 ks will effectively limit the controller output u. In some cases, you would also like to shape the complementary sensitivity function T = GK(I +GK) 1 (done by adding an extra output z 3 = W t y in Figure 1). A starting point is to choose W t = s + ω 0/M As + ω 0, (5) which is symmetric to W s around the line ω = ω 0. The two weighting functions are shown in Figure for the parameter values A = 0.01(= 40dB), M = 2(= 6dB) and ω 0 = 1 rad/sec. 3 Obtaining the subsystems There are several ways to obtain the dynamical systems G, W s and W ks in Matlab. Methods you probably already have heard about aress, tf andzpk in Control System Toolbox. Mu-tools offer a variety of similar possibilities like pck, nd2sys and zp2sys. Other methods are mksys and tree. You should be aware however, that mu-tools uses a different 2

10 5 0 5 W s 1 W t 1 Amplitude [db] 10 15 20 25 30 35 40 45 10 4 10 2 10 0 10 2 10 4 Frequency [rad/sec] Figure 3: Inverse of weighting functions W s and W t. representation than the Control System Toolbox, called a system matrix. Thus you cannot just pass a system generated with e.g. Gcst = ss(a,b,c,d) in Control System Toolbox to a function found in mu-tools (with RCT v.3.0.1 this is no longer so, most functions have been rewritten to accept both system representations). Which one to choose is a matter of convenience, you can transfer back and forth between the different representations quite easily. One possibility is to write [A,B,C,D]=ssdata(Gcst); Gmu=pck(A,B,C,D). The opposite way would be [A,B,C,D]=unpck(Gmu); Gcst = ss(a,b,c,d). Take a look at the documentation to see other options. 4 Obtaining the generalized plant P Also in creating P you have many options. I list five: 1. Write down the transfer function matrix in (2) directly. I prefer to use mu-tools for this option. If you afterwards convert to state-space, you should use e.g. minreal to obtain a minimal realization. Useful commands: sbs (side-by-side), abv (above), mmult (multiply), minv (inverse). 2. Write down the state space matrices A,B,C,D in (3) and use P = pck(a,b,c,d). 3. Use sysic (system interconnect), an m-file in mu-tools where you specify your subsystems and the interconnection between them. 4. Use sconnect, a function in LMI-tools where subsystems, inputs and outputs are passed as parameters, and sconncet returns the connected system. 5. Use iconnect in RCT v3.0.1, functionally similar to sysic. 3

Of these methods I personally prefer sysic and iconnect because they are flexible and easy to use also for more complex systems where method 1 and 2 are no longer feasible. Generally it is a good idea to use a balanced realization to avoid numerical problems. A balanced realization can be obtained e.g. with balreal in Control System Toolbox. 5 Synthesizing controller The H S/KS synthesis problem is to find a controller K which stabilizes G and minimizes the H cost function F l (P, K) = W ss W ks KS. I guess by now you are not surprised to hear that there are several methods available to synthesize H controllers. Typically you would use hinfsyn, hinfric or hinflmi which all have P in the System (mu-tools) representation as an input. In RCT v3.0.1, there is the function mixsyn with G, W s, W ks (and W t, a weight for the complementary sensitivity function) as inputs, that is, you do not need the generalized plant P at all. The main difference between the methods is whether they use Riccati equations and gamma-iteration or linear matrix equalities to solve the optimization problem. The LMI approach does not require all of the technical assumptions needed when using Riccati equation based solvers. There are a variety of other commands like ncfsyn and loopsyn (for H loop shaping of the open loop transfer function L = GK), hinfmix and msfsyn (multi-objective). Check out the manual. 6 Analysing the results After the controller has been synthesized, it is time to analyse the results. This can be done using Control System Toolbox commands like lsim, step (step response), bode (bode plot), sigma (singular value plot) and freqresp (frequency response) on typical transfer matrices like S, KS, T, K and GK. Similar functions in mu-tools are trsp (time response), frsp (frequency response), vsvd (singular values) and vplot. 7 Conclusions As you have seen, there are many options. To avoid going from one representation to another and back again, I prefer to use functions found in mu-tools and RCT as much as possible. If you know that there exists a function in the Control System Toolbox, chances are high you will find the same function in mu-tools, only with a sligthly different name. If you know what you want to do but cannot remember the command, the functions by category part of the matlab manual is a good reference. Hopefully this short introduction to Matlab and H will make it a little easier for you to synthesize your first H controller, good luck! 4

A Matlab code illustrating the commands %This script is to illustrate how one can design H-infinity controllers in %Matlab. The example shows some different ways to synthesize a controller %for the mixed S/KS weighted sensitivity problem. The plant and the weights %were found in (Skogestad and Postlethwaite, 1996 ed.1 p.60) and the %weights are not necessarily the "best". % %Most of the commands are available in mu-tools, some are from the %lmi-toolbox. Both mu-tools and lmi-tools are included in the robust %control toolbox v.3.0.1 in matlab 7 and higher %-Jorgen Johnsen 14.12.06 %Defining the subsystems %Plant G=200/((10s+1)(0.05s+1)^2) %Alternative 1, mu-tools directly: G = nd2sys(1,conv([10,1],conv([0.05 1],[0.05 1])),200); %Alternative 2, indirectly via cst: %s = tf( s ); %Gcst = 200/((10*s+1)*(0.05*s+1)^2); %[a,b,c,d] = ssdata( balreal(gcst) ); %G = pck(a,b,c,d); %Weights Ws = (s/m+w0)/(s+w0*a), Wks=1 M = 1.5; w0 = 10; A=1.e-4; Ws = nd2sys([1/m w0],[1 w0*a]); Wks = 1; %Alternative 0, direct approach: % /z1\ /Ws -Ws*G\ /r\ % z2 = 0 Wks % \ v/ \I -G / \u/ %Transfer matrix representation Z1 = sbs(ws,mmult(-1,ws,g)); Z2 = sbs(0,wks); V = sbs(1,mmult(-1,g)); P0 = abv(z1,z2,v); %P0 is generally not a minimal realization, so we use available reduction methods [a,b,c,d] = unpck(p0); [ab,bb,cb,db] = ssdata( balreal( minreal( ss(a,b,c,d) ) ) ); P0 = pck(ab,bb,cb,db); %now we have a System description %Alternative 1, direct approach: % /z1\ /W1 -W1*G\ /r\ % z2 = 0 W2 % \ v/ \I -G / \u/ 5

%ss realization of the subsystems: [A,B,C,D] = unpck(g); [A1,B1,C1,D1] = unpck(ws); [A2,B2,C2,D2] = unpck(wks); %number of inputs and outputs to the different subsystems: n1 = size(a1,1); [q1, p1] = size(d1); n2 = size(a2,1); [q2, p2] = size(d2); n = size(a,1) ; [p, q ] = size(d); %ss realization of the whole thing: Ap = [ A1, zeros(n1,n2), -B1*C ; zeros(n2,n1), A2, zeros(n2,n) ; zeros(n,n1), zeros(n,n2), A ]; Bp = [ B1,-B1*D; zeros(n2,p), B2 ; zeros(n,p), B ]; Cp = [ C1, zeros(q1,n2), -D1*C ; zeros(q2,n1), C2, zeros(q2,n) ; zeros(q,n1), zeros(q,n2), -C ]; Dp = [ D1, -D1*D; zeros(q2,p ), D2 ; eye(p), -D ]; %making a balanced realization reduces the likelihood of numerical problems [Apb,Bpb,Cpb,Dpb] = ssdata( balreal( ss(ap,bp,cp,dp) ) ); P1 = pck(apb,bpb,cpb,dpb); %Alternative 2, using sysic: systemnames = G Ws Wks ; inputvar = [r(1); u(1)] ; %all inputs are scalar, r(2) would be a 2dim signal outputvar = [Ws; Wks; r-g] ; input_to_g = [u] ; input_to_ws = [r-g] ; input_to_wks = [u] ; sysoutname = P2 ; cleanupsysic = yes ; sysic %Alternative 3, using sconnect: inputs = r(1); u(1) ; outputs = Ws; Wks; e=r-g ; K_in = []; %no controller present G_in = G:u ; Ws_in = Ws:e ; Wks_in = Wks:u ; 6

[P3,r] = sconnect(inputs,outputs,k_in,g_in,g,ws_in,ws,wks_in,wks); %Alternative 4, using iconnect: %(note1: here we no longer use the mu-tools System representation) %(note2: iconnect is only available in Robust Control toolbox v3.0.1 and up) % r = icsignal(1); % u = icsignal(1); % ws = icsignal(1); % wks = icsignal(1); % e = icsignal(1); % y = icsignal(1); % M = iconnect; % M.Input = [r;u]; % M.Output = [ws;wks;e]; % M.Equation{1} = equate(e,r-y); % M.Equation{2} = equate(y,ss(a,b,c,d)*u); % M.Equation{3} = equate(ws,ss(a1,b1,c1,d1)*e); % M.Equation{4} = equate(wks,ss(a2,b2,c2,d2)*u); % [ab,bb,cb,db] = ssdata( balreal(m.system) ); % P4 = pck(ab,bb,cb,db); %Synthesizing the controller %All the methods presented here use the System %matrix representation of the generalized plant P %Choose your favourite method and your favourite P %Choose plant P = P1; %(0-4) %then some parameters (number of measurements and inputs, and bounds on gamma ) nmeas = 1; nu = 1; gmn=0.5; gmx=20; tol = 0.001; %uncomment your favourite controller %[K,CL,gopt] = hinfsyn(p,nmeas,nu,gmn,gmx,tol); [gopt,k] = hinflmi(p,[nmeas, nu],0,tol); CL = starp(p,k,nmeas,nu); %[gopt,k] = hinfric(p,[nmeas, nu],gmn,gmx); CL = starp(p,k,nmeas,nu); %Alternative for RCT v3.0.1. %Normally you would of course not do all the transfers between the system %representations, but rather do everything using standard ss objects %[a,b,c,d] = unpck(g); Gcst = ss(a,b,c,d); %[a,b,c,d] = unpck(ws); Wscst = ss(a,b,c,d); %[a,b,c,d] = unpck(wks); Wkscst = ss(a,b,c,d); %[K,CL,gopt] = mixsyn(gcst,wscst,wkscst,[]); %[a,b,c,d] = ssdata( balreal(k) ); K = pck(a,b,c,d); %[a,b,c,d] = ssdata( balreal(cl) ); CL = pck(a,b,c,d); %Analysis of the result 7

%Note: mu-tools commands are used here. All of this can be done %using control toolbox commands instead, e.g. series and %feedback for interconnecting elements, sigma or freqresp, svd and bode %for singular value plots, and step or lsim for time responses %plot singular values of (weighted) closed loop system w = logspace(-4,6,50); CLw = vsvd(frsp(cl,w)); figure(1); vplot( liv,m,clw); title( singular values of weighted closed loop system ); %generate typical transfer matrices [type,out,in,n] = minfo(g); I = eye(out); S = minv(madd(i,mmult(g,k))); %sensitivity T = msub(i,s); %complementary sensitivity KS = mmult(k,s); %input to G GK = mmult(g,k); %loop transfer function %singular values as a function of frequency Sw = vsvd(frsp(s,w)); Tw = vsvd(frsp(t,w)); Kw = vsvd(frsp(k,w)); KSw = vsvd(frsp(ks,w)); GKw = vsvd(frsp(gk,w)); %Plot singular value plots %Note: if desired, you can change vplot to plot the amplitude in db. Type %edit vplot and uncomment the appropriate lines in the code figure(2); vplot( liv,lm,sw, -,Tw, --,GKw, -. ); title( \sigma(s(jw)) (solid), \sigma(t(jw)) (dashed) and \sigma(gk(jw)) (dashdot) ); xlabel( Frequency [rad/sec] ); ylabel( Amplitude ) figure(3); vplot( liv,lm,kw); title( \sigma(k(jw)) ); xlabel( Frequency [rad/sec] ); ylabel( Amplitude ) %Did we get what we asked for? Sd = minv(ws); Sdw = vsvd(frsp(sd,w)); %"desired" sensitivity KSd = minv(wks); KSdw = vsvd(frsp(ksd,w)); %"desired" output figure(4); vplot( liv,lm,sw, -,Sdw, -- ); title( \sigma(s(jw)) (solid) and \sigma(ws^{-1}(jw)) (dashed) ); xlabel( Frequency [rad/sec] ); ylabel( Amplitude ) figure(5); vplot( liv,lm,ksw, -,KSdw, -- ) title( \sigma(ks(jw)) (solid) and \sigma(wks^{-1}(jw)) (dashed) ); xlabel( Frequency [rad/sec] ); ylabel( Amplitude ) %Finally the step response reference = 1; tfinal = 1; step = 0.01; y = trsp(t,reference,tfinal,step); u = trsp(ks,reference,tfinal,step); figure(6); subplot(2,1,1); vplot( iv,d,y); title( Step response ); ylabel( y ); subplot(2,1,2); vplot( iv,d,u); ylabel( u ); xlabel( time ); 8