Flight Dynamics (9/14): Euler rates and quaternion rates

Channel: DrEstes Published: 2020-09-14 7,737 words Source: auto_caption
Advanced Mathematics & Geometric Physics

Transcript

[Music] [Music] [Music] [Music] [Music] how's it going you guys having a good monday [Music] [Music] just having a little apple cider it is fall after all as good as monday can be so no hey mondays are tough hey miracle i'm doing great how are you did you watch the f1 race yesterday i didn't i didn't shamiq who came out on top yesterday i was with my wife's family we were watching the bills game hamilton no surprises there who does hamilton race for i should know zarin says hi dr i was unable to attend recitation on friday and saw it wasn't recorded mercedes okay i'm still getting up to speed with f1 [Music] zeron says did i miss anything important on friday um so friday was covering some matlab basics so um that included some debugging [Music] some common errors that people encounter how to publish your matlab as a pdf so if you're acquainted with those basics you didn't really miss out oh miracle you watched that game but as a jets fan i'm sorry i'm sorry [Music] so sad about max who's max what happened to max [Music] seren you're welcome max verstappen an engine problem it's kind of crazy to me how how that happens you know the stakes are so high i'm just surprised that they don't identify those those problems i mean i know it's like i obviously don't know all that's involved it's very complex it's just kind of crazy that he said on the formation lap his engine stalled [Music] gotta update the title okay [Music] out of 20 guys only 13 finished the race formula one really it's something else that's extremely high pressure all right everybody what do you say we get started today we're talking about kinematic differential equations with euler rates as well as quaternions i'm going to start by motivating why this is important for aircraft dynamics all right so last time we showed that euler angles are a minimal parameterization of an attitude matrix in we introduced this mathematical space called so3 and so3 is the space of three by three matrices that are orthogonal and an orthogonal matrix all that means is that it preserves the length of the vector it operates on so a rotation matrix is orthogonal but additionally to be a rotation matrix you have to have a determinant of positive one an orthogonal matrix will have a determinant of plus one or minus one but minus one means that a reflection is happening um but no matter how you rotate an aircraft in the sky it can never become a reflection of itself so so3 is just a fancy mathematical word for all of the rotation matrices possible for an aircraft and a rotation matrix is just a way of describing its orientation in space so euler angles so there's three of them there's psi or maybe it's c i'm not totally sure how you pronounce it theta and phi so this is a minimal parameterization of so3 because we showed last time that the constraints that a matrix needs to satisfy to be so3 that's six different constraints um and if you have the most variables you could use for so3 is nine like if you make a direction cosine matrix using the cosines between basis vectors that uses nine parameters well if you you if you take away six or if you use six constraints that only leaves three variables so that's where euler angles come from it's a minimal set of variables to build an so3 matrix okay so given some euler angles and a position vector of the aircraft relative to a fixed frame so that would be the position vector of the cg of the aircraft which we call g relative to the origin of the fixed frame so given the euler angles and given this position vector you can define the pose of an aircraft oh my god are you going to make me do it uncle bill yeah whoa y'all okay so the pose of an aircraft is its position in space as well as its attitude or orientation so you need position vector you need the euler angles to define that so in real life how do i actually measure or estimate euler angles in order to determine the pose of an aircraft all right well this is where sensors come in all right so here we go i'm going to break this into i believe three steps so how do we measure or estimate euler angles so that we can get the pose perfectly said uncle bill okay great so we use body fixed sensors so these might be inertial measurement units fixed to the aircraft to measure among other things the angular velocity of the aircraft and because we're measuring the angular velocity of the aircraft with body fixed sensors this angular velocity is going to be expressed in body frame coordinates okay so first step you're going to get angular velocity readings from the aircraft it's going to be in the body frame of the aircraft all right next step transform these body angular rates so that's the angular velocity expressed in the body frame we call those the body angular rates into euler angle rates so we'll define these a little bit later on but why don't i just put these here these body angular rates we're going to use the variables p q and r so these are the angular rates we measure with the sensors we're going to transform them into euler angle rates so those are going to be the time derivatives of the euler angles okay so that's step two you measure p q and r you transform them into the euler angle rates all right when you do this transformation and we're going to get to this point today this we'll call it a transformation results in a kinematic equation uvara g cena 26 says hi hello so this transformation between the euler angle rates and the body angle angular rates results in a kinematic differential equation what is the kinematic differential equation it's a differential equation you integrate to recover the euler angles themselves or whatever attitude parameters you're interested in so let me write that out in a kinematic differential equation so that just means we can integrate this equation to solve for the euler angles themselves so it's like in dynamic systems when you solve a differential equation like x double dot plus blah blah blah x whatever when you solve that differential equation it's then in terms of x there's no derivatives left over all right so this is the procedure for getting oiler angles from sensors from an aircraft we're gonna break it down so here's another piece of information we can use the euler angles to get the pose but the euler angles in combination with the euler angle rates these are used for aircraft control so two types of control we'll look at in this class are stabilization and we'll do a little bit of flight path guidance as well so you can estimate the pose with these parameters you can also accomplish control which in my opinion control is the end purpose of studying dynamics right you understand how something moves so that you can manipulate it for your own purposes for evil or good that's up to you i hope you choose for good okay so let's get into it first we're going to talk about aircraft angular velocity because this is where it all starts right you measure the angular velocity from sensors mounted to the aircraft so up above i mentioned p q and r so let's break down what exactly they are all right so we have our fixed frame over here in blue it's got its origin we have g the center of air center of gravity of the aircraft so the aircraft angular velocity so the angular velocity of the b frame relative to a fixed frame f expressed in body frame coordinates is let's do this we know that to get the components of a vector relative to a frame we take the dot product of that vector with the basis vectors themselves oh before we get too much further just a notation thing when you look at this you should read it as angular velocity of b b relative to f all right so this angular velocity of b relative to f if we're expressing it in the b frame we project that vector using the dot product onto each of the basis vectors so i'm going to recycle some of these so i'm dotting this with each of the basis vectors and that'll give me my component along that basis vector direction okay so i'm dotting this one with b z and this is what i define p q and r to be so p is the projection of the angular velocity vector along the basis vector bx and then q and r and so physically this is what sensor gives us it's in the body frame okay so writing out a vector this way with respect to its basis vectors what we call it basis vector representation or basis vector notation let's write it in array form as well so this is how we like to notate it we put a subscript b to say it's with respect to the body frame and so we can just put our components in that array and we call this array notation all right so it must be said p q and r are not the same as our euler rates or euler angle rates many of us make this mistake thinking they're the same thing they're not so let's let's break that down a little so let's remember what the euler angles are and then um talk about the rates so the rates describe the angular velocity of the aircraft relative to the intermediate frames we used when defining the euler angles so i'm going to break this down with some pictures we're going to go back memory lane to wednesday of last week where we define the euler angles and then it'll make sense what these euler angle rates are and how it's related to p q and r okay so remember the euler angles you use them to describe the orientation of an aircraft or spacecraft and you think of it as three successive rotations so the first rotate i start with the fixed frame which i have in this dark blue and i rotate it in angle c or psi however you prefer to say it and that brings me to my first intermediate frame and then i'm going to do another rotation but i'm going to do it about the intermediate frame so notice i'm starting with this teal and i rotate about that frame in angle theta and then finally i rotate about this dark green our our second intermediate frame and finally i arrive at the body frame which is expressed in b basis vectors so when you think about what c dot theta dot oh wait i said that wrong that's v dot theta dot c dot when you think about what they are they're angular velocities of these intermediate frames with respect to one another so the angular velocity of our first intermediate frame i1 with respect to the fixed frame that's going to be psi dot and the way i drew these pictures we're always rotating about the frame that's i mean the the basis vector that's pointing out of the page so like for this one i have f z which is equal to i three prime that's coming out of the page and i'm rotating counter clockwise about that so this angular velocity of those two frames with respect to each other is this c dot about i3 prime now this second rotation it's about the the two basis vector so that's uh also known as i called it i2 double prime so theta dot this is describing the angular velocity of the second intermediate frame with respect to the first intermediate frame so i'm rotating with a rate theta dot about the axis i2 double prime and then we have one more rotation and finally this is going to be how the body frame rotates with respect to the second intermediate frame so let's get right to it that's going to be v dot about b x alright so these euler rates the main point they describe the rotation of intermediate frames with respect to each other now like i said at the beginning i want to relate these variables to p q and r which are the rates that i'm picking up from sensors and that's what's going to bring us to what we call the kinematic differential equation okay so to find the angular velocity with respect to the fixed frame we need to add those three angular velocities up above together so the angular velocity of b with respect to f it's going to be chaining all of those intermediate angular velocities together so first the first rotation was i1 with respect to f my first intermediate frame with respect to the fixed frame and then the second rotation i did was um the second intermediate frame with respect to the first intermediate frame and then the last one was the angular velocity of the body frame with respect to the second intermediate frame so if you look at these additions you see these are kind of they're tied together so if i want to go uh if i want to get the rate of b with respect to f i have to add all of these together at the same time so let's substitute in the expressions from up above this first one was psi dot about i1 prime and then this one was theta dot about i to double prime i believe and then the last one v dot about bx our body frame vector and what we want to relate this to all right because we know we know that these two are equal in terms of so the same angular velocity but expressed purely in the body frame is going to be p q and r so is uh is i supposed to be i3 oh you're talking about you're absolutely right thank you crispy brownies thank you very much that's definitely supposed to be i3 that's what we did up above thank you okay so the way we're going to relate these together we're going to put this in array form and we're going to use our trusty rotation matrices to help us relate these different basis vectors all right so we're going to relate these two vectors using array notation and rotation matrices okay so with respect to the body frame we know the angular velocity is pqr now what i'm going to do i'm going to take our three components from up above in their different frames and convert them to the body frame so that we can add them together so we're going to have the angular velocity with um with respect to the i1 frame so i'm going to take this first one right here so it's c dot with respect to the third basis vector so in array form the first two basis vectors have a zero component and the third one is going to be side dot now if i want to express this component of the angular velocity with respect to the b frame well what i need to do is i need to multiply this vector by a rotation matrix well i'm going to break it into two but just so you know overall what we need we need the rotation matrix that goes from i one to b and last time we got rotation matrices that can give us this so we we have the rotation matrix from i1 to i2 and we also have the rotation matrix from i2 to b and this is how rotation matrices work you can just multiply them sequentially like this so if those superscripts are compatible and then um these outer numbers tell you you know that it's from i 1 to b so i take this component of the angular velocity i multiply it by the rotation matrix from i 1 to b now this overall quantity will be with respect to the b frame now all right let's keep going all right our second one theta dot with respect to i2 i mean yeah and and this is the second basis vector of that frame so just like before it's theta dot with respect to the second basis vector of i2 and it wasn't rotating at all about the other basis vectors in that coordinate system so those elements are zero of that vector okay just like before i gotta relate this to the b frame so we'll take the rotation matrix from i to to b that's a little bit easier this time we don't have to multiply the matrices we just have that one ready to go all right the last component we have phi dot with respect to b x which is the first basis vector of the b frame so phi dot with respect to the first basis vector and there were no other components and this is already in the b frame so i don't need to use any rotation matrices and below i for reference these are rotation matrices that we derived last time when we were looking at the euler angles so we can just multiply these together multiply it all out and i'm going to give you guys the end result here so if we multiply everything out as we wrote up above oops we're going to see that pqr so the the components of the angular velocity in the b frame are related by this matrix to the euler angle rates and remember our goal is to so so this is a differential equation you can see that at this point i have this vector of derivatives of the euler angle rates and it's some function of well the euler angles themselves and the sensor measurements that i'm getting but this differential equation is in a more convenient format if we invert this matrix so that we just have this vector standing by itself so if we multiply the left and right sides by the inverse that's what we're going to call the kinematic differential equation so let's let me show you what this is going to be okay so if we invert that matrix let's just write this out okay so this it's going to be 3x3 the first column is one zero zero and the second column i'm going to use some abbreviated notation for sines and cosines and tangents so this is sine of phi times tangent theta and then the 2 2 element is cosine phi and then i have sine phi divided by cosine theta so this is the inverse of that matrix cosine phi tan theta how do you calculate the inverse of that three by three matrix i have done it by hand it's good to do it maybe once in your life but after that i would use a symbolic toolbox in matlab not gonna lie nobody wants to invert a three by three matrix just telling the truth okay so this is a kinematic differential equation you can think of the inputs to this differential equation as the you know these sensor measurements p q and r that you're getting from your from your aircraft and then if i solve this differential equation i get um or maybe i write this below well i'll just write it here so we're going to integrate this differential equation to get our euler rates or i mean not the rates just the euler angles themselves and that'll give us the pose of the aircraft okay now this matrix we're going to call it capital e and this is a function of this capital theta vector which it looks kind of like a little face doesn't it i just had to point that out it kind of does let's erase that though but now you can't unsee it um so this capital theta vector is the vector of the euler angles so this matrix that relates p q and r to the euler angle rates is e and it's a function of the euler angles themselves okay i don't think i need to say anything more about that we can okay let's just write this in a more compact notation i can say i take the e matrix it's a function of this vector and i multiply it by the angular velocity vector expressed in the b frame because that's what i get from my sensors from b to the fixed frame f so therefore when sampling that angular velocity vector from a sensor we can integrate this differential equation to update our estimate of the euler angles and this is in fact what you're going to do not for your next homework but the homework after that we're going to give you data from a quadcopter so you're going to be getting all of these body angle rates from the gyroscope on there and we're going to have you estimate the pose of the aircraft so that's that's what i really like about this that it's a very practical skill when you develop this and when you make your own code to process this data you could do this for conceivably any aircraft that's giving you this type of data okay however there's a little caveat here there's a problem with euler angles let's let's just get it out of the way when the pitch angle theta gets close to plus or minus 90 degrees this kinematic differential equation becomes unstable and uh well how does that happen we have some divide by zero singularities uh so how much of a problem is this uh i think for a commercial aircraft it's probably not a big deal because i don't think you'll find very often the orientation of the aircraft having a a an angle theta of plus or minus 90 degrees but it could happen and and in that case your code that's estimating the pose of the aircraft it's going to go haywire um let's show you from here how that happens so if we look at the matrix we'll take take this for example if theta is 90 degrees cosine of theta is going to be zero right and then this numerator could be non-zero so you're doing a divide by zero and the same thing's happening at this element so you can have elements of this matrix that are undefined or or approaching infinity so that's the problem this will work great until you get into a situation where theta approaches plus or minus 90 degrees and that's what brings what about jets then do they use a different equation yes yes and that's what we're gonna do next i'm not just gonna leave you here hang in this is where quaternions come in so if you think of a fighter craft that's going through all sorts of orientations it's not going to be using euler angles or same thing with spacecraft and satellites because in space whatever i'm going to rotate into whatever orientation i need and the aerodynamics of that aren't a problem okay so let's break down exactly how this works what equation do the bills use i would say most of the time euler angles and then it gets them into trouble uh like four or five games in but most the time they're okay you just have to cross your fingers okay so here we go the problem with the three two one euler angles is that when theta nears plus or minus 90 degrees we have i don't know if you can read this but it says singularities so like a divide by zero singularity in the kinematic differential equation now by defining aircraft attitude in terms of quaternions which are also known as euler parameters we overcome the issue of singularities if you use quaternions you'll have no singularities whatsoever well what is the price we pay it's not a it's not a terrible price actually it's kind of it's not too bad um this comes at the cost of parameterizing the attitude in terms of four parameters instead of three okay so so one more parameter that's that's not too bad actually so what are quaternions where do they come from the idea stems from euler's principle rotation theorem let me tell you what that is and i'll show you a figure too okay don't get confused by this you have our fixed frame f that's in blue and then superimposed on that i have the body frame in purple and the way that these two are related so this is what principle excuse me what principal rotation theorem says so wait let's back it up what euler angles would do it would say that look this body frame is rotated to the i mean is is related to the fixed frame by three rotations about intermediate frames the principal rotation theorem says no no no no no no no this frame is related to the fixed frame by one rotation through an angle that we're going to call gamma now the trick is that this angle of i mean that this rotation has to take place about a very specific axis uh which in this figure is in hat and this is the principal rotation wait did i get that name right look okay principal axis it's easier than i thought so it's a different way of looking at relating frames it's saying okay we're just going to do one rotation but because we're just doing one it has to be about a very specific axis called the principal axis okay so let's spell this out a rigid body or a coordinate reference frame can be brought from any initial orientation to any final orientation by a single rigid rotation of a principal angle gamma so this is how much you have to rotate about the principal axis in hat and this principle axis is fixed in the initial and final orientations it's not going to change throughout the rotation now i have a bunch of very detailed notes about quaternions but we're not going to get into them today i think i'll post them as supplemental material if you really want to get into how this principle axis works and i know dr daryl covered this in a decent amount in intermediate dynamics as well but um it's pretty interesting it's a different way of thinking about rotations okay therefore to describe relative orientation with this principal rotation perspective you need to define the principal rotation vector so let's define this vector um in the body frame so first i have to project that principle rotation vector onto each of the body frame axes so first i'm doing bx then i'm doing by we do projection using the dot product operation so let's project onto b z oops so um because all of these are unit vectors the dot product also boils down to the cosine of the angle between the basis vectors so the angle between the principal axis and the basis vector bx is cosine of zeta one i know that squiggle is a little weird cosine of zeta two so zeta 2 is the angle between the principal axis and basis vector y and cosine zeta 3. so i'm just showing you some different representations here or we could just call the components n1 n2 and n3 the point i'm trying to make here to define that principal rotation vector you need three parameters so that's already the same number of parameters we needed for the euler angles but now we need one additional parameter which you guessed it is how much we have to rotate about this vector so you need the components of the principal rotation vector or that principal axis and you also need the angle so this requires four parameters in one into n3 and gamma so if you're going to think of rotations this way you have to define four parameters instead of three that's where the four come from okay but i haven't said quaternions yet so what are quaternions also known as euler parameters what are they quaternions are a set of variables defined in terms of n1 n2 n3 and gamma so it's defined in front of the basis vectors for that axis and that angle and we define them in this way so there's there's four of them cosine of that angle divided by two and then the first basis vector sine gamma divided by two the second base vector also times sine gamma divided by two and the third sine gamma divided by two and you might be saying why the heck would you define them this way why didn't we just pick n one in two and three and gamma that's a lot easier to keep track of i'll get to it okay so you can also collect these in a vector which we'll call capital q so that's q naught q one q two and q three and then even among these four quaternions we tend to break them down into this q naught and then little q vector where this little q is just the collection of q one q two and q three and this just turns out to be for some notation purposes later on it's convenient to break them up in this way okay why are they defined this way they are defined in this way so that and you can prove this q naught squared plus q 1 squared plus q 2 squared plus q 3 squared equals one actually let's let's prove it because it's really not hard to do so they specifically chose these definitions so that this holds true think about what the equation of this looks like so think about that as we prove this okay so cosine squared gamma over two so that's q naught squared q one squared is n one squared sine squared gamma over two plus n two squared sine squared gamma over two plus n three squared sine squared gamma over two so does this equal one [Music] hmm we can factor out all these sine squareds right does that equal one okay here you have to remember in so that's our [Music] principal axis it's a unit vector so if you take the magnitude of that vector which would be that would equal one so this because n is a unit vector that's one and then you're just left with cosine squared plus sine squared which we know that is one okay so why what does it mean that this is equal to one well you can see this is the equation for a four-dimensional unit sphere can you visualize that i have no idea what that would look like in this way a given aircraft attitude described by this q vector so q not q one q two q three we know that all four of those parameters are going to add up to one so this means that any orientation of an aircraft with respect to quaternions we we represent that orientation as a point that lies on the surface of a 4d unit sphere that's kind of trippy right all possible aircraft orientations can be represented as the surface of a four-dimensional unit sphere the main benefit once again is that there are no singularities whatsoever so it doesn't matter how you flip around this aircraft in space however you orient that aircraft it's just going to be represented by four quaternion parameters and they're never going to become infinite at any point they just live on the surface of a four dimensional sphere okay now the rest of this stuff we're not going to derive in lecture with a bunch of detail because that's going to take a lot of time but i'm going to post some supplementary notes so if you're really curious you can see where this comes from so we're going to find the rotation matrix from the fixed frame to the b frame in terms of quaternions it turns out this equation although it may not look that way at face value this is the equation for a three by three rotation matrix so let's break this down really quick so this this first term is an identity matrix three by three and we're multiplying that by q naught squared q naught is a scalar and then we have this dot product of little q with little q remember the little q vector is q one q two q three so both of these numbers are scalars and we're multiplying it by a three by three so this first term is a three by three matrix so moving on to the next term what the heck is this what is this x-men symbol that is called the outer product i think it's a really cool symbol and so all that this means it's equal to q multiplied with q transpose so if you haven't done this before it can be a little weird but q little q is a three by one q transpose is a one by three and if you multiply these two together with the outer product this exists or it's a three by three matrix that's what i'm trying to say okay so the second term also three by three and then the last term it's 2 times q 0 times this function s of the q vector so we define s in this way and it's going to come up a couple times this s vector in essence it's a way of expressing cross products as a matrix but it's a three by three matrix minus q2 q1 zero okay so that's a three by three matrix so what we have here we have an equation and it is a three by three actually this thing maybe we'll take maybe take a second and so i want to show this to you q nut we'll come back to that i'll make a note to come back to this what is this sq matrix so okay let's hold on i'm trying to remember exactly i think okay i think it's equal to q whoops crossed no no hold on hold on hold on because this just gives this gives another vector let me bring this back it's been a second since i used it and i'm like oh no this is what it is this is what it is it's not even this it represents like this cross product operation okay with another vector so let's let me show you let's say i want to cross q with just like a generic vector v all right we're gonna like bring this over here okay what i'm gonna do i'm gonna write this as q one and i'm just going to make up a basis because i think this is how it works q2 b2 so that'll be q and then i'm going to cross it with um do i want to do that okay we'll do this one v1 b1 v2 b2 okay so we got cross product of q with respect to v and then i'm just making up some basis vectors but it's important that they're with respect to the same basis so this would be q1 i'm going to copy this i'm going to distribute this so it'll be like you take this vector you cross it with that and then you add this crossed with v2 b2 okay and then we add the last part v3 b3 okay so we're expanding that out now i want to look at this line by line so i'm just going to keep spreading this way okay so this first line okay so you you gotta use like this rule for cross products by the way have you you've seen this probably right so like if i have b1 cross b2 that's b3 but if i went the opposite direction if i want b1 b2 cross b1 that'd be minus b3 so like this is a what do you call it a mnemonic or something okay i forget what that thing's called but we're gonna we're gonna break this down and b1 cross b1 if you cross the same vector with itself it's just a zero vector so this is going to boil down to so these b1 b1 that's going to cancel i'm going to have q2 v1 b2 cross b1 which is minus b3 and then i have b3 cross b1 which is b2 so that's q3 v1 b2 so that's what this first line's going to be let's just do each line because you're going to add all these together um okay so i'm going to b1 because so i'm going to have q1 v2 cross with b2 that's b3 b2b b2 goes to zero b3 b2 goes to minus b1 b1 okay so that's the second line we're gonna do the third line okay b1 cross b3 is going to be b2 q2 cross b3 is b1 okay wait wait i went in the opposite direction of the arrow this should be minus b2 minus all right all right all right all right doing really great b1 okay so we have to add all of these three lines together and i so when i add them together i'm going to gather terms and we're just going to keep moving over to the right even further so let's get all the b1 terms first [Music] okay so that's going to be q2v3 minus q3v2 b1 those are all the b1s right and then okay b2 q3 v1 minus q1 v3 b2 and then b3 q1 v2 minus q2 v1 b3 okay so we got this by q crossed into v and then basically this s matrix is trying to turn this into some matrix operating on v so so basically it's turning cross product into a matrix operation so i'm going to pull v off to the side so v what was v it was just v1 v2 v3 in some like b frame that i made up but it was whatever it was in the same frame as q and then i have to choose a matrix so that when i multiply this out i get the same thing that we got here which is going to be q 2 v 3 minus q 3 v 2. so that would be the first element q three v one minus q one v three and then q one v two minus q two v one and then we just have to solve this puzzle so the v2 element is multiplied by a minus q3 so i have to put like a minus q3 here and then v3 is multiplied by v2 so i have to put a q2 there and then there's no v1 in that first you see what i'm doing here so if i multiply this row with v1 v2 v3 i'll get back this q2 times v3 minus q3 times v2 okay then this is uh q3 times v1 minus q1 times v3 and then the last row i have to have minus q2 times v1 plus q1 times v2 and then plus zero times v3 and then we call this matrix s of q so so that means that so the whole point is if i take q cross into v that by definition is s q operating on v well thanks for asking about a potato i was going to skip over it because i was a little intimidated at first but once we got into it i was like dude this is it is a cool thing to show wait hopefully this thing matches let's take this over here what if i copy this bring it over and it's different than the s matrix that i defined oh bless the lord they're the same so now you know but then you'll ask yourself like what the heck though like this is a little weird because this isn't operating on anything so it's kind of just like a cross product matrix hanging in space it's not it's not operating on it it's a little weird okay anyways if you guys uh multiply everything out in this equation and add it up you're going to get this 3 by 3 matrix in terms of the quaternions so notice it's just like any rotation matrix that goes from f to b but it's parameterized in terms of four variables q naught q one q two q three all right now i wanna show you this is our last thing this is our last thing today deriving this one takes a little work as well like i said i have some notes on it so if you're if you are interested i can hook you up but here we go this is our kinematic differential equation for quaternions so this is going to be a four by four matrix in here and then i'll tell you how we use this matrix okay p zero r minus q q minus r zero zero p r q minus p zero okay so this matrix it's it's populated by p q and r well these p q and r's are from um from our our friend the angular velocity vector so just to remind you that's p q r okay so here's the point of this kinematic differential equation um let's say i have an aircraft that's in the sky it's giving me these sensor readings angular velocity with respect to the body frame okay so let's say i get a set of p q and r once i get that i can build this matrix right i get those three readings and then i populate this four by four matrix with the readings i get from the sensor then assuming that i have some initial condition for my quaternions so you you do need some initial quaternions then i can integrate this and solve for q1q what you know what i'm saying i can solve this differential equation for the quaternions once you have the quaternions that set of four parameters corresponds to a unique attitude of an aircraft so it's just like euler angles given euler angles three euler angles i can tell you this is where the aircraft is pointed in the sky well with quaternions if you give me all four of them that also corresponds to where an aircraft is positioned well how would you relate it to how it's positioned it'll go back to um this definition where this tells you the components of the principal axis with respect to the body frame and this tells you the angle it's rotated about that axis so if you peel this back you can translate the quaternions into a unique orientation using a figure like this so it's just a it's a little less intuitive maybe but um but that's the point in practice we're getting sensor measurements we're turning those into attitude parameters whether they're euler angles or quaternions using integration and that tells us where the aircraft is you're gonna get to practice this two homeworks from now i believe or one homework from now it's like a little bit it's very near in your future and with that that is our content for today i've shown you a kinematic differential equation for euler angles and one for quaternions as well don't get lost in the math it's very practical thanks for your attention today guys thanks for your questions thank you for potato for asking what that s matrix is i'm glad we went through that i'll just hang out here for a little bit longer i gotta rewatch the video again it was pretty intense yeah it was pretty intense i agree pretty intense flight dynamics is pretty intense we're taking it one step at a time hey see ya miracle thanks for thanks for being here [Music] i went to campus today briefly i'd uh do a little facilities meeting let's get some dua lipa playing before next class but um yeah like nobody's nobody's on campus i thought it would be a little more populated than it is where's this music from kind of slaps so i use a i'm using this it's kind of cut off it's the service called sound stripe this is called weeping tooth crust by isaac joel but anyways the special thing about this music provider is you you subscribe you have to pay but then i don't know if you can see this on the right but they give you you can get the license for all of these songs so it's perfect for something like twitch or youtube where you can get into copyright issues so i'm not going to have copyright issues for playing this music because i have access to the license it's called sound stripe [Music] our groups have gotten random projects for 451 so do you think since we can we still can do your sponsor project if you're ready to sponsor or is it too late unfortunately i think it's too late because i have three groups and that's already a lot [Music] yeah so i'm sorry i think three is the max i can take [Music] yeah sorry roo [Music] all right everybody thank you for your attention today i'm gonna peace out i'll see you on wednesday looking forward to it [Music] do [Music] [Music] [Music] you