9 Implementation of Control Design Methods into Matlab Environment

Computer-aided tools for analysis and synthesis of control systems are widely employed by many users from a range of researchers, control engineers or students. The reason is obvious. Such toolboxes represent comfortable and effective way of dealing with an array of complex control problems, sometimes even without deeper knowledge of the specific method. For example, Control System Toolbox, Robust Control Toolbox or Polynomial Toolbox (PolyX, 2011) for Matlab belong among the most popular ones in the control field. The main aim of this chapter is to present two simple and freely downloadable Matlab programs which allow user-friendly work for two selected specific control design issues by means of Graphical User Interface (GUI). First of the packages (Matušů, 2010; Matušů & Prokop, 2011a) is focused on algebraic design of continuous-time controllers under assumption of interval plants. The program takes advantage of Matlab + Simulink + Polynomial Toolbox (PolyX, 2011) environment and it represents an easy but effective and user-friendly way to control synthesis, robust stability analysis and simulation. The second of the presented programs (Matušů & Prokop, 2010, 2011b, 2011c) deals with control of time-delay systems using three various modifications of Smith predictor. The software implementation includes the modification for unstable and integrating processes, PI-PD modification for systems with long dead time, and modification applying control design by Coefficient Diagram Method (CDM). The described software products, which can be used both for research and educational purposes, are freely available on the Internet (Matušů & Prokop, 2011a, 2011b). Their application potential is going to be illustrated on several control examples. The chapter is organized as follows. The Section 2 focuses on algebraic design of controllers for interval plants. It is divided into three partial subsections dealing with brief outline of basic theoretical background, description of the developed program itself and demonstration of its capabilities by means of an illustrative example, respectively. Analogically, the Section 3 has the very same structure but it presents the control of time-delay systems using three modifications of Smith predictor. Finally, Section 4 offers some conclusion remarks. The partial versions of this work have been already presented in (Matušů & Prokop, 2010, 2011c; Matušů 2010).


Algebraic design of controllers for interval systems
2.1 Theoretical background Problems of analysis and synthesis of control systems under uncertainty have attracted the attention of researchers and engineers for decades.The origin of uncertainty in constructed mathematical model of an industrial process can be seen in the effort to consider the process as an linear time invariant system, in spite of the fact, that the real behaviour is oftentimes different, much more complicated, and moreover because, strictly speaking, the physical parameters are never exactly known, possibly they can vary according to operating conditions.A possible and very popular approach to uncertain description supposes the known structure but uncertain knowledge of actual physical parameters of the controlled system.Their possible values are usually bounded by intervals and many of such plants can be assumed as so-called interval systems.The simple example of the interval system is represented by transfer function (1).The common problem is to design a cheap controller with simple structure and fixed parameters which guarantees stability and often also required control behaviour for all possible values of the uncertain parameters.A potential solution to this task relies on the application of continuous-time robust linear controllers designed via the general solutions of Diophantine equations in the ring of proper and (Hurwitz-)stable rational functions (R PS ).This technique is based on the ideas of Vidyasagar (1985) and Kučera (1993) and it is proposed and analyzed e.g. in (Prokop & Corriou, 1997).The algebraic method brings a single scalar parameter  0 m which influences the dynamics and robustness of the closed control loop.The controllers are designed for nominal systems while the robust stability can be tested through some standard instruments, for example the value set concept in combination with the zero exclusion condition and the overbounding method together with the Kharitonov theorem (Barmish, 1994).The well known closed-loop control configurations with one degree of freedom (1DOF) or two degrees of freedom (2DOF) are supposed.In both cases, the loop is assumed to contain an interval controlled plant and a fixed controller.The regulator is designed for a nominal plant and consequently it is applied to plant under uncertainty while the robust stability is tested using some standard tools.A fractional approach to continuous-time control design (Vidyasagar, 1985;Kučera, 1993) is based on general solutions of Diophantine equations in R PS .The set of stabilizing controllers is given by known Youla-Kučera parameterization and the choice of the appropriate controller according to user requirements (asymptotic tracking, disturbance rejection and attenuation) consists in utilization of divisibility conditions in the specified ring.One of advantages of this algebraic synthesis lies in the existence of single scalar tuning parameter  0 m which can serve for additional influencing the final closed-loop control behaviour.The very topical question is how to choose m to gain the appropriate controller.The papers (Matušů & Prokop, 2008, 2011d) outline a possible technique for selection of m based on user-defined nominal control behaviour in the form of the first under/overshoot size.An alternative method consists in minimization of sensitivity function (Vidyasagar, 1985;Kučera, 1993) using  H norm.In this instance, such m which tunes the "most robust" controller towards changes in controlled system (or in closed loop transfer function) is found.The simplest nevertheless in practice often sufficient solution is to select this parameter more or less "randomly" or on the basis of "engineering feeling" and subsequently test the regulation by means of simulation.Even an inexperienced user is usually able to find a suitable m after several steps.Much more details about the synthesis method and specific controller design and tuning can be found e.g. in (Prokop & Corriou, 1997;(Matušů & Prokop, 2008, 2011d).Once the nominally stabilizing controller is designed, one need to verify the stability of the closed control loop with this fixed controller and an interval plant.The robust stability can be investigated, for example, using the theory of polytopes (closed-loop characteristic polynomial has an affine linear uncertainty structure) or via the overbounding method in combination with the classical Kharitonov theorem.An excellent overview of this field provides e.g.books (Barmish, 1994;Bhattacharyya et al., 1995).

Description of the program
This section introduces a simple user-friendly program (Matušů, 2010;Matušů & Prokop, 2011a) for synthesis and simulation of control systems under assumption that controlled plants are affected by interval uncertainty.It incorporates selected controller design algorithms and tools for robust stability analysis as they have been adumbrated hereinbefore.The developed software tool takes advantage of functions and GUI of MATLAB (tested on various versions from 6.5.1 -R13SP1 to 7.9 -R2009b) and also benefits of simulation environment SIMULINK and support of the Polynomial Toolbox 2.5 (PolyX, 2011).The program can be downloaded from web page (Matušů & Prokop, 2011a).It must be decompressed and launched in the Matlab via "start.m"file.Then, it is very intuitive and easy to use.The main menu window of the product is shown in Fig. 1 which is accompanied by the following concise description of program possibilities according to numbered items: 1.The definition of nominal system (with fixed parameters) which is used for controller design.2. The definition of perturbed system (with interval parameters) which is used for simulation of control and robust stability tests.3. Size of perturbations (expressed in percentage).4. The choice of strategy for controller tuning.The first eventuality allows to define an arbitrary value of tuning parameter  0 m while the second one minimizes the sensitivity function and searches for the "most robust" regulator to given nominal plant.5.The selection of one from two basic closed control loop configurations -1DOF or 2DOF control system.6.The option of desired properties of the controller -either asymptotic tracking of reference signal or simultaneous tracking and disturbance rejection.7. Adjustments of basic simulation parameters such as simulation time, reference signal, load disturbance and controller saturation.8. Possibility of harmonic disturbance setting (in the output of the controlled plant).9. Possibility of ramp disturbance setting (in the output of the controlled plant).10.The selection of simulation results which should be displayed.The important item is "Number of partial intervals for simulation" defining how many intervals is each uncertain parameter in controlled system divided into.In other words, this number increased by one expresses the quantity of "sampled" values in individual uncertain coefficients.The aim is to create some "representative set of systems" (RSS) used for simulation process.However, be careful, the higher numbers noticeably increase computational time.11.The buttons for start of simulation and exit from the program.The capability of developed tool is demonstrated on the following example.

An example of application
The goal of this part is neither to prove the quality of utilized control design method nor to provide the comprehensive survey of all possibilities.It is just to show the basic idea of usage by means of a simple example.The controlled plant is given as the second order interval system described by uncertain transfer function: The aim is to design the controller which assures the asymptotic tracking of the reference signal and robust stability of the closed control loop, i.e. stability of control system for all members of interval family (1).The selection of  1 m , 1DOF structure and reference tracking lead to PID controller: As can be effortlessly verified, the nominal system will be stabilized by this controller in closed loop.The question is if the control circuit is robustly stable.The closed-loop characteristic polynomial has affine linear uncertainty structure: After substitution: First, the robust stability of ( 4) is verified via the overbounding method.It means that more complicated uncertainty structure (affine linear in this case) can be "overbounded" by the interval one and this new family is sequentially tested.Unfortunately, this method brings certain degree of conservatism into the analysis due to ignoring the mutual dependencies among coefficients in the original family.As a result, robust stability is investigated only with sufficient (i.e.stronger) and not necessary and sufficient condition.Apart from other things, the overbounding interval polynomial and four related Kharitonov polynomials can be seen in Fig. 3 which represents final result of robust stability analysis from the program.

Fig. 3. Results of robust stability investigation from the program
Only two of four Kharitonov polynomials are stable which means that the overbounding polynomial is not robustly stable.Moreover, the Kharitonov rectangles from Fig. 4 (depicted actually only for illustration under frequencies from 0 to 3.5 with step 0.04) with detailed view in Fig. 5 also distinctly indicate robust instability of the overbounding polynomial because they cover the origin of the complex plane.This quite general principle is known as the zero exclusion condition (Barmish, 1994).However, generally it does not point to any conclusion about robust stability of original structure (4) because the mutual dependence among polynomial coefficients has been ignored.4) in Fig. 6 with closed look to zero point in Fig. 7 reveal the closed-loop system is robustly stable in fact, because the complex plane origin is excluded from the value sets.
Now, only the final simulations of control behaviour are shown without deeper insight both for 1DOF and 2DOF configurations -see Figs. 10 and 11, respectively.However, the costs for "faster" regulation are more aggressive control signals.

Theoretical background
The time-delay has been intensively investigated phenomenon during the last decades, because it is very common in many process control applications and its presence in a control loop always brings serious complications.The relatively effective tool for compensation of time-delay term represents the classical Smith predictor which has been known to automation community since 1959 (Smith).However, this control structure has also its disadvantages and limitations.
Some drawbacks of the Smith predictor have been eliminated by improving the idea and creating many modifications of this connection (Watanabe & Ito, 1981;Åström et al., 1994;Mataušek & Micić, 1996;Majhi & Atherton, 1998;Kaya & Atherton, 1999;Hamamci et al., 2001).All three implemented techniques (Majhi & Atherton, 1998;Kaya & Atherton, 1999;Hamamci et al., 2001) have improved the classical Smith predictor loop using more sophisticated and complicated structure with additional controllers.Naturally, all the methods also use mathematical model of really controlled plant including time-delay term in the inner loop.Moreover, this model is assumed during design of controllers as a nominal system.In practice, however, the really controlled can differ from the ideal assumptions.
The example of modified Smith predictor structure is shown in Fig. 12.  (Hamamci et al., 2001) The controller synthesis itself is based on various approaches and techniques according to the applied modification.For example the standard forms for obtaining the optimal closedloop transfer function parameters in the meaning of integral squared time error (ISTE) criterion, Nyquist stability criterion, a simple algebraic approach to control system design, coefficient diagram, modification of Kessler standard form, or Lipatov stability analysis have been utilized -see e.g.(Mataušek & Micić, 1996;Majhi & Atherton, 1998;Manabe, 1998;Kaya & Atherton, 1999;Hamamci et al., 2001;Hamamci & Ucar, 2002).The final relations for controller design have been usually pre-derived for first and second order timedelay plants.

Description of the program
Analogically to the Subsection 2.2, this part briefly presents a simple user-friendly Matlab program (Matušů & Prokop, 2010, 2011b, 2011c), in this case for control of time-delay systems using three various modifications of Smith predictor.The software implementation includes the modification for unstable and integrating processes (Majhi & Atherton, 1998), PI-PD modification for systems with long dead time (Kaya & Atherton, 1999), and modification applying control design by CDM (Hamamci et al., 2001).It can be freely downloaded from the web page (Matušů & Prokop, 2011b).The program is a translated version of the one created under the scope of the Master's Theses (Matušů, 2002).After decompression it can be launched using "go.m"file.The software has been coded in Matlab 6.5.1 -R13SP1 but tested also under several newer versions.The main window of the program GUI (Fig. 13) allows selecting the modification which should be used for a whole control experiment.In the next step, coefficients of the controlled system of specific type and possibly some other additional parameters depending on the used method can be set as illustrated in Fig. 15.However, the program permits not only adjustment of nominal system (considered as a model for control design and in control loops as shown e.g. in Fig. 12), but also of the perturbed system (used as a really controlled plant) with potentially different coefficients.

Conclusion
This chapter has presented two freely downloadable Matlab programs which allow userfriendly work with selected control design methods via GUI.The first package is focused on algebraic design of continuous-time controllers under assumption of interval plants while the second one deals with control of time-delay systems using three various modifications of Smith predictor.The described software products can be used both for research and educational purposes.

Fig. 1 .
Fig. 1.The window of main menu for the first program

Fig. 13 .
Fig. 13.Initial window of the second programSubsequently, sort of controlled system (e.g.first order, second order or integrating plant as a special type) can be chosen together with fundamental properties of the experiment (simulation time, reference signal, disturbances) -see Fig.14.In the next step, coefficients of the controlled system of specific type and possibly some other additional parameters depending on the used method can be set as illustrated in Fig.15.However, the program permits not only adjustment of nominal system (considered as a model for control design and in control loops as shown e.g. in Fig.12), but also of the perturbed system (used as a really controlled plant) with potentially different coefficients.