So, Euler parameters or quaternions, both names work. I know, very corny joke. But they're very, very popular in spacecraft, or they have been. These days, I would say, modified with rigorous parameters is starting to make a pretty good run for it as well for this title. They're becoming quite popular. Different coordinate sets people are coming up with as well, depends on the application. But why do we call them Euler parameters? Or sometimes, they call them quaternions? Depends on your history, how this is done. Different papers have different notations. The way I was raised, they always called them Euler parameters. These days, they call them more often quaternions. I don't know why, but they're basically interchangeable. If you see one name, if it's Euler parameters, and that's what the book calls them too, we tend to use betas. That's the common notation you'll find in the literature for that. If you have quaternions, people like Q, so, it's all little q's. But there's still [LAUGH] questions even there with quaternions. Again, notations are wonderful here. They're always different. There's four quaternions that we have in the end. And some people tend to write these quaternions as q1, q2, q3 and q4. And some people write quaternions as q0, q1, q2, q3. So, if you're reading a paper, different textbook. If I'm dealing with quaternions and q's, the first thing I always look for is, where is that off one? These three, q1, 2 and 3, will always be the same. I haven't seen those interchanged. Nobody's been quite that cruel yet. So, please don't go there. But the q0 or q4, the fourth one is either on the fourth slot or the zero slot, notationally. So, it just depends which text, which training they had, that's where they put it. Some people like, some programming languages, if you look at the first index in some arrays are zero, other programming languages, the first index is one. It probably heavily relates to where they put that extra term. So, all kinds of history there. It's a four-parameter set that we're dealing with here. So, let's talk about this a little bit. They're very popular for spacecraft because they don't have singularities, that's one of them. But we've already seen an attitude of scope that doesn't have singularities. Chuck, which other attitude set that we've discussed so far doesn't have any singularities? >> A DCM? >> A DCM, exactly. With the DCM, what were some of challenges, Warda, Warda. Warda? Yes, what were some of the challenge of the DCMs, of dealing with that? >> A lot of computation is required. >> Yeah, so, it's a 3 by 3 times a 3 by 3, it's a lot of stuff. Now, it's linear math. Actually, computers are very fast with that. But the big challenge is how many constraints do these coordinates have? because we got nine coordinates. Six, right? So, when you integrate, you have to be very careful at every integration time step that you still satisfy all these constraints. Otherwise, your description is going to blow up and you end up with a matrix, kind of what you were talking about earlier, Robert. Where the columns are not unit length, the rows aren't unit length. And so, you always have to reapply those constraints, and that's a challenge. Now, here, we're dealing as a four-parameter set. So, how many constraints are we going to have here? One, right? So, only 1, so, that's a nice reduction. There are other benefits. I'm giving you quick preview. There's some really simple math. The differential kinematic equation was pretty nice for the DCMs. It turns out it's really nice for this, all the parameters as well. And that's, it's this bilinear form. It has good things if you take estimation theory, and have to do common filters. And you have to linearize this stuff. Well, and these things are already in bilinear form. It's really easy and you don't have to lose any accuracy just because you need a linear form. So, there's some really nice addition properties as well that we'll look at and in fact, you get to derive. That's always a highlight in this class. You can really see how good you are with algebra. To do that, but it's an elegant property and you will own it by the end of this stuff. It's a benefit, it's non-singular, linear differential kinematic equation. It works really for any small orientations, large orientations, challenges, constraints. There is a constraint, but only one, compared to the DCM where we had six essentially to apply. And then, you'll see, it's very easy to reapply this constraint. Not as simple to visualize, true, but we can't quite just use the fingers and do the sequences. But as we work with these parameters, I hope you get a little bit more intuition. I'm going to keep throwing out tips and tricks about this. This is how I can look at quaternions and quickly tell that's roughly pointing here. Or if I use it for a control problem, am I tracking well or not? What should I expect? Right, there's some nice patterns. It works pretty well to go there. So, let's look at the basic definitions. I'm going to use the beta definition for Euler parameters just to match what I have in my textbook. But you could also replace q0, 1, 2, 3. Then, we use everything in terms of beta. Beta 0, 1, 2, 3. This is how they're defined. And they're defined now directly in terms of the principal rotation angle and principal rotation access vector components. So, Shayla, these e1, 2, 3's. If this describes the orientation from n to b, are these vector components taken in the n frame or the b frame? >> [LAUGH] >> What's the answer? >> Doesn't matter. >> It doesn't matter. That was, remember that long orator statement we have, and judiciary, or whatever. It's basically saying, it's the same in either frame. It's the magic one. E-hat, how does it relate to the DCM in the end? It was an eigenvector. So, therefore, the DCM times e-hat gives you back the same DCM. So, all these little tips and tricks to help remember this. Good, so, I'll keep asking Pingy on this. Hope everytime we go through, it will sink in a little bit more. So, e1, 2, and 3, I'm not saying explicitly this is b or n frame, it could be either. What I do know it's not q frame or r frame, right? This is the attitude from n to b, so, either it's b or n, one of the two. That's the short hand. So, now, with this stuff, you can see the 1, 2, 3 components directly relate to the vector components, 1, 2, and 3. In fact, it's the vector components scaled times sine of the half angle. So, the other thing is to see, we don't deal with fee directly. It's always half fee, half angles. And that appears everywhere in the math. So, some triggered entities, you'll have to use the half or doubled-angled identities to get these stuff to work out. So, that's kind of what they're defined. So, therefore, if I did a pure 180-degree rotation about my 3 axis. In that case, e1 is going to be 0, e2 is 0, e3 is 1, right? It's just 0, 0, 1. That's my B3 axis. So, 0, 0, this is 1. I'm doing 180 divided by 2 is 90. So, B3 in that case is one. And these are all going to be zero. And if you want to look at this other one here. 180 over 2 is 90. Cosine of 90 is also 0. Because this is kind of how you apply it there. So the one, two, threes are the ones that are proportional to vector components times sign of half the angle. But this is the part that I typically remember,the E one,two,three.So if I know I am doing a pure rotation about one axis then I will only have a beta one,a beta two or beta three right,everything else will go to zero.This is the one we often use to tell us how close are we. So similar as with the principal rotation parameters to have a niat at an angle. And the angle is just one angle and it tells me hey, your estimation is good within two degrees. I don't care about which axis, it's just good within two degrees. At the same time, I can look at this one. There's no axis, it doesn't care about which axis have gone to go from N to B. It just tells me how much was the principal rotation angle divided by 2, cosine of that, that's it. So it's a single scalar measurement. We just don't have quite the direct geometric interpretation of the principal rotation angle, but it's still a single scalar part. So let's look at it again. If we have b and n are exactly the same attitude. In this case, what is the principle rotation angle? 0, right? E-hat in this case is not defined, but the principle rotation angle is very well defined. So the ambiguity just shows up in this, but phi is 0, so 0 times whatever finite you picked is going to be 0. Cosine of zero just gives you one. So the zero rotation ends up just being one on what's called the scalar part of the quaternion. This is often referred to as the vectorial part of the quaternion because it depends on the e hat vector. The scalar part does not depend on e hat vector, just the angle. So lots of little definitions. So how do we now interpret this? Zero rotation, I have one zero zero zero. That's it, now I'm there. What is 360 degrees principal rotation axis, Trevor? How does that differ in my attitude, how does bnn relate if I have a three hundred and sixty degree rotation? >> It's the same >> It's the same, so if I have 360 degrees and divide by two, take the cosine, what do you get? >> You get one. >> Almost. If you look at the cosine curve right you repeat it 360. We're halfway through. The cosine is going to be minus one in this case. Now doesn't that strike you a little bit odd? We have exactly the same orientation. Up to now, well at least for the DCM's and the Euler angles if you pick an orientation another orientation and compute these things, I only get one DCM. It's non singular, and it was unique. Euler angles the same thing. I only get one set of Euler angles, because they're bounded by those, you know, four quadrants or the two quadrants depending on the set. That's it, principle rotation parameters all of a sudden, you get four possible sets. Here also, the quaternions are not unique because the same orientation gives me now two different sets. So what's the answer? If I'm telling you b and n are identical, do you pick beta not equal to 1 or minus 1? Kevin, what do you think? >> I mean, just given the fact that b and n are the same, just pick one. >> Yes, just pick one. Which one would you tend to pick? >> This one. >> One, why? >> Because if I'm just given only the fact that b and n are the same and I assume that there is no rotation. >> Right, it's a common thing, right? Depends on your applications too. The only difference between beta not being one and beta not being minus one is the path at which you arrive at this rotation. One of them says you've done at least one revolution, all right? The other one says you're just there. Or what else could be happening? If you think of this, let's say you keep tumbling and now I'm now at 720 degrees. I've done two revolutions. Beta naught becomes 1 again. So that's implied in this. If you have a tumbling body which in spacecraft we often have. You've deployed off a rocket, you kicked off, it's tumbling, and you just integrate your betas, they will go from 1 to -1. The beta 0 would go from 1 to -1 to 1 to -1. And every time you go to 1, you can't say, well, now I have unwound my spacecraft, right. All you can say if you've gone back to the original history. But at some point, you have to start and say, that's my reference. Time to 0, this is what I've done. And you'd have to count such occurences, all right. So it doesn't, it just gives you, I haven't done, I've done at least one. And if you think beyond, I would have to keep track in my code to see if I'm tumbled six times. The proturnians won't tell you if you've tumbled six times. It'll only tell you if you've tumbled at least once. This is only actually two sets in these things. Okay, good so the zero rotation for other angles becomes just all zero Euler angles typically. We have this rotation angle just goes to zero for the zero rotation. That's fine, DCM, what's the zero rotation for the DCM? The identity matrix, right, doesn't go to zero. This is something like the DCM. If we have a zero rotation, I end up with non-zero coordinates. I will have a one here, and then these are all zero. So, different ways to interpret this stuff. If you've tumbled, the worst attitude error you can have is 180 degrees and it doesn't matter about which axis I do it. If I have 180 degrees divided by two, is 90. This cosine goes to 0. That means I've done 180 degrees. So if this one goes to 0, I've now tumbled upside down. If this one is positive, the beta naught, I'm actually describing the short rotation from zero to 180 degrees. And if I go to a negative beta 1, a beta naught, sorry. I'm going from 180 point Trevor was talking about onward to 360. So, now I'm just describing the long rotation. So, there's another one thing, is that I can just, if I'm looking at all for look for the scalar one. And just from this definition, you can see, well, if it's positive, it's describing a short rotation. If it's negative, it's describing a long rotation. And if it's zero, if beta naught goes to zero, I know this craft is pointing upside down relative to whatever the other frame is. All right, so we'll be using this. This will sink in hopefully more, and more, and more as we go through it. But this is the basic definition in terms of principle rotation parameters. Now there's constraints here we have to deal with. The e1, 2, 3s, they come from a unit vector, therefore e1 squared + e2 squared + e3 squared has to equal to 1. When you do a lot of Euler Parameter property validation, derivation, as you do this next homework, you definitely want to use this. Because then also, what comes out of this too is if you take these betas, you square them and add them up, you will end up with cosine squared plus sine squared times factored out e1, e2, e3 squared. Those three sums squared to 1. This just leaves you with cosine squared plus sine squared, which hopefully you remember from basic trig is just 1. So this now means in 3 dimensional space, what type of geometry do we describe? When you have x squared, and y squared, and z squared equal to 1? >> [INAUDIBLE] >> It's a sphere, which part of the sphere, Chuck? >> Sure. >> Anywhere around the sphere, inside the sphere, on the sphere, right? It's the surface, but I want to be very precise here. It's the surface, so this really describes the surface of these coordinates have to lie on a surface of a unit sphere. A three dimensional unit sphere. Now this math let's just go back one. This math where does this lie? >> Hypersphere. >> Yeah so if you had heard hyper in geometry. Basically means we're waving our hands and giving up. It's anything more than three, all right? Could be four, could be five. There's actually descriptions from six dimensional space. You can have six dimensional hyper whatever planes and stuff. What does that mean? It's like a three dimensional thing but in a higher dimensional space. So this resides on a three dimensional surface. Unit distance, so it's a unit sphere in a four dimensional space. So a surface in a four dimensional space is a three dimensional manifold, a three dimensional sub space of that. That's where these things lie. Now who can visualize that? I can't, right? So how I draw it typically is like this. I'm just cheating. I'm just drawing a ball. You know, it's the easiest way to map it actually. And there's a whole papers on how to take geography mapping projections, Mercator mapping, other kind of stuff to map these things into other coordinate sets to so the analogy to the earth globe is pretty good. You see this in lots of attitudes papers so it just means that these parameters have to lie somewhere on this unit surface. This is the concurring constraint when we integrate and the length of this is a unit concurnium. Concurnian math can actually be done for non-unit length as well. That's how who the quaternions? Is that Calvin? Hamilton? Who knows? I think it was another applied mathematician with way too much time on their hand. I should look that up. But you can see quaternion math where quaternions don't have to be at length. Quaternion math looks a lot like complex number math. You've got a real one, the scalar, and then these others are like these imaginary axes but instead of one imaginary axis we have three imaginary axes in a scalar. That's how quaternion math was built. And now if you actually make it a unit quaternion it turns out all these wonderful properties come up. I'm not showing you any three dimensional complex numbers stuff here. We're just going straight to the principle rotation parameter interpretation. We want to see that geometry. It's really easy to get to the same conclusion. So think of these having to reside on there. Now it turns out the other quaternion set or the parameter set is simply minus beta. We saw that for the zero rotation. It was either one, zero, zero or if it had 360. Which is the long way around to the same orientation, it was minus 1000. So and I'll prove this on the next slide going we had four sets of principle rotation parameters. If you take those and apply those into these definitions, you end up only with two unique kurturnions. So I'll show you on the next slide. But before I go there, let's do a quick vis. Sometimes just 3D geometry trips people up sometimes a little bit. So what we really have is I'm drawing a red ball. That's on our, pretend that this is a four dimensional space. I'm just showing you a three dimensional illustration of that. But any point, any attitude you do has a certain location on this surface, all right? So this point on that surface means 30 degrees about this axis. Another point, that means 65 degrees about a different axis. But every orientation can be described as a point on that surface. Now If this is my beta naught axis, if I'm on this half of that surface, beta naught being positive means I'm describing the short rotation. If this point now moves around to the far side, I'm describing the long rotation. So if one quaternion set goes to the long rotation, the other, the alternate quaternion set, has to become the short rotation. In fact, that's what we were talking about earlier. If I have beta not equal to one do I know it's a zero rotation? Well, technically not even. I could have done 720, right. Those two things just keep flip-flopping back and forth as you would continue to tumble and tumble and tumble. But that's essentially it. So anywhere on the surface if you have an attitude. There's always an anti-point that basically describes exactly the same orientation, as Trevor was saying. But, it describes a different path to that orientation. One's a short, one's a long. And it doesn't keep track of multi-revolution, it only keeps track of within one revolution, short and long. That's it. That's what we have. So, Moving on. That's the basic definition, four parameters, one constraint. They are non-singular. This works everywhere but we have to deal with this constraint.