0:05

So now, we're going to look at position-based functions.

We need something that's positive definite in terms of my position coordinate.

And the easy measure is always think upfront is like spring.

If you have a springiness, that's basically something.

You know if you have spring energy,

that means you're not where you should be.

And if it all decays, then you're back where you should be.

All right. That's kind of a thing.

So, if you think of spring-mass-damper systems-like things,

we can use a positive definite function for potential energy,

in this case, is K over 2x².

And we can do this now for Euler angles.

We can do it for different coordinates,

I'm gonna show you pluses and minuses of each.

So in this case, I only care about the attitude.

And that means actually from a control perspective,

I am treating my omega as a control variable,

or as you will see shortly,

we'll be doing attitude and rate control,

in which case these things fully couple and the omegas kind of sample out.

You'll see how that works.

But for now, just think of,

we're only caring about theta, our Euler angles.

So, K over 2x²,

in matrix form, you have a matrix that's symmetric positive definite.

You pre-impose multiply with the thetas.

This is guaranteed to be positive definite.

You take its derivative.

Well, that's gonna give you some of these things here.

That's got a theta dot transpose k theta.

The one half's drop out.

You plug in your differential kinematic equations,

and then you get this whole thing in terms of theta.

Now, this is not negative definite.

I haven't specified any dynamical system on it yet,

but if you would treat omega as a control,

as I'll show you shortly, you can do it.

If we do attitude and rate control,

then with this rate these things will couple.

So this becomes your fundamental,

like Lego building block.

If you want to add rates, use kinetic energy.

If you want to add Euler angles,

this quadratic measure could be a good form.

But also, if you remember the B matrix, it had singularities.

There were certain attitudes, pitch,

and steer inclinations that gave us issues.

So this is a nonlinear function,

immediately your control would be nonlinear and you may have to deal with singularities.

So Euler angles for general tumbling, not very good.

But that's what it is.

If you want to do not regulation,

but we want to do tracking.

And now my Euler angles are defined as – these are

the Euler angles that are of the body relative to reference.

So from the reference, what three, two,

one sequence do you do to get to the body?

That's how we're defining our attitude error.

And that's really the only difference.

This is theta of B relative to n,

omega is B relative to n. If you're doing tracking,

this is B relative to r. That's your attitude error relative to the reference.

And your omega is omega B relative to r.

And omega B relative to r is what we call delta Omega, right?

That's our angular velocity tracking error.

So one thing you can see now is this function and this function look

completely identical. And that's nice.

So when I'm talking about prototypical Lyapunov function for attitude errors,

I'm not gonna have one for rate,

for regulation and one for tracking.

The math is really equivalent.

The attitude is relative to something,

that's all we need at this stage.

And the rest of it's going to come together.

So, I'm always gonna draw it like it's just regulation,

but it really works for tracking.

And you will see that when we put it all together.

So now, let's go,

we're going through this reasonably quickly.

The math you do you're on your own.

I'm going through the highlights of this.

Classic Rodrigues parameters.

That's one nice, because you could go from

having singularities being no more than 90 degrees away,

to having a singularity being 180 degrees away from your reference.

That's kind of nice.

You can't do a complete tumbling yet.

If we use the classic quadratic measure,

I don't have a 1/2 in here,

because you might remember that differential kinematic equation for

CRPs was 1/2 B times omega,

so there's a half that appears there.

So I don't put it here just out of convenience,

so I don't end with something with lots of twos and

halves in there and so forth, just laziness.

But that's a convenient function,

you take its derivative, you plug in,

at some point, you're going to get q dots.

For q dots, that's our differential kinematic equation: 1/2 B times omega.

You plug that in, you get this equation.

And so this is if you have a general feedback gain matrix,

which is nice because you've got lots of knobs to do.

If you just go, you know what,

I don't care if it's left or right, up or down,

I just want everybody to have the same gain,

then you just make this a scalar times identity.

In which case, this K just becomes a scalar that you can take outside.

You got q transpose q,

which is just q squared.

You've got q tilde times q, Which is 0,

and identity times q Which is just q,

so things simplify nicely if you just have a single scalar.

At sometimes, you know,

from a control, you want to be as general as possible,

give the control design as many knobs as possible,

but sometimes it adds undue complexity.

And in the end, if you just throw in a diagonal matrix or a constant gain,

you can also look for a simplified version,

still a nonlinear equation because it's one plus q squared,

but way simpler and doesn't have some of those crazy zero of zero singularities.

But at 180s, q did blow up.

Now that's one function.

This is a very convenient function.

I have to credit Panagiotis Tsiotras on this one.

He was a postdoc at Purdue when we started working together.

He is now a professor, a senior professor, at Georgia Tech.

He came up with these log functions,

which are natural log functions,

which are very elegant.

So actually in the homework, you're gonna derive this once,

set up, and do this for the MRPs.

And what happens, you go look up what's the derivative of the natural log,

it's like one plus x,

derivative becomes like 1 over x squared times the partial chain rule stuff.

You plug in all the matrix math and go through that,

and lo and behold,

you end up with this Vdot,

which is incredibly simple.

It's beautiful. But, it does require the gain is not in here.

The gain has to be a scalar outside or none of this magic math works.

So immediately to use this function,

you would only have a gain that's equal along all attitude errors,

which is a very common scenario,

but if you need more,

you might have to go to something like this to prove global stability.

So that's very cool because this will lead to linear attitude controls.

There, we can prove global stability.

We don't have to have nonlinear controls to stabilize a nonlinear system.

So this is what works. Now, I mentioned we can make servo controls.

Actually I've got a paper coming up this year that we're using,

where in the book,

I mentioned this a few times but never give you a full control solution.

But what you can do here,

the basic principle is robotics – don't do controls like we do.

They are very complicated mechanical systems,

and try to do everything on a torque level is very very challenging.

What they do instead is they have the robot or you have a UAV flying, right?

You're basically giving it speed commands.

You put a joystick forward,

it starts moving forward.

You bring it back to rest, it stops.

You move it left, it moves to the robot's left, alright.

Every time you giving iy that input,

that control, it's a speed.

Move forward at one meter per second, stop.

Move left at one meter per second,

rotate at some angular velocity.

Then inside the robot is a sort of system that goes – Hey,

what is my rotation rate?

I'm at rest. I'm supposed to be one meter per second.

I better catch up, you know.

And that was some stiff gains,

we'll catch you up there.

So you have a subservo system that tracks the commanded rates.

We can do the same thing for spacecraft,

and actually we're getting some really interesting cool results,

where if this is just my Lyapunov function for attitude stuff,

I take it's derivative,

I now can treat my omegas as my control variable, right?

And these generate your reference rates you should have

that our subservo system compared to the actual gyro rates and then feedbacks on them.

And if you do this,

you just need to have some omega that's guaranteed

to drive this to be negative definite in terms of q's.

So, I'd pick an omega,

if my rates are minus a gain times my states,

I get something that's actually negative definite in terms of the attitudes,

and we have global stability.

While this is cool too, Manuel actually did this thesis right now.

He's superimposing on top of this inclusion,

repulsion zones, and so forth as well in this kinematic steering loss that we developed.

So that's kind of where some current research is going.

It gets a higher level of autonomy to do maneuvers,

subject to complicated inclusion conic inclusion exclusion constraints

in a steering formulation.

So, in this class though, we're not gonna do much of this.

There's one homework that's kind of this form.

You have Xdot equal to U, right?

You only care about X.

You're V only has to be about X. And you plug it in.

Keep it very simple,

positive definite function for X,

like something squared, and you'd be able to prove all this stuff.

So I've given you a lot of tips for that homework.

Okay. That's CRPs.

MRPs, turns out, have a very similar property.

I put a factor of two in here,

so it doesn't show up here.

MRP differential kinematic equation,

sigma dot was one over four times this B matrix times omega.

So, I'm just adding scaling factors to this function

to avoid having a bunch of scalars float around here, that's all.

But the same, Takis came up with this idea that one plus the sigma squared measure,

we can do this.

And then you get this linear dependence on sigma in Vdot which leads to linear controls.

In fact, when we put it together next, it'll be globally,

you know, asymptotically stabilizing controls without singularities.

With MRPs, what happens,

right, we typically switch at the sigma squared equal to one surface.

At sigma squared equal to 1,

what is the attitude of your body relative to reference?

What was that? Yeah. 180, exactly.

That means you're upside down.

That's the worst possible attitude error you could have.

Any more, and it gets better again.

Right. That's why we're on this SO(3) group, that we're dealing with.

So, if you look at this Lyapunov function,

even when we switch at sigma square equal to 1,

this V function at least is continuous.

That's not necessarily continuously differentiable,

as one of the arguments you were making earlier.

So, with switching, we will find there's

extra arguments we have to make to prove the stability.

We look at Switched Lyapunov structures.

But, continuity is a key aspect,

and that's nice with this Lyapunov functions in terms of MRPs.

When we're upside down and we switch,

at least I have continuity on my V function;

my cost function didn't change.

So, this was one you're actually deriving in your homework.

Take the derivative of this,

look up how to do a derivative of a natural log with chain rule,

then plug in the differential kinematic equations,

and you get up to this result.

It's a good matrix math,

you know, tilde matrix transpose,

those identities come in,

things cancel and you're there, not too bad.

Quarternions, Euler parameters, it's a four-dimensional set.

What people often do here is,

this is a common one.

My reference attitude now is 0.

But I'm not just driving quarternions to zero,

because that would violate their unit constraint, right?

Zero is actually (1 0 0 0).

So how do we deal with that?

And it's just a simple numerical difference,

your actual quarternions minus the zero quarternion.

The zero rotation quarternion is (1 0 0 0).

That one has to go to zero.

If this goes to zero,

then your quarternion error has converged to zero which is (1 0 0 0).

Again, that constraint just makes this math kind of weird.

But, remember again, zero quarternion is a nonzero set.

The zero orientation in terms of quarternion is a nonzero set.

If you take its derivative,

this one doesn't have derivative, it's a constant.

The beta dots have derivative,

you plug in the differential kinematic equation,

this is that four-by-three form of that quarternion math that we have.

We showed these identities.

So, you can quickly prove this to yourself.

This is one of the identities, actually,

that were shown at the end, as well.

This takes about 60 seconds and just carry out the matrix math,

and you will see what happens.

And in the end, you come up with this control, or not control,

but Vdot, where this is the vectorial part of the quarternion.

So let me ask you this now.

Let's say we have a control that drives my Vdot to zero,

What can you say the attitude must be if Vdot has gone to zero?

Ansel.

It would be zero, right, because you have the vectorial part...

Right. So this would have to go to zero, right?

Otherwise, this wouldn't work.

I mean, the rates you cannot have a nonzero rate and

zero attitude because the rates would eventually make it go there again.

But if these beta one,

two, threes go to zero,

what does beta not have to be?

Exactly. Which is a key challenge.

What does -1 mean, Caley?

Well, you're at 180, right?

No. What does minus one mean, Robert?

Rotated once.

360, right?

So that's always the opposites there.

So, the one means you've gone back to the original self.

If you control to -1,

you've actually wound, you know,

this one degree error is gonna correct by driving it back

359 degrees and get to that full revolution where it's minus 1, right?

Any more then it goes back to +1.

We never track more than one revolution with quarternions.

So with this control you can see, immediately,

you might have a wind-up issue,

if you just implement it as is.

Depending on which epsilon you throw in,

you're just guaranteeing those epsilons are going to go to zero,

which gets me the right attitude,

but it may be the really long way around,

instead of just doing a short rotation.

Enzo.

Where is that area where you'd want to use Euler parameters or something else?

It seems like the other ones just don't really have this issue.

This is gonna happen with any control that's globally asymptotic destabilizing.

Even with MRPs, we have the same issue.

With MRPs, what we do is just switch to the short set, right?

If we didn't switch MRPs,

then this stuff would blow up at 360,

and that's an issue.

So we switch.

And that gives me- that deals with that I'm always feeding back on the short error,

never the long error.

With quaternions, you actually switch as well.

These controls are typically implemented that when you get your attitude error,

in terms of quaternion,

we use Sheppard's method, I gave you a quaternion.

The last step is always- is beta not zero or positive?

But that leads to a discontinuous control,

right, immediately, to deal with the unwinding.

And that's what you're seeing there.

So I just wanted to highlight that.

So yeah, so you can see we use modified stuff,

quaternions and MRPs both lead to linear relationships in terms of the Vdots,

which is really nice, we can come up with

simple linear controls to stabilize the nonlinear system.

But, both will have to deal with switching to do this in a practical way,

just to avoid singularities and wind up,

and this just to avoid wind up.

But you have to switch either the way.