0:00

Welcome to the second lecture on LTI models on state space forum, where LTI

Â stood for Linear Time-Invariant Systems. And what we saw last time is that we could

Â model at least two systems like x dot is Ax plus Bu and y is Cx. Well, it turns out

Â that this is a very, very general description of a large class of systems.

Â And x here is state of the system. What that means is that x describes what the

Â system is currently doing, u is the input which tells us how we effect the system,

Â and y is the output which measures the aspects of the system that we care about

Â or that we have access to somehow. and the way we should think about these a, b, and

Â c matrices are really that, here, Ax, well, that's the physics of the system.

Â So, A is given to us by Newton, by the laws of physics or electromechanics, or

Â whatever it is that we're using to model our system. And there's very little we can

Â do about that. B, on the other hand, that tells us how the input affects the state.

Â Meaning, this tells us what actuators we have. So, if we buy new actuators, we get

Â a bigger B. In other words, B is, to a certain degree, up to us, the designers

Â who are actually building the systems. Similarly, C, actually encodes what

Â sensors we have. Meaning, how, can we actually get information about what's

Â going on inside the system. So, A is given. Typically, B and C redesigned when

Â we designed the system. And as we will see later on sometimes, we may not have enough

Â control authority, for instance, to make the system do what we want, meaning our B

Â matrix is too measly which means that we have to buy a better B matrix, maybe buy a

Â new actuator or so. but at the end of the day, a system like this, it's influenced

Â by our control signal u, that's the input, and out comes y, which is ultimately the

Â thing we can see. We can typically not see x, but we can see y, because that's what

Â our sensors are measuring. And the question that all of control theory is

Â really about, is how do we pick this input to make the system do what it should be

Â doing? And, more importantly, since we only can measure y. How do we pick u,

Â given y? Unfortunately, we cannot answer that question right away. What we do need

Â to do first is understand these systems a little bit and come up with tools for

Â describing their behaviors because until we understand their behaviors, we can't

Â pick u's that make the behaviors be what we want them to be. so we're going to do

Â that. but first, we actually need to understand a little bit more about where

Â these systems come from. So, let's start with our old friend, the car model. This

Â was the model we used when we built the cruise controller for a car. So, what's

Â going on here is that, the acceleration of the car, v dot, was c over m times u minus

Â gamma v. so, let's put this model on state space form. Well, let's say, first of all

Â that, we're building a cruise controller. All, all we care about is the velocity. In

Â this case, let's say, that the state is actually the velocity. The thing we're

Â measuring is the velocity, which means that y is Cx, where C is simply 1,

Â alright? We're simply measuring one. Well, v dot is

Â giving by this expression which means that x dot, where which x is the same as v is

Â Ax and A here is simply minus gamma, plus Bu, where B then become C over m. So, in

Â this case, we have a one-dimensional system for describing what's going on.

Â Now, let's pretend that instead of building a cruise controller, we'll

Â building a self-driving car. Well, clearly, we not only care about how fast

Â it's going, we care about where it is. So, in this case, let's make our state, the

Â position and the velocity, so P, V. In this case, we're measuring the position C,

Â 3:50

which means we're taking out the first component of the state. So, C is 1,0.

Â Similarly, this equation still holds so what we're controlling is the acceleration

Â through the Cm and what remains is my A matrix where the 1 here simply says, that

Â the time derivative of position is velocity and then, this gamma is the same

Â gamma as we got before. So, the impo rtant point to note here is that the model we

Â end up with, to a certain degree, depends on what we care about and what are the

Â things that we can, can measure. Now, let's take another model. Here is a

Â pendulum. And the pendulum is attached up here on the ceiling somewhere. And it's

Â swinging with an angle theta. It has length l. And the acceleration of this

Â angle, this angular acceleration, turns out to be minus gravity over the length

Â times sine of this angle plus Cu. And the way we should interpret this is that what

Â we're doing is we're actually applying a torque up here that allows us to swing the

Â pendulum a certain way. okay. Let's write this as an LTI system. Ouch.

Â Sine theta is not linear. So, we actually cannot write this as an LTI system. But,

Â here is something we can observe. For a very, for small thetas, then sine theta is

Â actually roughly equal to theta. so what we can do for small angles, is actually

Â replace this thing by theta. So, let's do that. For small angles then,

Â what we get is, wellm if we measure the angle, then y is simply 1, 0, where we're

Â taking out the angle and not the angle or velocity. Because the state, in this case,

Â is theta, theta dot. Well, similarly, we're having a C here, so

Â the C shows up there in the B matrix, and the A matrix looks like this. 0,1 here,

Â which means that the time derivative of the angle is the angle of velocity, and

Â this g over l term here is the same as the g over l term up there. So, this would be

Â the a, b, and c matrices for this pendulum.

Â And again, I want to encourage you to go through the math and perform this matrix

Â multiplications so that you indeed trust that this is correct. Okay, let's do

Â another example. Two simple robots. Let's say that we have two robots on a line and

Â what we can do is we can control the velocities of these robots. So, x1 is the

Â position of robot 1, x2 is the position of robot 2, and we want to somehow control

Â them. Well, first of all, what we get is that x dot is 1 0, 0 1 u. We have no A

Â matri x in this case, A is equal to 0 and the B matrix is simply the identity

Â matrix. let's say that we can match where the robots are, too, so in that case, y

Â would simply be the identity matrix times x, or just x itself, right? So, this would

Â be, our, our model of this. Now, let's solve the problem here. Let's solve what's

Â called the rendezvous problem. the rendezvous problem is the problem we'll

Â have when the robots meet. And, you know what, why don't we actually have them

Â drive towards each other? So, here's an idea one can have. Where we say that u1 is

Â x2 minus x1, which is simply code for saying that x1 is going to move towards

Â x2. And similarly, u2, let's make that x1 minus x2. Then, that means that robot 2 is

Â aiming towards robot 1. Well, what we've actually done now, is we've designed a

Â closed loop feedback law, where we have written control inputs in terms of the

Â states in this case, but since the outputs are the same as the states, we're actually

Â writing them in terms of the outputs. Well, if I do that, I get a new system. X

Â dot is negative 1, 1, 1, negative 1, x, and what this corresponds to is instead of

Â writing u here, I'm plugging in these things there, and then you end up with a

Â new system dynamics that's what's called a closed loop system dynamics. And, in fact,

Â if I run this, and let's run it for not 2 robots but a gazillion robots here, then

Â as you will see, running exactly this simple controller makes the robots

Â actually meet on a same, on the same point, so that's kind of cool. let's do

Â another example now. This is the unicycle robot we looked at that when we modeled

Â the differential drive robot. Again, sines and cosines are unpleasant. This is not

Â linear, alright? , But cosine for small angles is equal to 1. So, let's assume

Â we're dealing with small angles. And sine, for small angles, is equal to the angle

Â itself. So, using that, we get this. But look at this. This is still not linear

Â because here, we have a multiplication. So, even when we made a simplification, wh

Â ich by the way is a completely stupid simplification because the pendulum may

Â swing at small angles, but why does the car have to drive in only direction where

Â we are having small angles? That doesn't make any sense. But the point there is

Â that this kind of simplification didn't do anything. Still not linear. So, we need to

Â be a little bit more systematic when we generate linear time invariant models

Â from, for, from these kinds of non-linear systems because just saying that let the

Â angle be small and hope for the best, won't actually give us all that much. And

Â in the next lecture, we will be systematic in our generation of these linear

Â time-invariant models.

Â