0:23

The Direction Cosine Matrix, again, lots of different names.

Â When I say it is the mother of all parameterizations, I really mean it.

Â Because you will find every single definition that we have of altitude

Â coordinates, if you publish on this, somewhere the reviewers,

Â the editors are going to look for,

Â great, I love these coordinates, but how do they relate to DCMs?

Â 0:42

DCMs is going to be the way we do fundamental addition rotations,

Â quarter transformations.

Â Like you can translate between Cartesian and spherical coordinates,

Â there's math for that.

Â This DCM is the fundamental way that we'll be translating between sets of

Â coordinates as well.

Â So this is one we really want to understand and we use it a lot.

Â Very, very important one.

Â So hopefully has anybody here never seen a rotation matrix, DCM,

Â transformation matrix, something like that?

Â You should have used this at some point even as a physics major probably or

Â a not just an arrow.

Â So let's go through this again.

Â The fundamentals is more review at this point, but

Â I'm trying to fit everything in the same notation.

Â 1:26

And the definitions of angles I'll get to in a moment here.

Â The first thing I want to define is this concept called the vectrix.

Â It is a convenient way to do linear algebra with vectors.

Â So, all vectrix is, it's a matrix of vectors.

Â 1:42

And, if I do a quick example, now if I have to do math,

Â if I have to somehow evaluate 3 times b1 plus 2 times

Â b2 minus 5 times b3, I can actually write this as

Â [3 2 -5] times this vectrix of b, b2, b3, right?

Â You just do your usual.

Â It's can be this times this, this times this, this times this.

Â And the math implicitly involves scalars times vectors.

Â And that's fine.

Â So the answer is a vector.

Â But the vectrix is just the matrix representation of

Â typically sets of base vectors.

Â This allows us to group this delinear algebra in very convenient forms.

Â Okay, so nothing too scary unusual there.

Â 2:28

Good, so that's the vectrix.

Â And we have here the n vectrix, which formed by the base vectors n1, 2, 3,

Â and the b vectrix, which is b1, 2, 3.

Â To denote the difference, I'm using a curly bracket around the b hat.

Â That just means this, if you see this you know this is a three by one matrix of

Â some base of the b base vectors.

Â That's it.

Â Now, let's look at this stuff.

Â We did this projection earlier.

Â All right, where we talked about in homework one you're going to have to do

Â projections of e frames onto b frames.

Â At some point we're doing three dimensional rotations and

Â you figure out which sine and cosines to include and so forth.

Â This is really developing to a much more general way.

Â If you have to write this vector here in n frame components you really have, well,

Â b1 is something along n1, something along n2 and something along n3.

Â And these somethings are the projections, these are all unit vectors, so

Â how far do you have to move along this way?

Â It's the dot product between b1 and n1 which gives you magnitude one,

Â times magnitude one, times the cosine,

Â if you're thinking of those plastic laws definitions of the angle between the two.

Â So this element that you have to go, this is simply cosine alpha one one,

Â one one means it's between b1 and n1.

Â One two means it's between b1 and n1.

Â And one three is it's between b1 and n3.

Â 3:54

So with those three projection angles essentially

Â they're cosines that's where the name comes from, direction cosine angles or

Â direction cosine matrix in the end.

Â You can write b1 in terms of the other for a general rotation.

Â Not just when they differ by one axis.

Â And then for two and three, it's really the same process but instead of having

Â one one, one two, you have two one, two two and three one, three two and so forth.

Â Right? Cause youre doing the first, second or

Â third body vector.

Â So that's an easy way to just do a simple projection.

Â Now that's three equations, three vector equations.

Â I have to solve and do things with them.

Â And as you know, if you have to deal with multiple equations the way to go is really

Â linear algebra.

Â That's the great mathematical tool to kind of manage all this stuff and

Â solve systems of equations.

Â So let's put this in linear algebra form.

Â 4:44

And on the right-hand side, I'm going to have the n vectrix.

Â And then, in-between, we have this three by three matrix of direction cosines.

Â I've just plucked it all into a linear algebra form.

Â Hopefully trivial, at this point, just to go from one side to another.

Â And I'm going to call this matrix the c matrix.

Â Right now, I'm just using one letter.

Â Later on, I'll go to a two letter notation that you'll see,

Â dealing with lots of frames the two letter thing is really, really handy.

Â But we can do this.

Â So good.

Â This is what relates the n frame to the b frame in a general way.

Â 6:26

>> Just three.

Â >> Three, right.

Â So we needed three.

Â I'm showing you this DCM as an fundamental thing and holy crap, we went way too far,

Â we got nine.

Â How do we end up with nine?

Â Well, this is the basic definition.

Â The DCM is a highly over parameterized set of attitude coordinates.

Â 6:43

So if the DCM has nine, TBow,

Â does this mean all of a sudden we now have a nine degree of freedom system?

Â >> No some of the angles can be written as the sum of others, etc.

Â >> Right, in essence there has to be constraints,

Â this kinematic description has constraints.

Â And if you have nine coordinates, and it's three degree of freedom problem,

Â how many constraints- sorry, give me your name again.

Â >> Andre.

Â >> Andre, sorry, I should know.

Â 7:21

>> But you need six?

Â >> Six, right?

Â So you have nine coordinates minus degrees of freedom.

Â That's how much you've left.

Â You have three coordinates minus three degrees of freedom means you have zero

Â extra stuff.

Â That's it.

Â It's a minimal description.

Â If you have four coordinates minus three, there must be one constraint.

Â Here, there must be the equivalency of six constraints.

Â And there's lots of ways these constraints manifest.

Â What can you tell me about this DCM?

Â If we look at it now if somebody, let's just switch over.

Â You've seen the definition.

Â You're all seen this before.

Â Nobody raised their hand so everybody's fair game now, right?

Â That will wake you up.

Â 7:57

If I give you DCM 111000000, could this possible be the correct DCM?

Â Yeah, why Chuck?

Â >> Two frames could be- >> Do tell me what it means.

Â But there's looking at it upfront, your gut feeling says this could be right.

Â Something you may recognized that entity,

Â yeah I remember that from somewhere that actually means deserve rotation.

Â Good you might recognized it.

Â Let me put this elsewhere if we have 0,1,1,0,0,0,1,1,

Â bunch of 0s and 1s I've thrown in there.

Â Brian, could this be a proper DCM?

Â 8:44

>> [COUGH] Excuse me.

Â I don't think so.

Â >> Okay, you have 50/50 chance, so can you elaborate?

Â >> Because that would mean that one coordinate is aligned to two axis.

Â >> Right, so if b1 = n1 + n3,

Â what is the length of b1?

Â >> One.

Â >> It should be one.

Â >> Right >> Is it one in this case?

Â >> No. >> What is it?

Â 9:16

You're close.

Â You're not there yet.

Â >> Negative two.

Â >> You got n1 in one direction, n3 in another direction, orthogonal.

Â You add the two, what's that length of this triangle?

Â >> [INAUDIBLE] >> There you go.

Â Okay?

Â It's always going to be more.

Â All right?

Â So really, as you can see, because every row represents the b1,

Â b2, b3 vector components, these components better add up to one.

Â You do one squared, two squared, three squared, right?

Â They have to have unit length.

Â So if you're doing some problem and you're doing some, like that, and you end up with

Â a matrix that says [3, 5, 7], right away I've gotta stop right there.

Â [LAUGH] You're not on a good path, right?

Â There's no way this could be a DCM, doesn't make sense.

Â So every row has to add up.

Â Every element has to be a cosine of an angle.

Â 10:16

No, minus one to one right?

Â So you could have a minus one but you can't more than minus one.

Â Sorry, you can't have less than minus one.

Â You can't have more than plus one in this kind of stuff.

Â So immediately you can see there's lots of geometric constraints on what these

Â coordinates can be and in the end they're all equivalent to being six degrees or

Â six constraints that have to be applied.

Â So let's go back to the definitions.

Â We'll discover more and more relationships and what this stuff means.

Â Again, you've seen DCMs.

Â So the definition, the IJth element of the DCM

Â matrix is simply the cosine of the angle between the Ith and

Â Jth base vector of each of the respective frames, right?

Â And this is b and n.

Â Those are place holder like the transport theorem.

Â This could be q and t, s and r, whichever two frames you are doing.

Â The attitude of this frame relative to that frame.

Â So it's a dot product of two unit vectors which just gives you that cosine.

Â So good, so we've got that.

Â This basically maps, you can see here we are going from end frame components and

Â computing now what the equivalent B1, 2 and 3 are.

Â 11:16

If you want to do the reverse, you could have just taken n1 and gotten B1,

Â 2, 3 components.

Â And two, I can flip b and n really.

Â If you do that, it's the same angles, it's the same two frames.

Â But all the sudden, instead of 1,1 1,2, 1,3 we end up with 1,1 2,1 3,1.

Â The indexes become flipped.

Â If you have to do the projection of n on to the b frame.

Â The other one, it's the same matrix.

Â So the matrix that maps the the b vectrix into the n vectrix is really c transpose.

Â It's just a transpose of the original matrix.

Â 12:05

If one takes you from n to b and now you want to go from b back to n,

Â what do we have to do?

Â >> Inverse. >> Inverse,

Â you could've just taken the matrix inverse up here, brought it over, right?

Â That's where linear algebra really shines.

Â You know how to do that.

Â It's a bunch of numbers.

Â Give it some Mathlab.

Â You just made Mathlab's day.

Â It loves doing this stuff.

Â And here's an inverse.

Â Bring it over.

Â And now you do it.

Â But the beauty is, we can see for the DCM,

Â it turns out the inverse is nothing but the transpose.

Â 12:35

What do we call such a matrix when the inverse is equal to the transpose?

Â >> Orthogonal.

Â >> Orthogonal or also, in this case if you want to be very specific orthonormal.

Â We'll typically use orthogonal in all the attitude papers,

Â they used to talk about orthogonal, that's good.

Â If you took a linear math and applied math they probably talk orthonormal because

Â it's on a normal link space vector.

Â So really that's what we just discussed.

Â A matrix inverse in this case is just a transpose.

Â That means anywhere we see a not just an attitude dynamics and

Â you come across something in structural modeling and other things and

Â here's assisted math matrix and it's orthogonal.

Â That is good news.

Â Sometimes people shy away from this and go, that makes it sound complicated.

Â No, orthogonal is really good news.

Â That makes your algebra much easier.

Â If you have to analytically solve now for these inverses and do it,

Â anything more than a two by two quickly takes up pages and pages of algebra.

Â Just go with something like MathLab or Mathematica and

Â plug in a four by four matrix and ask it to invert it analytically.

Â It'll do it.

Â 13:31

Then it will be dumping it out.

Â You'll kill a lot of trees but it will take lots and lots of space to do it.

Â So if you can just do a transpose that is fantastic.

Â Now let me talk about the two letter notation that I use because

Â you will see this often when we solve problems.

Â The c matrix is a classic definition.

Â You see it in lots of different literature.

Â But also if you have multiple frames things get a little bit more complicated.

Â Then you really want to track, this is the attitude of b relative to a,

Â then a relative to q, then q relative to r.

Â And you don't want just c for everything because it gets very confusing.

Â So we'll tend to use what we just defined as c is really what I

Â have as a [BN] matrix.

Â Some people write this as T the transformation matrix with B and

Â N or N and B flipped.

Â There's a whole series of different notations, so if have a paper you're not

Â familiar with and have DCMs in there, first thing you should do is look up and

Â really understand how the they define this mapping.

Â Is it from one to the other or the inverse, it's not universal.

Â In astrodynamics we do everything in the body frame.

Â Our equations of motion are simplest in the body frame.

Â Our sensing happens in the body frame and so

Â everything is mapped into the body frame.

Â If you go to computer science and

Â robotics literature they do a lot of the same stuff.

Â Computer graphics.

Â How do you map all these things and just pixels and vertices and do all this stuff?

Â But they map everything by default into the inertial frame.

Â All the robotic stuff is typically written into respect to the inertial frame.

Â And everything's, the complex kinematics is all mapped back to that.

Â So all their definitions are exactly flipped from what ours are.

Â 15:05

I didn't invent it, I'm only the messenger.

Â So just pay attention.

Â And even sometimes across fields I found, I was working at Sandia there

Â were some things people called them Rodriguez parameters and you solved to

Â find Rodriguez parameters, but it turns out in that field Rodriguez parameters

Â meant what was to me not Rodriguez parameters but principle rotation vector.

Â That's about an afternoon wasted until I finally tracked down

Â why does this math not work?

Â And they're talking about very different coordinates.

Â So, it's just lots of fields have contributed to attitude schematics.

Â And so, there's just a whole praetorian of different definitions of that race to go.

Â So [BN], why is this handy?

Â This is what we have for b vectrix is equal to [BN] vectrix.

Â With this two letter notation somewhere you're denoting this

Â rotation matrix goes from this frame to this frame.

Â And in the attitude you will see we always tend to go from the right hand side

Â to the left.

Â We start from the right.

Â This is where we begin.

Â Then we start superimposing multiple rotations and

Â at the end we end up on the left.

Â It's just the way it goes, is from right to left.

Â That's good.

Â If I want to invert this matrix,

Â how would I denote that with this two letter notation?

Â >> NB.

Â >> NB.

Â Right. That's it.

Â So, you can just say [NB] ends up being [BN] transpose.

Â It's very simple.

Â And so you will see this.

Â For right now if I'm just doing one frame sometimes you just write c it's easier.

Â 16:31

So we'll see.

Â Okay so good so this orthoganility inverse.

Â That's really important.

Â If you looked at the DCM examples we did we said every row of this one had to be

Â a unit length.

Â But because if you invert it you're mapping b frame stuff onto

Â m frame m frame also m one, two,

Â three unit vectors therefore every column of your DCM has to have unit length.

Â 17:17

It maps one frame to another.

Â [BLANK AUDIO] Why not?

Â You're shaking your head.

Â Sorry, what was your name?

Â >> My name is Ansel.

Â >> Ansel thank you.

Â >> I think it would be left handed.

Â >> Good.

Â So the 0s and 1s make sense.

Â Nothing would violate the cosine requirements, all right.

Â The lengths, this has unit length, unit length, unit length, unit length,

Â unit length.

Â That's all cool but if this maps n to b b1,2,

Â 3 has to be right handed and you can see here if this is one,

Â this is two, one cross b1 cross b2 doesn't give me b3,

Â it gives you minus b3 in this case.

Â 18:02

So this is where somebody used their left hand to construct a coordinate frame, and

Â you end up, this is also an orthogonal matrix.

Â It satisfies all the conditions of orthogonality but

Â its a left handed system.

Â 18:14

And so there's some mathematical checks we can do to quickly identify

Â is this DCM left-handed or right-handed?

Â And we'll check for that.

Â These orthogonal matrix also come up when you do projections.

Â So there's some mathematical operations for projections, mirroring,

Â that kind of stuff.

Â With mirroring in particularly you could end up with a left handed type thing.

Â You will see that in a moment.

Â So here too so this I can look at and go well it's not for

Â an attitude description with a right handed coordinate frame.

Â That was the issue.

Â So very good, okay.

Â