Controller Design Basics¶
Mathematical connections: differential equations, Laplace transform
We are now ready to analyze our first closed-loop system. As we saw in the last lecture it can be very convenient to represent Input/Output relations using the transfer function approach. In this way we can reduce the dynamics to a relation
between the Laplace Transforms of the control and the output. We will call \(T(s)\) the plant transfer function. One of the simplest ways to construct a closed-loop feedback control is to take the difference between a given 'desired' output \(y_d(t)\) and the actual output \(y(t)\) and feed a constant multiple of this 'error' in output back as the control. For nonzero \(y_d(t)\) this type of control is called 'tracking control'.
At this point we are still concerned with SISO (single input, single output) systems where the transfer function is a scalar, so you can easily verify that in the Laplace Transform world this corresponds to choosing \(U(s) = k (Y_d(s) - Y(s))\) resulting in the new relation:
or solving for \(Y(s)\):
We now have a new transfer function \begin{equation} \label{propcont} T_c(s) = \frac{k T(s)}{1 + k T(s)} \end{equation} that gives us an input/output relation between the command signal (desired \(y_d\)) and the actual output.
You can imagine representing a more complicated relation between the tracking error \(y_d(t) - y(t)\) and the control \(u(t)\) (see for instance examples in the last lecture) by
The dynamical system with the transfer function \(K(s)\) is called the controller. You can easily verify that in this case the relation \eqref{propcont} has a more general form
Before delving into this general of a system, let's explore this type of tracking control system further on a simpler example. Let's assume our original system that we want to control (the plant) is given by the second-order differential equation \begin{equation} \label{secondord} m \ddot{x} + \beta \dot{x} + \kappa x = u. \end{equation} This should be very familiar from an Elementary Differential Equations course as a model for mass-spring system in which \(x\) represents the position from the equilibrium at time \(t \in [0, \infty)\) of the object of mass \(m\) attached to a spring with spring constant \(\kappa\) moving in a medium offering a resistance that is \(\beta\) times the instantaneous velocity under an external force \(u\). We will see that this equation is also very important in many other applications as oftentimes it approximates dynamics that are much more complex (e.g. an airplane flight).
Assuming our output is simply \(y(t) = x(t)\), and taking the Laplace Transform of both sides and assuming zero initial conditions you can verify that the open-loop input/output relation is: \begin{equation} \label{siso} Y(s) = \frac{1}{m s^2 + \beta s + \kappa} U(s). \end{equation} If it's been a while since differential equations here's a refresher on Laplace Transforms of derivatives -> Laplace Transforms
First we investigate the problem as an open-loop control. At this point do the following as homework:
As you can see even for a simple second order constant coefficient differential equation there could be a lot of different behaviors of the solution. If the idea is to use a control to drive the output \(y(t)\) to a steady state, the success (and performance) of such endeavor depends critically on the parameters of the system, which might be fixed.
Here is a natural question then. If the behavior is not what we want, can a feedback mechanism improve the situation? Say we want to 'drive' \(y(t)\) to the value \(y_0\). Going back to \eqref{propcont}, you can imagine the simplest type of command signal \(y_d\) to be a constant command \(y_d(t) = y_0\). Using the corresponding Laplace Transform \(Y_d(s) = y_0/s\) in \eqref{propcont} results in
where
Let us now write the transfer function \(T(s)\) as
where \(N(s)\) and \(D(s)\) are polynomials of degree \(m\) and \(n\) \((m \le n)\) respectively representing the numerator and the denominator. Then some algebra gives
as before.
As you saw in the exercise the stability and performance characteristics of the plant depend on the sign of the real parts of zeros of the denominator \(D(s)\) (note that these were also the eigenvalues of the original system). In particular to reach the desired steady state it must be true that the real parts of those zeros are negative). By introducing the feedback control we changed the problem into studying the zeros of the new denominator \(D(s) + k N(s)\), so the question becomes whether we can choose \(k\) to have the poles (zeros of the denominator) of the new transfer function have negative real parts. Or more generally how do the roots of
relate to the roots of
This is the question of the next lecture.
Try It in CCST
Use the Cloud Controls & Simulation Toolbox to explore the mass-spring-damper system from the exercises above. For example, with \(m=1\), \(\beta=0.5\), \(\kappa=4\) (\(\omega=2\), \(\xi=0.125\)):
ss [[0,1],[-4,-0.5]] [[0],[1]] [[1,0]] [[0]] -> msd
tf msd -> msd_tf
poles msd -> msd_poles
gdisplay msd_poles
Simulate the step response to see the underdamped oscillation:
Try changing \(\beta\) to see overdamped (\(\xi > 1\)) and critically damped (\(\xi = 1\)) behavior. Then add proportional feedback and observe how the poles move: