RMCT for Matlab: a tutorialBefore using the toolbox, it is recommended to read at least pages 109 to 115 of the manual. The RMCT Toolbox proposes three main tools for control design. These tools are
Example 1 : elementary use of fb_propThe input arguments of this function are
The considered example consists of shifting with "minimum energy" 4 poles of a system. The considered system has 4 dominant poles and 4 measurements, so, the design procedure is very simple, it reduces to: sys = rcamdata('lat',0,1); pol_ol = [-0.23+0.59j -0.18 -1.30]; pol_cl = [-0.60+0.60j -0.60 -1.30]; K1 = fb_prop(sys,0,pol_cl,'m',pol_ol)Let us examine more closely this short script.
% Load a system with 6 states, 4 measurements and 2 inputs sys = rcamdata('lat',0,1); % Compute open-loop eigenvalues eig(sys) ans = -1.3017 -0.1837 -0.2360 + 0.5954i -0.2360 - 0.5954i -6.6667 -3.3333 % This system has 4 dominant poles, so, 4 poles must be treated % -0.23+0.59j replaced by -0.60+0.60j % -0.18 replaced by -0.60 % -1.30 preserved pol_ol = [-0.23+0.59j -0.18 -1.30]; % This is def_pb pol_cl = [-0.60+0.60j -0.60 -1.30]; % Assignment by invoking fb_prop. Pole shifting is performed with % minimum energy option ('m') K1 = fb_prop(sys,0,pol_cl,'m',pol_ol) % Results (eig_fb computes closed-loop eigenvalues) K1 = -0.7506 0.2549 0.8871 0.2580 -0.7943 0.1637 2.0341 0.0377 eig_fb(sys,K1) ans = -6.4311 -2.4262 -0.6000 + 0.6000i -0.6000 - 0.6000i -0.6000 -1.3000
Additional comments on proportional feedback design.
Example 2 : use of fb_prop with an observerIn this example, we consider the system of Example 1 from which two measurements are removed. Therefore, there are still 4 dominant modes but only 2 measurements. As all dominant modes must be treated, keeping in mind that modal control with proportional feedback is efficient when the number of measurements is at least equal to the number of treated modes, two measurements are missing. We shall use an observer of order 2 in order to replace the 2 missing measurements (note that we do not need a minimum order state observer that would be of order 4). There are several functions available for observer design, see here. The function ob_ins optimizes the linear combinations of states that are observed in order to provide the best complement of the observation matrix (matrix usually denoted C). The function ob_gene is the dual counterpart of fb_prop. We shall use this function with the option 'p' which means projection of open-loop left eigenvectors. The benefits of such a strategy is discussed on page 51 of the manual. So, a 2nd order observer is designed by projection of two open-loop left eigenvectors. The observer is connected to the system. So, 4 measurements (the 2 original measurements plus 2 observed signals) are available. Finally, 4 poles are shifted with "minimum energy". The design procedure reduces to: sys2 = [1 0 0 0;0 0 0 1]*rcamdata('lat',0,1); [u,t,pi] = ob_gene(sys2,[-1,-2],'p',[-0.18,-1.3]); sys3 = add_obs(sys2,u,t,1,pi); pol_ol = [-0.23+0.59j -0.18 -1.30]; pol_cl = [-0.60+0.60j -0.60 -1.30]; K3 = fb_prop(sys3,0,pol_cl,'m',pol_ol)Let us examine more closely this short script (for the notation u, t, pi relative to observers, see the manual on pages 47 to 52).
% Load a system with 6 states, 2 measurements and 2 inputs sys2 = [1 0 0 0;0 0 0 1]*rcamdata('lat',0,1); % Compute open-loop eigenvalues eig(sys) ans = -1.3017 -0.1837 -0.2360 + 0.5954i -0.2360 - 0.5954i -6.6667 -3.3333 % Observer designed such that two observed signals are % added to the measurements: The observed signals are defined % by projection of the left eigenvectors corresponding to the % open-loop poles -0.18 and -1.30 and % -0.18 shifted to -1 % -1.30 shifted to -2 [u,t,pi] = ob_gene(sys2,[-1,-2],'p',[-0.18,-1.3]); % This observer is connected to the system sys3 = add_obs(sys2,u,t,1,pi); % sys3 considered as having 4 measurements with "C-matrix" [sys3.c;u] % -0.23+0.59j replaced by -0.60+0.60j % -0.18 replaced by -0.60 % -1.30 preserved pol_ol = [-0.23+0.59j -0.18 -1.30]; % This is def_pb pol_cl = [-0.60+0.60j -0.60 -1.30]; % Assignment by invoking fb_prop. Pole shifting is performed with % minimum energy option ('m') K3 = fb_prop(sys3,0,pol_cl,'m',pol_ol) K3 = -1.8347 0.3168 1.3869 0.0241 -2.0624 -0.4331 4.2717 -1.4181 % Results (eig_fb computes closed-loop eigenvalues) eig_fb(sys3,K3) ans = -6.7037 -3.7334 -2.0000 -0.6000 + 0.6000i -0.6000 - 0.6000i -0.6000 -1.0000 -1.3000 % We recognize the observer poles (-1 and -2), the poles assigned % by feedback (-0.6 + 0.6j, -0.6 and -1.3) and the non-dominant poles % that have moved to -6.70 and -3.73.
Additional comments on observer-based control design.
Example 3 : elementary use of fb_tunThis function solves a Linear Quadratic Programming Problem. The input arguments of this function are two matrices:
In this example we push to the left the poles with real part larger than -0.5. For that purpose, an iterative procedure is written. At each step of this procedure, the poles with real part larger than -0.5 are detected by using the function sort_ev. Then, first order constraints corresponding to a minimum shift of 0.1 to the left, are defined using the function cstr_dp. Finally, the function fb_tun computes the first order gain variation corresponding to these constraints (LQ Programming problem in which the quadratic criterion is defined by default: CRIT = []). The correponding script is : sys = demodata(1); k0 = zeros(2,4); for ii = 1:100; lam = eig_fb(sys,k0); lamshift = sort_ev(lam,'r>-0.5&i>=0'); if length(lamshift) == 0; disp('BREAK'), break,end; CSTR = cstr_dp([],sys,lamshift,'r','<',-0.1,k0); dk = fb_tun(CSTR,[]); k0 = k0+dk; end; Let us examine more closely this script.
% The eigenvalues are shifted to the left until all real parts % become less than -0.5 % Initial system and initial gain sys = demodata(1); k0 = zeros(2,4); % Tuning loop for ii = 1:100; % Eigenvalues to be shifted identified using sort_ev % (real part > -0.5 and imaginary part positive or zero) lam = eig_fb(sys,k0); lamshift = sort_ev(lam,'r>-0.5&i>=0'); if length(lamshift) == 0; disp('BREAK'), break,end; % First order shifting constraint plugged into CSTR. Real part % of each pole in lamshift reduced of an amount equal to 0.1 CSTR = cstr_dp([],sys,lamshift,'r','<',-0.1,k0); % The gain variation dk is computed and the gain k0 is updated dk = fb_tun(CSTR,[]); k0 = k0+dk; end; % Initial spectrum eig_fb(sys) ans = -0.1272 + 1.0734i -0.1272 - 1.0734i -0.9212 0.0057 -9.9000 -10.1000 % Results: final spectrum eig_fb(sys,k0) ans = -9.1834 -9.8022 -0.5835 + 0.5447i -0.5835 - 0.5447i -0.5087 + 0.1095i -0.5087 - 0.1095i
Additional comments on tuning.Pole selection.
Example 4 : use of fb_dyn for multimodel "phase control"Classical phase control consists of modifying the departure angles of some branches of the root locus. These directions are usually modified by tuning the phase of the system in given intervals of frequencies. On account of the use of the phase concept, this classical technique is obviously limited to SISO systems. In the manual on page 71, it is shown how the phase interpretation can be revisited in an eigenstructure assignment setting. This alternative interpretation leads to a generalization of "phase control" to MIMO and to multi-model control design. The main function for "generalized phase control" is fb_dyn. This function solves a Linear Quadratic Programming Problem. The input arguments of this function are two matrices:
The structure of the dynamic feedback gain must be defined first by invoking the function str_cstr. These constraints initialize the matrix CSTR. Then, the function dp_cstr will be used in order to compute pole shifting constraints and to write them into the matrix CSTR. The feedback that is obtained must be multiplied by a scalar that must be tuned from zero to some positive value. The illustrative example that is considered here consists of designing a feedback simultaneously relative to two systems. For both systems (each one has 2 pairs of complex conjugate poles), one complex pole must remain fixed and the other one must moves to the left along an horizontal tangent. Assuming that the two systems (sys1 and sys2) are in the work space, the design procedure reduces to the following script: CSTR = str_cstr(1,2,[-2+2*i;-3+3*i],1); CRIT = ktf_crit(CSTR,[0 0],i*[0 0.01 0.05 0.1 0.5 1]); pol1 = [ -0.1+3*i;-0.1+3.0*i;-1.0+2.0*i;-1.0+2.0*i]; pol2 = [ -1.0+4*i;-1.0+4.0*i;-0.1+6.0*i;-0.1+6.0*i]; dpol = [ -0.2 ; 0 ; 0 ; 0 ]; CSTR = dp_cstr(CSTR,sys1,pol1,'riri','<===',dpol); CSTR = dp_cstr(CSTR,sys2,pol2,'riri','<===',dpol); fb = fb_dyn(CSTR,CRIT); Root locus results:
Explanations relative to the above script.
% Two systems considered (1 input, 2 outputs). % System 1 (poles -1+2i and -0.1+3i): den1 = [-1+2*i -1-2*i -0.1+3*i -0.1-3*i]; sys1 = ss(zpk({[1];[2]},{den1;den1},[1;2])); % System 2 (poles -1+4i and -0.1+6i): den2 = [-1+4*i -1-4*i -0.1+6*i -0.1-6*i]; sys2 = ss(zpk({[1];[3]},{den2;den2},[1;2])); % Gain structure: size 1 x 2, two poles = -2+2*i and -3+3*i % and denominator degree - numerator degree = 1 CSTR = str_cstr(1,2,[-2+2*i;-3+3*i],1); % Criterion: reference gain = [0 0] at listed frequencies CRIT = ktf_crit(CSTR,[0 0],i*[0 0.01 0.05 0.1 0.5 1]); % Phase control constraints to be read column wise< % pole -0.1+3i with real part variation < -0.2 % pole -0.1+3i with imaginary part variation = 0 % pole -1+2*i with real and imaginary part variations = 0 % Similar for the poles of sys2. pol1 = [-.1+3*i;-.1+3*i;-1+2*i ;-1+2*i ]; pol2 = [ -1+4*i;-1+4*i ;-.1+6*i;-.1+6*i]; fld1 = [ 'r' ; 'i' ; 'r' ; 'i' ]; fld2 = [ '<' ; '=' ; '=' ; '=' ]; fld3 = [ -0.2 ; 0 ; 0 ; 0 ]; [CSTR] = dp_cstr(CSTR,sys1,pol1,fld1,fld2,fld3); [CSTR] = dp_cstr(CSTR,sys2,pol2,fld1,fld2,fld3); % Gain computation fb = fb_dyn(CSTR,CRIT); % Root locus results figure; rlocus(sys1*fb,[0:-0.1:-2]) figure; rlocus(sys2*fb,[0:-0.1:-2])
Example 5 : use of fb_dyn for multi-model eigenstructure assignmentMulti-model control laws cannot be designed in one shoot. It is recommended to design first a single-model nominal law, then to apply this law to other models (or use µ-analysis). Analysing other models permits the designer to identify one or more worst cases that must be treated together with the nominal system. When worst cases are treated, in order to avoid conflicting objectives, it is better to take into account the closed-loop properties of worst case models controlled by the initial feedback. For example, move the poles but try to preserve the assigned eigenvectors by using projection ideas. The main function for multi-model eigenstructure assignment is fb_dyn. This function solves a Linear Quadratic Programming Problem. The input arguments of this function are two matrices:
The structure of the dynamic feedback gain must be defined first by invoking the function str_cstr. These constraints initialize the matrix CSTR. Then, the function eig_cstr will be invoked once for each selected worst case model. This function computes eigenstructure assignment constraints and write them into the matrix CSTR. The input arguments of eig_cstr are similar to those of fb_prop (without the second argument k0: see Example 1). In the following illustrative example, it is assumed that the initial feedback fb0 has been designed relative to sys1 (assigning pol0) and, from analysis, the system sys2 has been identified as a worst case. Assuming that fb0, pol0, sys1 and sys2 are in the work space: CSTR = str_cstr(2,6,-8,0); CRIT = ktf_crit(CSTR,fb0,i*[0 0.01 0.05 0.1 0.5]); CSTR = eig_cstr(CSTR,sys1,pol0,'p',pol0,fb0); oldpol = [-2.37+4.40*i -1.14+3.0*i]; newpol = [-4+4*i -3+3*i]; CSTR = eig_cstr(CSTR,sys2,newpol,'p',oldpol,fb0); fb = fb_dyn(CSTR,CRIT); Explanations relative to the above script (see Example 1 for the design of fb0).
% Generation of the nominal model sys1 = rcamdata('lat',12,2,0.1); % Initial proportional feedback computed for sys1 pol0 = [-0.9+0.9i -0.8 -2 -1.5 -1]; def_pb = [4 4 1 1 1]; K0 = fb_prop(sys1,0,pol0,'n',def_pb); fb0 = ss([],[],[],K0); % Analysis: the worst case model turns out to be sys2 below sys2 = rcamdata('lat',25,2,0.075); % The system sys2 controlled by fb0 has two pairs of badly damped % closed-loop poles which are -2.37 + 4.40i and -1.14 + 3.00i. % These poles will be shifted to -4 + 4i and -3 + 3i. The % initially assigned poles of sys1 will be re-assigned. % Gain structure: size 2 x 6, a single pole at -8, % and denominator degree - numerator degree = 0 CSTR = str_cstr(2,6,-8,0); % Criterion: reference gain fb0 at listed frequencies CRIT = ktf_crit(CSTR,fb0,i*[0 0.01 0.05 0.1 0.5]); % For sys1 the initial assignment (by fb0) is preserved CSTR = eig_cstr(CSTR,sys1,pol0,'p',pol0,fb0); % For sys2 the poles assigned by fb0 are moved to the left % and the corresponding eigenvectors are the projections of % those assigned by fb0 oldpol = [-2.37+4.40*i -1.14+3.0*i]; newpol = [-4+4*i -3+3*i]; CSTR = eig_cstr(CSTR,sys2,newpol,'p',oldpol,fb0); % Dynamic feedback computation fb = fb_dyn(CSTR,CRIT); % Analysis of the results (pol0 is in the first spectrum % newpol in the second one): [eig_fb(sys1,fb) eig_fb(sys2,fb)] ans = -30.7701 +18.3849i -41.3772 +25.0282i -30.7701 -18.3849i -41.3772 -25.0282i -30.5619 +18.1003i -41.0257 +24.5727i -30.5619 -18.1003i -41.0257 -24.5727i -7.4785 -4.0000 + 4.0000i <- assigned -6.5154 -4.0000 - 4.0000i -0.9000 + 0.9000i -3.0000 + 3.0000i <- assigned -0.9000 - 0.9000i -3.0000 - 3.0000i -2.0475 -2.8696 + 0.2111i -2.0000 -2.8696 - 0.2111i -1.5647 -1.5690 + 1.0900i -1.5000 -1.5690 - 1.0900i -1.0000 -0.5829 -0.8000 -0.3766
Example 6 : use of fb_dyn for controller order reductionThe proposed method for controller order reduction consists of:
The main function for controller order reduction (i.e. re-design) is fb_dyn. This function solves a Linear Quadratic Programming Problem. The input arguments of this function are two matrices:
The structure of the dynamic feedback gain must be defined first by invoking the function str_cstr. These constraints initialize the matrix CSTR. Then, the function eig_cstr is invoked in order to define constraints corresponding to re-assigning the dominant eigenstructure. This function computes these constraints and write them into the matrix CSTR. The input arguments of eig_cstr are similar to those of fb_prop (without the second argument k0: see Example 1). The illustrative example considered below was proposed by Caroline Chiappa in [Chiappa et al, Improvement of the robustness of an aircraft autopilot designed by a µ-synthesis technique, CESA'98]. The initial controller was designed using a µ-synthesis approach detailed in [Bennani and Looye, Chapter 22 of Robust flight control: a design challenge, LNCIS 224]. The considered system is the longitudinal motion of the RCAM (the linearized models used here have more states and measurements than the models available by invoking the RMCT function rcamdata, therefore, augmented models are provided in a .zip file). The controller architecture is depicted in the following figure. For notation, see the aforementioned papers.
The initial feedback fb0 (K(s) in the figure) has been designed relative to the system sys0 (RCAM in the figure). Assuming that fb0, sys0 are in the work space: sysbf = feedback(sys0,fb0,1); p_dom_bf = plot_res(sysbf,1,1,inf); p_dom = p_dom_bf(1:5); beta=[-10 -0.015]; [CSTR] = str_cstr(3,6,beta); omega=[.01:.01:0.1]*sqrt(-1); CRIT = ktf_crit(CSTR,fb0,omega); CSTR = eig_cstr(CSTR,sys0,p_dom,'p',p_dom,fb0); fb = fb_dyn(CSTR,CRIT,0.0001);The results are given in the following figures. The first one corresponds to the original µ-controller fb0 of order equal to 18. The step responses are given for the nominal model but also for other models covering all the flight domain. The second figure corresponds to similar results relative to the reduced order controller fb of order equal to 4.
Explanations relative to the above script.
% The system sys0, and the initial feedback fb0 are loaded load ex6_data % Analysis for identifying dominant modes sysbf = feedback(sys0,fb0,1); [p_dom_bf,res] = plot_res(sysbf,1,1,inf); format short e [p_dom_bf,res] ans = -6.4634e-01 + 2.9574e-01i -4.3401e+01 -1.1819e+00 3.2808e+01 -2.5150e-01 + 6.2944e-01i 1.2327e+01 -8.3603e-01 -2.8614e+00 -4.0363e-01 + 6.1812e-01i 1.0316e+00 -6.5799e+00 + 5.8447e+00i 1.3467e-01 -7.1421e-01 -3.0885e-02 -3.1618e-01 + 3.1629e-01i 1.8490e-03 -1.5050e-01 1.0791e-03 -1.4950e-01 -1.0737e-03 -1.1248e-01 + 3.1673e-02i -4.3618e-05 -1.4144e-01 + 1.4136e-01i 2.7219e-06 -1.1143e+02 2.2292e-06 -1.1042e+01 2.3912e-07 -1.0940e+02 + 1.1127e+02i -1.3514e-07 -1.2821e+02 9.1333e-10 -1.9876e+03 1.9283e-15 -6.7000e-01 5.6541e-22 % For example, consider 5 poles (residuals >1, right column) p_dom = p_dom_bf(1:5); % Feedback gain structure definition: size 3 x 6, two poles % -100 and -0.015. One of these values must be close to the % origin in order to preserve the integral effect of fb0 beta=[-10 -0.015]; [CSTR] = str_cstr(3,6,beta); % Criterion: reference gain fb0 at listed frequencies omega=[.01:.01:0.1]*sqrt(-1); CRIT = ktf_crit(CSTR,fb0,omega); % Constraints for re-assignment of dominant modes (poles % re-assigned here at the same location because the 3rd and % 5th arguments are equal) CSTR = eig_cstr(CSTR,sys0,p_dom,'p',p_dom,fb0); % Dynamic feedback computation fb = fb_dyn(CSTR,CRIT,0.0001); % Step responses analysis figure sys_k = fb; plotstep figure sys_k = fb0; plotstep
Additional comments on order reduction.Selection of closed-loop dominant modes
Controller poles
Frequency domain constraints
|