0:08

So, let's start with this briefly.

This, up to now,

we've talked about stability.

We made it global, we made it asymptotic,

we made it robust,

if we have external unmodeled disturbances.

What we haven't addressed is actuation limitations.

I think you mentioned this too about torque limitations, right?

At some point you're going to saturate where a thruster only be full on,

there's nothing more that you can do,

that's as big a torque as you can get.

Right? So, how do we deal with that?

That's a different nonlinear phenomenon that often happens with spacecraft.

So, now we want to deal with what's called the Lyapunov optimal feedback.

It's a different kind of a way to look at it.

We're still going to build on

the Lyapunov optimal control or the Lyapunov of control theory,

so we build the Lyapunov function, take its derivative,

we have to prove it's going to be negative,

semi definite at least, right?

But we're going to deal with the control solutions that aren't just continuous.

So far, we had the Q was minus again times,

you know, the rates.

That's a nice linear function.

But if the rate errors get huge,

your control gets huge and you would saturate.

How do we handle this?

And there's also actually a related homework problem you currently working on that kind

of leads into this spirit a little bit.

So, let's go back to a really general dynamical system,

and then we'll specialize it for the spacecraft again.

But I want to show you these theories actually apply in a much more complex way.

I want to bring my rates to zero.

That was the original rate feedback,

cues in my states,

that could be the multilink angles,

it could be your attitude,

it could be your position, whatever coordinates define your dynamical system.

And cue dots would be those coordinate rates essentially.

And then if you do look around in dynamics or something,

you end up with this big equation.

Details aren't important, it's just it has this form.

And we went through this process already,

we said, 'hey, we can make this kinetic energy',

then a bunch of math later,

this is your work energy principle that the rates times to

control effort has to be equal to your power equation.

So we have to come up with a control such

that this is stabilizing and what we picked was,

I think it was a game matrix,

but I'll make it diagonal here.

So my controls are minus and positive gain times my rates,

and I can guarantee now this system is globally,

asymptotically stabilizing, to get the rates to zero, right?

That's our goal, only the rates.

But this control, if my rates go to infinity,

my control goes to infinity. And that's an issue.

So, how can we modify this?

Or are there better ways?

This just gives you a control performance.

Is this the best we can do?

If you have X amount of control authority,

are you using it to its maximum capability in this case?

And that's something that actually leads to the Lyapunov optimal constrategies.

So that's what we want to look at next.

What if our control authority is limited?

So, the first approach it's very popular actually,

it's you look at the system and go, 'you know what?

How unlucky do you feel?

How bad could this error get?

And often driven things like tip off velocities,

or if you lose communication for a certain amount of time and have these disturbances,

how bad could this tumble happen?

You know, you come up with some bound and say,

'that's the worst tumble I have to deal with', right?

If I then pick the worst case tumble,

I have to pick a feedback gain such that I never saturate.

In that case, this holds.

I can guarantee stability.

But what have I done?

I've actually probably reduced my feedback gain to

compensate that I never- You're basically avoiding saturation.

You're dealing with saturation by never hitting it.

But the consequence is,

you've reduced your performance,

you've reduced your gains.

So with this I could have settled in 30 seconds,

now I'm going to settle in 30 minutes and I did that by bringing down my gains,

all the gains, so the control requirements never flat-lined,

you know, they never hit that limit.

So this can work, and it's done actually quite

often and people are very paranoid about saturation.

What I want to show you next is other approaches where we can let it saturate,

and in several conditions still guarantee stability on the system.

Right?So this would work,

but there's a performance hit,

it limits how much you can do. We can do better.

I can still saturate,

guarantee stability and detumble it in a short amount of time than what I get with this.

So, it's true for all that dot wonder on me, that should be up there.

So that would have worked, but the key result is reduced performance.

That's our worry.

So here's the second approach.

We have limited actuation,

our control can only go so big.

And for stability, what we really need to guarantee

is that V dot is as negative as possible.

If we make it negative definite fantastic,

but you just want it to be negative.

If it's negative and guaranteed stability,

it doesn't have to be a minus gain Q dot squared form.

You can have different forms as long as it's negative,

that's all that Lyapunov theory requires,

there's no smoothness requirements on this one, at least here.

So this is a first order system.

So let's focus on that.

What will make my V dots negative?

And the cost function that we have, that's our V dot,

so Lyapunov optimal control is designed to make my V dot as negative as possible.

And that's all of course, if you have unconstrained control- If unconstrained control,

you know, U minus k Sigma,

minus P that, to make it as negative as possible,

you make those gains infinite.

And now it's really negative.

Right? But we can't do that because we have limited actuation.

So, this is done as a constrained problem.

Right? You can only make Q so big.

So then the question is, what do you make Q such that J,

which is our cost function here, V dot,

which is our cost function J,

make it as negative as possible?

If we look at this now,

we come up with this control strategy.

In the end I've got this max limit.

I can do one Newton meter of torque, that's all I can do.

Both clusters around, I get a pure couple torque, right?

I get one Newton meter.

If I define my control torque to be

the max torque that I can generate times the sign of the rate air,

so I'm tumbling at one degree per second or five degrees per second.

This doesn't care.

It only feeds back on the sign of the radar.

And that says, 'hey, you are tumbling at a positive sense,

I need to torque in a negative sense',

that's where the negative sign comes in, essentially.

And it's good to torque at maximum capability.

It's going to hit it hard.

If you plug this in here,

Q dot times this control,

there is a minus sign,

Q max comes in and you get QI time- Q dot times sign of Q dot.

Which, of course, is guaranteed to be positive, right?

Regardless of size. Yes, sir.

Does this mean that if you are minimizing J,

we want the control to go as fast as possible as...

Yes. You are maximizing your perform- you're making your-.

End of time.

Maybe we want to maximize the interval energy of fuel consumption or something like that.

Then it wouldn't be a Lyapunov optimal one.

Lyapunov optimal really is defined as you've made your V dot as negative as possible.

So that's the time derivatives,

so at this stage, I'm picking my steepest gradient.

It doesn't give you a global optimization, you know,

there's whole books on global optimizations and trajec-

Maybe moving left first helps you get there quicker,

I don't have that kind of an optimization.

It's at this instant what control solution will make

my Lyapunov rate as strongly negative as possible,

so I'm coming down as steep as I can.

So it's kind of a local optimal thing in that sense.

Yup. So you can do that,

and then this is what you get.

And, well, actually, let's talk about this then.

So that's the control that we can implement,

this is very much a bang bang.

Right? This just says,

'are you positive or negative?'

And then, you either hit positive, or hit negative.

Any practical concerns with that one?

If you do a bang bang.

Bryan.

It's goint to be really key?

There is that.

If you hit it with an impulse,

you might be exciting on model torques, that's a good point.

You might be sloshing fuel that you didn't expect,

you might be sloshing panels, flexing panels,

that could be happening, so that could be a concern with sharp bang bangs.

Okay. What else could be an issue?

If you miss your target.

Well, if I have continuous control with this theory,

I would hit the target.

But this Q dot comes from rate gyros,

if it's an attitude problem.

How good are your rate gyros?

Are they perfect?

So, if you add a little bit of Epsilon.

Right? So that's kind of where we can think of this.

If you think of a rate gyro measurement and,

you know, 'hey, we had a maneuver it's kind of noisy, but we had a maneuver'.

Now you're getting close to zero and close to zero is kind of doing this.

Right? I can't even draw the Gaussian noise too much,

but it will do some weird stuff.

This point means hit it full on one way.

This point is below,

hit it full on the other way.

And there's no real rate driving this.

There's no real error driving it,

its purely measurement errors.

Right? So, if you're driving this kind of assigned functions that

mathematically optimal it made my V dot as negative as possible,

but there's some really strong practical considerations to implement this in that.

You know, Epsilon off when you're hitting it hard.

Now, you can fix this, for example,

with dead zones, some people do that, and they say, 'look,

any error less than some value is close enough,

hopefully less than the noise level' and then you going, 'that's good'.

But, you know, then that limits how far you can go,

or we'll find- we'll start here next time,

there's other modified ways that we actually blend different behaviors

with nice smooth response and saturated response.

But I can still guarantee the V dot being negative part.

So we start to construct different ways to assemble these things.

The issue is the response around zero.

Infinitesimal to the left, whack, maximum response.

Infinitesimal to the right, whack, maximum response.

Right? That's too sensitive.

But we liked the part that,

'hey, babe, big error',

basically if you're tumbling to the right,

you need to stop it and just give max torque to the left,

to arrest it as quickly as possible.

So is there a hybrid approach?

And still be able to guarantee stability,

and that's what you see outlined down here.

In fact, what we have here is,

we still have a saturated response.

If we have large errors,

well, you can tune it here my- I'm going linear up to my control authority.

And then I am saturating.

Right? And at that point I just if it's more than one Newton meter,

I just give it one Newton meter.

And the nice thing is,

with this control, I can stil,

l if you plug that cue in here,

you can still guarantee that V dot is always negative.

This one would not be Lyapunov

optimal because you're not making V dot as negative as possible.

For smaller tracking errors,

you end up with a linear control.

But then you can say handle saturation smoother.

So, if you have little noise levels it's, you know,

it scales with- if I measure intent to the minus 16 times again,

it's going to ask me to torque to that direction but only by a little bit.

Right? And you're not gonna have just to whack the whole system and excite all the modes.

So, you get a linear response coupled with the nonlinear ones,

that's a saturated function.

Yes.

Can we modify the maximum value at which we switch between the two?

Yes. There's lots of ways you can do this in the end because if you look at...

Let's play with some ideas here.

Now, I need to move this over,

hold on. There we go.

So, if I'm doing Lyapunov optimal,

I get a response that's basically like this.

Now you're a little bit- or actually I think I got it backwards.

It was a minus sine that we had, right?

So if this is- This is Q dot,

Q was minus Q max,

sine of Q dots.

If this is positive, my control authority should be negative, right?

And if you're negative,

the control authority should be positive,

and that is the Q max value.

And that's going to guarantee that you're always negative definite.

But, if you look at this function,

that we had the V dot, was simply Q dot times Q.

What we have here, right?

Let's pretend we only have one degree of freedom

otherwise- There's a summation involved once.

You can do it for one of the degrees,

you can do it for all the degrees individually with this approach.

So all I need is just to have the right sine of this.

So I need this to have opposite sine of Q dot.

If you'd come up with a control and say, 'you know what?

I don't like using max force,

maybe I want to use half of it'.

You could actually just, you know,

this kind of a control would also

be saturated control and would be asymptotically destabilizing,

which is not Lyapunov optimal.

Because it didn't hit the maximum control authority.

You could have made V dot a stronger negative,

but maybe you don't like it because you'll be shaking

around the astronauts too much or to payloads or,

you know, flexible structures get excited and so forth.

So that can be one.

So let's look at the hybrid approaches.

So, if we do one of them,

basically it says you're using a linear response,

until you saturate, and then you saturate.

Right?

So, that was the one that I showed you modified the purple line that's really there.

So, Kevin what was your approach then.

You wanted to do what?

If you modify like the point at which we go to saturation.

I mean, do we need to do the control to be continuous or-.

No, this doesn't require continuity there because V dot,

the continuity we need is in V, not V dot.

So you can actually switch to controls and V dot doesn't have to be smooth even,

just has to be in a negative definite and with guaranteed stability.

So we can switch between two controls.

So you could, if you wanted to,

you could go up to here and then and from here go on good enough.

Maybe you have the linear part only to hear to handle noise around here,

and then if you get past it, jump up.

But then you deal with a discrete jump and you control authority that might,

you know, excite on unmodeled dynamics,

that's probably my biggest concern I would have.

But what I'm showing here too,

is a single- I'm doing a linear feedback,

that's one saturation function.

In the homework's actually, there's the one with

the robotic system that you just- it's just X dot equal to U,

and you're trying to track something,

and then you have a maximum speed that you can control.

It can't go more than some one meter per second or something.

There we use an A10 function,

that's a very popular function,

because really all I need here is that this function, the control,

has to be odd that if my rates- if my error measure is positive,

the control is negative.

Right? Or Vice versa.

That's all you need here to guarantee that way,

if this times this is always negative,

I'm guaranteed it's stable.

Right? So that allows you now to design all kinds of responses,

and that's why the robotics love X dot equal to U

because they get to shape and do this exactly how they want.

We have X dot equal to U that we haven't.

Torques and spacecraft is different.

So this is just linearly saturated and then you have a kick and when you hit saturatio.

The A10 function would look something more like this applied to this problem.

It's infinitely smooth response.

But, you know, the tangent function, or the A10 function,

around the origin linearizes to basically a linear response.

So it's kind of cool because we can pick then,

okay, for small responses, this is the slope I want,

that's stiffness that I want for disturbance rejection,

for closely performance considerations.

All of that stuff. But then as it gets large,

it's going to smoothly approached that one and never jolt the system.

So, you can modify this actually,

in a lot of ways and deal with saturation.

If you're dealing with a first order system,

all we need is V dot to be negative.

If it's negative definite,

we have asymptotic stability.

Right? You could switch between controls,

as long as this is true and is still guaranteed, you know?

We don't typically because, again,

I have to deal with the jarring every time I'm

switching which you could smooth out with the filter and stuff.

But if you don't have to deal with it.

It's my post my most popular one is probably the Green Line, the A10 function,

we've used that quite a bit to deal with saturated responses on these kind of things,

especially when it's a first order system like this.

That makes sense?

So being first order is nice.

It's a really simple V dot and it gives you huge amounts of freedom

in how you want to design and shape that response and deal with saturation.

The linear control we had was this one and just would extended,

but it's not necessarily realistic.

Right? So... So it's nice.

So, let's see.

So now we're going to switch from a general mechanical system and

apply this to specific to spacecraft.

And we have rate control we want to talk about and we also have the attitude,

you know, the rate and attitude or just rate control.

Those are two considerations,

and the rate control is a first order system as you've seen.

We make very strong arguments.

The attitude and rate control gets a lot more complicated

and sometimes we can come up with conservative bounds for stability,

but they're conservative as you will see.

So, this is typically the setup.

This was the control we derived at the very beginning for our tracking problem.

And so, UUS means map control authority U in the unsaturated state.

Right? If you had infinite capability,

this is what you should do,

and you plugged in the V dot and this is what you would get.

And if you plug in this U in here,

this whole thing would be minus Del Omega transpose P Del Omega.

But that assumes you can really implement this control.

So, now we can look at what happens if we saturate.

And here's some of the challenges.

So just like that modified one,

this basically gives me the control up to

the point that I've reached my saturation limit,

and then I'm enforcing a hard saturation limit

where I'm not getting the six Newton meters,

but I'll give you the max of five.

The key is you're giving it at the right sign that you need.

That comes out of that controls.

So either you need a positive.

So this USI, that is the... Actually,

that should be U max I believe,

that shouldn't be USI, that's a typo.

Okay. US that should be the U max.

You give it max with the right sign.

So I should have had six, but I want five.

If you want minus six, you wouldn't give plus five,

you would give minus five, the closest neighbor with the right sign.

Right? That's what you're doing.

And you can come up with an argument here.

If you look at this function,

if V dot has to become negative,

if your control authority is larger,

the maximum control authority is larger than all these other terms combined.

You can basically overpower whatever their values are and then

ensure that whatever's left is done in a way such that this term,

you know, this is five,

I need something slightly negative to make five times negative a negative number.

And the V dot becomes negative, and this is the vector.

So, you know, it's a three by one,

so you'll have three of those terms.

So as long as you control authority exceeds all these individual terms,

I can always come up with a control that guarantees at least I have the right sign to

dropped my V dot to a smaller value and I can guarantee stability.

Now, performance again, another question.

But it turns out this is a very conservative bound.

If you can do that, that's great,

but you're probably being overly conservative now with the gains you

pick and how you can perform.

So, yes saturated control is actually really

tough to guarantee areas of convergence analytically.

People often resort to numerical tests.

Monte Carlo is running this stuff.

And then you get exactly what the numerical response was and for all these cases,

this is how it converged.

So let's look at something simpler than the full on reference tracking.

Reference tracking is tough too because your reference motion impacts,

you know, it's my control going to be less than that?

Well, are you tracking something that's moving very slowly?

Or are you tracking something that's spinning very quickly?

Within the control authorities quickly going to be exceeded to try to track it.

Omega R was part of that bound discussion.

So, we'll look at regulation problem.

It's an easier way to get inside,

and this is an area where the MRPs will actually have some nice properties as well.

So, for a classic unsaturated control,

just a PD, we proved actually,

we didn't have to feedback compensate for the Omega tilde I Omega,

that term vanished because it was Omega transpose,

Omega tilde I Omega.

So you can include it or not. It impacts performance,

but not the stability argument.

So we use a very simple PD control,

we know it's globally stabilizing all the one asymptotic.

And then, you look at the corresponding V dots that you

get with the classic Lyapunov functions we had last time.

This is what you get.

So now you can see here that U has to compensate for this,

and then add a term that makes this thing negative,

semi definite at least, right?

So, we can see now similar bounding arguments.

If K times sigma is always less than the maximum control authority,

you can cut- you can guarantee, you can come up with a control, U,

that's going to make this V dot negative,

and therefore, guarantee stability.

Well, okay.

But because we are dealing now with the dual MRP set and these implementations,

you definitely want to be switching MRPs because that means

my attitude measure is going to be bounded to 180 degrees.

Anymore than 180 and I would switch to the other set.

That means my MRPs are actually upper bounded by one.

One is the worst attitude error you have.

Which is very convenient when we're doing game design.

I know, you know, what's the worst case I could have on this?

How much effort with the with

the proportional feedback required of the control system in here?

Well, it's basically, you know,

this could be at worst one so K, essentially Newton meters,

tells you right away with this gain, 180 off,

you would ask for k Newton meters.

So what you can look at here is,

that means with MRPs,

as long as K is less than your maximum Newton meters that your torquing can do,

you can guarantee that you can always stabilize the system, guaranteed.

Again, this is a somewhat a conservative thing, but it's a nice bound.

It's a very simple bound where we take advantage of the boundedness of attitude errors,

and the MRP description that gives us a very elegant-

the worst error is one in MRP space at least, right?

So, that's the way you can bound it.

So that's now, this is a regulation attitude and rate thing that we're looking at.

Now, let's look at just the rate regulation problem.

So, here the goal is always to bring the Omegas to zero.

I don't care what the attitude is.

And as we saw with the mechanical system,

you can do this in a variety of ways.

If you just wanted to see it here, I have the max.

Okay.

Here I've got the hybrid solution.

This was not Lyapunov optimal,

because I've got a linear approximation so I don't have

that noise sensitivity issues that appear bang bang would have.

You could replace this whole thing with

an A10 engine function if you wished, or other limits.

But I'm just going up to the max and then I'm saturating at the max.

And you can do this control and in the end for this system,

let's say you have of your three axes,

lets say two of them are not saturated but one of them is saturated.

In that case here, big M would be two,

two of the axes you're just applying a linear control,

and in that case their contributions are guaranteed negative definite.

And the one that is saturated it applies this control,

which gives a different Lyapunov rate function.

But this is where you can mix and match nicely because if you're saturated or not,

you have one V dot or another, but both V dots,

regardless of saturated or not,

are negative definite expressions.

So the sum of two negative expression,

negative definite expressions, is still negative definite.

So this kind of the mathematical structure.

This is why you could replace this with something else,

a different saturation limit,

but you're always guaranteeing this property,

that V dot is negative,

and that's what guarantee stability.

So, this is actually a really handy control.

The simple feedback on the control torque is minus a gain,

times your angular velocity measures.

We argued already this is insensitive completely to inertia modeling errors,

because inertia doesn't appear.

And now you can actually also show that hey,

even if your omega measured is wrong,

you're measuring one radian but it's really two radians per second.

It won't perform, it won't close up quite as quickly as it should,

but it's guaranteed to be stable.

It's guaranteed to converge.

If you just measured half the rate that you actually have,

it may take double the time to converge,

but you're still guarantee it will converge cause that's often the issue.

People think of stability as somehow being tied to performance,

those are two separate questions.

Here we're always arguing the performance, no,

the stability is arguments the same,

the performance will be different if you measure the wrong Omegas.

So, as long as you don't get the sign wrong,

that's the one error that's going to kill you if you [inaudible] dumbling.

But this is great application for orbital servicing,

we're talking about picking up pieces of debris,

servicing satellites, docking on it,

picking up boulders of asteroids.

We really don't know what the inertia mass properties are,

and you're picking it up and you want to first to stabilize yourself.

You don't want to throw in stuff that

requires knowledge of inertia and knowledge of this,

knowledge of that, very precisely.

You want something that's really robust,

and this simple rate control allows you to prove amazing levels of robustness on how

to stabilize these kind of tumbling.

So I know inertia is- which we just mentioned, very robust.

All right that one. So here's a quick numerical example.

Show you how this all comes together.

You can see initial conditions,

were going to be having large attitude, large rates,

principle inertia's three different gains on P,

one on K, maximum torque is one,

just an easy number.

And am using the classic,

it's just the proportional derivative feedback K Sigma and P Omega here.

So if you run this now,

you can see the response had big rates.

It tumbled actually, one, two, three, four,

five times before it stabilizes.

But it's always fighting and doing this.

If you look at the control authority,

am actually saturating all this time.

And despite saturating, I am still actually converging,

and working, and the rates, you know,

the big one tumble rate took a long time to bring down,

but once it all comes together,

it all stabilizes nicely.

What I want to illustrate here though is I picked gains,

this K is 7.11.

U is one.

And we said, if we made K less than U max,

I could guarantee this would always stabilize.

Which it would have, it would have taken a lot

longer to stabilize because the gains are less.

It would have worked.

Yes, sir. You got a question.

In these examples, are we applying the previous controls we said?

Like, we switching between saturation and then a linear bar in the middle?

Yes. Yes. So we're doing U is equal to minus Sigma,

minus P Omega, it's unsaturated.

And then if I hit one on one of the axes,

am just letting that axis saturate individually.

That way, you know, that's the control that I'm applying.

Yup. Good. That's basically this and then we saturate each access to this value.

So you can see here, I'm grossly violating actually that one condition I had and say,

'hey, if this were less than one,

I would be guaranteed, analytically,

this would always be completely stabilizing and

V dots would always be negative' and life is good,

but that's not the case here.

So this is also an illustration of this is an 'if statement', right?

If V dot is negative definite and guaranteed asymptotic stability.

If it's not negative definite,

I'm not guaranteed instability.

And that's why these bounds that we have,

what I'm trying to illustrate here is how conservative are there.

So, when I do this response,

I'm taking the time scale that was 300 seconds and I'm showing

you roughly 100 seconds worth here zoomed in.

Right? And I'm showing you the attitude response and superimpose,

and shading out regions where I'm taking all my current states.

You know, if you go look at your V dot function, what was its form?

And I'm computing the V dot that comes out of the actual states.

And if I had a guarantee of stability,

V dot would always be negative.

But in these regions because of that high gain of K,

you can see there's these great regions that actually

indicate regions where we have positive V dots.

So, temporarily, our error measures actually increased with that gain function.

Right? Which in this case I wouldn't have it and a little guarantee of stability.

But you can see from the performance,

it behaves extremely well, still, and stabilizes.

So this is one of the lessons learned with this stuff in Lyapunov theory.

This is necessary condition for stability,

but they're not necessary, you know,

there's not an if and only if and this kind of stuff.

So, these analyses can often help you guideline,

'hey, what are some cons-' If I know within here, I'm good.

But these types of Lyapunov energy based controls have been proven to be very,

very robust, including saturation.

So, if you're designing them, I would say,

if you can live within the natural bounds and guarantee

stability for what you need from a performance point of view,

great, but if not, try to push them too.

I bet they're going to work quite well.

But then you have to use numerical methods to, basically,

run lots and lots of cases to guarantee, yup,

within this area, within this domain,

within this neighborhood, all of these things converged and I'm good for this mission.

Right? You still have the analytic guarantee,

unless you invoke other fancy math.

This whole feels unsaturated control as well.

Anyway, so it kind of shows you saturation is hard.

As a summary, with the MRPs being a bounded measure.

The worst error is one,

we can take advantage of that in some cases and come up with bounds.

But just keep in mind these tend to be very conservative bounds to do that.

The overall system tends to be actually far more

stable than what we're predicting with these conservative bounds.