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.

Â