Now the next thing, the last thing we need for this, the current homework set two, but is the differential kinematic equation. The kinematic differential equation. This we had for the DCM already. What was the DCM, Charles? What was the DCM, differential kinematic equation? What were we talking about? >> I don't remember kind of end. >> How does the DCM rate relate to Omega? What was your name again? >> Ryan. >> Ryan. >> [INAUDIBLE] >> Yes so c dot was minus omega tilde c. That's what we saw. I just want to bring it up quick. I'm not going to slide back again. That was it. That related, because you may have the initial altitude, you know the initial orientation, so you'd have C at the time T zero. If you measure omega, which we often do with rate gyros, you can now integrate the altitude and figure out where was that sounding rocket as it took off and spiral and did stuff. That's what we're doing using the DCM. The DCM was non-singular but also is highly redundant, all right. We had nine coordinates for a three degree feeding problem. So Jordan, if we have nine coordinates, three to meet the freedom, how many constraints do we have? >> Six. >> Thank you, okay. Six, exactly. So here we're doing the same thing but we have to relate yaw, pitch, roll rates to the omega. And so it's a pretty straightforward process. The key to solving this is remembering what Euler angles are. They're a sequence of rotations. So yaw rate really means this first rotation, how is that changing with time? Time stamp one, we had 30 degrees, next time stamp we had 40 degrees. So one second apart, you're increasing your yaw angle at 10 degrees per second. That's about this first access, right? The second one is the pitch. If pitch was 10 and one second later, it's 11, that means you did your yaw and the increasing it very quickly that the pitch angle's only varying at one degree per second, all right. But that's about this intermediate axis and then finally the roll. How much is the role rate? How much is the roll angle changing? That's your roll rate. It's angular velocities of one frame to this intermediate frame, which we call the prime. Then the pitch, we went to the double prime. And then the final rotation gets you to b, all right? That was that kind of four cartoon sequence I showed you. That's what we're doing here. That's what these are. And what we have to do is relate them to this omega. Omega is the instantaneous angular velocity of this frame, of b relative to n. Omega is b relative to n. Without writing all the letters all the time. So we have those rates. How do they relate to here? That's the key. So is that cartoon sequence we had. So if you look at this, we're going from B. Actually, I lost my primes. Let me just. I can't draw on here. So we went from the N-frame, where B and N are identical. Then we do a three rotation first, the yaw. That gives me the prime frame. This was the prime frame, the first intermediate frame. Then the second rotation, we rotate about 2, so that would be the 2B 2 prime. That gets us here and then the last rotation, this is the double prime frame. We're rotating about the one axis so B1 double prime and B1 aren't the same in that sequence. So that's where the roll is just about here. This is where you start out from. You have to get this omega right, it's a three to one sequence. So the first rotation's about to inertial 3. Then the second one is going to be about this one, b2 prime. Or it could be b2 double prime. They are the same. because you are rotating about that. And then the last one is always in the b frame because that gets you to the b frame. All right, whatever the sequence is. But that's the yaw, pitch, roll. And you notice, we talked about what is vectors earlier, this is a vector. Magnitude times the direction, magnitude times the direction, magnitude times the direction. And to relate yaw rate, pitch rate, roll rate to the omega, if you go back, we already have the same vector written out this way but along b1, 2, 3 components. To define your differential kinematic equations, fundamentally what it breaks down to is once you have this equation, you have to translate everything into b frame components. So we have to map this b2 prime, which is the same thing as b2 double prime, into b frame. And we have to map n3 into the b frame. Now you have everything is something times b1, something times b2, something times b3. And those somethings have to be equal to omega 1 b1, omega 2 b2, omega 3 b3. That's the sequence. So we're going to do this. b2 prime, again, same thing as b2 double prime. The trick to get to that one is the double prime frame to the final frame, we did a 3, 2, 1. You look down your final rotation axis, you can draw that. If you don't see how the cosine, sines are, I would just draw that out, and then you can see how to map b double prime to the b frame. And it's just a 1D rotation, kind of what you did in chapter 1 homework. That's where you come up with this kind of a relationship. Everybody see that or do you want me to do just one example? Okay, let's just do this. 3D thinking can sometimes, with the best of efforts, like, I just don't see it right now. Okay, let's do this. So let's see. We're looking now b1 and then we need b2, b3 okay. So I'm going to just draw this out. So if I look down I'm going, This is, b1 is out of the board so I'm looking down b1. So this would have to be b2 double prime, b3 double prime. You did this sequence, I'm looking down this axis. So that's my current 2 and 3 and then I'm doing the roll to get to the final body. So I want to use a different color. Let's go red. And all right, that's the final roll angle. And we're going with roll. We're going from that second intermediate frame to the final frame, so that's the sequence. Great. And that's feet. And what did we need? We needed b2 double prime in the end, right? because there b2 prime is equal to b2 double prime because that second rotation from here to here. This is b2 prime, b2 double prime. And they're rotating about the two axis. They're identical. Here, this one, whoop, let me get the other labels in. This would be b2 hat because that's the final b frame. And that's b3 hat. So how far, if you do this, do your projections here, how far do you have to move in the b2 direction? Mariel. What's this distance going to be, from here to here? >> b2 prime, wait, what, sorry. Could you do that again? [LAUGH] What's the distance. From here to here, how far do you have to travel. >> In the B2 for you, or- >> Along this I'm drawing it right here. >> Yeah. >> What's that distance. No, B2 is an axis. That's not a distance. >> Okay, well one. >> No, B1 will be all the way to the end because b2 hat is a unit vector. You've gone too far. So the thing to remember when you're doing projections, these are orthogonal sets. So this axis has to be orthogonal to this. B2 and b3 are orthogonal. That's a right hand triangle. What's the length of B2 double prime there, Mariel. >> That's one. >> That's one. Exactly, so you're on the right track. This is the full one. These other two have to be less. So if this is one, what's this distance. >> Very sorry, so that would be cosine phi. And then the other one would be sine phi. >> Good, okay, let me just write that in >> This is cosine phi and that's sine phi, okay. We're almost done Mariel. So now B2 had to go from here to this point, you go cosine phi in the plus B2 or minus B2 direction. Plus, right, exactly. And that's the last thing we have to check. So that would be a cosine phi B2 hat, good. So, Tony, next to that. She's already given you the distance. This is how far you have to travel. But in which direction do you have to travel to get from here to here. >> From B2 to the B2 hat. >> No, from this point. >> You want- >> To this point. We've gone from here to here. We have to now figure out to here, right. We're trying to write B2 double prime in terms of B2 and B3 base vectors. >> You would subtract sine phi. >> Now we have to go this distance. Since phi, but we're going to be going in the minus B3 direction. And that's it. Now you've done the corner transformation to get from one frame to another. Here I've done the direction cosines. I've taken the projections. There's many different ways to do it. And really any of them are fine for the homework if you're doing this. You could have just written the DCM. You could have said, well this is one rotation from this frame to this frame. And you could look up and one into positive phi rotation. And that would have given you the correct way to map one set of coordinates into another set of coordinates. That could work as well. So this is kind of, if you don't see the phi geometry, you can always draft the mass of math of M1, M2, and M3. In fact, we use that in the last step. Here I typically do this because I can derive this usually quicker than looking, grab my book, find the right page, do that. This is such a simple thing. I just have to, that's the code, that's a plus minus. It's either cosine and sine and one of them is negative usually, or possibly. That's what I have to check for. The other one N3, now we have to map N3 into the final body. That's doing a lot of rotations. I don't do that in my head. There's no single nice projection to get there. So, what do we have to do. This is a coordinate transformation. And the way I got these components is, I simply looked up the DCM formula. That's even on the equation sheet you have for an exam. I'm giving you some of those already, like a three, two, one. And then you have to know how to use it. So if you've already derived the three, two, one. Then I know, I put the vectrix that maps b frame vectrix into n frame, or N frame into B. That's a DCM. I have it in terms of order angles, so I just look it up. Let's go back to that. I see some. Here's the three, two, one that we'd have. What happens here is we have to get the N3. This maps N1, 2, 3 into B1, 2, 3. I need N3, though, the opposite. What do you have to do to this DCM. >> [INAUDIBLE] >> Transpose it, exactly. because once you have NB [COUGH], then it's going to be N1, 2, 3 times the transpose of this matrix equal to B1, 2, 3. Now I need the third one. I need N3. I don't need N1, N2. You can find them but they are not useful in this math. I just need the N3 part. So the N3, where do I find now the three vector components that I need. It's going to be the third column, right. If you transpose this, the third column becomes the first row of the first, the third row. The third column becomes the third row. And therefore, N3 will be this much times B1. This much times B2, this much times B3. Or, in one of your homeworks now, I'm asking you to prove this BN was B1,2,3 in N frame components transpose. Now we've got the rows are B1, 2, 3 or the columns are N1, 2, 3. If you remember that definition, you could look at this and go well I know this is B1, 2, and 3. This is N1, N2, N3. Lots of different ways to get there. Lots of different little tricks. But that's all we have to do. People stumble over the mathematics of this. But really just recognize the hardest thing, to get the differential kinematic equations and it is not hard, really is this part. Get the correct sequence. Then once you have this you just have to figure out well that intermediate frame how do i map it to B. That first access, how do I map it to B. It's just coordinatetransformations. And there's geometric ways to do it, there's mathematical way to do it. It'll all gets you there. That's one that I'm asking you to do in this homework too. I mean you've look at the answers in the Appendix if you wish. You don't get points for the answer. If you just give any answer, you get zero points. It's really easy grading, you know. Show me the path, show me how you get this, that's what you have to go and do. Good, we did that. Now how do you wrap this up. Here, if you plug this in and you plug this in, and then compare to here. This N3 goes here. And this B2 prime, B2 double prime. Same thing, goes here. And then you collect all equal terms. Give me all the B1 components. They have to be equal to omega one. Right, because this three orthogonal axes and all the B2 components that you end up with have to be a omega two and all the B3 components have to be omega 3. Well that give me three equations, the three unknowns, and how do we solve that. Linear algebra, right, we put them in a matrix form. That's what I've done here. This what you do when you derive this on your own, really, this last step. It's just a matter of identifying that's where that term goes, this term, this term, that's it. That shouldn't be hard. But this relates now, if you have ordered angle rates into omega. We use that sometimes but it's not the most common form. Typically we need to inverse. I have omega because i measured it from rate gyros. Or as in the next section, let me get into the kinetics, we find differential equations and how to solve for omega. Now I'm giving you that. What is the corresponding attitude. We need the inverse of this and there's no easy way around this. You basically go Mathematica and ask it to invert it. And it'll be so happy to do that for you. You can try to do it by hand but life is too short really. That's all we need, the inverse of this matrix. Find a symbolic manipulator, invert it and get here. In an exam I would never ask you to do this inverse because this is really why. Give it to a computer, it will do it for you. Now, when we get this inverse, you can look at here. Are there any mathematical issues with this differential kinematic expression. Looks good, nothing bad happens. Let's look at the inverse. When you do the inverse, there's this one factor you can fact, you can take outside, one over cosign theta. Where is this differential equation going to have issues now, Evan. >> Beta equals zero or 180 Theta's equal to 0. >> Right, 90. Plus or minus 90. >> 90. Plus or minus 90. Right because at 90, cosine theta is 0. Minus 90 equals n theta 0. So this is the pitch angle for a 3-2-1 sequence. So it's an asymmetric sequence and we promised it's a second angle that's a troublemaker and it's going to be a plus or minus 90. This is the way you see it mathematically manifested. And if you had any other asymmetric sequence these terms would look different but these is always going to the same. You'll always have the one over the cos sign if it's an asymmetric sequence. And if it's a symmetric sequence they'll be a one overside. That would be a singular for that but that, so that's what the mathemat, that's what ambiguity of these coordinates Manifest himself. And all a sudden, the differential equations have stuff like 0 over 0. And your numerical integrator will have a lot of trouble with that. So that's how these singularities manifest themselves. We typically write this big matrix is the b matrix so its what maps omega into your coordinate rates. I'm going to use the same notations for other [INAUDIBLE] coordinates. We'll just have omega that maps mrp's, crp's, [INAUDIBLE] different coordinate set. But that's a differential kinematic equation. Good. Here's the same if we do a 3-1-3 sequence. So you would derive that the same way. He did a 3 rate for your big omega rate, your inclination rate. And then a sending node rate. And you do all this quotum protections. Always should be a frame at the end. To group terms you end up with this. This term always looks good, going from [INAUDIBLE] rates to omega. But you invert that metrics analytically, you'll find a one over sine, as we expect. So here at zero angle or 180 degrees angle, we're dividing by zero. And you have these issues with the ambiguity. And that's a sensitivity question. These actually manifest themselves very much in orbits. So if you look at the classic orbit elements, node, inclination, They're called singular, they're actually a singular coordinate axis set. Because if you have an equatorial plane, or an almost equatorial or an almost. Circular stuff too. There's all kinds of ambiguities in how these angles are defined. And all of a sudden you're can very drastically put your positions on in just this much. But you're working right around that singularity. So in attitude terms, this is how it manifests itself and you see it in lots of different fields. Okay, any questions on differential kinematic equations? This is hopefully something we can wrap up quickly. Okay, Tony? >> So, I was wanting to go back to the 3, 2, 1 figure? >> This one? >> No, for the 3, 2, 1. >> This one? >> About going to the, yeah. So for the B prime, B hat two prime. >> Yeah prime would be this sequence, that's the first intermediate step. >> Okay so. >> Instead of calling it e or d it's still b and just along my way to b right? So that's why I use b prime, it's just the convenience. Mm-hm! >> A line for b half. One. Line is b half. One is not different. One will be b half, one double prime. >> Here we would have all double prime. Yes. And you could put those on this lines if you wish. And to go add those again. >> So then you would write. >> So all the Ps in this side are double primes. All the bs here are single primes. And the final bs are just bs. Now, that is the final frame, once you finish the third rotation. So if you look here, for example, we did a three. So we are rotating about threes. And three is equal to b three prime, actually. b three prime and three are the same because you're just doing that rotation. But now we are doing a three, a two sequence, so we are rotating about two, so it would be 2 prime, and B2 double prime. You can see they are the same direction. That doesn't change. B1 Prime was here, and leave it in there as a thin line, that's really the direction of the original B1 prime. [SOUND] And now that we're rotating out to the double prime, so that's where that moves up. And the b3 prime moves to here, to b3 double prime. >> So then, would you write b-hat-1 double prime in the equation of the angular velocity? >> You could, they're identical. Yes. So if you go look at here, you could have single prime or you could do double prime. They are the same thing. That's why here, if you looked at this one, I'll still write that expressively. b one prime, b one double prime, because that second rotation is about b two not b one. The second rotation is about two, so the axis is in variant between those two frames. >> Okay, yeah, I was just confused- >> You're on the right track. >> I was just confused with the first and the last. >> Okay, so work this through, come back with questions. I also have office hours tomorrow if needed. We'll go from there. So some final comments, something we've already reviewed really. It's the geometric singularities. If it's a asymmetric set it's 90 degrees. Otherwise it's zero 180. Always a second angle. But you can also see from these singularities we're never further than a 90 degree rotation away From a singularity. So they don't linearize that well. It doesn't take that much before woo, you really have to go for the full nonlinear stuff. This we'll compare and to other coordinates as we're getting into, that'll linearize way better, or we can be much further away from a singularity. And just something to keep in mind as we go through this. Good. You got just a few minutes. We'll wrap this up next class. So who already said we could use symmetric angles to do direct additions? Somebody over here mentioned. Robert. Okay. You're like no. He's going to ask me questions now. No, you had a good comment. So symmetric angles. They are direct addition properties. So instead of taking all these coordinates. I'm mapping them to the DCM. That's a 3 by 3 times a 3 by 3. Gets another 3 by 3. And then you don't even use all of them, right? We only use five of those elements. One for the second. And then two sets of twos for the first and the third. That's a lot of wasted math, really. Are there quicker elegant ways to get from one set to another? And it turns out, yes. But we have to use spherical trigonometry. This is kind of an elegant result. Mach and Schuster showed this in his paper on the survey of attitude parameters. It's kind of a very elegant paper. So I just want to use a few minutes to explain what is spherical trigonometry. You're all used to King/Ian trigonometry. Right? So in a flat plane all your inner angles have to add up to be 180 in the end, right, have to. If you take that triangle though and move it onto, let's just draw a picture. Let's say we move it onto the globe, I don't need that anymore. So here's your equator. Here's the North Pole. So someday travels from the North Pole all the way south to the equator. Then they want to travel along the equator. They're taking locally a 90 degree left turn. And now they walk along way And then they swim >> Dodge crocodiles. Who knows. They get all the way across. 90 degrees across the globe. And I take another left. And you go all way up to the pole, that going to frigid. I know, it's a long walk. How many 90 degree turn and you started over again. How many 90 degree turns have you made? Three. All right, you start out here. That's first, 92nd, 93rd. So all of these inner angles are actually right angles. So 90 + 90 is 180, but. Net ninety that's 270. So on a sphere, spherical trigonometry, the inner angles don't add up to 180. They add up to other quantities. This is kind of one of the extremes. But that's what we're looking at. These are the inner angles. You're taking your triangles and you painted it on a unit sphere. That's one way to look at it alright? So this travel, we talk really about the angles. This is the center of the earth. There's angles here that you will see. So how far have you traveled? Or there are angles here, or there's these arc distances. So this length would have a 90 degree distance on that unit sphere. You went from here to here. So everything in terms of angles on these triangles, spherical triangles. So if you go back here, A is really this angle. How far have you traveled there. B B is this angle and C is this angle, right? So those are the distances you've traveled on this sphere and then when you get to a corner point on your triangle working on this sphere, how much have you rotated to go from this line to this line? So what's that inner angle? And I'm using capital letters for the inner angles and small letters for the outer, that's the outer side. It's like the length of a triangle, but the length here is in time of angular distances because we're working on those units here. That's the trick. Now, with regular trigonometry, you have signs and laws of signs and laws of cosigns. Spherical trigonometry, they look very similar, but slightly modified. And these are the ones that will be used from this. Well next time we'll derive these properties. This is something that's useful for the next homework assignment actually. But I'm going to end there. This was just a kind of a quick introduction. Something to get you thinking about this. And we'll pick up on Thursday, okay?