1 AUTOMATIC CONTROL Andrea M. Zanchettin, PhD Spring Semester, 2018 Introduction to Automatic Control & Linear systems (time domain)
2 What is automatic control? From Wikipedia Control theory is an interdisciplinary branch of engineering and mathematics that deals with the behavior of dynamical systems with inputs, and how their behavior is modified by feedback. The definition is challenging to be fully understood (as for now), however we notice relevant concepts dynamical systems (their) behaviour (which is) modified by feedback Dynamical systems are usually addressed in course dealing with System Theory. In the first lectures, we are going to recall few concepts regarding those systems and their behaviour.
3 A very simple example Reservoir (tank) for public water supply. Objective: maintain the level (bottom pressure) as much as possible close to a reference value regardless the users request. How does the system work? Very much like your bank account! If (income > outflow) then level increases Using some simple math
4 A very simple example cont d The local company for water management has monitored the behaviour of the users request during a week. The outcome is as follows (during 24 hours) Nominal behaviour Users demand (m 3 ) Daily average Time (hrs)
5 A simple example cont d Let s try to inject a constant flow equal to the daily average consumption. Actual level Water level (m) Desired level Time (hrs) Remarkable fluctuations are present, they might be tollerated, however
6 A simple example cont d what if the users demand increases? Water level (m) and users demand (m 3 ) Actual demand Time (hrs) The new situation cannot be tollerated anymore
7 A simple example cont d So far we tried to command the pump to inject the average amount of requested water, i.e. We are completely neglecting our objective (i.e. maintaining the level constant). How about injecting a quantity proportional to the difference between the actual level and the desired one (error)? Let s see what happens
8 A simple example cont d This simple law seems to be promising. Our objective has been reached. The level seems now to be under control no matter the bad estimation of the users demand. Water level (m) and users demand (m 3 ) Actual demand Time (hrs)
9 Closed-loop vs. open-loop We have seen two different solutions to our problem (tank level): open-loop: no measurement is taken from the plant, our algorithm decides the injected flow idependently; closed-loop: the quantity of water to be injected is derived from level measurements (as compared to their desired value). The open-loop solution does extremely depend on the quality of the model we have of the system we want to control. It is therefore very sensitive to i) uncertainties, ii) disturbances, etc. In turn, the closed-loop solution does not require an accurate model of the system to be controlled whilst guarantee better performance. It clearly requires additional hardware to be in place (sensors!).
10 Basic notions What is a dynamical system? A mathematical description consists of: State variables, their domain and initial values, x Inputs and their domain, u Outputs and their domain, y Time (usually positive), t or k Two functions Usually, function Φ is not given explicitly, but somehow expressed using other functions (e.g. differential equations).
11 Basic notions cont d A very simple (non-exhaustive) classification: Time: continous (real) or discrete (integer) State values: finite set (automata) or not State dimension: finite or infinite (distributed parameters) Among all possible combinations, we will focus on Continuous time with finite dimension (n = order) Discrete time with finite dimension (n = order)
12 Continuous time systems A continuous time system is usually (implicitly) defined by means of a differential equation. Example: RL circuit y R u x L
13 Continuous time systems cont d A further example: the simple pendulum (no input) order of the system?
14 Continuous time systems cont d Continuous time systems defined by differential equations. How about their solutions? Under suitable assumption (e.g. Lipschitz-continuity of the function, and others) the problem has a unique solution the solution depends continuosly on the initial condition
15 Continuous time systems cont d How does the system behave? Notice that we only need to know how the state evolves w.r.t. time. We are actually looking for the solution of the Cauchy s initial value problem The (usually unique) solution is referred to as (state) motion. Example: back to the RL circuit y R u x continuous dipendency on initial condition(s) L
16 Continuous time systems cont d
17 Stability (definition) Consider a time-invariant system, a corresponding initial condition and input function Let be the corresponding motion. What if we (slightly) change the initial condition? Is the corresponding motion similar to? A different initial condition, say, might, in general, generate a different motion. Definition: a motion is called stable iff such that Definition: otherwise, it is called unstable.
18 Stability (definition) cont d
19 Stability (definition) Stability means that a bounded perturbation on the initial condition (with respect to the nominal motion), causes a bounded perturbation on the corresponding motion. Should we look for something more? Definition: a motion is called asymptotically stable iff stable and The perturbed motion tends to reach the nominal one as time goes on.
20 Equilibrium Equilibrium is a particular (steady) motion characterized by, hence As other motions, we can wonder whether an equilibrium is stable or not.
21 Take home message Focus on the motivating example (water reservoir) and take some time to think about how we modify the bahaviour of the system (for the same input) Think about further examples of dynamical systems and try to identify input outputs objective of their control system For example: temperature of your apartment input: heating power (boiler) output: temperature objective: maintaining the temperature at desired level
22 Linear systems A linear time invariant (LTI) system is such that functions are linear with respect to their inputs without explicit dependency on time, hence and Matrices are constant (with respect to time). Linear systems are relevant tools to describe a variety of systems as well as a generic system in the neighborhood of a working condition (linearization).
23 Linear systems cont d Example: with no particular physical meaning #states = order, n = 2 #inputs = 1 #outputs = 1
24 Linear systems cont d Another example: mass with friction u m
25 Change of variables It is sometime useful to study the same system from a different point of view. The same phenomenon, as be seen from different reference systems, has a different mathematical formulation. Apple falls vertically Apple falls inclined
26 Change of variables cont d More formally, consider a change of variables how does the (LTI) system in terms of the new variables?
27 Change of variables cont d Therefore and similarly for the output equations
28 Change of variables cont d Example: RLC circuit u L C x 2 z 2 x 1 = z 1 R y
29 Change of variables cont d With the new state variables, we obtain Verify that
Lagrange s formula 30 Joseph-Louis Lagrange (Turin 1736 - Paris 1813) Given a LTI system can we say something about its motion? In other words, are we able to solve the Cauchy initial value problem? The answer is the Lagrange s formula what is this?
31 Lagrange s formula cont d What is the exponential of a matrix? We shall try to recall first what the exponential of a number is! According to Taylor s formula Similarly, for a matrix we can define
32 Lagrange s formula cont d Notice that in general it wrong to compute the exponential of each entry in the matrix, except for the particular case of a diagonal one, in fact
33 Lagrange s formula cont d We can exploit this fact through the diagonalization process. Definition: given a generic square matrix A, it is call diagonalizable iff with D diagonal (real). Moreover, D contains the eigenvalues of A, while the columns of T -1 are the corresponding (ordered) eigenvectors.
34 Lagrange s formula cont d Back to the matrix esponential, assume A is diagonalizable, then therefore can be rewritten (+) as (+) notice that
35 Lagrange s formula cont d Recap on Lagrange s formula: the formula contains the matrix exponential its computation is easy if the matrix is diagonal(izable) How do we use these results? Let s try to verify the formula which solves the initial value problem
36 Lagrange s formula cont d Time derivative of the matrix exponential Therefore if u(t) = 0 the motion of systems is (Lagrange) In fact
37 Lagrange s formula cont d If u(t) 0, assume x 0 = 0, then the motion of the system is (Lagrange) Applying some math (+) (+) notice that
38 Superposition principle Back on the Lagrange s formula we notice that it is the sum of two terms it is linear with respect to the input u(t) Does not depend on input, only on initial condition (free motion) Depends on input only (forced motion)
39 Superposition principle cont d The linearity with respect to the input allows to ease the study in case The resulting motion is
40 Superposition principle cont d The linearity with respect to the initial condition allows to ease the study in case The resulting (free) motion is
41 Superposition principle cont d More in general, consider two motions if we combine the initials state and inputs as the combined motion we obtain is as follows
42 Stability of LTI systems Let s focus on a generic LTI system (output equation omitted) and on the Lagrange s formula Notice: no matter what the input u() is, the behaviour of the system (both in terms of free and force motion) depends on the exponential of matrix A. When we introduced the concept of stability we formally characterized the behaviour of the system subject to a perturbed initial condition.
43 Stability of LTI systems cont d Forced motion does not depend on the initial condition, however effect of perturbed initial condition Is the effect of this perturbation limited? Does it tend to zero as times goes on? Recalling the definition of stability, we are wondering whether the motion is (asymptotically) stable or not. If so, how big is the perturbation on initial condition we can tollerate?
44 Stability of LTI systems cont d Let s tackle the problem starting from a simple example, consider the first order system Applying the Lagrange s formula, the perturbation is. Therefore if the effect of perturbation vanishes (asymptotically stable) if the effect of perturbation is as big as the perturbation itself, still bounded (stable) otherwise, i.e., the effect of perturbation diverges (unstable)
45 Stability of LTI systems cont d Consider now the more general case where matrix A is diagonal(izable), i.e.. The effect of the perturbation is
46 Stability of LTI systems cont d Therefore, if all d s are negative, then the motion is asymptotically stable for each perturbation. Recall: those numbers are called eigenvalues. They always exist (even when the matrix is not diagonalizable). Result: if all eigenvalues negative, then the motion is asymptotically stable if at least one eigenvalue is positive, then the motion in unstable
47 Stability of LTI systems cont d Even more general case: what if the matrix A is not diagonalizable? Eigenvalues are possibly complex (and conjugate) numbers and solution of which is called characteristic equation (the LHS part is called characteristic polynomial). General result: if the motion is asymptotically stable if the motion is unstable otherwise, it is a bit tricky
48 Stability of LTI systems cont d We have a case which is still unclear: the case of null eigenvalue(s). Focus on the following examples: In both cases we have null eigenvalues. The first example is stable, the second is unstable! To distinguish we need two concepts: algebraic and geometric multiplicity.
49 Stability of LTI systems cont d Eigenvectors are solution of. Back to the example: (with algebraic multiplicity = 2) Two different eigenvectors Only one eigenvector In the former case (stable) we have the same algebraic and geometric multiplicity, in the latter algebraic and geometric multiplicity are different.
50 Results on stability of LTI systems Consider an LTI system: General result: if if the motion is asymptotically stable the motion is unstable if and those such that are simple roots (i.e. same algebraic and geometric multiplicity), the motion is stable (but not asymptotically), otherwise it is unstable
51 System vs. motion stability So far, we have introduced the notion of stability related to perturbed motion, due to a perturbed initial condition. Recall the perturbed (free) motion as obtained using the Lagrange s formula As the perturbation on the initial state appears linearly, and the perturbed motion is additive, i.e. We can conclude that infer that stability, at least for LTI systems, does not depend on how big the perturbation is as well as on the particular motion we are studying.
52 System vs. motion stability cont d For a generic LTI system General result: if one motion is stable (asymptotically stable), then all motions are stable (asymptotically stable) In this case (stable or asymptotically stable LTI systems) we can say that the system is stable, and we can talk about system stability. Notice: this is not true for generic dynamical systems!
53 Invariance of stability Consider, again, an LTI system Apply the following change of variables already seen we obtain the following system. As we have Is the new system stable? Note that and have the same eigenvalues. General result: the stability property of an LTI system is invariant with respect to a change of variables
Routh s criterion 54 Edward John Routh (Quebec 1831 - Cambridge 1907) The stability property of an LTI system depends on the eigenvalues of matrix, are we always able to compute them? They are solution of is a polynomial, then, and we know that the LHS for first order polynomials the solution is for second order polynomials are the solutions for higher order polynomials do not have such formulas, we
55 Routh s criterion cont d Consider a generic characteristic polynomial As (asymptotic) stability is concerned, we are interesting in verifying that all eigenvalues are such that without being able to explicitly compute them! A generic result (necessary and sufficient condition) exists, and can be formulated in terms of the coefficients of the characteristic polynomial.
56 Routh s criterion cont d Definition: the Routh table has n+1 rows, the first two rows contain the the coefficient of the characteristic polynomial Coefficients of the characteristic polynomial (pair on the first row, odd on the second) All other rows can be computed from the first two
57 Routh s criterion cont d Coefficient of row are computed using the two previous rows. First column of previous rows Next column of previous rows In case positions of previous rows are missing, fill them with zeros.
58 Routh s criterion cont d General result: an LTI system is asymptotically stable if and only if the elements of the first column have all the same sign (positive vs. negative). Notice: the table is called undefined if some element of the first column is zero (and the full table cannot be computed). In this case the elements does not have the same sign! Comment: Routh criterion allows to discuss stability of an LTI system without explicitly computing its eigenvalue. Nowadays several tools (like Matlab) are available to compute eigenvalues numerically. Still, Routh s criterion is usefull in case the matrix is parametric.
59 Routh s criterion cont d Example: consider the following matrix Compute the characteristic polynomial The system has one positive eigenvalue (triangular matrix, eigenvalues are diagonal terms), it is therefore unstable. At least two coefficients have different sign
60 LTI systems with inputs Consider a generic asymptotically stable LTI system: General results: an a.s. LTI system has the following properties for constant input, i.e. the equilibrium is unique after long time, the motion depends only on the input, as the free motion vanishes if the input tends to a constant value, then the system tends to the corresponding equilibrium (stability of the motion) a bounded input produces a bounded output (BIBO stability)
61 Stability of nonlinear systems We are wondering whether the same results can be applied to generic (nonlinear) dynamic systems. Example: consider the pendulum (with damping) Focus on equilibria only
62 Stability of nonlinear systems cont d Therefore, pendulum has two equilibria in Intuitively, the downward equilibrium is stable, whilst the upward one is unstable. Notice: we have a clear example that when nonlinear systems are concerned, stability is no longer a property of the system!
63 Linearization We are able to study the stability of a linear system, can we exploit this for nonlinear systems? The answer is yes, through linearization. Idea: to study the stability of an equilibrium of a nonlinear system, let s zoom on its neighbour. Almost linear behaviour
64 Linearization cont d Consider a generic nonlinear system assume the input is constant equilibrium state, i.e. and that there exists an We can then approximate the system bahaviour in the neighborhood of the equilibrium with a linear system
65 Linearization cont d The system is now linear Where Does the linear(ized) system reflect the stability property of the original (nonlinear) one? Let s try first to linearize the pendulum equations.
66 Linearization cont d Example: linearized pendulum We obtain
67 Linearization cont d For the downward equilibrium we obtain The corresponding Routh table is Then, the linearized system is asymptotically stable.
68 Linearization cont d For the upward equilibrium we obtain The corresponding Routh table is Then, the linearized system is unstable.
69 Linearization and stability We can generalized these achievements as follows. General results: given the equilibrium of a nonlinear system if the corresponding linearized system has all eigenvalues with strictly negative real part, then it is asymptotically stable if the corresponding linearized system has at least one eigenvalue with strictly positive real part, then it is unstable Notice: nothing can be said in other situations. Moreover, the stability property of a nonlinear system is strictly related to a particular equilibrium, rather than to the whole system.
70 Reachability and observability We have address the stability problem for LTI system. For control purposes, however, we are also interested in the following problems: how much can we change the state (and consequently the output) of a system acting on its inputs? how much information can we infer about the state of a system from its outputs? Those are inportant questions we need to address, especially for control purposes (as we aim at changing the behaviour of a system).
71 Reachability Before we can answer those questions, we need a formal definition of the properties we are looking for. Reachability relates to the capability of changing the state of a system acting on its inputs. The bahaviour of the state depending on the input is implicitly defined in the following equation Definition: an LTI system is said reachable if, for any initial condition, there exists an input able to steer the state to the origin in finite time
Reachability cont d 72 Rudolf E. Kalman (Budapest 1930-2016) We have now formalized the concept of reachability as the possibility to change the state of the system. This is very important for control purposes as it guarantees we can change the state of a system acting on its inputs (which is indeed the final aim of a control system!). Property (Kalman s reachability test): the system is reachable iff the reachability matrix has full rank.
73 Reachability cont d Result: the reachability property is invariant with respect to a particuar choice of state variables, in other words it is a structural property (like stability) and it is not affected by a change of variables. Proof: consider the reachability matrix and perform the following change of variables The corresponding reachability matrix is as follows which has the same rank of the original one, since is non singular.
74 Reachability cont d Example: consider the following circuit u x 1 x 2 y R L L Rows are linear dependent (cannot be full rank). The system is not reachable.
75 Reachability cont d The explaination is simple: by acting on the input, the currents on the two inductors (state variables) cannot be set independently. u x 1 x 2 R L L In order to look more deeply in this property let s apply the following change of variables
76 Reachability cont d The new matrices become clearly showing that the input (which influences z 1 ) cannot influence the second state variable, neither directly nor inderectly through z 1. u z 1 R L/2 Comment: the equivalent system (as seen from the input) has only one inductor (and is equivalent to a first order system!)
77 Observability In many realistic control problems, it is not possible to measure directly the state of the system. We can usually access a limited set of variables (by sensors), that we call outputs. The bahaviour of the outputs depending on the states is implicitly defined in the following equations We are trying to figuring out how much we can infer on the state of a system by observing its output.
Observability cont d 78 Rudolf E. Kalman (Budapest 1930) Definition: an LTI system is said observable if, for any non null initial condition, the free motion of the outputs differs, within any time horizon, from the zero output. In other words, if we observe a zero output in some, we are sure that the state is zero in the corresponding time interval. Property (Kalman s observability test): the system is observable iff the observability matrix has full rank.
79 Observability cont d Result: the observability property is invariant with respect to a particuar choice of state variables. Proof: similar to the reachability property. Back to the example: considering The observability matrix is rank deficient, then the system is not observable. Notice that the change of variables clearly shows us that the output is only influenced by the first state variable!
80 Kalman s decomposition In the examples, we introduced a (suitable) change of variable able to highlight how: the input did not influence (neither directly nor inderectly) one of the state variables the output was not influenced (neither directly nor indirectly) by one of the state variables We ask ourself whether it is always possible to find out such a change of variables
81 Kalman s decomposition cont d You will not find any path from the input to a non reachable part, as well as you will not find any path from a non observable part to the output. Not reachable Not observable Reachable Not observable Not reachable Observable Reachable Observable