**S P R I N G E R B R I E F S I N APPLIED SCIENCES AND TECHNOLOGY**

# Steven A. Frank

Control Theory Tutorial Basic Concepts Illustrated by Software Examples

SpringerBriefs in Applied Sciences and Technology

SpringerBriefs present concise summaries of cutting-edge research and practical applications across a wide spectrum of fields. Featuring compact volumes of 50– 125 pages, the series covers a range of content from professional to academic.

Typical publications can be:

SpringerBriefs are characterized by fast, global electronic dissemination, standard publishing contracts, standardized manuscript preparation and formatting guidelines, and expedited production schedules.

On the one hand, SpringerBriefs in Applied Sciences and Technology are devoted to the publication of fundamentals and applications within the different classical engineering disciplines as well as in interdisciplinary fields that recently emerged between these areas. On the other hand, as the boundary separating fundamental research and applied technology is more and more dissolving, this series is particularly open to trans-disciplinary topics between fundamental science and engineering.

Indexed by EI-Compendex, SCOPUS and Springerlink.

More information about this series at http://www.springer.com/series/8884

Steven A. Frank

# Control Theory Tutorial

Basic Concepts Illustrated by Software Examples

Steven A. Frank Department of Ecology and Evolutionary Biology University of California, Irvine Irvine, CA USA

Mathematica® is a registered trademark of Wolfram Research, Inc., 100 Trade Center Drive, Champaign, IL 61820-7237, USA, http://www.wolfram.com

and

MATLAB® is a registered trademark of The MathWorks, Inc., 1 Apple Hill Drive, Natick, MA 01760-2098, USA, http://www.mathworks.com.

Additional material to this book can be downloaded from http://extras.springer.com.

ISSN 2191-530X ISSN 2191-5318 (electronic) SpringerBriefs in Applied Sciences and Technology ISBN 978-3-319-91706-1 ISBN 978-3-319-91707-8 (eBook) https://doi.org/10.1007/978-3-319-91707-8

Library of Congress Control Number:<PHONE_NUMBER>

Mathematics Subject Classification (2010): 49-01, 93-01, 93C05, 93C10, 93C40

© The Editor(s) (if applicable) and The Author(s) 2018. This book is an open access publication. Open Access This book is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.

The images or other third party material in this book are included in the book's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the book's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.

The use of general descriptive names, registered names, trademarks, service marks, etc. in this publication does not imply, even in the absence of a specific statement, that such names are exempt from the relevant protective laws and regulations and therefore free for general use.

The publisher, the authors and the editors are safe to assume that the advice and information in this book are believed to be true and accurate at the date of publication. Neither the publisher nor the authors or the editors give a warranty, express or implied, with respect to the material contained herein or for any errors or omissions that may have been made. The publisher remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Printed on acid-free paper

This Springer imprint is published by the registered company Springer International Publishing AG part of Springer Nature

The registered company address is: Gewerbestrasse 11, 6330 Cham, Switzerland

# Précis

This book introduces the basic principles of control theory in a concise self-study tutorial. The chapters build the foundation of control systems design based on feedback, robustness, tradeoffs, and optimization. The approach focuses on how to think clearly about control and why the key principles are important. Each principle is illustrated with examples and graphics developed by software coded in Wolfram Mathematica. All of the software is freely available for download. The software provides the starting point for further exploration of the concepts and for development of new theoretical studies and applications.

# Preface

I study how natural biological processes shape the design of organisms. Like many biologists, I have often turned to the rich theory of engineering feedback control to gain insight into biology.

The task of learning control theory for a biologist or for an outsider from another scientific field is not easy. I read and reread the classic introductory texts of control theory. I learned the basic principles and gained the ability to analyze simple models of control. The core of the engineering theory shares many features with my own closest interests in design tradeoffs in biology. How much cost is it worth paying to enhance performance? What is the most efficient investment in improved design given the inherent limitation on time, energy, and other resources?

Yet, for all of the conceptual similarities to my own research and for all of my hours of study with the classic introductory texts, I knew that I had not mastered the broad principles of engineering control theory design. How should I think simply and clearly about a basic control theory principle such as integral control in terms of how a biological system actually builds an error-correcting feedback loop? What is the relation between various adaptive engineering control systems and the ways in which organisms build hard-wired versus flexible control responses? How do the classic cost-benefit analyses of engineering quadratic control models relate to the commonly used notions of costs and benefits in models of organismal design?

After several years of minor raiding around the periphery of engineering control theory, I decided it was time to settle down and make a carefully planned attack. I lined up the classic texts, from the basic introductions to the more advanced treatises on nonlinear control, adaptive control, model predictive control, modern robust analysis, and the various metrics used to analyze uncertainty. I could already solve a wide range of problems, but I had never fully internalized the basic principles that unified the subject in a simple and natural way.

This book is the tutorial that I developed for myself. This tutorial can guide you toward broad understanding of the principles of control in a way that cannot be obtained from the standard introductory books. Those classic texts are brilliant compilations of knowledge with excellent drills to improve technical skill. But those texts cannot teach you to understand the principles of control, how to internalize the concepts and make them your own. You must ultimately learn to think simply and clearly about problems of control and how such problems relate to the broad corpus of existing knowledge.

At every stage of learning, this tutorial provides the next natural step to move ahead. I present each step in the quickest and most illustrative manner. If that quick step works for you, then you can move along. If not, then you should turn to the broad resources provided by the classic texts. In this way, you can build your understanding rapidly, with emphasis on how the pieces fit together to make a rich and beautiful conceptual whole. Throughout your study, you can take advantage of other sources to fill in technical gaps, practical exercises, and basic principles of applied mathematics.

You will have to build your own course of study, which can be challenging. But with this tutorial guide, you can do it with the confidence that you are working toward the broad conceptual understanding that can be applied to a wide range of real-world problems. Although the size of this tutorial guide is small, it will lead you toward the key concepts in standard first courses plus many of the principles in the next tier of advanced topics. For scientists outside of engineering, I cannot think of another source that can guide your study in such a simple and direct way. For engineering students, this tutorial supplements the usual courses and books to unify the conceptual understanding of the individual tools and skills that you learn in your routine studies.

This tutorial is built around an extensive core of software tools and examples. I designed that software to illustrate fundamental concepts, to teach you how to do analyses of your own problems, and to provide tools that can be used to develop your own research projects. I provide all of the software code used to analyze the examples in the text and to generate the figures that illustrate the concepts.

The software is written in Wolfram Mathematica. I used Mathematica rather than the standard MATLAB tools commonly used in engineering courses. Those two systems are similar for analyzing numerical problems. However, Mathematica provides much richer tools for symbolic analysis and for graphic presentation of complex results from numerical analysis. The symbolic tools are particularly valuable, because the Mathematica code provides clear documentation of assumptions and mathematical analysis along with the series of steps used in derivations. The symbolic analysis also allows easy coupling of mathematical derivations to numerical examples and graphical illustrations. All of the software code used in this tutorial is freely available at http://extras.springer.com/2018/978-3-319-91707-8.

The US National Science Foundation and the Donald Bren Foundation support my research.

March 2018

Irvine, USA Steven A. Frank

# Contents

### Part II Design Tradeoffs

# **Chapter 1 Introduction**

I introduce the basic principles of control theory in a concise self-study guide. I wrote this guide because I could not find a simple, brief introduction to the foundational concepts. I needed to understand those key concepts before I could read the standard introductory texts on control or read the more advanced literature. Ultimately, I wanted to achieve sufficient understanding so that I could develop my own line of research on control in biological systems.

This tutorial does not replicate the many excellent introductory texts on control theory. Instead, I present each key principle in a simple and natural progression through the subject.

The principles build on each other to fill out the basic foundation. I leave all the detail to those excellent texts and instead focus on how to think clearly about control. I emphasize why the key principles are important, and how to make them your own to provide a basis on which to develop your own understanding.

I illustrate each principle with examples and graphics that highlight key aspects. I include, in a freely available file, all of the Wolfram Mathematica software code that I used to develop the examples and graphics (see Preface). The code provides the starting point for your own exploration of the concepts and the subsequent development of your own theoretical studies and applications.

### **1.1 Control Systems and Design**

An incoming gust of wind tips a plane. The plane's sensors measure orientation. The measured orientation feeds into the plane's control systems, which send signals to the plane's mechanical components. The mechanics reorient the plane.

An organism's sensors transform light and temperature into chemical signals. Those chemical signals become inputs for further chemical reactions. The chain of chemical reactions feeds into physical systems that regulate motion.

How should components be designed to modulate system response? Different goals lead to design tradeoffs. For example, a system that responds rapidly to changing input signals may be prone to overshooting design targets. The tradeoff between performance and stability forms one key dimension of design.

Control theory provides rich insights into the inevitable tradeoffs in design. Biologists have long recognized the analogies between engineering design and the analysis of biological systems. Biology is, in essence, the science of reverse engineering the design of organisms.

### **1.2 Overview**

I emphasize the broad themes of feedback, robustness, design tradeoffs, and optimization. I weave those themes through the three parts of the presentation.

### *1.2.1 Part I: Basic Principles*

The first part develops the basic principles of dynamics and control. This part begins with alternative ways in which to study dynamics. A system changes over time, the standard description of dynamics. One can often describe changes over time as a combination of the different frequencies at which those changes occur. The duality between temporal and frequency perspectives sets the classical perspective in the study of control.

The first part continues by applying the tools of temporal and frequency analysis to basic control structures. Open-loop control directly alters how a system transforms inputs into outputs. Prior knowledge of the system's intrinsic dynamics allows one to design a control process that modulates the input–output relation to meet one's goals.

By contrast, closed-loop feedback control allows a system to correct for lack of complete knowledge about intrinsic system dynamics and for unpredictable perturbations to the system. Feedback alters the input to be the error difference between the system's output and the system's desired target output.

By feeding back the error into the system, one can modulate the process to move in the direction that reduces error. Such self-correction by feedback is the single greatest principle of design in both human-engineered systems and naturally evolved biological systems.

I present a full example of feedback control. I emphasize the classic proportional, integral, derivative (PID) controller. A controller is a designed component of the system that modulates the system's intrinsic input–output response dynamics.

In a PID controller, the proportional component reduces or amplifies an input signal to improve the way in which feedback drives a system toward its target. The integral component strengthens error correction when moving toward a fixed target value. The derivative component anticipates how the target moves, providing a more rapid system response to changing conditions.

The PID example illustrates how to use the basic tools of control analysis and design, including the frequency interpretation of dynamics. PID control also introduces key tradeoffs in design. For example, a more rapid response toward the target setpoint often makes a system more susceptible to perturbations and more likely to become unstable.

This first part concludes by introducing essential measures of performance and robustness. Performance can be measured by how quickly a system moves toward its target or, over time, how far the system tends to be from its target. The cost of driving a system toward its target is also a measurable aspect of performance. Robustness can be measured by how likely it is that a system becomes unstable or how sensitive a system is to perturbations. With explicit measures of performance and robustness, one can choose designs that optimally balance tradeoffs.

### *1.2.2 Part II: Design Tradeoffs*

The second part applies measures of performance and robustness to analyze tradeoffs in various design scenarios.

Regulation concerns how quickly a system moves toward a fixed setpoint. I present techniques that optimize controllers for regulation. *Optimal* means the best balance between design tradeoffs. One finds an optimum by minimizing a cost function that combines the various quantitative measures of performance and robustness.

Stabilization considers controller design for robust stability. A robust system maintains its stability even when the intrinsic system dynamics differ significantly from that assumed during analysis. Equivalently, the system maintains stability if the intrinsic dynamics change or if the system experiences various unpredictable perturbations. Changes in system dynamics or unpredicted perturbations can be thought of as uncertainties in intrinsic dynamics.

The stabilization chapter presents a measure of system stability when a controller modulates intrinsic system dynamics. The stability measure provides insight into the set of uncertainties for which the system will remain stable. The stability analysis is based on a measure of the distance between dynamical systems, a powerful way in which to compare performance and robustness between systems.

Tracking concerns the ability of a system to follow a changing environmental setpoint. For example, a system may benefit by altering its response as the environmental temperature changes. How closely can the system track the optimal response to the changing environmental input? Once again, the analysis of performance and robustness may be developed by considering explicit measures of system characteristics. With explicit measures, one can analyze the tradeoffs between competing goals and how alternative assumptions lead to alternative optimal designs.

All of these topics build on the essential benefits of feedback control. The particular information that can be measured and used for feedback plays a key role in control design.

### *1.2.3 Part III: Common Challenges*

The third part presents challenges in control design. Challenges include nonlinearity and uncertainty of system dynamics.

Classical control theory assumes linear dynamics, whereas essentially all processes are nonlinear. One defense of linear theory is that it often works for real problems. Feedback provides powerful error correction, often compensating for unknown nonlinearities. Robust linear design methods gracefully handle uncertainties in system dynamics, including nonlinearities.

One can also consider the nonlinearity explicitly. With assumptions about the form of nonlinearity, one can develop designs for nonlinear control.

Other general design approaches work well for uncertainties in intrinsic system dynamics, including nonlinearity. Adaptive control adjusts estimates for the unknown parameters of intrinsic system dynamics. Feedback gives a measure of error in the current parameter estimates. That error is used to learn better parameter values. Adaptive control can often be used to adjust a controller with respect to nonlinear intrinsic dynamics.

Model predictive control uses the current system state and extrinsic inputs to calculate an optimal sequence of future control steps. Those future control steps ideally move the system toward the desired trajectory at the lowest possible cost. At each control point in time, the first control step in the ideal sequence is applied. Then, at the next update, the ideal control steps are recalculated, and the first new step is applied.

By using multiple lines of information and recalculating the optimal response, the system corrects for perturbations and for uncertainties in system dynamics. Those uncertainties can include nonlinearities, providing another strong approach for nonlinear control.

#### 1.2 Overview 5

**Open Access** This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.

The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.

# **Part I Basic Principles**

# **Chapter 2 Control Theory Dynamics**

The mathematics of classical control theory depends on linear ordinary differential equations, which commonly arise in all scientific disciplines. Control theory emphasizes a powerful Laplace transform expression of linear differential equations. The Laplace expression may be less familiar in particular disciplines, such as theoretical biology.

### **2.1 Transfer Functions and State Space**

Here, I show how and why control applications use the Laplace form. I recommend an introductory text on control theory for additional background and many example applications (e.g., Åström and Murray 2008; Ogata 2009; Dorf and Bishop 2016).

Suppose we have a process, *P*, that transforms a command input, *u*, into an output, *y*. Figure 2.1a shows the input–output flow. Typically, we write the process as a differential equation, for example

$$
\ddot{\mathbf{x}} + a\_1 \dot{\mathbf{x}} + a\_2 \mathbf{x} = \dot{\mathbf{u}} + bu,\tag{2.1}
$$

in which *x*(*t*) is an internal state variable of the process that depends on time, *u*(*t*) is the forcing command input signal, and overdots denote derivatives with respect to time. Here, for simplicity, we let the output be equivalent to the internal state, *y* ≡ *x*.

The dynamics of the input signal, *u*, may be described by another differential equation, driven by reference input, *r* (Fig. 2.1b). Mathematically, there is no problem cascading sequences of differential equations in this manner. However, the rapid growth of various symbols and interactions make such cascades of differential equations difficult to analyze and impossible to understand intuitively.

**Fig. 2.1** Basic process and control flow. **a** The input–output flow in Eq. 2.2. The input, *U*(*s*), is itself a transfer function. However, for convenience in diagramming, lowercase letters are typically used along pathways to denote inputs and outputs. For example, in **a**, *u* can be used in place of *U*(*s*). In **b**, only lowercase letters are used for inputs and outputs. Panel **b** illustrates the input–output flow of Eq. 2.3. These diagrams represent open-loop pathways because no closed-loop feedback pathway sends a downstream output back as an input to an earlier step. **c** A basic closed-loop process and control flow with negative feedback. The circle between *r* and *e* denotes addition of the inputs to produce the output. In this figure, *e* = *r* − *y*

We can use a much simpler way to trace input–output pathways through a system. If the dynamics of *P* follow Eq. 2.1, we can transform *P* from an expression of temporal dynamics in the variable *t* to an expression in the complex Laplace variable *s* as

$$P(s) = \frac{Y(s)}{U(s)} = \frac{s+b}{s^2 + a\_1s + a\_2}.\tag{2.2}$$

The numerator simply uses the coefficients of the differential equation in *u* from the right side of Eq. 2.1 to make a polynomial in *s*. Similarly, the denominator uses the coefficients of the differential equation in *x* from the left side of Eq. 2.1 to make a polynomial in *s*. The eigenvalues for the process, *P*, are the roots of *s* for the polynomial in the denominator. Control theory refers to the eigenvalues as the *poles* of the system.

From this equation and the matching picture in Fig. 2.1, we may write *Y* (*s*) = *U*(*s*)*P*(*s*). In words, the output signal, *Y* (*s*), is the input signal, *U*(*s*), multiplied by the transformation of the signal by the process, *P*(*s*). Because *P*(*s*) multiplies the signal, we may think of *P*(*s*) as the signal gain, the ratio of output to input, *Y* /*U*. The signal gain is zero at the roots of the numerator's polynomial in *s*. Control theory refers to those numerator roots as the *zeros* of the system.

The simple multiplication of the signal by a process means that we can easily cascade multiple input–output processes. For example, Fig. 2.1b shows a system with extended input processing. The cascade begins with an initial reference input, *r*, which is transformed into the command input, *u*, by a preprocessing controller, *C*, and then finally into the output, *y*, by the intrinsic process, *P*. The input–output calculation for the entire cascade follows easily by noting that *C*(*s*) = *U*(*s*)/*R*(*s*), yielding

$$Y(\mathbf{s}) = R(\mathbf{s})C(\mathbf{s})P(\mathbf{s}) = R(\mathbf{s})\frac{U(\mathbf{s})}{R(\mathbf{s})}\frac{Y(\mathbf{s})}{U(\mathbf{s})}.\tag{2.3}$$

These functions of *s* are called *transfer functions*.

Each transfer function in a cascade can express any general system of ordinary linear differential equations for vectors of state variables, *x*, and inputs, *u*, with dynamics given by

$$\begin{aligned} &\alpha^{(n)} + a\_1 \alpha^{(n-1)} + \dots + a\_{n-1} \alpha^{(1)} + a\_n \alpha \\ &= b\_0 \mu^{(m)} + b\_1 \mu^{(m-1)} + \dots + b\_{m-1} \mu^{(1)} + b\_m \mu, \end{aligned} \tag{2.4}$$

in which parenthetical superscripts denote the order of differentiation. By analogy with Eq. 2.2, the associated general expression for transfer functions is

$$P(s) = \frac{b\_0 s^m + b\_1 s^{m-1} + \dots + b\_{m-1} s + b\_m}{s^n + a\_1 s^{n-1} + \dots + a\_{n-1} s + a\_n}.\tag{2.5}$$

The actual biological or physical process does not have to include higher-order derivatives. Instead, the dynamics of Eq. 2.4 and its associated transfer function can always be expressed by a system of first-order processes of the form

$$
\dot{x}\_i = \sum\_j a\_{ij} x\_j + \sum\_j b\_{ij} u\_j,\tag{2.6}
$$

which allows for multiple inputs, *u <sup>j</sup>* . This system describes the first-order rate of change in the state variables, *x*˙*<sup>i</sup>* , in terms of the current states and inputs. This statespace description for the dynamics is usually written in vector notation as

$$\begin{aligned} \dot{\mathbf{x}} &= \mathbf{A}\mathbf{x} + \mathbf{B}\mathbf{u} \\ \mathbf{y} &= \mathbf{C}\mathbf{x} + \mathbf{D}\mathbf{u}, \end{aligned}$$

which potentially has multiple inputs and outputs, **u** and **y**.

For example, the single input–output dynamics in Eq. 2.1 translate into the statespace model

$$\begin{aligned} \dot{x}\_1 &= -a\_2 x\_2 + bu \\ \dot{x}\_2 &= x\_1 - a\_1 x\_2 + u \\ y &= x\_2, \end{aligned}$$

in which the rates of change in the states depend only on the current states and the current input.

### **2.2 Nonlinearity and Other Problems**

Classical control theory focuses on transfer functions. Those functions apply only to linear, time-invariant dynamics. By contrast, state-space models can be extended to any type of nonlinear, time-varying process.

Real systems are typically nonlinear. Nonetheless, four reasons justify the study of linear theory.

First, linear analysis clarifies fundamental principles of dynamics and control. For example, feedback often leads to complex, nonintuitive pathways of causation. Linear analysis has clarified the costs and benefits of feedback in terms of tradeoffs between performance, stability, and robustness. Those principles carry over to nonlinear systems, although the quantitative details may differ.

Second, many insights into nonlinear aspects of control come from linear theory (Isidori 1995; Khalil 2002; Astolfi et al. 2008). In addition to feedback, other principles include how to filter out disturbances at particular frequencies, how time delays alter dynamics and the potential for control, how to track external setpoints, and how to evaluate the costs and benefits of adding sensors to monitor state and adjust dynamics.

Third, linear theory includes methods to analyze departures from model assumptions. Those linear methods of robustness often apply to nonlinear departures from assumed linearity. One can often analyze the bounds on a system's performance, stability, and robustness to specific types of nonlinear dynamics.

Fourth, analysis of particular nonlinear systems often comes down to studying an approximately linearized version of the system. If the system state remains near an equilibrium point, then the system will be approximately linear near that point. If the system varies more widely, one can sometimes consider a series of changing linear models that characterize the system in each region. Alternatively, a rescaling of a nonlinear system may transform the dynamics into a nearly linear system.

Given a particular nonlinear system, one can always simulate the dynamics explicitly. The methods one uses to understand and to control a simulated system arise mostly from the core linear theory and from the ways that particular nonlinearities depart from that core theory.

### **2.3 Exponential Decay and Oscillations**

Two simple examples illustrate the match between standard models of dynamics and the transfer function expressions. First, the simplest first-order differential equation in *x*(*t*) forced by the input *u*(*t*), with initial condition *x*(0) = 0, is given by

$$
\dot{\boldsymbol{x}} + a\boldsymbol{x} = \boldsymbol{u}, \tag{2.7}
$$

which has the solution

$$\mathbf{x}(t) = \int\_0^t e^{-a\tau} u(t-\tau) d\tau. \tag{2.8}$$

This process describes how *x* accumulates over time, as inputs arrive at each time point with intensity *u*, and *x* decays at rate *a*.

If the input into this system is the impulse or Dirac delta function, *u*(*t*)d*t* = 1 at *t* = 0 and *u*(*t*) = 0 for all other times, then

$$x(t) = e^{-at}.$$

If the input is the unit step function, *u*(*t*) = 1 for *t* ≥ 0 and *u*(*t*) = 0 for *t* < 0, then

$$x(t) = \frac{1}{a} \left( 1 - e^{-at} \right).$$

Many processes follow the basic exponential decay in Eq. 2.8. For example, a quantity *u* of a molecule may arrive in a compartment at each point in time and then decay at rate *a* within the compartment. At any time, the total amount of the molecule in the compartment is the sum of the amounts that arrived at each time in the past, *u*(*t* − τ ), weighted by the fraction that remains after decay, *e*−*a*<sup>τ</sup> .

The process in Eq. 2.7 corresponds exactly to the transfer function

$$P(\mathbf{s}) = \frac{1}{\mathbf{s} + a},\tag{2.9}$$

in which the output is equivalent to the internal state, *y* ≡ *x*.

In the second example, an intrinsic process may oscillate at a particular frequency, ω0, described by

$$
\ddot{\chi} + a\_0^2 \chi = u.
$$

This system produces output *x* = sin(ω0*t*) for *u* = 0 and an initial condition along the sine curve. The corresponding transfer function is

$$P(s) = \frac{a\_0}{s^2 + a\_0^2}.$$

We can combine processes by simply multiplying the transfer functions. For example, suppose we have an intrinsic exponential decay process, *P*(*s*), that is driven by oscillating inputs, *U*(*s*). That combination produces an output

$$Y(s) = U(s)P(s) = \frac{\alpha\_0}{(s+a)(s^2 + \alpha\_0^2)},\tag{2.10}$$

which describes a third-order differential equation, because the polynomial of *s* in the denominator has a highest power of three.

We could have easily obtained that third-order process by combining the two systems of differential equations given above. However, when systems include many processes in cascades, including feedback loops, it becomes difficult to combine the differential equations into very high-order systems.Multiplying the transfer functions through the system cascade remains easy. That advantage was nicely summarized by Bode (1964), one of the founders of classical control theory

The typical regulator system can frequently be described, in essentials, by differential equations of no more than perhaps the second, third or fourth order. … In contrast, the order of the set of differential equations describing the typical negative feedback amplifier used in telephony is likely to be very much greater. As a matter of idle curiosity, I once counted to find out what the order of the set of equations in an amplifier I had just designed would have been, if I had worked with the differential equations directly. It turned out to be 55.

### **2.4 Frequency, Gain, and Phase**

How do systems perform when parameters vary or when there are external environmental perturbations? We can analyze robustness by using the differential equations to calculate the dynamics for many combinations of parameters and perturbations. However, such calculations are tedious and difficult to evaluate for more than a couple of parameters. Using transfer functions, we can study a wide range of conditions by evaluating a function's output response to various inputs.

This chapter uses the Bode plot method. That method provides an easy and rapid way in which to analyze a system over various inputs. We can apply this method to individual transfer functions or to cascades of transfer functions that comprise entire systems.

This section illustrates the method with an example. The following section describes the general concepts and benefits.

Consider the transfer function

$$G(s) = \frac{a}{s+a},\tag{2.11}$$

which matches the function for exponential decay in Eq. 2.9. Here, I multiplied the function by *a* so that the value would be one when *s* = 0.

**Fig. 2.2** Dynamics, gain, and phase of the low-pass filter in Eq. 2.11 in response to sine wave inputs at varying frequencies, ω. Details provided in the text. **a**–**c** Dynamics given by *a* multiplied by the transfer function on the right-hand side of Eq. 2.10. **d** Response of Eq. 2.11 to unit step input. **e** The scaling of the Bode gain plot is 20 log10(gain). That scaling arises from the relation between the magnitude, *<sup>M</sup>* = |*G*(*j*ω)|, and power, *<sup>P</sup>* <sup>=</sup> *<sup>M</sup>*2, of a signal at a particular frequency, <sup>ω</sup>, or equivalently *<sup>M</sup>* <sup>=</sup> <sup>√</sup>*P*. If we consider gain as the magnitude of the output signal, then the scale for the gain is given as 20 log10( <sup>√</sup>*P*) <sup>=</sup> 10 log10(*P*), the standard decibel scaling for the relative power of a signal. **f** Bode phase plot

We can learn about a system by studying how it responds to different kinds of fluctuating environmental inputs. In particular, how does a system respond to different frequencies of sine wave inputs?

Figure 2.2 shows the response of the transfer function in Eq. 2.11 to sine wave inputs of frequency, ω. The left column of panels illustrates the fluctuating output in response to the green sine wave input. The blue (slow) and gold (fast) responses correspond to parameter values in Eq. 2.11 of *a* = 1 and *a* = 10. All calculations and plots in this book are available in the accompanying Mathematica code (Wolfram Research 2017) at the site listed in the Preface.

In the top-left panel, at input frequency ω = 1, the fast (gold) response output closely tracks the input. The slow (blue) response reduces the input by <sup>√</sup><sup>2</sup> <sup>≈</sup> <sup>0</sup>.7. This output–input ratio is called the transfer function's *gain*. The slow response output also lags the input by approximately 0.11 of one complete sine wave cycle of 2π = 6.28 radians, thus the shift to the right of 0.11 × 6.28 ≈ 0.7 radians along the *x*-axis.

We may also consider the lagging shift in angular units, in which 2π radians is equivalent to 360◦. The lag in angular units is called the *phase*. In this case, the phase is written as −0.11 × 360◦ ≈ −40◦, in which the negative sign refers to a lagging response.

A transfer function always transforms a sine wave input into a sine wave output modulated by the gain and phase. Thus, the values of gain and phase completely describe the transfer function response.

Figure 2.2b shows the same process but driven at a higher input frequency of ω = 10. The fast response is equivalent to the slow response of the upper panel. The slow response has been reduced to a gain of approximately 0.1, with a phase of approximately −80◦. At the higher frequency of ω = 100 in the bottom panel, the fast response again matches the slow response of the panel above, and the slow response's gain is reduced to approximately 0.01.

Both the slow and fast transfer functions pass low-frequency inputs into nearly unchanged outputs. At higher frequencies, they filter the inputs to produce greatly reduced, phase-shifted outputs. The transfer function form of Eq. 2.11 is therefore called a low-pass filter, passing low frequencies and blocking high frequencies. The two filters in this example differ in the frequencies at which they switch from passing low-frequency inputs to blocking high-frequency inputs.

### **2.5 Bode Plots of Gain and Phase**

A Bode plot shows a transfer function's gain and phase at various input frequencies. The Bode gain plot in Fig. 2.2e presents the gain on a log scale, so that a value of zero corresponds to a gain of one, log(1) = 0.

For the system with the slower response, *a* = 1 in blue, the gain is nearly one for frequencies less than *a* and then drops off quickly for frequencies greater than *a*. Similarly, the system with faster response, *a* = 10, transitions from a system that passes low frequencies to one that blocks high frequencies at a point near its *a* value. Figure 2.2f shows the phase changes for these two low-pass filters. The slower blue system begins to lag at lower input frequencies.

Low-pass filters are very important because low-frequency inputs are often external signals that the system benefits by tracking, whereas high-frequency inputs are often noisy disturbances that the system benefits by ignoring.

In engineering, a designer can attach a low-pass filter with a particular transition parameter *a* to obtain the benefits of filtering an input signal. In biology, natural selection must often favor appending biochemical processes or physical responses that act as low-pass filters. In this example, the low-pass filter is simply a basic exponential decay process.

Figure 2.2d shows a key tradeoff between the fast and slow responses. In that panel, the system input is increased in a step from zero to one at time zero. The fast system responds quickly by increasing its state to a matching value of one, whereas the slow system takes much longer to increase to a matching value. Thus, the fast system may benefit from its quick response to environmental changes, but it may lose by its greater sensitivity to high-frequency noise. That tradeoff between responsiveness and noise rejection forms a common theme in the overall performance of systems.

To make the Bode plot, we must calculate the gain and phase of a transfer function's response to a sinusoidal input of frequency ω. Most control theory textbooks show the details (e.g.,Ogata 2009). Here, I briefly describe the calculations, which will be helpful later.

Transfer functions express linear dynamical systems in terms of the complex Laplace variable *s* = σ + *j*ω. I use *j* for the imaginary number to match the control theory literature.

The gain of a transfer function describes how much the function multiplies its input to produce its output. The gain of a transfer function *G*(*s*) varies with the input value, *s*. For complex-valued numbers, we use magnitudes to analyze gain, in which the magnitude of a complex value is <sup>|</sup>*s*| = <sup>√</sup>σ<sup>2</sup> <sup>+</sup> <sup>ω</sup>2.

It turns out that the gain of a transfer function in response to a sinusoidal input at frequency ω is simply |*G*(*j*ω)|, the magnitude of the transfer function at *s* = *j*ω. The phase angle is the arctangent of the ratio of the imaginary to the real parts of *G*(*j*ω).

For the exponential decay dynamics that form the low-pass filter of Eq. 2.11, the gain magnitude, *M*, and phase angle, φ, are

$$M = |G(j\omega)| = \frac{a}{\sqrt{\omega^2 + a^2}}$$

$$\phi = \angle G(j\omega) = -\tan^{-1}\frac{\omega}{a}.$$

Any stable transfer function's long-term steady-state response to a sine wave input at frequency ω is a sine wave output at the same frequency, multiplied by the gain magnitude, *M*, and shifted by the phase angle, φ, as

$$
\sin(\alpha t) \xrightarrow{G} M \sin(\alpha t + \phi),
\tag{2.12}
$$

in which the angle is given in radians. For example, if the phase lags by one-half of a cycle, φ = −π ≡ −180◦, then *M* sin(ω*t* + φ) = −*M* sin(ω*t*).

**Open Access** This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.

The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.

# **Chapter 3 Basic Control Architecture**

### **3.1 Open-Loop Control**

Suppose a system benefits by tracking relatively slow oscillatory environmental fluctuations at frequency ω*<sup>e</sup>* and ignoring much faster noisy environmental fluctuations at frequency ω*n*. Assume that the system has an intrinsic daily oscillator at frequency ω<sup>0</sup> = 1, with time measured in days. How can a system build a control circuit that uses its intrinsic daily oscillator to track slower environmental signals and ignore faster noisy signals?

We can begin by considering circuit designs that follow the cascade in Fig. 2.1b. That cascade is a single direct path from input to output, matching the cascade in Eq. 2.3. That path is an open loop because there is no closed-loop feedback.

Using the components in Fig. 2.1b, the internal oscillator is given by

$$P(s) = \frac{a\alpha}{s^2 + a\_0^2},$$

and the external reference signal is given by

$$R(s) = \frac{\alpha\_e}{s^2 + \alpha\_e^2} + \frac{\alpha\_n}{s^2 + \alpha\_n^2},$$

the sum of one low- and one high-frequency sine wave. From Fig. 2.1b, the design goal seeks to create a preprocess controlling filter, *C*(*s*), that combines with the intrinsic internal oscillator, *P*(*s*), to transform the reference input, *R*(*s*), into an output, *Y* (*s*) ≈ ω*e*/(*s*<sup>2</sup> + ω<sup>2</sup> *<sup>e</sup>* ), that fluctuates at ω*<sup>e</sup>* and ignores ω*n*.

In this case, we know exactly the intrinsic dynamics, *P*(*s*). Thus, we can use the open-loop path in Fig. 2.1b to find a controller, *C*(*s*), such that the transfer function *C*(*s*)*P*(*s*) gives approximately the input–output relation that we seek between *R*(*s*) and *Y* (*s*). For example, by using the controller

$$C(s) = \left(\frac{\alpha\_0}{s + \alpha\_0}\right)^3 \left(\frac{s^2 + \alpha\_0^2}{\alpha\_0}\right),\tag{3.1}$$

the open-loop system becomes

$$L(s) = C(s)P(s) = \left(\frac{\alpha\_0}{s + \alpha\_0}\right)^3,\tag{3.2}$$

because the second term in *C*(*s*) cancels *P*(*s*). The system *L*(*s*) is the low-pass filter in Eq. 2.11 raised the third power. With ω<sup>0</sup> = 1, this system has a Bode plot similar to the blue curve in Fig. 2.2e, f, but because of the exponent in *L*(*s*), the gain falls more quickly at high frequencies and the phase lag is greater.

As with the low-pass filter illustrated in Fig. 2.2, this open-loop system, *L*(*s*), tracks environmental signals at frequency ω*<sup>e</sup>* ω<sup>0</sup> and suppresses noisy signals at frequencyω*<sup>n</sup>* ω0. However, even if we could create this controller over the required range of frequencies, it might turn out that this system is fragile to variations in the parameters.

We could study robustness by using the differential equations to calculate the dynamics for many combinations of parameters. However, such calculations are tedious, and the analysis can be difficult to evaluate for more than a couple of parameters. Using Bode plots provides a much easier way to analyze system response under various conditions.

Suppose, for example, that in the absence of inputs, the internal oscillator, *P*(*s*), actually fluctuates at the frequency ω˜ <sup>0</sup> = ω0. Then, the open-loop system becomes

$$L(s) = \frac{\tilde{\alpha}\_0}{\alpha\_0} \left(\frac{\alpha\_0}{s + \alpha\_0}\right)^3 \left(\frac{s^2 + \alpha\_0^2}{\alpha\_0}\right) \left(\frac{\tilde{\alpha}\_0}{s^2 + \tilde{\alpha}\_0^2}\right),\tag{3.3}$$

in which the first term adjusts the gain to be one at *s* = 0.

The gold curves in Fig. 3.1 show the Bode plot for this open loop, using ω<sup>0</sup> = 1 and ω˜ <sup>0</sup> = 1.2. Note the resonant peak in the upper magnitude plot. That peak occurs when the input frequency matches the natural frequency of the intrinsic oscillator, ω˜ 0. Near that resonant frequency, the system "blows up," because the denominator in the last term, *s*<sup>2</sup> + ˜ω<sup>2</sup> 0, goes to zero as *s* = *j*ω → *j*ω˜ <sup>0</sup> and *s*<sup>2</sup> →−˜ω<sup>2</sup> 0.

In summary, open-loop control works well when one has accurate information. Successful open-loop control is simple and has relatively low cost. However, small variations in the intrinsic process or the modulating controller can cause poor performance or instabilities, leading to system failure.

### **3.2 Feedback Control**

Feedback and feedforward have different properties. Feedforward action is obtained by matching two transfer functions, requiring precise knowledge of the process dynamics, while feedback attempts to make the error small by dividing it by a large quantity.

—Åström and Murray (2008, p. 320)

Feedback often solves problems of uncertainty or noise. Human-designed systems and natural biological systems frequently use feedback control.

Figure 2.1c shows a common form of negative feedback. The output, *y*, is returned to the input. The output is then subtracted from the environmental reference signal, *r*. The new system input becomes the error between the reference signal and the output, *e* = *r* − *y*.

In closed-loop feedback, the system tracks its target reference signal by reducing the error. Any perturbations or uncertainties can often be corrected by system dynamics that tend to move the error toward zero. By contrast, a feedforward open loop has no opportunity for correction. Feedforward perturbations or uncertainties lead to uncorrected errors.

In the simple negative feedback of Fig. 2.1c, the key relation between the openloop system, *L*(*s*) = *C*(*s*)*P*(*s*), and the full closed-loop system, *G*(*s*), is

$$G(\mathbf{s}) = \frac{L(\mathbf{s})}{1 + L(\mathbf{s})}.\tag{3.4}$$

This relation can be derived from Fig. 2.1c by noting that, from the error input, *E*(*s*), to the output, *Y* (*s*), we have *Y* = *L E* and that *E* = *R* − *Y* . Substituting the second equation into the first yields *Y* = *L* (*R* − *Y* ). Solving for the output *Y* relative to the input *R*, which is *G* = *Y*/*R*, yields Eq. 3.4.

The error, *E*, in response to the environmental reference input, *R*, can be obtained by a similar approach, yielding

$$E(s) = \frac{1}{1 + L(s)} R(s). \tag{3.5}$$

If the open loop, *L*(*s*), has a large gain, that gain will divide the error by a large number and cause the system to track closely to the reference signal. A large gain for *L* = *C P* can be achieved by multiplying the controller, *C*, by a large constant, *k*. The large gain causes the system to respond rapidly to deviations from the reference signal.

Feedback, with its powerful error correction, typically provides good performance even when the actual system process, *P*, or controller, *C*, differs from the assumed dynamics. Feedback also tends to correct for various types of disturbances and noise, and can also stabilize an unstable open-loop system.

Feedback has two potential drawbacks. First, implementing feedback may require significant costs for the sensors to detect the output and for the processes that effectively subtract the output value from the reference signal. In electronics, the implementation may be relatively simple. In biology, feedback may require various additional molecules and biochemical reactions to implement sensors and the flow of information through the system. Simple open-loop feedforward systems may be more efficient for some problems.

Second, feedback can create instabilities. For example, when *L*(*s*) → −1, the denominator of the closed-loop system in Eq. 3.4 approaches zero, and the system blows up. For a sinusoidal input, if there is a frequency, ω, at which the magnitude, |*L*(*j*ω)|, is one and the phase is shifted by one-half of a cycle, φ = ±π = ±180◦, then *L*(*j*ω) = −1.

The problem of phase arises from the time lag (or lead) between input and feedback. When the sinusoidal input is at a peak value of one, the output is shifted to a sinusoidal trough value of minus one. The difference between input and output combines in an additive, expansionary way rather than providing an error signal that can shrink toward an accurate tracking process. In general, time delays in feedback can create instabilities.

Instabilities do not require an exact half cycle phase shift. Suppose, for example, that the open loop is

$$L(\mathbf{s}) = \frac{k}{(\mathbf{s}+1)^3}.$$

This system is stable, because its eigenvalues are the roots of the polynomial in the denominator, in this case *s* = −1, corresponding to a strongly stable system. The closed loop has the transfer function

$$G(s) = \frac{L(s)}{1 + L(s)} = \frac{k}{k + (s+1)^3},$$

which has an eigenvalue with real part greater than zero for *k* > 8, causing the system to be unstable. An unstable system tends to explode in magnitude, leading to system failure or death.

### **3.3 Proportional, Integral, and Derivative Control**

Open loop systems cannot use information about the error difference between the target reference input and the actual output. Controllers must be designed based on information about the intrinsic process and the likely inputs.

By contrast, feedback provides information about errors, and controller design focuses primarily on using the error input. Given the error, the controller outputs a new command reference input to the intrinsic system process. Precise knowledge about the intrinsic system dynamics is much less important with feedback because the feedback loop can self-correct.

This section discusses controller design for feedback systems. A controller is a process that modulates system dynamics. For the simplest feedback shown in Fig. 2.1c, we start with an intrinsic process, *P*(*s*), and end up with feedback system dynamics

$$G(s) = \frac{C(s)P(s)}{1 + C(s)P(s)} = \frac{L(s)}{1 + L(s)},$$

in which *C*(*s*) is the controller. The problem is how to choose a process, *C*(*s*), that balances the tradeoffs between various measures of success, such as tracking the reference input and robustness to perturbations and uncertainties.

Figure 3.2a includes two kinds of perturbations. The input *d* describes the load disturbance, representing uncertainties about the internal process, *P*(*s*), and disturbances to that internal process. Traditionally, one thinks of *d* as a relatively lowfrequency perturbation that alters the intrinsic process. The input *n* describes perturbations that add noise to the sensor that measures the process output, η, to yield the final output, *y*. That measured output, *y*, is used for feedback into the system.

To analyze alternative controller designs, it is useful to consider how different controllers alter the open-loop dynamics, *L*(*s*) = *C*(*s*)*P*(*s*). How does a particular change in the controller, *C*(*s*), modulate the intrinsic dynamics, *P*(*s*)?

First, we can simply increase the gain by letting *C*(*s*) = *k <sup>p</sup>* > 1, a method called proportional control. The system becomes *G* = *k <sup>p</sup> P*/(1 + *k <sup>p</sup> P*). For large *k <sup>p</sup>* and positive *P*(*s*), the system transfer function is *G*(*s*) → 1, which means that the system output tracks very closely to the system input. Proportional control can greatly improve tracking at all frequencies. However, best performance often requires tracking low-frequency environmental inputs and ignoring noisy high-frequency inputs from the reference signal. In addition, large *k <sup>p</sup>* values can cause instabilities, and it may be that *P*(*s*) < 0 for some inputs.

**Fig. 3.2** Closed-loop feedback. **a** An extended feedback loop with inputs for disturbance, *d*, and noise, *n*. The function *F*(*s*) may be used to filter the reference input, providing a second degree of freedom in addition to the main controller, *C*(*s*). The system can be divided into intrinsic processes that cannot be adjusted directly and designed processes of control that can be adjusted. Note the inputs for each block: *r* and *y* for the controller, and *u*, *d*, and *n* for the process. **b** In this panel, the blocks *P* and *C* represent the multicomponent process and control blocks from the upper panel. The reference signal is assumed to be zero, allowing one to focus on the roles of disturbance and noise in relation to system stability. **c** An abstraction of the feedback process, in which the vector *y* includes all the signals from the process to the controller, *u* includes all the control input signals to the process, w includes all the extrinsic inputs, and *z* includes any additional signal outputs from the process. Redrawn from Åström and Murray (2008), © Princeton University Press

Second, we can add integral control by including the term*ki* /*s* to the controller.We can understand why this term is an integrator by considering a few steps of analysis that extend earlier equations. Multiplying Eq. 2.5 by 1/*s* increases the denominator's order of its polynomial in *s*. That increase in the exponents of *s* corresponds to an increase in the order of differentiation for each term on the left side of Eq. 2.4, which is equivalent to integrating each term on the right side of that equation. For example, if we start with *x*˙ = *u* and then increase the order of differentiation on the left side, *x*¨ = *u*, this new expression corresponds to the original expression with integration of the input signal, *x*˙ = *u*d*t*.

Integrating the input smooths out high-frequency fluctuations, acting as a filter that passes low-frequency inputs and blocks high-frequency inputs. Integration causes a slower, smoother, and often more accurate adjustment to the input signal. A term such as *a*/(*s* + *a*) is an integrator for large *s* and a pass-through transfer function with value approaching one for small *s*.

Perfect tracking of a constant reference signal requires a pure integrator term, 1/*s*. A constant signal has zero frequency, *s* = 0. To track a signal perfectly, the system transfer function's gain must be one so that the output equals the input. For the simple closed loop in Eq. 3.4, at zero frequency, *G*(0) must be one. The tracking error is 1 − *G* = 1/(1 + *L*). The error goes to zero as the gain of the open loop goes to infinity, *L*(0) → ∞. A transfer function requires a term 1/*s* to approach infinity as *s* goes to zero. In general, high open loop gain leads to low tracking error.

Third, we can add derivative control by including the term *kd s*. We can understand why this term differentiates the input term by following the same steps as for the analysis of integration. Multiplying Eq. 2.5 by *s* increases the numerator's order of its polynomial in *s*. That increase in the exponents of *s* corresponds to an increase in the order of differentiation for each term on the right side of Eq. 2.4. Thus, the original input term, *u*(*t*), becomes the derivative with respect to time, *u*˙(*t*).

Differentiating the input causes the system to respond to the current rate of change in the input. Thus, the system responds to a prediction of the future input, based on a linear extrapolation of the recent trend.

This leading, predictive response enhances sensitivity to short-term, highfrequency fluctuations and tends to block slow, low-frequency input signals. Thus, differentiation acts as a high-pass filter of the input signal. A term such as *s* + *a* multiplies signals by *a* for low-frequency inputs and multiplies signals by the increasing value of *s* + *a* for increasingly high-frequency inputs. Differentiators make systems very responsive, but also enhance sensitivity to noisy high-frequency perturbations and increase the tendency for instability.

A basic proportional, integral, and derivative (PID) controller has the form

$$C(\mathbf{s}) = k\_p + \frac{k\_i}{s} + k\_d \mathbf{s} = \frac{k\_d \mathbf{s}^2 + k\_p \mathbf{s} + k\_i}{s}.\tag{3.6}$$

PID controllers are widely used across all engineering applications. They work reasonably well for many cases, they are relatively easy to understand, and their parameters are relatively easy to tune for various tradeoffs in performance.

### **3.4 Sensitivities and Design Tradeoffs**

Figure 3.2a shows a basic feedback loop with three inputs: the reference signal,*r*, the load disturbance, *d*, and the sensor noise, *n*. How do these different signals influence the error between the reference signal and the system output? In other words, how sensitive is the system to these various inputs?

To derive the sensitivities, define the error in Fig. 3.2a as *r* − η, the difference between the reference input, *r*, and the process output, η (Åström and Murray 2008, Sect. 11.1). To obtain the transfer function between each input and output, we use the rule for negative feedback: The transfer function between the input and output is the open loop directly from the input to the output, *L*, divided by one plus the pathway around the feedback loop, 1 + *L*.

If we assume in Fig. 3.2a that there is no feedforward filter, so that *F* = 1, and we define the main open loop as *L* = *C P*, then the output η in response to the three inputs is

$$
\eta = \frac{L}{1+L}r + \frac{P}{1+L}d - \frac{L}{1+L}n,\tag{3.7}
$$

in which each term is the open loop between the input signal and the output, η, divided by one plus the pathway around the full loop, *L*. If we define

$$S = \frac{1}{1+L} \qquad \qquad T = \frac{L}{1+L} \qquad \qquad S + T = 1,\tag{3.8}$$

with *S* as the sensitivity function and *T* as the complementary sensitivity function, then the error is

$$r - \eta = Sr - PSd + Tn.\tag{3.9}$$

This expression highlights the fundamental design tradeoffs in control that arise because *S* + *T* = 1. If we reduce *T* and the sensitivity to noise, we increase *S*. An increase in *S* raises the error in relation to the reference signal, *r*, and the error in relation to the load disturbance, *d*. If we reduce *S*, we increase *T* and the sensitivity to noise, *n*. These sensitivity tradeoffs suggest two approaches to design.

First, the sensitivities *S*(*s*) and *T* (*s*) depend on the input, *s*. Thus, we may adjust the tradeoff at different inputs. For example, we may consider inputs, *s* = *j*ω, at various frequencies, ω. Sensor noise, *n*, often arises as a high frequency disturbance, whereas the reference input, *r*, and the load disturbance, *d*, often follow a low frequency signal. If so, then we can adjust the sensitivity tradeoff to match the common input frequencies of the signals. In particular, at low frequency for which *r* and *d* dominate, we may choose low *S* values whereas, at high frequency for which *n* dominates, we may choose low *T* values.

Second, we may add an additional control process that alters the sensitivity tradeoff. For example, we may use the feedforward filter, *F*, in Fig. 3.2a, to modulate the reference input signal. With that filter, the transfer function from the input, *r*, to the error output, *r* − η, becomes 1 − *F T* . If we know the form of *T* with sufficient precision, we can choose *F T* ≈ 1, and thus we can remove the sensitivity of the error to the reference input.

Note that adjusting the tradeoff between *S* and *T* only requires an adjustment to the loop gain, *L*, which usually does not require precise knowledge about the system processes. By contrast, choosing *F* to cancel the reference input requires precise information about the form of *T* and the associated system processes. In other words, feedback is relatively easy and robust because it depends primarily on adjusting gain magnitude, whereas feedforward requires precise knowledge and is not robust to misinformation or perturbation.

#### 3.4 Sensitivities and Design Tradeoffs 27

**Open Access** This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.

The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.

# **Chapter 4 PID Design Example**

I illustrate the principles of feedback control with an example. We start with an intrinsic process

$$P(\mathbf{s}) = \left(\frac{a}{s+a}\right)\left(\frac{b}{s+b}\right) = \frac{ab}{(s+a)(s+b)}.$$

This process cascades two exponential decay systems, each with dynamics as in Eq. 2.8 and associated transfer function as in Eq. 2.9. For example, if the input into this system is a unit impulse at time zero, then the system output is

$$\mathbf{y}(t) = \frac{ab}{b-a} \left( e^{-at} - e^{-bt} \right),$$

expressing the cascade of two exponentially decaying processes.

For this example, we use

$$P(\mathbf{s}) = \frac{1}{(\mathbf{s} + 0.1)(\mathbf{s} + 10)}\tag{4.1}$$

as the process. We also consider an alternative process

$$\tilde{P}(s) = \frac{1}{(s + 0.01)(s + 100)}.\tag{4.2}$$

We assume during system analysis and design that Eq. 4.1 describes the process, but in fact Eq. 4.2 is actually the true process. Put another way, the difference between the two processes may reflect uncertain information about the true process or unknown disturbances that alter the process. Thus, we may consider how a system performs

**Fig. 4.1** Response of the system output, η = *y*, to a sudden unit step increase in the reference input, *r*, in the absence of disturbance and noise inputs, *d* and *n*. The *x*-axis shows the time, and the *y*-axis shows the system output. **a** Response of the original process, *P*(*s*), in Eq. 4.1 (blue curve) and of the process with altered parameters, *P*˜(*s*) in Eq. 4.2 (gold curve). **b** System with the PID controller embedded in a negative feedback loop, with no feedforward filter, *F*(*s*) = 1, as in Fig. 3.2a. **c** PID feedback loop with feedforward filter, *F*, in Eq. 4.4

when it was designed, or evolved, in response to a process, *P*, and the underlying system becomes *P*˜.

In this example, the problem concerns the design of a negative feedback loop, as in Fig. 3.2a, that uses a controller with proportional, integral, and derivative (PID) action. Many methods derive PID controllers by tuning the various sensitivity and performance tradeoffs (Åström and Hägglund 2006; Garpinger et al. 2014).

I obtained the parameters for the PID controller in Eq. 3.6 by using the Ziegler– Nichols method in Mathematica, yielding

$$C(s) = \frac{6s^2 + 121s + 606}{s}.\tag{4.3}$$

I also used Mathematica to calculate the feedforward filter in Fig. 3.2a, yielding

$$F(s) = \frac{s^2 + 10.4s + 101}{s^2 + 20.2s + 101}.\tag{4.4}$$

### **4.1 Output Response to Step Input**

Figure 4.1 illustrates various system responses to a unit step increase from zero to one in the reference input signal,*r*. Panel (a) shows the response of the base process, *P*, by itself. The blue curve is the double exponential decay process of Eq. 4.1. That process responds slowly because of the first exponential process with time decay *a* = 0.1, which averages inputs over a time horizon with decay time 1/*a* = 10, as in Eq. 2.8. The gold curve, based on Eq. 4.2, rises even more slowly, because that alternative process, *P*˜, has an even longer time horizon for averaging inputs of 1/*a* = 100.

Panel (b) shows the response of the full feedback loop of Fig. 3.2a with the PID controller in Eq. 4.3 and no feedforward filter, *F* = 1. Note that the system responds much more rapidly, with a much shorter time span over the *x*-axis than in (a). The rapid response follows from the very high gain of the PID controller, which strongly amplifies low-frequency inputs.

The PID controller was designed to match the base process *P* in Eq. 4.1, with response in blue. When the actual base process deviates as in *P*˜ of Eq. 4.2, the response is still reasonably good, although the system has a greater overshoot upon first response and takes longer to settle down and match the reference input. The reasonably good response in the gold curve shows the robustness of the PID feedback loop to variations in the underlying process.

Panel (c) shows the response of the system with a feedforward filter, *F*, from Eq. 4.4. Note that the system in blue with the base process, *P*, improves significantly, with lower overshoot and less oscillation when settling to match the reference input. By contrast, the system in gold with the alternative base process, *P*˜, changes its response very little with the additional feedforward filter. This difference reflects the fact that feedforward works well only when one has very good knowledge of the underlying process, whereas feedback works broadly and robustly with respect to many kinds of perturbations.

### **4.2 Error Response to Noise and Disturbance**

Figure 4.2 illustrates the system error in response to sensor noise, *n*, and process disturbance, *d*. Panel (a) shows the error in response to a unit step change in *n*, the input noise to the sensor. That step input to the sensor creates a biased measurement, *y*, of the system output, η. The biased measured value of *y* is fed back into the control loop. A biased sensor produces an error response that is equivalent to the output response for a reference signal. Thus, Fig. 4.2a matches Fig. 4.1b.

Panel (b) shows the error response to an impulse input at the sensor. An impulse causes a brief jolt to the system. The system briefly responds by a large deviation from its setpoint, but then returns quickly to stable zero error, at which the output matches the reference input. An impulse to the reference signal produces an equivalent deviation in the system output but with opposite sign.

The error response to process disturbance in panels (c) and (d) demonstrates that the system strongly rejects disturbances or uncertainties to the intrinsic system process.

**Fig. 4.2** Error response,*r* − η, of the PID feedback loop to sensor noise, *n*, or process disturbance, *d*, from Eq. 3.9. Blue curve for the process, *P*, in Eq. 4.1 and gold curve for the altered process, *P*˜, in Eq. 4.2. **a** Error response to sensor noise input, *n*, for a unit step input and **b** for an impulse input. **c** Error response to process disturbance input, *d*, for a unit step input and **d** for an impulse input. An impulse is *u*(*t*)d*t* = 1 at *t* = 0 and *u*(*t*) = 0 at all other times. The system responses in gold curves reflect the slower dynamics of the altered process. If the altered process had faster intrinsic dynamics, then the altered process would likely be more sensitive to noise and disturbance

**Fig. 4.3** System response output, η = *y*, to sine wave reference signal inputs, *r*. Each column shows a different frequency, ω. The rows are (Pr) for reference inputs into the original process, *P* or *P*˜, without a modifying controller or feedback loop, and (Rf) for reference inputs into the closed-loop feedback system with the PID controller in Eq. 4.3. The green curve shows the sine wave input. The blue curve shows systems with the base process, *P*, from Eq. 4.1. The gold curve shows systems with the altered process, *P*˜, from Eq. 4.2. In the lower left panel, all curves overlap. In the lower panel at ω = 1, the green and blue curves overlap. In the two upper right panels, the blue and gold curves overlap near zero

### **4.3 Output Response to Fluctuating Input**

Figure 4.3 illustrates the system output in response to fluctuating input (green). The top row shows the output of the system process, either *P* (blue) or *P*˜ (gold), alone in an open loop. The system process is a cascade of two low-pass filters, which pass low-frequency inputs and do not respond to high-frequency inputs.

The upper left panel shows the response to the (green) low-frequency input, ω = 0.1, in which the base system *P* (blue) passes through the input with a slight reduction in amplitude and lag in phase. The altered system *P*˜ (gold) responds only weakly to the low frequency of ω = 0.1, because the altered system has slower response characteristics than the base system. At a reduced input frequency of ω = 0.01 (not shown), the gold curve would match the blue curve at ω = 0.1. As frequency increases along the top row, the processes *P* and *P*˜ block the higher-frequency inputs.

The lower row shows the response of the full PID feedback loop system. At a low frequency of ω ≤ 0.1, the output tracks the input nearly perfectly. That close tracking arises because of the very high gain amplification of the PID controller at low frequency, which reduces the system tracking error to zero, as in Eq. 3.5.

At a higher frequency ofω = 10, the system with the base process *P* responds with a resonant increase in amplitude and a lag in phase. The slower altered process, *P*˜, responds only weakly to input at this frequency. As frequency continues to increase, both systems respond weakly or not at all.

The system response to sensor noise would be of equal magnitude but altered sign and phase, as shown in Eq. 3.7.

Low-frequency tracking and high-frequency rejection typically provide the greatest performance benefit. The environmental references that it pays to track often change relatively slowly, whereas the noisy inputs in both the reference signal and in the sensors often fluctuate relatively rapidly.

### **4.4 Insights from Bode Gain and Phase Plots**

Figure 4.4 provides more general insight into the ways in which PID control, feedback, and input filtering alter system response.

Panels (a) and (b) show the Bode gain and phase responses for the intrinsic system process, *P* (blue), and the altered process, *P*˜ (gold). Low-frequency inputs pass through. High-frequency inputs cause little response. The phase plot shows that these processes respond slowly, lagging the input. The lag increases with frequency.

Panels (c) and (d) show the responses for the open loop with the PID controller, *C*, combined with the process, *P* or *P*˜, as in Fig. 2.1b. Note the very high gain in panel (c) at lower frequencies and the low gain at high frequencies.

**Fig. 4.4** Bode gain (top) and phase (bottom) plots for system output, η = *y*, in response to reference input, *r*, in the absence of load disturbance and sensor noise. Blue curves for systems with the base process, *P*, in Eq. 4.1. Gold curves for systems with the altered process, *P*˜, in Eq. 4.2. **a**, **b** The original unmodified process, *P* or *P*˜, with no controller or feedback. **c**, **d** The open loop with no feedback,*C P* or*C P*˜, with the PID controller,*C*, in Eq. 4.3. **e**, **f** The closed loop with no feedforward filter, *F* = 1. **g**, **h** The closed loop with the feedforward filter, *F*, in Eq. 4.4

PID controllers are typically designed to be used in closed-loop feedback systems, as in Fig. 2.1c. Panels (e) and (f) illustrate the closed-loop response. The high openloop gain of the PID controller at low frequency causes the feedback system to track the reference input closely. That close tracking matches the log(1) = 0 gain at low frequency in panel (e). Note also the low-frequency phase matching, or zero phase lag, shown in panel (f), further demonstrating the close tracking of reference inputs. At high frequency, the low gain of the open-loop PID controller shown in panel (c) results in the closed-loop rejection of high-frequency inputs, shown as the low gain at high frequency in panel (e).

Note the resonant peak of the closed-loop system in panel (e) near ω = 10 for the blue curve and at a lower frequency for the altered process in the gold curve. Note also that the altered process, *P*˜, in gold, retains the excellent low-frequency tracking and high-frequency input rejection, even though the controller was designed for the base process, *P*, shown in blue. The PID feedback loop is robust to differences in the underlying process that varies from the assumed form of *P*.

Panels (g) and (h) show the PID closed-loop system with a feedforward filter, *F*, as in Fig. 3.2a. The feedforward filter smooths out the resonant peak for the blue curve, so that system does not amplify inputs at resonant frequencies. Amplified resonant inputs may lead to instabilities or poor system performance. Note that the feedforward filter does not have much effect on the altered process in gold. Feedforward modifiers of a process typically work well only for a specific process. They often do not work robustly over a variant range of processes.

### **4.5 Sensitivities in Bode Gain Plots**

Figure 4.5 illustrates the sensitivities of the system error output,*r* − η, to inputs from the reference, *r*, sensor noise, *n*, and load disturbance, *d*, signals, calculated from Eq. 3.9. Figure 3.2a shows the inputs and loop structure.

The blue curve of panel (a) shows the error sensitivity to the reference input. That sensitivity is approximately the mirror image of the system output response to the reference input, as shown in Fig. 4.4e (note the different scale). The duality of the error response and the system response arises from the fact that the error is *r* − η, and the system response is η.

Perfect tracking means that the output matches the input, *r* = η. Thus, a small error corresponds to a low gain of the error in response to input, as occurs at low frequency for the blue curve of Fig. 4.5a. In the same way, a small error corresponds to a gain of one for the relation between the reference input,*r*, and the system output, η, as occurs at low frequency for the blue curve of Fig. 4.4e.

The noise sensitivity in the green curve of Fig. 4.5a shows that the system error is sensitive to low-frequency bias in the sensor measurements, *y*, of the system output, η. When the sensor produces a low-frequency bias, that bias feeds back into the system and creates a bias in the error estimate, thus causing an error mismatch between the reference input and the system output. In other words, the system is sensitive to errors when the sensor suffers low-frequency perturbations. The PID system rejects high-frequency sensor noise, leading to the reduced gain at high frequency illustrated by the green curve.

The disturbance load sensitivity in the red curve of Fig. 4.5a shows the low sensitivity of this PID feedback system to process variations.

This PID feedback system is very robust to an altered underlying process, as shown in earlier figures. Here, Fig. 4.5b illustrates that robustness by showing the relatively minor changes in system sensitivities when the underlying process changes

**Fig. 4.5** Bode gain plots for the error output, *r* − η, in response to reference input, *r* (blue), sensor noise, *n* (green), and load disturbance, *d* (red), from Eq. 3.9. The systems are the full PID-controlled feedback loops as in Fig. 3.2a, with no feedforward filter. The PID controller is given in Eq. 4.3. **a** System with the base process, *P*, from Eq. 4.1. **b** System with the altered process, *P*˜, from Eq. 4.2

from *P* to *P*˜. However, other types of change to the underlying process may cause greater changes in system performance. Robustness depends on both the amount of change and the kinds of change to a system.

**Open Access** This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.

The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.

# **Chapter 5 Performance and Robustness Measures**

A theory of design tradeoffs requires broadly applicable measures of cost, performance, stability, and robustness. For example, the PID controller in the previous example performs reasonably well, but we ignored costs. That PID controller achieved good tracking performance by using high gain amplification of lowfrequency input signals. High gain in a negative feedback loop quickly drives the error to zero.

High gain has two potential problems. First, high signal amplification may require excessive energy in physical or biological systems. We must consider those costs for a high gain controller.

Second, high gain can cause system instability, with potential for system failure. We must consider the tradeoff between the benefits of high gain and the loss of robustness against perturbations or uncertainties in system dynamics.

Beyond the simple PID example, we must consider a variety of tradeoffs in performance and robustness (Zhou and Doyle 1998; Qiu and Zhou 2010). Earlier, I discussed tradeoffs in system sensitivities to disturbance and noise. I also presented qualitative descriptions of system performance in terms of response time and tracking performance.

To advance the theory, we need specific measures of cost, performance, stability and robustness. We also need techniques to find optimal designs in relation to those conflicting measures of system attributes.

We will never find a perfect universal approach.  Nonetheless, basic measures and simple optimization methods provide considerable insight into the nature of design. Those insights apply both to the building of human-designed systems to achieve engineering goals and to the interpretation and understanding of naturally designed biological systems built by evolutionary processes.

# **5.1 Performance and Cost:** *J*

To analyze performance, we must measure the costs and benefits associated with a particular system. We often measure those costs and benefits by the distance between a system's trajectory and some idealized trajectory with zero cost and perfect performance.

Squared deviations provide a distance measure between the actual trajectory and the idealized trajectory. Consider, for example, the control signal, *u*(*t*), which the controller produces to feed into the system process, as in Fig. 2.1c.

The value of |*u*(*t*)| <sup>2</sup> = *u*<sup>2</sup> measures the magnitude of the signal as a squared distance from zero. We can think of *u*<sup>2</sup> as the instantaneous power of the control signal. Typically, the power requirements for control are a cost to be minimized.

The square of the error output signal, |*e*(*t*)| <sup>2</sup> = *e*2, measures the distance of the system from the ideal performance of *e* = 0. Minimizing the squared error maximizes performance. Thus, we may think of performance at any particular instant, *t*, in terms of the cost function

$$
\mathcal{J}(t) = \mu^2 + \rho^2 e^2,
$$

for which minimum cost corresponds to maximum performance. Here, ρ is a weighting factor that determines the relative value of minimizing the control signal power, *u*2, versus minimizing the tracking error, *e*2.

Typically, we measure the cost function over a time interval. Summing up *J* (*t*) continuously from *t* = 0 to *T* yields

$$\mathcal{J} = \int\_0^T (\mu^2 + \rho^2 e^2) \mathrm{d}t. \tag{5.1}$$

Most squared distance or quadratic performance analyses arise from extensions of this basic equation. Given this measure, optimal design trades off minimizing the energy cost to drive the system versus maximizing the benefit of tracking a target goal.

# **5.2 Performance Metrics: Energy and** *H***<sup>2</sup>**

The cost measure in Eq. 5.1 analyzes signals with respect to time. It is natural to think of inputs and outputs as changing over time. With temporal dynamics, we can easily incorporate multivariate signals and nonlinearities. In spite of those advantages, we often obtain greater insight by switching to a frequency analysis of signals, as in the previous chapters.

In this section, I present alternative measures of cost and performance in terms of transfer functions and complex signals. Those alternative measures emphasize frequencies of fluctuations rather than changes through time. Frequency and complex analysis allow us to take advantage of transfer functions, Bode plots, and other powerful analytical tools that arise when we assume linear dynamics.

The assumption of linearity does not mean that we think the actual dynamics of physical and biological processes are linear. Instead, starting with the linear case provides a powerful way in which to gain insight about dynamics.

In the previous section, we considered how to measure the magnitude of fluctuating control and error signals. A magnitude that summarizes some key measure is often called a *norm*. In the prior section, we chose the sum of squared deviations from zero, which is related to the 2–norm of a signal

$$\|\mu(t)\|\_{2} = \left(\int\_{0}^{\infty} |\mu(t)|^{2} dt\right)^{1/2}.\tag{5.2}$$

The energy of the signal is the square of the 2–norm, *u*(*t*)-2 2. When the time period in the cost function of Eq. 5.1 goes to infinity, *T* → ∞, we can write the cost function as

$$\mathcal{J} = \|\mu(t)\|\_2^2 + \rho^2 \|e(t)\|\_2^2. \tag{5.3}$$

The signal *u*(*t*) is a function of time. The associated transfer function *U*(*s*) describes exactly the same signal, but as a function of the complex number, *s*, rather than of time, *t*.

It is often much easier to work with the transfer function for analysis, noting that we can go back and forth between time and transfer function descriptions. For the analysis of squared distance metrics, the 2–norm of the transfer function expression is

$$\|U(s)\|\_{2} = \left(\frac{1}{2\pi} \int\_{-\infty}^{\infty} |U(j\omega)|^{2} \mathrm{d}\omega\right)^{1/2}.\tag{5.4}$$

This transfer function 2–norm is often referred to as the *H*<sup>2</sup> norm. The term |*U*(*j*ω)| 2 is the square of the Bode gain or magnitude, as in Fig. 2.2e. That gain describes the amplification of a sinusoidal input at frequencyω. The*H*<sup>2</sup> norm expresses the average amplification of input signals over all input frequencies.

If the goal is to minimize the control input signal, *u*, or the error deviation from zero, *e*, then the greater the amplification of a signal, the greater the cost. Thus, we can use the *H*<sup>2</sup> norm to define an alternative cost function as

$$\mathcal{J} = \|U(\mathbf{s})\|\_2^2 + \rho^2 \|E(\mathbf{s})\|\_2^2,\tag{5.5}$$

which leads to methods that are often called *H*<sup>2</sup> analysis. This cost describes the amplification of input signals with respect to control and error outputs when averaged overall input frequencies. Minimizing this cost reduces the average amplification of input signals.

If the energy 2–norm in Eq. 5.2 is finite, then the energy 2–norm and the *H*<sup>2</sup> norm are equivalent, *u*(*t*)-<sup>2</sup> = -*U*(*s*)-2, and we can use Eqs. 5.3 and 5.5 interchangeably. Often, it is more convenient to work with the transfer function form of the *H*<sup>2</sup> norm.

We can use any combination of signals in the cost functions. And we can use different weightings for the relative importance of various signals. Thus, the cost functions provide a method to analyze a variety of tradeoffs.

# **5.3 Technical Aspects of Energy and** *H***<sup>2</sup> Norms**

I have given three different cost functions. The first in Eq 5.1 analyzes temporal changes in signals, such as *u*(*t*), over a finite time interval. That cost function is the most general, in the sense that we can apply it to any finite signals. We do not require assumptions about linearity or other special attributes of the processes that create the signals.

The second function in Eq. 5.3 measures cost over an infinite time interval and is otherwise identical to the first measure. Why consider the unrealistic case of infinite time?

Often, analysis focuses on a perturbation that moves a stable system away from its equilibrium state. As the system returns to equilibrium, the error and control signals go to zero. Thus, the signals have positive magnitude only over a finite time period, and the signal energy remains finite. As noted above, if the energy 2–norm is finite, then the energy 2–norm and the *H*<sup>2</sup> norm are equivalent, and the third cost function in Eq. 5.5 is equivalent to the second cost function in Eq. 5.3.

If the signal energy of the second cost function in Eq. 5.3 is infinite, then that cost function is not useful. In an unstable system, the error often grows with time, leading to infinite energy of the error signal. For example, the transfer function 1/(*s* − 1) has temporal dynamics given by *y*(*t*) = *y*(0)*e<sup>t</sup>* , growing exponentially with time. The system continuously amplifies an input signal, creating instability and an output signal with infinite energy.

When the energy is infinite, the *H*<sup>2</sup> norm may remain finite. For the transfer function 1/(*s* − 1), the *H*<sup>2</sup> norm is 1/ <sup>√</sup>2. The average amplification of signals remains finite. In general, for a transfer function, *G*(*s*), the *H*<sup>2</sup> norm remains finite as long as *G*(*j*ω) does not go to infinity for any value of ω, and *G*(*j*ω) → 0 as ω → ±∞. Thus, the *H*<sup>2</sup> norm cost in Eq. 5.5 can be used in a wider range of applications.

The *H*<sup>2</sup> norm is related to many common aspects of signal processing and time series analysis, such as Fourier analysis, spectral density, and autocorrelation.

# **5.4 Robustness and Stability:** *H***<sup>∞</sup>**

A transfer function for a system, *G*(*s*), defines the system's amplification of input signals. For a sinusoidal input at frequency ω, the amplification, or gain, is the absolute value of the transfer function at that frequency, |*G*(*j*ω)|.

Often, the smaller a system's amplification of inputs, the more robust the system is against perturbations. Thus, one common optimization method for designing controllers seeks to minimize a system's greatest amplification of inputs. Minimizing the greatest amplification guarantees a certain level of protection against the worst case perturbation. In some situations, one can also guarantee that a system is stable if its maximum signal amplification is held below a key threshold.

A system's maximum amplification of sinusoidal inputs over all input frequencies, ω, is called its *H*<sup>∞</sup> norm. For a system *G*(*s*), the *H*<sup>∞</sup> norm is written as -*G*(*s*)-∞. The norm describes the maximum of |*G*(*j*ω)| over all ω. The maximum is also the peak gain on a Bode magnitude plot, which is equivalent to the resonance peak.

System stability and protection against perturbations set two fundamental criteria for system design. Thus, *H*<sup>∞</sup> methods are widely used in the engineering design of controllers and system architectures (Zhou and Doyle 1998).

**Open Access** This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.

The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.

# **Part II Design Tradeoffs**

Many performance tradeoffs occur. A system that responds quickly to control signals often suffers from sensitivity to perturbations. A more rapid response also associates with a greater tendency toward instability.

Design of a control system by an engineer must balance the competing dimensions of performance. Similarly, design of biological systems by evolutionary processes implicitly balances the different dimensions of success. In engineering, we can specify performance criteria. In biology, we must figure out how natural processes set the relative importance of different performance measures.

Once we have a set of performance criteria, how do we find the control architectures and parameters that perform well? If we do not have formal design methods, then we end up with ad hoc solutions. Such solutions may perform well. But we do not have any way to know if there are better solutions or better ways to formulate the design criteria.

Ideally, we would have an optimization method that provided the best solution for a given problem and a given set of performance criteria. Optimization forces us to specify the problem with clarity. We must write down exactly the performance criteria, the nature of the problem, and all associated assumptions. We then get an answer about whether there is a best design for the given assumptions or a set of comparable alternative designs.

Optimization is, of course, only as good as the assumptions that we make. In engineering, we may be able to specify design criteria clearly. Or, at least, we can experiment with various criteria and examine the alternative optimal designs.

In biology, figuring out the appropriate assumptions and constraints that express natural evolutionary processes can be very difficult. We may make some progress by trying different assumptions as hypotheses about the natural design process. We can then test the match between the optimal solutions and what we actually see in nature (Parker and Maynard Smith 1990).

Design by optimization must begin with performance criteria. Three kinds of performance criteria dominate in typical engineering applications.

Regulation, or homeostasis, concerns aspects of design that return a system to its setpoint. Good regulation requires insensitivity to perturbations. If the system does get pushed away from its setpoint, a well regulated system rapidly returns to its equilibrium. Tradeoffs arise between the responses to different kinds of perturbations.

Stabilization concerns aspects of design that protect against instability. An unstable system may lead to failure or death. Often, the primary design goal is to protect against instability.

Tracking concerns how well the system follows changes in environmental or reference input signals. A system that rapidly adjusts to changes may track closely to reference inputs but may suffer from sensitivity to perturbations or instability.

The next sections briefly illustrate these concepts. I use modified examples from the excellent article by Qiu and Zhou (2013).

# **Chapter 6 Regulation**

The regulation problem analyzes how quickly a perturbed system returns to its equilibrium setpoint. For this problem, we assume that the setpoint does not change. We can, without loss of generality, assume that the external reference signal is *r* = 0.

With no external reference signal, we can express the general form of the regulation problem as in Fig. 6.1. We take the process, *P*, as given, subject to uncertainties or disturbances represented by the input, *d*. We seek an optimal controller, *C*, with respect to particular design tradeoffs.

### **6.1 Cost Function**

The cost function summarizes the design tradeoffs. We use a cost function based on the *H*<sup>2</sup> norm, similar to Eq. 5.5. The *H*<sup>2</sup> norm describes the response of the system to perturbations when averaged over all input frequencies. Minimizing the *H*<sup>2</sup> norm minimizes the extent to which the system responds to perturbations. Recall that the *H*<sup>2</sup> norm is often equivalent to the signal energy, which is the total squared deviation of a signal from zero when measured from the time of an initial perturbation until the time when the signal returns to zero.

From Fig. 6.1, the two inputs are the load disturbance, *d*, and the sensor noise, *n*. The two outputs are the process output, η, and the control signal, *u*. We can write the outputs as transfer functions, η(*s*) and *U*(*s*), and the cost function in Eq. 5.5 as

$$\mathcal{J} = ||U(\mathbf{s})||\_2^2 + \rho^2||\eta(\mathbf{s})||\_2^2.$$

In this case, we need to relate each of the two outputs to each of the two inputs. We require four transfer functions to describe all of the input–output connections. For the transfer function between the input *d* and the output η, we write *G*η*<sup>d</sup>* (*s*), for

**Fig. 6.1** Classic regulation problem illustrated by closed-loop feedback with a constant reference input signal,*r* = 0. The disturbance input, *d*, perturbs the system process. Such perturbations can be considered as stochasticity in the process, or as uncertainty with regard to the true process dynamics relative to the assumed dynamics. The noise input, *n*, perturbs the sensor that produces the output measurement, *y*, based on the actual process output, η. See Fig. 3.2 for context

which we assume that the other input, *n*, is zero. Using our usual rule for the transfer functions of a closed loop, the four functions are

$$G\_{ud} = \frac{-PC}{1 + PC} \qquad \qquad \qquad G\_{\eta d} = \frac{P}{1 + PC}$$

$$G\_{un} = \frac{-C}{1 + PC} \qquad \qquad \qquad G\_{\eta u} = \frac{-PC}{1 + PC} . \tag{6.1}$$

We can express these transfer functions in terms of the sensitivities in Eq. 3.8 by defining the open loop as *L* = *PC*, the sensitivity as *S* = 1/(1 + *L*), and the complementary sensitivity as *T* = *L*/(1 + *L*), yielding

$$G\_{ud} = -T \qquad\qquad\qquad G\_{\eta d} = PS$$

$$G\_{\eta n} = -CS \qquad\qquad\qquad G\_{\eta n} = -T.\tag{6.2}$$

Because *S* + *T* = 1 at any input, *s*, these transfer functions highlight the intrinsic design tradeoffs.

We can now consider the total cost as the sum of the response with respect to the input *d*, holding *n* at zero, plus the response with respect to the input *n*, holding *d* at zero

$$\mathcal{J} = ||G\_{ud}(\mathbf{s})||\_2^2 + \rho^2 ||G\_{\eta d}(\mathbf{s})||\_2^2$$

$$+ ||G\_{un}(\mathbf{s})||\_2^2 + \rho^2 ||G\_{\eta n}(\mathbf{s})||\_2^2. \tag{6.3}$$

For this example, we use impulse function inputs, δ(*t*), which provide a strong instantaneous shock to the system, as defined in the caption of Fig. 4.2. We can design the system to be relatively more or less sensitive to disturbance inputs relative to noise inputs by weighting the disturbance input byμ, so that *d*(*t*) = μδ(*t*) and *n*(*t*) = δ(*t*). Larger μ causes design by optimization to yield better disturbance regulation at the expense of worse noise regulation.

#### 6.1 Cost Function 47

The transfer function for an impulse is equal to one. Thus, the transfer functions for disturbance and noise inputs are, respectively, *D*(*s*) = μ and *N*(*s*) = 1. A system's response to an input is simply the product of the input and the system transfer function. For example, the first term in Eq. 6.3 becomes

$$||D(\mathbf{s})G\_{ud}(\mathbf{s})||\_2^2 = \mu^2||G\_{ud}(\mathbf{s})||\_2^2,$$

and the full cost function becomes

$$\mathcal{L} = \mu^2 ||G\_{ud}(\mathbf{s})||\_2^2 + \mu^2 \rho^2 ||G\_{\eta d}(\mathbf{s})||\_2^2$$

$$+ ||G\_{un}(\mathbf{s})||\_2^2 + \rho^2 ||G\_{\eta u}(\mathbf{s})||\_2^2. \tag{6.4}$$

Using the sensitivity expressions in Eq. 6.2, we can write this expression more simply as

$$\mathcal{J} = ||CS||\_2^2 + (\mu^2 + \rho^2)||T||\_2^2 + \mu^2 \rho^2 ||PS||\_2^2. \tag{6.5}$$

### **6.2 Optimization Method**

This section follows Qiu and Zhou's (2013) optimization algorithm. Their cost function in the final equation on page 31 of their book is equivalent to my cost function in Eq. 6.4.

Optimization finds the controller, *C*(*s*), that minimizes the cost function. We search for optimal controllers subject to the constraint that all transfer functions in Eq. 6.1 are stable. Stability requires that the real component be negative for all eigenvalues of each transfer function.

A transfer function's eigenvalues are the roots of the denominator's polynomial in *s*. For each transfer function in Eq. 6.1, the eigenvalues, *s*, are obtained by solution of 1 + *P*(*s*)*C*(*s*) = 0.

We assume a fixed process, *P*, and weighting coefficients, μ and ρ. To find the optimal controller, we begin with a general form for the controller, such as

$$C(\mathbf{s}) = \frac{q\_1 \mathbf{s} + q\_2}{p\_0 \mathbf{s}^2 + p\_1 \mathbf{s} + p\_2}. \tag{6.6}$$

We seek the coefficients *p* and *q* that minimize the cost function.

Qiu and Zhou (2013) solve the example in which *P*(*s*) = 1/*s*2, for arbitrary values of μ and ρ. The accompanying Mathematica code describes the steps in the solution algorithm. Here, I simply state the solution. Check the article by Qiu and Zhou (2013) and my Mathematica code for the details and for a starting point to apply the optimization algorithm to other problems. The following section applies this method to another example and illustrates the optimized system's response to various inputs.

For *P* = 1/*s*2, Qiu and Zhou (2013) give the optimal controller

$$C(\mathbf{s}) = \frac{\sqrt{2\rho\mu}\left(\sqrt{\rho} + \sqrt{\mu}\right)\mathbf{s} + \rho\mu}{\mathbf{s}^2 + \sqrt{2}\left(\sqrt{\rho} + \sqrt{\mu}\right)\mathbf{s} + \left(\sqrt{\rho} + \sqrt{\mu}\right)^2},$$

with associated minimized cost,

$$\mathcal{J}^\* = \sqrt{2} \left[ \mu^2 \sqrt{\rho} + \rho^2 \sqrt{\mu} + 2\rho\mu \left( \sqrt{\mu} + \sqrt{\rho} \right) \right].$$

For ρ = 1, the controller becomes

$$C(\mathbf{s}) = \frac{\sqrt{2\mu}\left(1 + \sqrt{\mu}\right)\mathbf{s} + \mu}{\mathbf{s}^2 + \sqrt{2}\left(1 + \sqrt{\mu}\right)\mathbf{s} + \left(1 + \sqrt{\mu}\right)^2},\tag{6.7}$$

with associated minimized cost,

$$\mathcal{I}^\* = \sqrt{2} \left[ \mu^2 + \sqrt{\mu} + 2\mu(\sqrt{\mu} + 1) \right].$$

We can see the tradeoffs in design most clearly from the controller with ρ = 1. When μ is small, load disturbance inputs are smaller than sensor noise inputs. An optimal system should therefore tolerate greater sensitivity to load disturbances in return for reduced sensitivity to sensor noise.

In the optimal controller described by Eq. 6.7, a small value of μ produces low gain, because *C*(*s*) becomes smaller as μ declines. We can see from Eq. 6.1 that a small gain for the controller, *C*, reduces the sensitivity to noise inputs by lowering *Gun* and *G*η*<sup>n</sup>*. Similarly, a small gain for *C* raises the sensitivity of the system output, η, to disturbance inputs by raising *G*η*<sup>d</sup>* .

The optimal system achieves the prescribed rise in sensitivity to disturbance in order to achieve lower sensitivity to noise.

### **6.3 Resonance Peak Example**

This section applies the previous section's *H*<sup>2</sup> optimization method to the process

$$P(s) = \frac{1}{s^2 + 0.1s + 1}.\tag{6.8}$$

This process has a resonance peak near ω = 1.

My supplemental Mathematica code derives the optimal controller of the form in Eq. 6.6. The optimal controller is expressed in terms of the cost weightings μ and ρ. The solution has many terms, so there is no benefit in showing it here.

**Fig. 6.2** Relative *H*<sup>2</sup> values for the transfer functions in Eq. 6.1, with *Gud* = *G*η*<sup>n</sup>* in red, *G*η*<sup>d</sup>* in gold, and *Gun* in green. The *H*<sup>2</sup> value for each transfer function is divided by the total *H*<sup>2</sup> values over all four functions. The transfer functions were derived from the process in Eq. 6.8 and the associated optimal controller. The weighting parameters in the cost function of Eq. 6.4 are μ = 1 and ρ varying along the *x*-axis of the plot. Swapping values of μ and ρ gives identical results, because of the symmetries in Eqs. 6.1 and 6.4

The general solution in terms of μ and ρ provides a simple way in which to obtain the optimal controller for particular values of μ and ρ. For example, when μ = ρ = 1, the optimal controller is

$$C(s) \approx \frac{0.609(s - 0.81)}{s^2 + 1.73s + 2.49}.$$

Similar controller expressions arise for other values of μ and ρ. Those controllers may be used in the closed loop of Fig. 6.1 to form a complete system.

Figure 6.2 shows the relative *H*<sup>2</sup> values of the four input–output transfer functions in Eq. 6.1. The *H*<sup>2</sup> values express sensitivity over all frequencies.

To interpret this figure, look at Eq. 6.4. As the product of the weightings, μρ, increases, the output of *G*η*<sup>d</sup>* (gold curve) plays an increasingly important role in the total cost relative to the output of *Gun* (green curve).

As the relative cost weighting of *G*η*<sup>d</sup>* increases, its *H*<sup>2</sup> value declines. Similarly, as the relative cost weighting of *Gun* decreases, its *H*<sup>2</sup> value increases. Once again, we see the sensitivity tradeoffs in response to the relative importance of different perturbations.

The top row of Fig. 6.3 compares the Bode plots for the process, *P*, and the input– output transfer functions in Eq. 6.1. As ρ increases in the columns from left to right, the rise in the green curve for *Gun* is the strongest change. We can understand that change by examining the cost function in Eq. 6.4. Because *Gud* = *G*η*<sup>n</sup>*, a rise in ρ reduces the weighting of *Gun* relative to all other terms.

The strongest increase in relative weighting as ρ rises occurs for *G*η*<sup>d</sup>* , shown in gold. The mild decline in the gold curve with increasing ρ is consistent with the increased relative cost weighting of that signal.

**Fig. 6.3** Response of the process in Eq. 6.8 in blue and the transfer functions in Eq. 6.1, with *Gud* = *G*η*<sup>n</sup>* in red, *G*η*<sup>d</sup>* in gold, and *Gun* in green. Top row shows Bode magnitude plots. Bottom row shows impulse responses. The input signal weights in Eq. 6.4 are μ = 1 and, for the three columns from left to right, ρ = 0.25, 1, 4. Swapping values of μ and ρ gives identical results, because of the symmetries in Eq. 6.1 and 6.4

The bottom row shows the impulse responses. As with the Bode plots, an increase in ρ favors reduced response of *G*η*<sup>d</sup>* , in gold, causing a smaller impulse response in the right plot with high ρ relative to the left plot with low ρ. Similarly, an increase in ρ weakens the pressure on the *Gun* transfer function in green, causing a larger impulse response with increasing ρ.

### **6.4 Frequency Weighting**

The *H*<sup>2</sup> norm sums a system's gain over all input frequencies, as in Eq. 5.4. That sum weights all input frequencies equally.

Often, we wish to protect against perturbations that occur primarily in a limited band of frequencies. For example, disturbance loads, *d*, typically occur at low frequency, reflecting long-term fluctuations or misspecifications in the system's intrinsic processes. In that case, our optimization method should emphasize reducing a system's gain at low frequency with respect to disturbance load inputs and accepting a tradeoff that allows a greater gain at high frequency. By reducing the gain at low frequency, we protect against the common frequencies for load disturbances.

Tradeoffs between low- and high-frequency bands are common. If we start with a process transfer function

$$G(s) = \frac{10(s+1)}{s+10},$$

then at zero frequency, *s* = *j*ω = 0, the gain is one. As frequency increases, the gain approaches ten.

If we weight this process transfer function by *W*(*s*) = 1/(*s* + 1), then the new system becomes *W G* = 10/(*s* + 10). Now, the gain declines with increasing frequency, from a maximum of one at zero frequency to a minimum of zero at infinite frequency.

By weighting the original system, *G*, by the weighting function, *W*, we cause the *H*<sup>2</sup> norm of the combined system, *W G*, to be relatively more sensitive to lowfrequency disturbances. When we design a controller by minimizing the *H*<sup>2</sup> norm associated with *W G*, we will typically find a system that is better at rejecting lowfrequency load disturbances than a design minimizing the *H*<sup>2</sup> norm associated with *G*. For the weighted system, optimization will avoid controllers that reject highfrequency load disturbances, because the weighted system already rejects those highfrequency inputs.

Roughly speaking, a weighting function instructs the optimization method to reduce the gain and sensitivity for certain frequencies and to ignore the gain for other frequencies. The weighting functions do not alter the actual system. The weighting functions are only used to alter the cost function and optimization method that determine the optimal controller.

Figure 6.4 shows the regulation feedback system of Fig. 6.1 with additional weightings for the disturbance and noise inputs. The weightings modify the four system transfer functions and associated sensitivities in Eq. 6.2 to be *WdGud* , *WdG*η*<sup>d</sup>* , *WnGun*, and *WnG*η*<sup>n</sup>*. The cost function in Eq. 6.5 becomes

$$\mathcal{J} = \mu^2 ||W\_d T||\_2^2 + \mu^2 \rho^2 ||W\_d P S||\_2^2$$

$$+ ||W\_n C S||\_2^2 + \rho^2 ||W\_n T||\_2^2. \tag{6.9}$$

Consider an example in which we begin with the process, *P*, in Eq. 6.8. To emphasize low-frequency load disturbances, set *Wd* = 1/(*s* + 0.1) to be a low-pass filter. That weighting filters out disturbances that are significantly greater than ω = 0.1. To emphasize high-frequency sensor noise, set *Wn* = *s*/(*s* + 10). That weighting filters out noise that is significantly less than ω = 10. By using these two filters, the optimization method puts very low weight on any disturbances in midrange frequencies of ω = (0.1, 10).

**Fig. 6.4** Basic regulation feedback loop in Fig. 6.1 with additional weightings for disturbance and noise inputs. The weightings alter the cost function to emphasize particular frequency bands for disturbance and noise, yielding a modified optimal controller

**Fig. 6.5** Role of frequency weighted inputs in the design of optimal *H*<sup>2</sup> controllers for system regulation, illustrated by Bode magnitude plots. **a** Plot for the unweighted case, matching the plot in Fig. 6.3c. **b** Plot for the frequency weighted example in the text, which emphasizes the regulation of low-frequency load disturbances, *d*, and high-frequency sensor noise, *n*

By minimizing the weighted *H*<sup>2</sup> cost in Eq. 6.9, we obtain the optimal controller

$$C(s) = \frac{2.02(s + 1.52)}{s^2 + 1.17s + 6.3}.$$

I calculated the values for this controller by using the numerical minimization function in Mathematica to minimize the *H*<sup>2</sup> cost, subject to the constraint that all transfer functions in Eq. 6.1 are stable. See the supplemental Mathematica code.

Figure 6.5 compares the optimized system response for the unweighted and weighted cases. Panel **a** shows the Bode magnitude response of the optimized system for the unweighted case, equivalent to the plot in Fig. 6.3c. Panel **b** shows the response of the optimized system for the weighted case in this section.

The weighted case emphasizes low-frequency load disturbances and highfrequency sensor noise, with low weight on midrange frequencies. Comparing the unweighted case in (a) with the weighted case in (b), we see two key differences.

First, the weighted case allows a large rise in magnitudes and associated sensitivity to perturbations for midrange frequencies. That rise occurs because the particular weighting functions in this example discount midrange perturbations.

Second, the gold curve shows that the weighted case significantly reduces the low-frequency sensitivity of system outputs, η, to load disturbances, *d*. The gold curve describes the response of the transfer function, *G*η*<sup>d</sup>* . Note that, because of the log scaling for magnitude, almost all of the costs arise in the upper part of the plot. The low relative magnitude for the lower part contributes little to the overall cost.

#### 6.4 Frequency Weighting 53

**Open Access** This chapter is licensed under the terms of the Creative Commons Attribution 4.0 International License (http://creativecommons.org/licenses/by/4.0/), which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons license and indicate if changes were made.

The images or other third party material in this chapter are included in the chapter's Creative Commons license, unless indicated otherwise in a credit line to the material. If material is not included in the chapter's Creative Commons license and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder.

# **Chapter 7 Stabilization**

The previous chapter assumed that the intrinsic process, *P*, has a given unvarying form. The actual process may differ from the given form or may fluctuate over time. If a system is designed with respect to a particular form of *P*, then variation in *P* away from the assumed form may cause the system to become unstable.

We can take into account the potential variation in *P* by altering the optimal design problem. The new design problem includes enhanced stability guarantees against certain kinds of variation in *P*.

Variation in an intrinsic process is an inevitable aspect of design problems. In engineering, the process may differ from the assumed form because of limited information, variability in manufacturing, or fluctuating aspects of the environment.

In biology, a particular set of chemical reactions within an individual may vary stochastically over short time periods. That reaction set may also vary between individuals because of genetic and environmental fluctuations. In all cases, actual processes typically follow nonlinear, time-varying dynamics that often differ from the assumed form.

We may also have variation in the controller or other system processes. In general, how much variability can be tolerated before a stable system becomes unstable? In other words, how robust is a given system's stability to perturbations?

We cannot answer those question for all types of systems and all types of perturbations. However, the *H*<sup>∞</sup> norm introduced earlier provides insight for many problems. Recall that the *H*<sup>∞</sup> norm is the peak gain in a Bode plot, which is a transfer function's maximum gain over all frequencies of sinusoidal inputs. The small gain theorem provides an example application of the *H*<sup>∞</sup> norm.

### **7.1 Small Gain Theorem**

Suppose we have a stable system transfer function, *G*. That system may represent a process, a controller, or a complex cascade with various feedback loops. To express the mathematical form of *G*, we must know exactly the dynamical processes of the system.

How much may the system deviate from our assumptions about dynamics and still remain stable? For example, if the uncertainties may be expressed by a positive feedback loop, as in Fig. 7.1, then we can analyze whether a particular system, *G*, is stably robust against those uncertainties.

In Fig. 7.1, the stable transfer function, Δ, may represent the upper bound on our uncertainty. The feedback loop shows how the nominal unperturbed system, *G*, responds to an input and becomes a new system, *G*˜ , that accounts for the perturbations. The system, *G*˜ , represents the entire loop shown in Fig. 7.1.

The small gain theorem states that the new system, *G*˜ , is stable if the product of the *H*<sup>∞</sup> norms of the original system, *G*, and the perturbations, Δ, is less than one

$$||G||\_{\infty} ||\Delta||\_{\infty} < 1. \tag{7.1}$$

Here, we interpret *G* as a given system with a known *H*<sup>∞</sup> norm. By contrast, we assume that Δ represents the set of all stable systems that have an *H*<sup>∞</sup> norm below some upper bound, ||Δ||∞. For the perturbed system, *G*˜ , to be stable, the upper bound for the *H*<sup>∞</sup> norm of Δ must satisfy

$$||\Delta||\_{\infty} < \frac{1}{||G||\_{\infty}}.\tag{7.2}$$

If *G* is a system that we can design or control, then the smaller we can make ||*G*||∞, the greater the upper bound on uncertainty, ||Δ||∞, that can be tolerated by the perturbed system. Put another way, smaller ||*G*||∞ corresponds to greater robust stability.

**Fig. 7.1** System uncertainty represented by a feedback loop. The transfer function, Δ, describes an upper bound on the extent to which the actual system, *G*˜ = *G*/(1 − *G*Δ), deviates from the nominal system, *G*. Here, *G* may represent a process, a controller, or an entire feedback system

A full discussion of the small gain theorem can be found in textbooks (e.g., Zhou and Doyle 1998; Liu and Yao 2016). I present a brief intuitive summary.

The positive feedback loop in Fig. 7.1 has transfer function

$$
\tilde{G} = \frac{G}{1 - G\Delta}.\tag{7.3}
$$

We derive that result by the following steps. Assume that the input to *G* is *w* + ν, which is the sum of the external input, *w*, and the feedback input, ν. Thus, the system output is η = *G*(*w* + ν).

We can write the feedback input as the output of the uncertainty process, ν = Δη. Substituting into the system output expression, we have

$$
\eta = G(\nu + \nu) = G\nu + G\Delta\eta.
$$

The new system transfer function is the ratio of its output to its external input, *G*˜ = η/*w*, which we can solve for to obtain Eq. 7.3.

The new system, *G*˜ , is unstable if any eigenvalue has real part greater than or equal to zero, in which the eigenvalues are the roots of *s* of the denominator, 1 − *G*(*s*)Δ(*s*) = 0.

Intuitively, we can see that *G*˜(*s*) blows up unstably if the denominator becomes zero at some input frequency, ω, for *s* = *j*ω. The denominator will be greater than zero as long as the product of the maximum values of *G*(*j*ω) and Δ(*j*ω) are less than one, as in Eq. 7.1. That condition expresses the key idea. The mathematical presentations in the textbooks show that Eq. 7.1 is necessary and sufficient for stability.

Reducing the *H*<sup>∞</sup> norm of *G* increases its robustness with respect to stability. In Eq. 7.2, a smaller ||*G*||∞ corresponds to a larger upper bound on the perturbations that can be tolerated.

A lower maximum gain also associates with a smaller response to perturbations, improving the robust performance of the system with respect to disturbances and noise. Thus, robust design methods often consider reduction of the *H*<sup>∞</sup> norm.

### **7.2 Uncertainty: Distance Between Systems**

Suppose we assume a nominal form for a process, *P*. We can design a controller, *C*, in a feedback loop to improve system stability and performance. If we design our controller for the process, *P*, then how robust is the feedback system to alternative forms of *P*?

The real process, *P* , may differ from *P* because of inherent stochasticity, or because of our simple model for *P* misspecified the true underlying process.

What is the appropriate set of alternative forms to describe uncertainty with respect to *P*? Suppose we defined a distance between *P* and an alternative process, *P* . Then a set of alternatives could be specified as all processes, *P* , for which the distance from the nominal process, *P*, is less than some upper bound.

We will write the distance between two processes when measured at input frequency ω as

$$\delta[P(j\omega), P'(j\omega)] = \text{distance at frequency } \omega,\tag{7.4}$$

for which δ is defined below. The maximum distance between processes over all frequencies is

$$\delta\_v(P, P') = \max\_{\alpha} \; \delta[P(j\omega), P'(j\omega)],\tag{7.5}$$

subject to conditions that define whether *P* and *P* are comparable (Vinnicombe 2001; Qiu and Zhou 2013). This distance has values 0 ≤ δν ≤ 1, providing a standardized measure of separation.

To develop measures of distance, we focus on how perturbations may alter system stability. Suppose we start with a process, *P*, and controller, *C*, in a feedback system. How far can an alternative process, *P* , be from *P* and still maintain stability in the feedback loop with *C*? In other words, what is the stability margin of safety for a feedback system with *P* and *C*?

Robust control theory provides an extensive analysis of the distances between systems with respect to stability margins (Vinnicombe 2001; Zhou and Doyle 1998; Qiu and Zhou 2010, 2013). Here, I present a rough intuitive description of the key ideas.

For a negative feedback loop with *P* and *C*, the various input–output pathways all have transfer functions with denominator 1 + *PC*, as in Eq. 6.1. These systems become unstable when the denominator goes to zero, which happens if *P* = −1/*C*. Thus, the stability margin is the distance between *P* and −1/*C*.

The values of these transfer functions, *P*(*j*ω) and *C*(*j*ω), vary with frequency, ω. The worst case with regard to stability occurs when *P* and −1/*C* are closest; that is, when the distance between these functions is a minimum with respect to varying frequency. Thus, we may define the stability margin as the minimum distance over frequency

$$b\_{P,C} = \min\_{\omega} \ \delta[P(j\omega), -1/C(j\omega)].\tag{7.6}$$

Here is the key idea. Start with a nominal process, *P*1, and a controller, *C*. If an alternative or perturbed process, *P*2, is close to *P*1, then the stability margin for *P*<sup>2</sup> should not be much worse than for *P*1.

In other words, a controller that stabilizes *P*<sup>1</sup> should also stabilize all processes that are reasonably close to *P*1. Thus, by designing a good stability margin for *P*1, we guarantee robust stabilization for all processes sufficiently near *P*1.

We can express these ideas quantitatively, allowing the potential to design for a targeted level of robustness. For example,

$$b\_{P\_{\Sigma},C} \ge b\_{P\_1,C} - \delta\_\nu(P\_1, P\_2).$$

Read this as the guaranteed stability margin for the alternative process is at least as good as the stability margin for nominal process minus the distance between the nominal and alternative processes. A small distance between processes, δν , guarantees that the alternative process is nearly as robustly stable as the original process.

The definitions in this section depend on the distance measure, expressed as

$$\delta(c\_1, c\_2) = \frac{|c\_1 - c\_2|}{\sqrt{1 + |c\_1|^2}\sqrt{1 + |c\_2|^2}}.$$

Here, *c*<sup>1</sup> and *c*<sup>2</sup> are complex numbers. Transfer functions return complex numbers. Thus, we can use this function to evaluate δ[*P*1(*j*ω), *P*2(*j*ω)].

### **7.3 Robust Stability and Robust Performance**

The stability margin *bP*,*<sup>C</sup>* measures the amount by which *P* may be altered and still allow the system to remain stable. Note that *bP*,*<sup>C</sup>* in Eq. 7.6 expresses a minimum value of δ over all frequencies. Thus, we may also think of *bP*,*<sup>C</sup>* as the maximum value of 1/δ over all frequencies.

The maximum value of magnitude over all frequencies matches the definition of the *H*<sup>∞</sup> norm, suggesting that maximizing the stability margin corresponds to minimizing some expression for an *H*<sup>∞</sup> norm. Indeed, there is such an *H*<sup>∞</sup> norm expression for *bP*,*<sup>C</sup>*. However, the particular form is beyond our scope. The point here is that robust stability via maximization of *bP*,*<sup>C</sup>* falls within the *H*<sup>∞</sup> norm theory, as in the small gain theorem.

Stability is just one aspect of design. Typically, a stable system must also meet other objectives, such as rejection of disturbance and noise perturbations. This section shows that increasing the stability margin has the associated benefit of improving a system's rejection of disturbance and noise. Often, a design that targets reduction of the *H*<sup>∞</sup> norm gains the benefits of an increased stability margin and better regulation through rejection of disturbance and noise.

The previous section on regulation showed that a feedback loop reduces its response to perturbations by lowering its various sensitivities, as in Eqs. 6.2 and 6.5. A feedback loop's sensitivity is *S* = 1/(1 + *PC*) and its complementary sensitivity is *T* = *PC*/(1 + *PC*).

Increasing the stability margin, *bP*,*<sup>C</sup>*, reduces a system's overall sensitivity. We can see the relation between stability and sensitivity by rewriting the expression for *bP*,*<sup>C</sup>* as

$$b\_{P,C} = \left[ \max\_{\omega} \sqrt{|S|^2 + |CS|^2 + |PS|^2 + |T|^2} \right]^{-1}$$

This expression shows that increasing *bP*,*<sup>C</sup>* reduces the total magnitude of the four key sensitivity measures for negative feedback loops.

**Fig. 7.2** Comparison between the responses of two systems to a unit step input, *r* = 1. The blue curves show *P*<sup>1</sup> and the gold curves show *P*2. **a**, **b** Systems in Eq. 7.7, with *k* = 100 and *T* = 0.025. The top plot shows the open-loop response for each system. The bottom plot shows the closed-loop feedback response with unit feedback, *P*/(1 + *P*), in which the error signal into the system, *P*, is 1 − *y* for system output, *y*. **c**, **d** Open (top) and closed (bottom) loop responses for the systems in Eq. 7.8, with *k* = 100. Redrawn from Fig. 12.3 of Åström and Murray (2008), ©Princeton University Press

### **7.4 Examples of Distance and Stability**

The measure, δν (*P*1, *P*2), describes the distance between processes with respect to their response characteristics in a negative feedback loop. The idea is that *P*<sup>1</sup> and *P*<sup>2</sup> may have different response characteristics when by themselves in an open loop, yet have very similar responses in a feedback loop. Or *P*<sup>1</sup> and *P*<sup>2</sup> may have similar response characteristics when by themselves, yet have very different responses in a feedback loop.

Thus, we cannot simply use the response characteristics among a set of alternative systems to understand how variations in a process influence stability or performance. Instead, we must use a measure, such as δν , that expresses how variations in a process affect feedback loop characteristics.

This section presents two examples from Sect. 12.1 of Åström and Murray (2008). In the first case, the following two systems have very similar response characteristics by themselves in an open loop, yet have very different responses in a closed feedback loop

#### 7.4 Examples of Distance and Stability 61

$$P\_1 = \frac{k}{s+1} \qquad \qquad P\_2 = \frac{k}{(s+1)(Ts+1)^2},\tag{7.7}$$

when evaluated at *k* = 100 and *T* = 0.025, as shown in Fig. 7.2a, b. The distance between these systems is δν (*P*1, *P*2) = 0.89. That large distance corresponds to the very different response characteristics of the two systems when in a closed feedback loop. (Åström and Murray (2008) report a value of δν = 0.98. The reason for the discrepancy is not clear. See the supplemental Mathematica code for my calculations, derivations, and graphics here and throughout the book.)

In the second case, the following two systems have very different response characteristics by themselves in an open loop, yet have very similar responses in a closed feedback loop

$$P\_1 = \frac{k}{s+1} \qquad \qquad P\_2 = \frac{k}{s-1},\tag{7.8}$$

when evaluated at *k* = 100, as shown in Fig. 7.2c, d. The distance between these systems is δν (*P*1, *P*2) = 0.02. That small distance corresponds to the very similar response characteristics of the two systems when in a closed feedback loop.

### **7.5 Controller Design for Robust Stabilization**

The measure *bP*,*<sup>C</sup>* describes the stability margin for a feedback loop with process *P* and controller *C*. A larger margin means that the system remains robustly stable to variant processes, *P* , with greater distance from the nominal process, *P*. In other words, a larger margin corresponds to robust stability against a broader range of uncertainty.

For a given process, we can often calculate the controller that provides the greatest stability margin. That optimal controller minimizes an *H*<sup>∞</sup> norm, so in this case we may consider controller design to be an *H*<sup>∞</sup> optimization method.

Often, we also wish to keep the *H*<sup>2</sup> norm small. Minimizing that norm improves a system's regulation by reducing response to perturbations. Jointly optimizing the stability margin and rejection of disturbances leads to mixed *H*<sup>∞</sup> and *H*<sup>2</sup> design.

Mixed *H*<sup>∞</sup> and *H*<sup>2</sup> optimization is an active area of research (Chen and Zhou 2001; Chang 2017). Here, I briefly summarize an example presented in Qiu and Zhou (2013). That article provides an algorithm for mixed optimization that can be applied to other systems.

Qiu and Zhou (2013) start with the process, *P* = 1/*s*2. They consider three cases. First, what controller provides the minimum *H*<sup>∞</sup> norm and associated maximum stability margin, *b*, while ignoring the *H*<sup>2</sup> norm? Second, what controller provides the minimum *H*<sup>2</sup> norm, while ignoring the stability margin and *H*<sup>∞</sup> norm? Third, what controller optimizes a combination of the *H*<sup>∞</sup> and *H*<sup>2</sup> norms?

For the first case, the controller

$$C(s) = \frac{\left(1 + \sqrt{2}\right)s + 1}{s + 1 + \sqrt{2}}$$

has the maximum stability margin

$$b\_{P,C}^{\*} = \left(4 + 2\sqrt{2}\right)^{-1/2} = 0.38... $$

The cost associated with the *H*<sup>2</sup> norm from Eq. 6.5 is *J* = ∞, because the sensitivity function *C S* has nonzero gain at infinite frequency.

For the second case, the controller

$$C(s) = \frac{2\sqrt{2}s + 1}{s^2 + 2\sqrt{2}s + 4}$$