Abstract
How can we get the output of a system to behave in a certain way if we only have direct control on the input? In this chapter we cover error, feedback (negative and positive), and stability. We look at recognizing these concepts in static systems (opamp) and in dynamic systems. We also cover PID control ler design as a very basic example of how controllers are designed. Finally, we discuss the effect of implementing a controller on a digital computer and the effects of using finite representations of values (N bits to represent values) and time (being able to sample or actuate only at clock ticks).
Download chapter PDF
How can we get the output of a system to behave in a certain way if we only have direct control on the input? In this chapter we cover error, feedback (negative and positive), and stability. We look at recognizing these concepts in static systems (opamp) and in dynamic systems. We also cover PID control ler design as a very basic example of how controllers are designed. Finally, we discuss the effect of implementing a controller on a digital computer and the effects of using finite representations of values (N bits to represent values) and time (being able to sample or actuate only at clock ticks).
1 Introduction
The function of virtually every cyberphysical system involves control in the sense of bringing some variable quantity to have a certain desired value. For example, we may want a car to maintain a certain speed, a ship to maintain a certain bearing, or a plane to maintain a certain altitude. The theory of control concerns itself with such problems.
Intuitively, a system is controlled by determining how certain inputs should be varied to achieve a certain behavior in outputs. In the simple examples above we have singlevalue and singleparameter goals. In practice, control problems can involve achieving highly sophisticated dynamic behavior in several different dimensions simultaneously. That said, many of the most fundamental principles of control can be explained and illustrated with singlevalue, singleparameter examples.
When discussing control, it is customary to refer to the system being controlled as the “Plant” and the system providing the inputs needed to achieve the desired output as the “Controller.” Block diagrams such as the one in Figure 4.1 are typically used to describe the relation between these two systems.
If our goal is simply to achieve a singlevalue output, and the operation of the plant is fully understood to us, then we can achieve this result with a controller with no inputs (such as the one depicted in Figure 4.1). In general, however, we will want to devise a controller that brings the plant to produce different output values depending on the value of another input that we provide. For that purpose, we will want to have a controller that is parameterized by our goal for the plant output. This more general situation can be depicted as in Figure 4.2.
It is instructive here to note the following: if the behavior of the plant can be viewed as a mathematical function, then this problem can be solved by a controller that is the inverse of the plant function. Of course, this also means that the problem can only be solved if the behavior of the plant is itself an invertible function. A further and more subtle difficulty is that, in order to construct the inverse, we would also have to know the exact plant function in advance (meaning, at the time of designing the controller). In general, we hardly ever have such knowledge. Most systems that we need to control have parameters and components that vary slightly from one instance to the next due to a variety of reasons. These can include production process, temperature effects, age effects, environmental effects, as well as many others.
2 Feedback Control
In practice, almost any real controller will have imperfections. The degree of imperfection in the operation of the controller at any time instant can be quantified by the difference between the desired plant output and the actual plant output. This difference will be called the error. Note that by doing so we are thinking of the controller input as telling us the desired output. This is a common viewpoint when we think of a system as a control system .
Rather than simply trying to construct the inverse (which is difficult even in static systems), the error can be used directly to construct a much simpler controller that can be very effective in practice. This is achieved by the powerful idea of feedback, whereby the output of the system is fed back as an input (either of the entire system or, in the context of control, of just the controller). Once we allow ourselves to use the output of the system as an input to the control process, the error is easily computed by a simple component that subtracts the value of the plant output from the desired plant input. In general, we can imagine a situation such as the one shown in Figure 4.3.
A simple strategy can consist of the following: firstly we can “try” a value for plant input; if the error is positive, we increase that value; if the error is negative, we decrease that value; and we can stop when we get close enough.
While this control strategy is helpful to get a simple intuition for how feedback can be useful for controlling a system, it is not necessarily the easiest to analyze formally. For this reason, we will first look more closely at a simpler strategy for designing a controller.
3 Proportional Feedback Control
A controller can simply consist of a unit that takes two inputs, computes the error, and then multiplies this error by a certain factor to generate the input that is fed into the plant. This situation can be depicted as shown in Figure 4.4.
Despite the seeming simplicity of a controller constructed like this, the idea of using feedback in this manner is powerful, and has many useful theoretical and practical benefits, in addition to being relatively easy to construct. First, however, we need to be certain that such a controller would actually help us achieve our goal of computing a plant input that would bring the plant output to have the desired value.
Example 4.1: Feedback Control of a Wire Plant Consider the situation where our plant is simply a wire with no interesting behavior. It would be good to know how well the idea feedback control works in this setting. Let us further consider a multiplier gain of G. For brevity, let us also use the following variables to denote the various values in the system as follows:

e is error,

x is plant input,

y is plant output, and

z is desired plant output.
The equations that govern the behavior of the system are:

1.
the error e is e = z − y,

2.
the plant is a simple wire, so, y = x, and

3.
the plant output is the controller output, so, x = Ge.
To understand the behavior of this type of controller we have to understand the combined effect of the equations above. If we substitute e from 1 into 3 we get
Similarly, substituting that value of x into Equation (4.2) we get
Starting from this equation we can derive an expression for y in terms of z as follows: first we note that the equation implies that
by distributivity of multiplication across subtraction. From this we can derive that
by adding Gy to both sides. By distributivity of multiplication on addition we get
If we assume that G is positive, then 1 + G is nonzero, so, we can divide both sides by (1 + G) to get
Now we can consider what happens to the relation in (4.1) as we change the value of G. If G is 0, then we have y = 0. This is clearly a very poor controller. But if G is 1, then y = (1∕2)z. This is by no means a perfect controller, as the output is always only half what we want it to be. But it is interesting that this simple construction causes y to behave in an interesting manner as z varies. The relation of the overall gain with the gain G is depicted in Figure 4.5.
If G is 99, then y = 0.99z. This suggests that, as the gain gets larger, this controller causes y to track z more closely. Obviously, 99% of a value is not the same as the value itself, but it is pretty close, and this is an impressive result to get from such a simple controller. Finally, note that, as the gain is increased arbitrarily, this controller can make the output value arbitrarily close to the desired value.
Exercise 4.1 Derive a formula for determining G given the desired overall gain of the feedback system described in Example 4.1.
4 Operational Amplifier s
It is instructive to consider the effect of this controller on a completely passive plant that consists entirely of a wire from its input directly to its output. But we may wonder if we could ever need to control such a simple system in practice. In particular, why is using such a construction better than just wiring the controller’s input directly to the plant input? As it turns out, this is a common construction in electronics that is known as the voltage follower circuit, and it is often depicted diagrammatically as in Figure 4.6.
The entity represented by the triangle is an operational amplifier, which consists of a differencing unit followed by a multiplication unit. The gain is usually called β (read “beta”) and is usually around hundreds of thousands. One of the biggest benefits of this construction is that it allows us to create a (largely) directed relation between the input and the output: the operational amplifier will force the value of the output to follow the value of the input closely, but not the other way around. The power that the operational amplifier consumes to achieve this comes from a power source not explicitly represented on such diagrams. Because of their usefulness in building controllers in various circuits, operational amplifiers are one of the most commonly used components in electronic circuits.
Example 4.2: Constant Gain Plant Now consider the situation where our plant is no longer simply a wire but rather an amplifier with a gain H. Again assume that our multiplier has gain of G. We will use the same conventions:

e is error,

x is plant input,

y is plant output, and

z is desired plant output.
This new system is described by the following equations:

1.
e = z − y is the error,

2.
y = Hx is the behavior of the plant,

3.
x = Ge is the behavior of the controller.
Substituting e from 1 into 3 yields
Substituting x from this equation into Equation (4.2) yields
Following a similar set of steps, and assuming that 1 + GH is not zero, we can arrive at
Note that the equation we derived in the first example is a special case of this equation, where H is equal to 1. But it is more instructive here to consider carefully how the overall gain factor (HG∕(1 + HG)) changes as H changes. Assuming that G is positive, then for a positive value of H, we get behavior similar to what we saw before: the output will be close to the goal value. As H grows arbitrarily large, the ratio HG∕(1 + HG) also goes to 1, which means that this controller is effective at getting the output to have the desired value. It is also interesting to note that if H is negative and it goes to negative infinity, the ratio also goes to 1, although it does so from above. This is an interesting observation because it shows that a feedback controller can work effectively even when the gain of the system is negative.
However, neither of these observations imply that such a controller will work for any combination of H and G. In particular, if the term 1 + HG is equal to zero, we cannot derive the last equation. In fact, what we have in that situation degenerates to 0 = HG ⋅goal, which contradicts the assumption that goal is any value other than zero. This is a situation where our controller has a singularity. In fact, the overall behavior of the system is problematic for values of H between − 1∕G and 0. The singularity occurs exactly at the value − 1∕G, but the overall gain is negative up until the point when H is 0. To get a sense of how H affects the overall gain, let us take G as 1 and plot the term H∕(1 + H) as H. The result is shown in Figure 4.7.
Thus, when we were just trying to find a G to control a system with known (positive) gain, it was enough to take any positive G, and the higher the gain the closer we were able to get to the goal. However, if the gain of the system that we are controlling is not strictly positive, then we may need to do (significant) additional work to make sure that our negative feedback control strategy does not lead to singularities or undesired behavior.
While checking that H is positive can be relatively easy to do for certain kinds of systems, it is not necessarily easy to do when the “gain” of the system itself depends on the state of the plant. In that case, H can be viewed as the derivative of the output with respect to the input for the system in that particular state. Ensuring that such a controller is wellbehaved requires the analysis of the system for all possible states.
Exercise 4.2 For the system in Example 4.2, take z to be 1 and G to be 1, and plot e as it varies with H from 50 to 50. On the same graph (if possible), plot the curves when G is equal to 10 and 100.
Example 4.3: Dynamical System s Consider the situation where our plant is not just a simple (constant) gain but, rather, a dynamical process that accumulates the input variable. An example of such a system is an object whose position we can observe and whose speed we can control. This is the case when we are driving a car. Now the plant is no longer a simple function of input to output but, instead, a notion of time must be factored in.
Following a convention similar to the one we used before, at any time instant t we will say that:

e(t) is error,

x(t) is plant input,

y(t) is plant output, and

z(t) is desired plant output.
This new system is described by the following equations:

1.
e(t) = z(t) − y(t) is the error

2.
\(y(t) = y(0) + \int _0^t x(s) ds \) is the behavior of the plant

3.
x(t) = Ge(t) is the behavior of the controller
Substituting equation e(t) from Equation (4.1) into Equation (4.4) we get x(t) = G(z(t) − y(t)). Substituting x from this equation into Equation (4.2) we get
If this is our first encounter with such an equation it may seem imposing. However, there are many ways to make progress towards solving it. In fact, because it can be viewed as a linear differential equation, there are techniques to transform it to the frequency domain and proceed almost exactly in the same way we did with the two previous examples, which are static in the sense that they do not have any notion of time.
The reader interested in linear systems (such as students of electrical engineering) can consult the ample literature available on linear circuits and linear control theory to explore this path. Here, instead, we will explore a path that does not require the elegant but somewhat specialized machinery used for linear differential equations.
Returning to our Equation (4.3), we can proceed by making several simplifications that help us get a sense of how this equation behaves. Once we have a solution under simplified assumptions, we will see how we can remove the assumptions. To get started, let us assume that G is 1 and also that z(t) is the constant function 0. Now we are left with the equation
Because integration, as well as differentiation, is a linear operator, we can take the minus sign outside the integration operator to get
We can further simplify this equation by differentiating both sides, which yields the equation
This equation does not uniquely determine the solution of the previous equation, because it loses the information about y(0). However, it is still a very useful equation to arrive at. It tells us that, whatever the solution y(t) will be, it must have the property that it is equal to the negative of its derivative. One function that has this property is the exponential function y(t) = e ^{−t}. In fact, for any constant a, the function y(t) = ae ^{−t} satisfies the last equation. We can pin down the value of a by equating y(0) to ae ^{−0} which is simply a. Thus, if y(0) = 2, the output of the system is y(t) = 2e ^{−t}. The solution is shown in Figure 4.8.
Judging from this example, our feedback strategy appears to provide us with the controlling effect that we want. If the desired goal is the function that is 0 at all times, our simple feedback controller with gain G of 1 seems to cause the system to approach that goal. Furthermore, the system appears to approach this goal relatively quickly. The graph in Figure 4.8 indicates that, within 5 time units, the output of the system becomes quite close to zero.
Now let us consider the case when the output is not zero but instead some other constant value Z. Here the equation for the system becomes
Differentiating both sides in (4.4) yields
Because we know that the derivative of a constant value is zero, we can consider trying the function y(t) = Z + ae ^{−t} as a solution to this equation. Indeed, it works as expected, because subtracting Z from Z also yields zero. The specific value for a is determined in the same way as before: namely, using the initial condition y(0) = Z + a, thus, a = y(0) − Z. Of course, we assume that Z is given. For y(0) = 1 and Z = 5, a = −4, and y(t) = 5 − 4e ^{−t}, which has the form given in Figure 4.9.
Here again we notice that the output value quickly goes to the desired value: in this case 5.
It is also possible to analytically compute a closed form for some timevarying functions. For example, we may wish to determine the output of the system when z(t) = Z − t. In this case the equation becomes
and differentiating both sides yields
By a similar process of inspection to the previous example we can see that the solution is
which when substituted into both sides of the last equation yields
This can be reduced to
which is clearly satisfied.
For Z = 5, y(0) = 2, the solution equation at time 0 gives us 2 = 5 + 1 − 0 + a which is 2 = 6 + a and so a = −4. Thus, y(t) = 6 − t − 4e ^{−t}, which is the black curve in Figure 4.10.
The red curve here is the desired output function. Thus, this controller does a reasonable job of tracking the desired output function. But it does not track it as precisely as we might expect. This brings us naturally to the question of how changing the gain G in our feedback controller can affect our system. To take into account the gain G we would revise (4.5) to be
Differentiating both sides we get
A good trick to understand how we solve this analytical problem is to step back and ignore for a moment z(t) (which shows up in the last equation as the term Z − t). Thus, with z(t) = 0 the system would be governed by the equation dy(t)∕dt = −Gy(t). If we naively plug in the (incorrect) solution y(t) = ae ^{−t}, we get a good hint of what needs to be done to get a correct solution. The left hand side is − ae ^{−t} and the righthand side is − Gae ^{−t}. To fix this disparity we need to put G into the solution form so that it “comes down” as a multiplicative factor when we differentiate, that is, to use y(t) = ae ^{−Gt}. For this expression, both sides are − Gae ^{−Gt}, and the equation is satisfied.
With this as the starting point for the solution with z(t) = 0, we can go back to Equation (4.7) and try to construct the solution for this problem. Again, we can substitute an educated guess for the solution and see what happens. For example, we might consider
which is just a small tweak to the solution for the case of G = 1 that we had derived above. Now the lefthand side is
and the righthand side is
which means that we just need to find a way to get − 1 instead of − G on the righthand side. This suggests a solution function
Plugging this term into the left hand side yields
and into the righthand side
which is − 1 − Gae ^{−Gt} and we confirm that this is the right form for the solution. For Z = 5, y(0) = 2, G = 10, the solution equation at time 0 gives us 2 = 5 + 0.1 − 0 + a which is 2 = 5.1 + a and so a = −3.1. Thus, y(t) = 5.1 − t − 3.1e ^{−10t}, which is the black curve in the following in Figure 4.11.
In this graph, it is clear that our new controller is tracking the target function much more closely, both in terms of how quickly it intersects with the trajectory of the target function and in the difference in amplitude between the two functions after this intersection happens.
To summarize, we have seen that proportional feedback control can work for (a) a donothing plant where the output is equal to the input, (b) a proportional plant where the output is proportional to the input (and where some care is needed to avoid singularities), and (c) for a simple dynamical system.
Exercise 4.3 Implement the last system discussed above in Example 4.3, using Acumen. Run a simulation that confirms the analytical results that we derived for the output function. Using your Acumen model, vary the value of G so that the error between the desired output and actual output at time 1.6 is no more than 1/100.
5 MultiDimensional Error and Proportional/Integral/Differential Feedback Control
We noticed above that by increasing the controller gain we can often get better performance in terms of how close the output value tracks the desired output value. However, simply increasing the gain is not always the most desirable approach to improving the performance of a controller. For instance, using high gain can entail using large amounts of energy. In addition, if the feedback reading is faulty or the link is broken, the system would have high “openloop ” gain, which can lead to feeding the plant inputs that can cause it damage.
Stepping back to look at the bigpicture of proportional feedback control, we can consider the possibility of performing different computations on the feedback; then using them to compute different notions of error, and combining them into a single error term that is used to drive the plant. This can be depicted as shown in Figure 4.12.
Here Op could be, in principle, any operation. For example, in the case of the car where we are controlling the speed, we can take the Op operator to be the differentiation operation, thereby converting the position reading into a speed reading. Alternatively, we can take Op to be integration, in which case we would have an estimate of the distance traveled. There is also no reason to limit ourselves to one or the other, and we can add another Op path and support both operations at the same time. Each path that contributes to the error in this layout can be viewed as one dimension of a tuple that together represents the error. Then, the input is computed as a weighted linear sum of these individual components. The question then is what type of behavior we get from the system by incorporating each of these paths.
Example 4.4: ThrottleControlled Car Consider a system that consists of a car that is controlled by means of a throttle parameter (assumed to be proportional to acceleration), and where the output of the system is the car’s speed. The controller has as input the desired speed. This example is instructive for getting a sense of the effect of each of these two choices of operators (differentiation and integration), which are used relatively frequently. But it is easier to imagine that we disable the other path(s) when we try to understand the action of each one. Then we can consider the effect of adding the errors from each component at the end. Using differentiation alone would give us a controller that tries to get the car to have the same acceleration as the controller’s input appears to have. This could be a useful control strategy, for example, when we want to satisfy certain comfort constraints (high acceleration interferes with passenger comfort). Practically, some care is often needed with such controllers, as derivatives can change much more suddenly than the actual value of the desired speed signal. In addition, estimating acceleration from the speed signal can be prone to noise and measurement artifacts. When we used simple proportional feedback on a dynamical system that had an integrative effect, the key underlying differential equation had the form y′ = −y. When the differentiation operator is introduced, our system remains essentially of the same form. In a sense, we just have more ways to achieve the same coefficient in such an equation.
Using integration alone would give us a controller that tries to get the car to have the same position (up to some constant offset) as the controller’s input appears to add up to. This method can be used to avoid constants such as the ones observed in the last system studied in Example 4.3.
In general, it can be very helpful for realizing a controller that keeps some history of its past behavior, as well as for getting a system to function properly in situations where the entire past behavior can affect the current state (such as the way in which a car’s entire speed history affects the position where it ends up).
However, with the use of the integration operator in the controller we have an equation of the form y″ = −y. An important characteristic of such equations is that they can lead to oscillation. In particular, sin(t) can be a solution to such an equation. This is one reason why it is often useful to combine different dimensions of error to produce the final result. For example, discounting the acceleration signal in proportion with the current speed generally produces a damping effect on such oscillations. The essential equation underlying such combined (proportionaldifferential) systems can be viewed as y″ = −y − y′.
Exercise 4.4 Construct a system where there is a singledimensional error using the derivative of the feedback that has an output described by the equation y′ = −y.
Exercise 4.5 Construct a system where there is a singledimensional error using the integral of the feedback that has an output described by the equation y″ = −y.
Exercise 4.6 Construct a system where there is a twodimensional error that has an output described by the equation y″ = −y − y′.
The lab will provide some further experience with such systems. This experience will help you develop a competitive project submission.
6 Chapter Highlights

1.
Control Theory

(a)
An almost inseparable part of CPS

Examples: HVAC, cars, airplanes, Segways


(b)
At the level of mathematical models, what does it mean?

We want to find an input that gives us a certain output

Basically, an inverse

Example: Water tap with angle



(c)
But is an inverse function really what we want?

(a)

2.
Negative feedback in a proportional system

(a)
A simple multiplicative system (H)

(b)
Simple negative feedback gain (G)

(c)
Careful deviation of composite gain

(d)
Limit as G goes to +/− infinity

(e)
What if H is + or −

(f)
What about the singularity?

(a)

3.
Negative feedback in an integrative system

(a)
A simple integrative system

(b)
Derivation of corresponding equation

(c)
Form of response

(d)
Effect of changing parameters

(e)
Energy cost

(a)

4.
Negative feedback in a doubly integrative system

(a)
A double integrative system

(b)
Derivation of corresponding equation

(c)
Form of response

(d)
Possibilities for stabilization

Pick up feedback earlier on

Estimate feedback


(a)

5.
Negative feedback in 2D and 3D

(a)
Equations in two dimensions

(b)
Equations in three dimensions

(a)
7 Study Problems

1.
Solve and submit Exercises 4.1, 4.2, 4.3, and 4.4 of this chapter.

2.
Consider the operational amplifier (opamp) in the configuration shown in Figure 4.13. Assume that the gain for this operational amplifier is G.

(a)
Write down the equation governing the relation between V _{in} and V _{out}, and using the gain G.

(b)
Use the equation you wrote above to derive an equation for the ratio V _{out}∕V _{in} in terms of G.

(c)
Calculate the smallest value for the gain G that would ensure that V _{out} is always within 10% of V _{in}, that is, V _{out} is always between 90% and 110% of V _{in}.

(d)
Insert a gain H between V _{out} and the negative (−) input of the opamp. Determine H to ensure that V _{out} equal exactly V _{in} for the gain you determined in part (c) of this problem.

(a)

3.
Consider the situation where you have been assigned the task of building a controller for an elevator. The controller gets two signals: position_goal, and speed_goal. It also gets two measurement signals, called current_position, and current_speed. The controller must produce one signal called desired_ acceleration.

(a)
Write down a mathematical expression for a simple proportionalintegraldifferential (PID) controller that will compute the value at any given time for output desired_acceleration in terms of the inputs available to the controller. Assume constants K _{1}, K _{2}, K _{3} … for any gain coefficients that may be needed in your expression.

(b)
Write an Acumen model that captures the effects of quantization and discretization of all input signals and discretization of all output signals to the controller. Assume all values are quantized by 0.01 sized steps and discretization is for 0.1 time steps.

(c)
Create a test scenario for your system, and use it to determine reasonable parameters for each of these parameters. Justify your choice of test scenario and the results that you have arrived at.

(d)
What kind of damage can result from instability in this system, and what methods would you use to manage any destabilization effects that could result from any unexpected disturbances on the elevator system?

(a)

4.
You are designing a control system that allows an object at point Q with mass 1 to follow another object at point P that is continually moving. Both points have a twodimensional coordinate. We will say that Q is at position q and P is at position p. You are using a controller of the form:
$$\displaystyle \begin{aligned}q'' = A (p  q)  B q'.\end{aligned}$$You start your design process by making a reasonable initial guess for the constants A and B.

(a)
Should you select positive or negative values for A and for B? Explain your choice.

(b)
Suppose that you run a few tests (simulations) and find that Q either oscillates around P or overshoots P when P moves. What change would you make to the parameters A and/or B to address this problem, and why?

(c)
After making this change, suppose you find that Q is following P but it appears to be slow or constantly falling behind (lagging). What change would you make to the parameters A and/or B to address this problem?

(d)
Suppose your selection appears to work well except when the point P moves faster the lag (the distance between the two points) gets bigger. Without making any changes to A or to B, what changes can you make to your controller to improve it?

(e)
Identify some practical difficulties that one can encounter in realizing such a controller.

(a)
8 Lab: Exploring Control
The purpose of this lab is to get some practice with the basic ideas of control in the context of simulations of some simple but representative dynamical systems.
The following model describes a first order dynamical system with its initial conditions:
Let us begin by considering an important technicality. In Acumen, one specifies more than the initial conditions usually needed for differential equations. In the above example, as a differential equation we would only need to specify the initial value for x, but here we also specify one for x'. For this model, the extra initialization will have no significant effect, as the equation in the always section will update the value of x' as soon as the simulation starts.
Going back to this system itself, this simple differential equation can be seen as a complete control system driving the value of x to 5 using a negative feedback scheme where the speed with which x changes, that is x' is proportional to the difference between our target 5 and the current value of x.
This type of controller will bring the value of x relatively quickly to be quite close to the target. If we want to speed up this process, we can multiply the term 5x by a factor greater than one.
Simulate the original model above. Next, add a gain factor as described above to see its effect on how the value of x changes over time. Confirm that changing the gain factor does not change the target value that the system seems to converge towards. Change the target value to another value to confirm that the new controller (with the higher gain) still seems to converge to the target value you specified.
A disadvantage of such a controller is that the value of x can get arbitrarily close to the target, but will never really get there in any finite amount of time. This motives investigating second order systems. The simplest way to get a second order system is in fact to differentiate both side of the question above. This gives us the following model:
If we give the derivative x' the variable name y, then this equation is y' = y. This helps us see that this itself can be seen as a control system where we are driving the variable y to the target value 0. This is a good property for our original model to have, where our explicit goal is to drive the value of x to five, but we implicitly would also like to have the value of x to stop changing when it reaches that value.
Explore modifying the above model to drive the value of x' not to zero but rather to a nonzero speed, say 10. As a hint, you can look at our original model and how we drove the value of x to 5 there. Run the simulation to verify that the model behaves as you expect.
But as long as we have an equation which we can reduce to a first order equation, we are not really exploring the full power of a second order equation. The following model is a more representative example of a second order system:
Again, we can view this system as control system. Here, the acceleration is being used to actuate the system, and the value of the variable x is being driven via negative feedback to the target value of zero. At the same time, we can view this system as a spring mass system, where the acceleration, which is equal to the spring force, is proportional to the length of the string. With this analogy, however, we can expect the system will oscillate around the target rather than converge towards it. That said, we are making a bit of progress, since we are now able to get the value of x to cross the target value. In a sense, what we need to do now is to get rid of the oscillation, or at least reduce it to an acceptable level.
Simulate the above system to verify this expectation.
Compared to the previous model above, we have lost the term that allowed us to drive the speed to zero. In a sense, we can “mix” the two effects by having both terms on the righthand side of the equation, as in the following model:
This equation can also be seen as a control system where we are driving x to zero and damping the actuation using the speed x'. The term x' is considered to damp the system because the higher the speed the lower the acceleration (as determined by the equation) will be. A key benefit of working with such a system is that now the variable x can actually reach the intended value, overshoot it, but still gradually converge towards it.
Simulate the above to confirm these observations, and in particular, that the damping diminishes with time.
We can generalize the above model with the following template, introducing additional undefined variables A,B, a, b:
The capital letter variables are gains, and the small letter variables are offsets. These variables remind us that we can tune the gain factor that we feedback to the actuation of acceleration, and we can choose target values for both position and speed as we see fit for our application.
Simulate instances of the above model template with different values assigned to these variables to better understand their role and their interactions. Try values such as 1 and 10 for A and B in alternation. Do you notice qualitative differences in response? Try other values. Can you identify qualitatively different behaviors and build a hypothesis about when (that is, based on what gains) they arise?
Next, go back to the value 1 for both of these variables, and explore different values for the small letter variables. What can you say about how they work? Can you imagine situations where the small letter variables come from another dynamical system?
To conclude this lab, consider how you can define in your model a notion of power for the amount of energy being put into the system. As a hint, consider that in dynamical systems power is force times speed. Next, consider how you can use this definition to define the total amount of energy being put into controlling the system. Next, define a cost function that includes both energy and distance from target integrated over time. What applications can you think of for this function?
9 Project: AccelerationBased Player for Ping Pong Robot
This chapter’s project is still aimed at developing a ping pong player that can outperform the other player, and at the very least, the default player. The new challenge that we consider this time is that the bat has mass. To capture this more realistic model of the system, the new bat Actuator can only receive a signal for acceleration. The force that you can apply is also limited. Your task is therefore to continue to develop the player that you created for the last chapter’s project activity by determining what forces must be exerted on the bat in order to realize the action that you were previously able to specify directly in terms of speeds. Note that the more acceleration exerted, the more energy is consumed (maxE). For this activity, your modified player must also consume less energy than the default player and predict the second point better than the default player. You will need to develop your own strategy to make the bat accelerate slowly.
Beyond this formal requirement you should feel free to enhance and improve your player in other creative ways. You have a lot of freedom in how you approach this task, and you have several issues that you can explore. Remember that your goal is to make the best player, and that at the same time you do not know how the other player will play. But you can imagine that your task is to build a player that can beat as many players as possible. Issues you may choose to consider can include:

Optimizing the parameters in the default controller (given to you as part of the default player for this tournament)

Developing an alternative controller (either as a continuous equation or as a hybrid controller)

Maximizing the accuracy of this player while reducing its energy consumption

Improving the methods of estimation in your player, either by tuning parameters or developing completely new methods

Changing the playing strategy (path planning)

Change parameters of the playing strategy
Feel free to explore any of or all these possibilities, as well as any others that you may feel can give your player a competitive edge!
10 To Probe Further

Article on Control Theory.

Article on Operational Amplifiers.

Video on TED talk about CPS with quadcopters

Video on control of an underactuated system, inverted triple pendulum

Video on quadcopters playing racket

Article on a complex control loop: Sleep and mood

Robohub article about control with quadcopters and an inverted pendulum

Article on Amazon developing quadcopters for delivery service.

Video of TED talk about how a fly flies
Author information
Authors and Affiliations
Rights and permissions
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.
Copyright information
© 2021 The Author(s)
About this chapter
Cite this chapter
Taha, W.M., Taha, AE.M., Thunberg, J. (2021). Control Theory. In: CyberPhysical Systems: A ModelBased Approach. Springer, Cham. https://doi.org/10.1007/9783030360719_4
Download citation
DOI: https://doi.org/10.1007/9783030360719_4
Published:
Publisher Name: Springer, Cham
Print ISBN: 9783030360702
Online ISBN: 9783030360719
eBook Packages: Computer ScienceComputer Science (R0)