With this dynamical system that we have here. This is a rigid spacecraft, we have a control vector, we have external influence, the gyroscopics. The last week of classes we're actually going to look at, what if the dynamics become more complicated? But a common pattern you will find because the controlled development strategies are very, very similar. It's just as you do all the math, instead of just having these gyroscopics, if you've got reaction wheels there is additional gyroscopics you have to account for. If you have CMG's different stuff. Variable BCMG's even more stuff, so you can adds to it. But the control development you'll find is very, very similar in that. So we're going to focus here on rigid body. If you want to have more on that then 6010, the follow on class to this, actually delves much more into systems of reaction mills, and CMGs, and variable speeds, and discernible laws, and everything that comes from them. But in here too we've got a tracking control. So we're bringing omega equal to the reference. And the attitude is a body relative to reference. And in the end, we developed this control law. This one is for the unconstrained control. So there's no limit in how big u could become, if your omegas go to infinity, your u goes to infinity, which of course is not realistic. because if we implement with thrusters, that's probably full-on is all you can do. That's as much torque as you're going to get as you fire those things. But also reaction mill, CMG's, and kind of attitude devices have limitations in how strongly they can push, again, torque the spacecraft. So this one you went through. Now, let's see, what do we have to argue for stability? Kevin, let me start with you, here. What did we have to do? What is the key part of this slide that shows me this system is going to be stable? >> We need to look at the the Lyapunov function. >> Okay, so we have a Lyapunov function. >> Need to make sure it's positive definites. >> All right, which this form it would be for any non 0 states. And we often break up the rates, energy like and then the states sometimes spring like or here we get just natural logs that work well for the rigid parameters, good. And what's the next step? >> And make sure that [INAUDIBLE] >> Right, which we actually imposed down here. This is a common trick we do when we develop these controls, that we take Lyapunov function, we take it's derivative, we set it equal to something negative semi-definate. But now, we note we set it equal to something in the rates, all right. It's negative-definite, in terms of my rate error, not the state error. And the reason for that, in a mechanical system, you always need some rate to measure, which tends to be something squared. State measures, take a derivative, rates appear on both sides, we can factor them out and then that's how we equate them again, right. It's the same process. It doesn't matter if it's the spring mass system with cubics or rotational stuff. The most mechanical systems has something like this. So good, so this was actually the argument. This one was negative semi-denifite only. The attitudes are also important but don't appear in this expression. So V dot can be 0 when we have 50 degrees error, in this mathematics, all right. The question is, does that actually happen? And this is a necessary condition, but it doesn't guarantee, if this is only semi-definite, that means it is stable. But it doesn't mean it is not asymptotically stable, right? That's why we have to have additional arguments. So what was the additional stuff we do, do you remember? To look at asymptotic stability on such systems? >> Yeah, if we want to prove it's asymptotic and stable, there has to be the derivative of the Lyapunov function has to be definite negative. >> Well, if we could make it, yes. But unfortunately, for these kind of second order systems it's very tough. I haven't seen one that actually does it successfully. >> We're looking then at the second order derivative. >> Exactly, so there's other methods. If you do nominal control, you may have heard of invariance principle. It's kind of related. It's a different approach. You find the largest invariant set where this thing manages and then there's some extra arguments. But the chain theorem I like very much, because it's a nice approach especially for engineers. You know how to take derivatives, you do it and then we have to look at that, right? So Daniel look at your chin, could you quickly outline that one for me? >> Well, we keep on deriving to the Lyapunov function until we get to something that's not 0. >> Right, so we take an extra time derivative of that second derivative, third derivative. And you expect these things to be 0 for the even ones and you're looking for an odd derivative that's non 0. On which set, Kevin, do we actually evaluate these higher derivatives? >> The set where the V dot function is going to 0. >> Right, which in this kind of formulation is always tends to be the rates of 0. With integral feedback we had something where it was the measure of the rates and integral term combined goes to 0. But it's something of that form, exactly. So good, we went through that. Global stability we argued if you treat these as just going to infinity, which we can do. But of course there we exclude the case that the spacecraft tumbles 360 degrees, because then our measure goes to infinity. So you can talk about global stability, but you still can't do a completely continuous tumbling body. To do that, we kind of had to start talking about switch Lyapunov functions. And what saves us there was that as we switch at sigma is equal to 1, the Lyapunov function itself actually remains continuous. Not smooth, but continuous. And in those arguments you can do. So we do have a globally stabilizing one and here's the outline of what we had with asymptotic stability. You take the second derivatives. Why could we always assume that delta omega dots and so forth or delta omega double dots are finite? What was that argument? >> [INAUDIBLE] >> Exactly, all right, sometimes students. because you could plug in and in the spring mass damper system I show you, you have an x double dot. You can take the dynamics, plug it in, put it in x dot equal to 0, and then show okay, if this is all that it vanishes. But if you can argue that this is stable, this is finite. 0 times finite has to be 0 and you save yourself some steps in algebra so, that's kind of a nice approach. So now, we have asymptotic stability. There we looked at robustness last time, so let's review that one quickly. The way we write that mathematically, is we have now, three torques [LAUGH]. This is the torque we controlled u, due to thrusters. Something's applying directly a pure coupled torque to the space craft. We have no new torques L, which could be a gravity gradients, or pressures, or radiation torques something we know, some outgassing on a thruster, because the valve's stuck and it's not quite closed. because that's a really common problem. You can model that and compensate for it. And then delta Ls are the unknown things that happen. So, you can also think, if you're holding a certain attitude and you're firing a thruster as an orbit correction and one of the thrusters fires hotter than the other one. This would give you a continuous disturbance, and it actually would be fixed as in a body frame. The following analysis, what you want to remember then is that we're assuming if all the other stuff, that delta L is fixed. And when I'm taking derivatives here, these are actually technically body frame derivatives. I put dots on there but my next book is going to fix that and make them primes. They're really body frame derivatives. So as seen by the body frame, we need these delta Ls to be fixed and then we can make this assumption. We did some other math. The Lyapunov doesn't tell us what happens here, because this function is indefinite. All I know is delta omega can't blow up to infinity, but that's not very comforting. So we look at other steps and we could turn it something like a spring mass tamper with a variable spring stiffness and there's some stability guarantees, as we'll have steady states. So my rate errors will go to 0, which is nice. But my steady state errors, if you have unmodeled torques actually go non 0, all right. So now, if we have unmodeled torques, we can predict what the error is and as Daniel was talking last time, we get to pick K. So that's what's called modeled disturbance rejection part of the gain selection. You may have gain selection criteria that specify how you over damped, under damped, how rapid is your response, but you may also have to consider external disturbances. These gains help stabilize something when you have unknowns coming in. Feedback is a fantastic way to get rid of ignorance, all right? We think it's rigid but really not, we think it's point. All the stuff that's going on, and to the feed back it's a way to clean things up but you have to see to what degree. It never does it perfectly. And this gives you a nice analytic estimate. So good, we're just jumping through these the way we fix that. In linear control, you add integral but with non linear motion it's not easy just to add integral feedback. This will relate very closely to the last part of the lecture today, where I'm going to show you perfectly linearized closed set dynamics. And there it's actually easy to add classic linear proportional, derivative, integral terms, but you pay the price somewhere else to get that kind of a form. So here we're looking at how to modify the Lyapunov approach. We still have our del omega, we still have a sigma. And we're introducing a new variable z, which is the integral of attitude and in integral of inertia times angular acceleration error. This is what makes all this math work. You're v dot, we found was still negative semi-definite. And then to look at asymptotic conversions. This is 0, if these two terms are summed to 0, right? Not if del omega 0 is a del omega 0, individually. So we apply this, if you only have known torques this control with integral still converges, and everything should go to 0. The more interesting part was when we included unmodeled errors, right, then we get that extra term. And at the end, we can argue that this has to be bounded. So the integral term of something having debounded means these terms have to at some point go to 0. And this helped us argue that the states should go to 0, but the z part with extra arguments doesn't go to 0. But anyway, so that was integral which relates to today's lecture. Gain selection, let's see what you remember of that one. Why are MRP's nice for gain selection? What do you think Kevin? >> because they all linear in the right range. It can read now as- >> If you say linear, they're nearly linear, right? I mean, fundamentally, they're non-linear. If you double your angle, it's not exactly double the MRP, but it's pretty darn close, right? So we don't have a completely linear description in that sense, but it's really, really close to a linear one. In fact, for a very large range, typically well past 90 degrees. 90, 120ish, depends on your tolerance, all right? So in H180 nothing crazy happens, like you have with CRP. CRPs has blow up to infinity at 180. MRPs just start to, you get a little bit more non-linearity but it's not too bad. So that's the key, with these things we can linearize. And your MRP differential equation, the key thing to remember is this one. This B matrix basically linearizes to identity. So as MRPs are angles over 4, MRP rates are rates over 4 essentially, and you can plug that in. And if you wanted to, you could use this form with a complete P, a complete inertia tensor and place roots and so forth. But realistically we tend to have spacecraft where we've picked the coordinate frame that is pretty darn close to principle. May not be exact. Maybe some astronaut put the suitcase on the left side instead of the right side. Now we're slightly different. But it's pretty diagonally dominated so that's a good assumption. And the gains, that's a pretty common assumption too. So you could pick your selections from here, right? The next steps are not required for this step. We've already done the linearization. It was dead trivial because the kinetic, the closed loop side was already linear. it was just the MRP dynamics that we had to linearize. So that's kind of a nice thing of this, and then you do that. So if you have a diagonal inertia, diagonal p matrix, you can come up with this simple decoupled that one axis controls the attitude and rates of one. Attitudes and rates of two, attitudes and rates of three, and you can set your gains individually. One of the challenges here, still, is we can have three different rate feedbacks, but we still always with the MRP that we have only have a single gain on the MRP. That gain had to be on the outside of the lateral log function. It was k times natural log 1 plus sigma squared. If you'd move it inside as a matrix, the math doesn't work as nicely, you have lots of muddle in your terms. And then you can linearize them again, but it won't match up nearly as well. So once you know where the roots are, you can look up on how to get natural responses, damping, decay times, damped angle velocities. It's kind of nice. And so, we get now something that's for the non-linear motion, globally asymptotically stabilizing. With integral, we can make this also robust.