0:05

So the last step is - we've done kinematics,

Â we've done all that stuff,

Â we've done our control laws,

Â we've gone through the up and off definitions, right?

Â And we've developed them.

Â But so far we've developed controls laws just for you.

Â We had these equations of motion,

Â I kinda - I think I've got that equation here.

Â Yeah. Pretty much like this, right?

Â And we found out some method to come up with this U,

Â L is treated as a non-torical;

Â if it's known, you can include it.

Â Right? But there's certain steps that require it.

Â What I want to do now is show you,

Â in this one simple example,

Â how we can use everything you've just learned to become answers for and apply it to

Â a different dynamical system and come up with a control very, very quickly.

Â And you get the same stability argument,

Â the same analysis, all the stuff,

Â but the control will look differently because it's a different dynamical system.

Â All right? That's the goal.

Â That's what we want to do and that's what we'll end with here.

Â So now it's a control with multiple things.

Â It's where everything kind of comes together.

Â Here is our equations of motion.

Â This is a single spacecraft with N reaction wheels.

Â We were able to write the momentum of

Â each reaction wheel into the h vector. That's what we got here.

Â And this us is nothing but an N by one of motor torques.

Â We have that form. That's still some external torque.

Â And everything else is fixed.

Â I(RW) in this case is I(RW) fixed as seen by the body.

Â All right. If you look at the definition here,

Â this is a system of reaction wheels.

Â So our gt and gg fixed as seen by the body.

Â Yeah.

Â Right. So that's going to be nice.

Â So in our earlier - the Lyapunov function that we had,

Â you will see there's a slight modification;

Â but we can use the same tricks as if it was just this one as we had earlier.

Â Before we basically just had a rigid body which was - which we're now calling Is.

Â So now, we want to do three Xs attitude control.

Â I want to point my heading and control the rate

Â simultaneously to do a tracking problem or regulation.

Â But I think I'll do a - a tracking here in a moment,

Â the most general form.

Â So that means I want to come up with a control law for us,

Â a set of motor torques that will make this craft spin up the wheels, gyrate,

Â spin around and stabilize smoothly,

Â pointing in the desired direction or stabilize and

Â smoothly follow a time-varying history.

Â Right? That's the reference-tracking problem.

Â Outline for me quickly what the steps were.

Â How did we do this?

Â Tepa - we'll start from left to right in the room.

Â If we do a control,

Â first question is what states are we gonna control?

Â So in this problem,

Â what all has to go to zero?

Â The Omegas - oh, well - yeah.

Â I guess if we want a - well,

Â not Omega, depending on the frame.

Â The frame-to-satellite omega has to go to zero;

Â frame being the goal frame.

Â So the reference frame?

Â Reference frame.

Â If it's in - if it's in trackings or Omega B relative to R has to go to zero?

Â Maybe R.

Â So which Omega is this?

Â This often causes confusions to people.

Â BN, isn't it?

Â This is BN, right? If you see that, that's just the body.

Â When you simulate in the code, you're simulating BN.

Â And then you're somehow keeping track of what the reference

Â has to be and you always have to compute separately.

Â You never compute BR,

Â Omega BR, even Sigma BR directly.

Â You compute Sigma BN just hey,

Â this is my system and it's spinning and gyrating and this is the reference.

Â And then you do all your proper kinematics.

Â Good. So that's one of them.

Â What's the other? So our rates want to go to zero.

Â Relative angles.

Â Yep, definite Sigmas. You know me, I like Sigmas.

Â Right? So our Sigmas,

Â which are Sigma B relative to R. Right?

Â But we just write Sigma for shorthand a little bit.

Â But if you would like it merbose - good.

Â Now, Mariel, we know what states want to go to zero.

Â What's the next step?

Â What do we have to create now to devise a control?

Â A Lyapunov function.

Â Okay. So, Andrew, what does a Lyapunov function have?

Â What properties must it have?

Â So the function itself has to be opposite semi-definite [inaudible].

Â Negative definite?

Â Negative definite - or negative semi-definite.

Â And the -

Â Depending on what kind of stability you want, right?

Â Just stay at stability right now.

Â Okay.

Â So Vdot has to be negative set.

Â Yeah, that's the next step.

Â But right now, the V function is set positive semi-definite?

Â So I can make a V function that is all zero?

Â That would be three positive-definite.

Â Yeah. At least it has to be a neighborhood somewhere that is positive-definite.

Â Ideally, it's globally positive-definite,

Â that would be ideal, right?

Â But yeah, so it has to be a negative.

Â Good. So now we go to V. What's the next step, Mondar?

Â Oh, we have to take the derivative of it.

Â Right.

Â And then -

Â So you take Vdot.

Â Now, we want this - and you already gave that,

Â saying it had to be negative semi-definite.

Â So what do - so, Kevin,

Â what do we make Vdot equal to to make it semi-definite?

Â Minus the term Omega transpose P.

Â Yeah. So the rate measure squared which - Omega transpose P - Omega, something like that.

Â Could you make - for a secular mechanical system,

Â can you make Vdot negative

Â definite directly?

Â I mean, it depends if you want to subtract the attitude on it, but -

Â All right.

Â So if you're looking at this - I don't need fire, hold on.

Â So we have V, that's a Sigma.

Â And let me just do Omega on the regulation.

Â This is a little bit quicker.

Â So we've got this and we say one-half Omega transpose I

Â Omega plus two k natural log 1 plus Sigma squared.

Â All right. That's our favorite MRP, the Lyapunov function.

Â You do this - you take the derivative of

Â this whole thing and you end up always factoring out Omegas.

Â Okay. Sigma, right?

Â If we would say - no,

Â we - what you described first was minus Omega transposed P Omega.

Â Why is this only negative semi-definite?

Â Casey? Why is it not negative?

Â This looks negative definite to me,

Â but why is this actually only negative semi-definite?

Â 6:39

Because of the K Sigma term?

Â No, that's not here.

Â Doesn't it depend on Sigma, so -

Â It doesn't, right?

Â It's a - this V,

Â we care both about states and rates.

Â This - this Vdot is negative definite in terms of the rates,

Â but that's only half of the states we care about.

Â The Sigma doesn't appear.

Â So if Omega is zero, the Sigma is zero;

Â but Sigma could be 50 and the Vdot is still zero, right?

Â That's why it's only semi-definite.

Â Only we know with higher order derivatives,

Â we can prove asymptotic stability on

Â this control in this case, but that's kind of what we do.

Â But now, why do we make it negative semi-definite?

Â Because with these mechanical systems,

Â you - you tend to have a quadratic rate measure and a quadratic state measure.

Â Taking a derivative with chain rule,

Â you're going to get rates on both sides.

Â And we can always factor out rates.

Â And then we make it negative semi-definite in terms - or you know,

Â negative definite in terms of rates.

Â And then we can say this bracketed term must be equal to minus P Omega.

Â And you have to - the last step is plug in the equations of motion.

Â Right? And that's where the control variables appear.

Â And you solve for the right control to make this work.

Â Or sometimes we can find some of them.

Â There's an Omega tilde, if you plug it in then we can say Omega transpose,

Â Omega tilde vanishes.

Â There are some tricks we can play that you get the same negative definite function.

Â It's not just one control that gives you that behavior. But that was a step.

Â If we had minus K Sigma transpose Sigma and we did this stuff,

Â what happens then is we can't just factor out Omegas and solve for this.

Â This gives you a set of differential - a set of algebraic equations

Â that we just can't solve for that control variable.

Â And that's the classic problem with this stuff.

Â So that's why, in mechanical systems,

Â we can't just do this and that's why we always end up with

Â negative semi-definiteness with these Lyapunov approaches.

Â And then we look at LaSalle's in-variance or Mukuchi Chan,

Â we discussed in class,

Â to analyze and study asymptotic conversions.

Â Good. So that was the process.

Â Right? Now we have something that looks a lot more complicated with

Â whole systems of reaction wheels instead of just having that little U.

Â Now, I'll show you how we modify this approach to get there.

Â So good, we're here.

Â First thing is - Tepa already gave this away, right?

Â This is the body relative to reference.

Â Exact same notations that we had earlier.

Â This is really Sigma BR.

Â This del Omega is Omega BR,

Â but you can write it as Omega BN minus Omega RN. Same thing.

Â We come up with a Lyapunov function.

Â What's the only difference in this Lyapunov function,

Â compared to the one we used for a single rigid body?

Â There's one term that's different.

Â Yeah, I changed this.

Â Now this is still a symmetric positive definite matrix.

Â Why do you think I replaced I of

Â the hub with I(RW)?

Â What appears in our - in our equation;

Â in our differential equation.

Â Yeah. When we differentiated this,

Â this is Omega minus Omega R. You can have an I(RW) times Omega dot,

Â which makes it really easy now because then,

Â if you go look at your differential equations,

Â I can just substitute it in directly.

Â I could have an array to the Lyapunov function,

Â it's just one-half Omega transpose Omega.

Â But then you have to invert that inertia tensor to solve for Omega dot and plug it in.

Â Throwing in that I there is a nice algebraic trick to avoid some silly matrix inverses.

Â Because in the end, with the gains,

Â you can always compensate for that. It doesn't make any - you know?

Â If this a - as we said,

Â if this is a Lyapunov function,

Â I can take this function and multiply it times

Â 10 and it's still a Lyapunov function, right?

Â It has no impact. It just - you make your gains 10 times smaller,

Â but it's the same the same control, the same response.

Â So that's it. We just change this out of convenience.

Â It's still a symmetric positive definite function the way we defined it.

Â And now, when we take derivatives,

Â as with a single rigid body,

Â we only end up with the body frame derivatives of del Omega.

Â There is no body frame derivative of this I(RW); whereas for reaction wheels,

Â that inertia tensor, even with 16 wheels in there, it's still fixed.

Â Right? The wheels are perfectly balanced.

Â If they're not balanced, all hell breaks loose and it gets very complicated.

Â But if they're balanced, nice and easy. Right?

Â So this looks pretty much exactly what we had before.

Â We take a derivative,

Â we set it equal to something that's negative semi-definite,

Â it's negative definite in terms of the rates.

Â Then when you plug this in, we get this.

Â Now at this stage,

Â we have to actually substitute in the true body for a derivative del Omega,

Â as we did before.

Â And then you introduce the equations of motion.

Â We plug it in and that's the only part that's different now.

Â All of a sudden, instead of just having I Omega

Â dot equal to minus Omega tilde I Omega plus U,

Â we have a few other gyroscopic terms that appear.

Â Right? But you still just solve for the same U.

Â And in this case,

Â I'm solving for GS times U and this is the right-hand side.

Â So the motor torques times the projection axis have to give you

Â - this is the K Sigma P del Omega.

Â If we didn't have momentum of the wheels,

Â this looks just like Omega I Omega that we had in the other control.

Â And this is the part that has to do with the reference trajectory,

Â the feed forward part, that this is the trajectory

Â you should be following to get asymptotic convergence.

Â And we feedback compensate for known external torques.

Â It's almost the same.

Â It just has a few extra terms.

Â So you can see the strategy that we applied,

Â actually Lyapunov, very quickly at least,

Â I'm leaving with something that works.

Â We aren't spending much time on this,

Â but if you understand the earlier Lyapunov,

Â it's a trivial expansion.

Â It's almost the same control.

Â It just - you have to not come up with a motor torque that generates this.

Â And that's where the trick is.

Â So let's look at some conditions.

Â So I'll - on this right-hand side, I'm just going to call it LR,

Â that's my required control torque.

Â I need to come up with a set of motor torques that produces that torque.

Â If we have this popular arrangement where you have three wheels,

Â each spin axis of the wheel - spin axes one lines up with B1,

Â spin axis two lines up with B2,

Â spin axis three lines up with B3;

Â in that case, GS becomes identity.

Â Right? That's it.

Â And then us must be equal to LR.

Â So really, just the three components of LR is motor torque one,

Â motor torque two, motor torque three.

Â That's it. There's no wiggle room.

Â There's no optimization.

Â It's just one answer.

Â Hopefully, you can do that.

Â If these exceed your available torque, you just saturate it.

Â That's it. That's - that's all you're doing at that stage.

Â A more common situation is maybe - or more and more I should say common,

Â is that you have N reaction wheels.

Â So now we have a cluster of reaction wheels.

Â A popular configuration is four,

Â can also in a pyramid-like configuration,

Â they could all run simultaneously.

Â They can all help each other so much produce this torque.

Â So now we have to figure out how do we invert this matrix.

Â This is now a three by N. So this becomes a three by four.

Â And you can't just invert a three by four,

Â you can only invert square matrices.

Â So there's different inverses you can take.

Â This one is the matrix form of a minimum norm inverse.

Â Anybody not heard of a minimum norm?

Â Good. I won't ask Mandar, then.

Â So Andrew, since you've heard of it - he raised his hand,

Â he was - yeah, he was smarter than you.

Â By now, you should be up to these tricks. All right?

Â So what is a minimum norm inverse?

Â What answer does it find?

Â It finds the answer,

Â the minimum at the linear least squares answer.

Â No. Those are two different things. They're very similar.

Â The - the least squares solution has this inverse,

Â kind of, over here and the things are transposed.

Â They are very close cousins, right?

Â So let's go look at this.

Â This is a little bit linear algebra I want to review.

Â So I'm assuming you've seen this before.

Â It's - it comes down to how do we solve systems of equations.

Â Little less fire - okay. So if - now,

Â we'll do this in red. Why not?

Â So if we have GS one,

Â GS two, GS three,

Â GS four times us one,

Â us two, us three,

Â us four equal to one,

Â two, three as LR.

Â Just easy numbers.

Â Right?

Â I have four unknowns.

Â I have four control variables.

Â What are the four motor torques?

Â How many constraints do I have with this equation?

Â They must set - these four torques must satisfy how many constraints?

Â Three, right?

Â They all - whatever torques you pick times - you know,

Â this is a three by four matrix.

Â The first row times this better give me one.

Â The second row times the same motor torques better give me two.

Â And the third row times the same motor torques better give me three.

Â How many possible answers are there to this problem?

Â Infinite, actually.

Â There's an infinity of answers,

Â because we got more parameters and constraints.

Â That means you could have superimposed extra conditions or just make something up.

Â What people are doing - which is the most popular way,

Â has been the norm - is to just make something up and say hey,

Â out of all the possible infinity of answers,

Â I'm picking the answer that has the smallest norm,

Â the L2 norm, of this stack.

Â That's what you're doing. All right?

Â Which makes sense physically, too,

Â because you really - you're finding the one set that has, kind of,

Â the smallest motor torques required at this instant to produce that.

Â It's a very - you're making it up,

Â but it turns out to be a very practical answer.

Â So this is the least effort.

Â And if you're moving a big object,

Â that's kind of the challenge, right?

Â How do we do this?

Â The least squares answer you're asking about,

Â that's where the matrix looks different.

Â So let's say we have a three by two and two unknowns.

Â Let's call it x one and two and three by two,

Â two by one gives you a two by one.

Â A three by two - no,

Â that should give me a three by one.

Â Right? What am I doing wrong?

Â No, that makes sense. That's a three by one.

Â Yup. Okay. In this case,

Â we have two variables, but three constraints.

Â This, generally, you can't

Â satisfy unless there's three constraints or somehow compliance.

Â You found a way that hey,

Â everybody has to be in a line and the only option is to be on the line.

Â You know, that's going to work.

Â But if you look at the classic least squares fitting - if you take

Â data or anything - one constraint has it here,

Â one there, one there.

Â You've got three data points and you kind of pick the best nearest line.

Â That's the least squares inverse.

Â And in matrix form, it looks very similar to that.

Â It's just the - the inverse is more on the left versus the right.

Â So those - those are the two answers.

Â If you don't have a square matrix that's full rank.

Â If it's full rank, in a square matrix as if it's identity,

Â there's only one answer.

Â Right? So what I'm showing you here is the minimum norm inverse.

Â And if you - if you can go look up a linear algebra book, if you're curious.

Â It gives us the smallest set of the L2 norm of

Â this motor torque vector to implement this control at this instant.

Â Right? And that's what we got here now.

Â That's what that minimum norm inverse does.

Â So that's only one possible answer.

Â Actually, I've published a few papers in the last five years.

Â Maybe six, seven now - it's been longer.

Â On other answers, there's different theories on this.

Â This shows my use of research.

Â This minimizes my instantaneous motor torque requirements

Â so you can keep your motor torques as small as possible,

Â but it doesn't necessarily instantaneously minimize your power usage.

Â So because there's an infinity of answers,

Â if you have more than three wheels - if I have five wheels, there's,

Â like, two dimensional sub-manifold.

Â Here it is a one dimensional sub-manifold that you could choose.

Â Play with that.

Â We actually can come up with analytic answers on

Â how to come up with a different motor torque solution that,

Â at this instant, actually minimizes my power, which is given here.

Â This is my motor torque equation.

Â So if you - especially for small sides, this becomes interesting.

Â They're not as much torque limited,

Â those little motors are quite good with torque,

Â but they're very limited in how much energy they can dissipate.

Â Right? There's this little bitty thing and you get

Â all this power inside. That's fantastic.

Â A big battery and it's running all these high-speed wheels.

Â You know, it becomes a little nuclear meltdown.

Â It - basically, it just - you know, it takes up too much heat,

Â so you might be worried about energy usage.

Â Or maybe you're more energy-limited with a small side and you go hey,

Â do these maneuvers back up this little battery?

Â It's only going to last me for x amount.

Â Well, this other one will get you there with the smallest motor.

Â There's other solutions we've come up with that get you there - where at this instant,

Â I'm not minimizing my motor torques;

Â I'm - I'm actually minimizing my power equation.

Â And it comes out of the work energy principle.

Â And then you do all the optimization around it.

Â But we can come up with analytic answers and show - at times we can do big maneuvers,

Â we've shown, especially, if you have some non-zero wheel speeds.

Â With zero wheel speeds, normally it kind of becomes a wash,

Â but you can save 20-30 percent of energy to do - you know,

Â it's the exact same control response.

Â From a stability point of view, nothing changes.

Â As long as GS times us gives me LR,

Â all the Lyapunov stability holds.

Â I will have that control torque and I will have exactly this convergence;

Â this close to performance undershooting,

Â overshooting, whatever you've designed it to be.

Â The only difference is what effort is involved to generate that.

Â So that's the minimum norm solution.

Â I just don't want to leave you with the idea that this is one,

Â but not the only one.

Â There's others. We have L2 norms.

Â You can think about hey, braking a wheel.

Â Not breaking it like this,

Â but slowing it down as in braking a wheel.

Â You can actually retract energy and some of the modern reactions will do that.

Â So you can actually account for that in optimization as well.

Â Or it becomes an L infinity optimization.

Â Actually, Robin Blendon did a paper - or his master's thesis - on that.

Â So he has a few papers out on how to do - at this instant,

Â optimize my power usage. You know?

Â Or if you want to extract power from the wheels,

Â how do you do that at that instant?

Â It doesn't give you a global guarantee because this is all,

Â at this instant, what generates this torque.

Â I have no guarantee that if I put in

Â a little bit more effort going left that I would have a less power,

Â less requirement. You know?

Â It's not a maneuver-wide optimization.

Â It's just an instantaneous optimization of the resource allocation, essentially.

Â So there's whole papers on just this kind of a stuff,

Â as well, of the control theory.

Â But what I hope you see out of this is

Â the Lyapunov stuff you're learning, it's very versatile.

Â It can be applied to lots of different things.

Â As we get to more and more complicated dynamics,

Â it's always kind of the same methods,

Â the things we've just went through in this class.

Â It's just at some point, you apply your equations of motion.

Â You maybe tweak this a little bit so you don't

Â have so many matrix inverses floating around.

Â You just put it out there up front and

Â then you come up with the controls, the same stability.

Â But with multiple systems,

Â you start to raise new questions of how,

Â if you have an infinity of answers,

Â which one do we pick?

Â And there's very practical answers and there's other more interesting ones,

Â too, that gives other kind of benefits.

Â