# Control Systems in Practice: Passivity-Based Control to Guarantee Stability

From the series: Control Systems in Practice

*Brian Douglas*

Learn about passivity-based control to guarantee closed-loop stability of feedback systems. Consider different ways to assess the stability of systems other than looking at gain and phase margin.

In this video, we're going to talk about guaranteeing closed loop stability of feedback systems. And the main purpose of this video is to introduce the idea of passivity, and get you thinking about other ways to assess stability of systems than just looking at gain and phase margin. I hope you stick around for it. I'm Brian, and welcome to our MATLAB Tech Talk.

To begin, I want to set up a simple example that we're going to use throughout this video, controlling a Cantilevered Flexible Beam. Here, disturbance forces enter this system near the middle of the beam, and set the beam in motion. And we can measure the velocity of the beam at that point with a velocity sensor, and then control the motion of the beam with a force actuator. So in this example, the disturbance, the input force, and the measured velocity, are all co-located at this point.

And our goal is to develop a feedback controller that can regulate this system by responding to and rejecting the external disturbances, to reduce vibrations in this beam. The way we're going to approach this problem at first is to develop a Linear-Quadratic-Gausssian controller. An LQG controller is the combination of an LQR controller to minimize a quadratic cost function that takes into account system performance and actuator effort, and a Kalman filter to estimate state in the presence of measurement and process noise.

And both of these concepts are covered in other Tech Talk videos, links in the description. So I'm not going to go into detail here. Now to build this controller we need a linear model of the flexible beam. We can model the first bending mode of this beam as a second order transfer function, with parameters specifying the mode frequency, damping, and gain. And we can add to this transfer function, the second bending mode to get the response to the first two modes. And in this way we can continue adding more modes in a similar fashion such that the transfer function is this summation.

Now the question is how many modes do we actually need to model? The more we model, the more accurate it will be and the higher the chances are that LQG controller will work on the real beam. However, the more states we add to the model, the more states the controller has since it's a 1 to 1 ratio. So we're going to end up with a larger controller as well. Now to investigate this question, let's start with just the first two modes which has a total of four states.

In MATLAB, I've written this live script to walk through the LQG design. I define zeta, alpha, and omega, for the first two modes and build the transfer function G2. Here the transfer function is converted to state space form and then the parameters of the controller are defined and the LQG controller is created. Now looking back at the block diagram for our system, we have G2 which is the model of the plant using just the first two bending modes, and we have the LQG controller.

And notice that these two blocks are connected through positive feedback. Since we're adding the actuator command to the external disturbance. Therefore, when we create the whole closed loop system, we have to put in this +1 in the feedback function to indicate that positive connection. Now with this feedback system we can look at the impulse response for both the uncontrolled system which is in orange and the LQG controlled system which is in blue. And we can see that our controller does in fact help reject disturbances.

And we could play around with the cost function and the measurement and process noises if we want to tune this response, but that's not where I want to take this video. I want to look at how much stability margin we have in this design. We know that our model of the flexible beam is not perfect. It's just the first two modes. Therefore, to give us confidence that this controller won't create an instability on the real beam, we should have adequate stability margin in the design. And we can check for that by looking at the disk margin.

Here, this states that we can handle an uncertain gain between about 0.1 and 8 and an uncertain phase between about plus or minus 75 degrees. And that's a huge amount of margin, which is great. But let's see how this controller holds up with a higher fidelity model of our system. That is, I wonder how much of this margin we're eating into when we add in the additional flexible modes into the beam model. So that's what I'm doing here. I'm adding in four more modes. So the first six modes in total and creating a new plant model called G6.

Now I'm placing the existing LQG controller in feedback with this higher fidelity model and seeing how well it performs. And check this out, the impulse response is actually still really good. It appears as though the performance hasn't really been impacted too much by adding in the additional four modes. But if we check the disk margin for this system, you're going to see that it tells a different story. We lost a significant amount of margin in the design by adding in that additional fidelity. The upper gain margin went from about 8 down to 2.7. And the phase margin went from 75 degrees down to 50 degrees.

Now, before we panic too much with this change in margin, we should realize that this is exactly the purpose of margin. Right? It's to ensure stability in the presence of uncertainty. So we did in fact eat up some of our margin with this uncertainty but it was exactly as intended. But this drives the question, is the system still stable if we add 12 modes or 24 modes to our model? And what if we're off on the mode frequencies or the mode shape, do we have enough margin to guarantee stability in these conditions?

And maybe we do but we don't actually have to answer that because in this case, it turns out we have another tool that we can use to assess stability of feedback systems that will give us a lot more confidence that our beam controller will be stable, even in the presence of huge modeling uncertainty. And that is with the concept of passivity and passive control. A system is passive if it cannot produce energy on its own, and can only dissipate the energy that is stored in it initially.

And for many real world systems, this can be generalized to the statement that in input-output mapping is passive, if on average increasing the output y requires increasing the input u. That is, in order to get more out of the system, you have to put more into it. And so if you stop putting energy into the system, then you know that the output on average won't continue to increase. And we're going to come back to this in just a second. But first I want to talk about the benefits of passive systems.

Why do we care about them? The passivity theorem states that if we have two passive systems placed in negative feedback, then this will produce a stable closed loop system. Therefore, if the system you're trying to control is passive then you can design a passive feedback controller and you are guaranteed to have a stable system, even in the presence of unmodeled dynamics. As long as those dynamics don't impact the passivity of the system.

The reason this theorem is so important is because there are classes of physical systems that are known to be passive. For example, a lot of analog electronic systems that are made out of passive components like resistors and capacitors are passive systems. And in our example, the flexible beam with a force actuator, co-located with a velocity sensor, is a passive system. So if we design a passive controller, then

we know running that controller on the real physical system will be stable, even if our model of the physical system is wildly off.

Now in our case, because we have this positive feedback, this means that we want to design our controller such that the negative of the controller is passive. And that would then guarantee that the closed loop system is stable. Now we're not claiming that performance will be great if the model is way off, but at least we know that there won't be some hardware damaging instability. All right. So back to how we can tell if a system is passive.

I mentioned that in input-output map is passive if on average increasing the output y requires increasing the input u. And mathematically this is represented by this inequality. This is saying that the inner product of the output and the input must be greater than zero for all time given zero initial condition. Basically, if you multiply the output and the input together, the sum should always be positive given all input-output trajectories. If so, then the system is passive.

And this kind of seems like a strange constraint to place on a system, but it turns out that there is some physical reasoning behind it. For example, if the input into the system is a force and the output is the velocity that the force generates, like our beam problem, then this constraint is basically saying that the integral of force times velocity, or the integral of power is always positive. Therefore, the energy transferred into the system is always greater than the energy that we get back. No matter what forces we apply. The system only consumes or dissipates energy.

And if you'd like to walk through a proof that the flexible beam in our problem is actually passive, check out section 2.17 of the book by Lozano and others that I've linked to. In there may show how an infinite sum of modes governed by the transfer function alpha s, over s squared plus 2 zeta omega S, plus omega squared, is known to be passive. Therefore adding more modes into our model or changing the existing mode shapes won't affect passivity because they still adhere to this summation structure.

Now, when we're talking about linear systems like this, checking for passivity becomes a lot simpler. In the frequency domain, passivity is equivalent to the positive real condition. For single input single output systems, this is saying that the real component of G of j Omega is greater than 0 at all frequencies. Or another way of putting it the entire Nyquist plot lies in the right half plane, the positive real plane.

And so if you look at the Nyquist plot for a linear system, and it exists completely in the positive real plane, then that linear system is passive and if we go back to MATLAB, we can see that our linear model of the flexible beam is passive by looking at the Nyquist plot, it's all in the right half plane. And this is the case for both the two mode and six mode versions. Now more simply in MATLAB you can check for passivity of linear systems with the function is passive. And again, we see the models are passive.

And if we check for passivity of the negative of our LQG controller, we can see that it is not passive. The Nyquist plot doesn't reside completely in the positive real plane. This means that using this controller we can take advantage of the passivity theorem to guarantee closed loop stability. All right. So we have a plan now. If we design a passive controller, then the feedback system will produce a stable closed loop system even if our model is off with the number of modes and mode parameters of the real system. And we can specify that we want a passive controller with the systune function in MATLAB.

Here I'm setting up a four state controller. The same as LQG controller. And then using the two mode model to tune it. And I'm giving it two different tuning goals. One is to minimize the same LQG cost function that we used earlier, and two is to ensure that the negative of our controller is passive. And systune returns CL1 which is the tuned closed loop system and J1 which is the minimum value of the cost function that the optimizer was able to achieve.

And if we compare this minimum cost value to what the LQG controller got, you can see that it only increased by much less than 1%. And we can see this minimum change in performance by comparing the impulse responses of the two systems. There's hardly any difference at all. And if we check the Nyquist plot for the negative passive controller, you can see that it does lie completely in the positive real half, whereas the LQG one does not.

So we don't have a huge performance loss with this controller, but we get the benefit of passivity which comes with the guarantee of closed loop stability. For our flexible beam system, we know that none of the unmodeled modes or mode shape uncertainties will cause instability regardless of the gain in phase margins in our system. And this is going to give us a huge amount of confidence to do Hardware-in-the-loop testing, or to deploy our controller on a real beam with unknown dynamics and know that we won't hit a hardware destroying instability, which I think is pretty cool. All right.

This is where I'm going to leave this video. If you want to understand how systune is able to develop a passive controller, or if you want to understand how a sector-bound constraint like the one we use to check for passivity can be used to investigate other robust system properties, check out the paper that I've linked to in the description. And don't forget there are more resources in the description to everything else I mentioned in this video.

And if you don't want to miss any future Tech Talk videos, don't forget to subscribe to this channel. Also, if you want to check out my channel, Control System Lectures, I cover more control theory topics there as well. Thanks for watching, and I'll see you next time.

#### Related Products

#### Learn More

Select a Web Site

Choose a web site to get translated content where available and see local events and offers. Based on your location, we recommend that you select: .

You can also select a web site from the following list:

## How to Get Best Site Performance

Select the China site (in Chinese or English) for best site performance. Other MathWorks country sites are not optimized for visits from your location.

### Americas

- América Latina (Español)
- Canada (English)
- United States (English)

### Europe

- Belgium (English)
- Denmark (English)
- Deutschland (Deutsch)
- España (Español)
- Finland (English)
- France (Français)
- Ireland (English)
- Italia (Italiano)
- Luxembourg (English)

- Netherlands (English)
- Norway (English)
- Österreich (Deutsch)
- Portugal (English)
- Sweden (English)
- Switzerland
- United Kingdom (English)

### Asia Pacific

- Australia (English)
- India (English)
- New Zealand (English)
- 中国
- 日本Japanese (日本語)
- 한국Korean (한국어)