Computing Euler Angles: Tracking Attitude Using Quaternions

  Рет қаралды 24,097

Christopher Lum

Christopher Lum

Күн бұрын

In this video we continue our discussion on how to track the attitude of a body in space using quaternions. The quaternion method is similar to the Euler Kinematical Equations and Poisson’s Kinematical Equations in that it consumes rate gyro information to compute Euler angles. However, it has advantages in that it is robust to singularities in orientation that plague the Euler and Poisson techniques.
Topics and Timestamps:
0:00 - Introduction
1:00 - Quaternions definition
9:09 - Quaternion example
19:43 - Quaternion mathematical operations
23:37 - Attitude representation using quaternions
45:51 - Quaternion example revisited
54:38 - Quaternion kinematical equations
1:02:26 - Simulink implementation of quaternion kinematical equations
Lecture notes and code can be downloaded from github.com/clum/KZfaq/tree/...
All Flight Mechanics videos in a single playlist ( • Flight Mechanics )
#FlightMechanics
You can support this channel via Patreon at / christopherwlum or by clicking on the ‘Thanks’ button underneath the video. Thank you for your help!

Пікірлер: 91
@ChristopherLum
@ChristopherLum 4 жыл бұрын
In case it is helpful, here are all the Flight Mechanics videos in a single playlist kzfaq.info/sun/PLxdnSsBqCrrEx3A6W94sQGClk6Q4YCg-h. You can support this channel via Patreon at www.patreon.com/christopherwlum. Please let me know what you think in the comments. Thanks for watching!
@andreichirap3259
@andreichirap3259 4 жыл бұрын
You are an amazing teacher! Thank you so much for sharing this high quality content on youtube! God bless you!
@sunnysarkar7643
@sunnysarkar7643 2 ай бұрын
AE 512: My manager asked me about Quaternions a couple weeks ago and I wasn't familiar before watching this so this was great!
@davidtelgen8114
@davidtelgen8114 2 ай бұрын
AE512: Really helpful to see all the models compared in Simulink, thanks!
@philipcasey8361
@philipcasey8361 2 ай бұрын
AE512: This video does a really good job connecting the dots between Euler angles, DCM, and quaternions, thanks!
@sohamprajapati8784
@sohamprajapati8784 2 жыл бұрын
There's greatness in you! Thank you for the lecture!
@thomasstiglich3484
@thomasstiglich3484 4 жыл бұрын
Another great video! I am treating these as a course, taking notes and writing the programs.
@aimeepak717
@aimeepak717 2 ай бұрын
AE512: This was my first exposure to quaternions. Thanks!
@ChristopherLum
@ChristopherLum 2 ай бұрын
These are very powerful and I think you'll see them around various simulations
@OmarUgolini
@OmarUgolini 3 жыл бұрын
Excellent practical video, thank you!
@vahidengineer7303
@vahidengineer7303 3 жыл бұрын
you made science easy! I adore you man.
@ChristopherLum
@ChristopherLum 3 жыл бұрын
I'm glad it was helpful. There are several related videos on the channel. Please feel free to check them out and I would love to hear what you think in the comments. Thanks for watching!
@kurtcobainsr
@kurtcobainsr 4 жыл бұрын
Great video! Always love watching your content. Would love to see more flight mechanics videos in the future!
@ChristopherLum
@ChristopherLum 4 жыл бұрын
Brian, I'm glad it was entertaining. There will be lots more flight mechanics videos coming. If you are subscribed and turn on notifications you should hopefully see when they are posted. I hope to catch you at a future video!
@Colin_Baxter_UW
@Colin_Baxter_UW 5 ай бұрын
AA516: First time seeing quaternions, thank you for the explanation!
@anthonysu1712
@anthonysu1712 2 жыл бұрын
I really liked the flow of this video; it really paralleled the thought process from the Euler/Poisson derivation and made it easy to follow.
@davea1771
@davea1771 3 жыл бұрын
Excellent content. Quaternions explained in English and pictures, plus an example that applies them and shows the results. Everything that's necessary, but nothing that isn't. Well done and Thank You. 👍👍👍
@ChristopherLum
@ChristopherLum 3 жыл бұрын
I'm glad it was helpful, thanks for watching!
@charlesharmon9065
@charlesharmon9065 2 жыл бұрын
Very enjoyable comparison between this quaternion method of attitude tracking vs the Euler and Poisson Kinematical equations.
@dr_ned_flanders
@dr_ned_flanders 2 жыл бұрын
This was a great video. Thank you for your time in putting it together.
@ChristopherLum
@ChristopherLum 2 жыл бұрын
Thanks for reaching out. If you have questions or would like to request a video, I hope you'll consider supporting the channel via Patreon at www.patreon.com/christopherwlum. I'd love to have you as a Patron as I'm able to talk/interact personally with Patrons. Thanks for watching!
@yaffetbedru6612
@yaffetbedru6612 5 ай бұрын
AA516: Awesome to see how the transformations from DCMs to Quaternions can happen and how your diagrams you draw relate to Simulink drawings.
@Kumky605
@Kumky605 4 ай бұрын
AA516: Forgot to comment on this when I watched it the first time but this was my first intro to quaternions and I'm glad it was introduced this way. A much better jumping off point then previous courses.
@doya5
@doya5 2 жыл бұрын
Best video I have seen on quaternions! Thank you so much
@ChristopherLum
@ChristopherLum 2 жыл бұрын
Hi, Thanks for the kind words, I'm glad you enjoyed the video. If you find these videos helpful, I hope you'll consider supporting the channel via Patreon at www.patreon.com/christopherwlum. Given your interest in this topic, I'd love to have you a as a Patron as I'm able to talk/interact personally with all Patrons. Thanks for watching! -Chris
@MarioHdz68
@MarioHdz68 3 жыл бұрын
Great video, thanks a lot
@beritsyltebo3940
@beritsyltebo3940 2 жыл бұрын
AA516: I remember trying to learn about quaternions last quarter to no avail. This explanation made it very easy to understand.
@wiloberlies9598
@wiloberlies9598 4 жыл бұрын
yes!!!!!! Thank you.
@liupeterw
@liupeterw 5 ай бұрын
AA516: Very helpful lecture! I've had some exposure to the math before, but the Simulink implementation along with the quirks of quaternions in Matlab is very helpful. :)
@shavykashyap
@shavykashyap 5 ай бұрын
AA516 Great Explanation !
@mohameddemerdash2395
@mohameddemerdash2395 3 жыл бұрын
Thanks Chris for this awesome video. I'd like to point that there might be wrong signs at min 33:50 in the table of conversion from DCM to Quaternions (The last two terms in the second row, i.e., qmax=qx) ... Reference: Brian L. Stevens and Frank L. Lewis, Aircraft Control and Simulation, 2nd Edition, page 32, eqn (1.3-34b)
@bsgove
@bsgove 26 күн бұрын
AE512: This was very helpful for the homework. Also, quaternion is quite the word. It's too bad you have to use small workarounds to get this to work perfectly in simulink.
@funkyfoogee
@funkyfoogee 3 жыл бұрын
You are a hero
@peterwhite6837
@peterwhite6837 Жыл бұрын
If any of you are having trouble extracting the Euler Angles properly with the equations he listed in a previous video, for this example's DCM and Euler Angles just do phi plus pi, psi plus pi, and for theta do pi minus whatever value you get for theta should get you back to the original angles.
@edwardmau5877
@edwardmau5877 2 ай бұрын
AE 512 It's cool to see the comparison between the 3 methods.
@mu.makbarzadeh2831
@mu.makbarzadeh2831 4 жыл бұрын
Thank you so much
@ChristopherLum
@ChristopherLum 4 жыл бұрын
You are welcome, thanks for watching!
@sethwhittington28
@sethwhittington28 2 жыл бұрын
AE512: I appreciate that this method is robust and doesn’t have the singularity issue that the Euler angle method had in your previous video.
@ChristopherLum
@ChristopherLum 2 жыл бұрын
Seth, wow, you don't waste any time getting to the videos :)
@sethwhittington28
@sethwhittington28 2 жыл бұрын
@@ChristopherLum “hello everyone and welcome to another video” plays in my head while I sleep
@ChristopherLum
@ChristopherLum 2 жыл бұрын
@@sethwhittington28 Haha, my kids tell me something similar and make fun of the fact that I don't have a better opening line.
@sethwhittington28
@sethwhittington28 2 жыл бұрын
@@ChristopherLum at this point it’s such an established thing I think you need to keep it!
@WarmWeatherGuy
@WarmWeatherGuy Жыл бұрын
31:58 There are two minuses that should be pluses. For qx-tilda being the max we add C12 and C21 and we add C31 and C13, not subtract. To see this is correct let psi = 0, theta = 10°, and phi = 100°. Create the DCM. Make a quaternion from the DCM (it will have qx-tilda be the max). Make a DCM from the quaternion. Calculate psi, theta, phi from the DCM. Psi will be -1.47°, theta will be -8.27°, and phi will be 100.11°.
@ibrahimallafi1460
@ibrahimallafi1460 2 жыл бұрын
good lecture
@divinadileep9464
@divinadileep9464 3 жыл бұрын
great !!
@timproby7624
@timproby7624 2 ай бұрын
[AE 512] I've seen quaternions a few times and tried to watch different videos but the breakdown of the 4x1 was helpful, especially the scalar vs. vector portions. I never really understood the scalar portion until watching this lecture. Are we going to talk about gimbal lock more? Edit: also appreciate you not diving step by step into all the proofs and you focused more on the application
@ChristopherLum
@ChristopherLum 2 ай бұрын
Think about gimbal lock in one of the upcoming hw problems when thinking about singularities
@WalkingDeaDJ
@WalkingDeaDJ 2 ай бұрын
Jason-AE512: I think this video help me a lot on the homework 3. Thanks.
@princekeoki4603
@princekeoki4603 5 ай бұрын
AA516 : Interesting how atleast for this example, the quaternion method lines up exactly with Poisson's. Unless I missed it in the video at what point does implementing quaternions have an advantage over poissons? They both appear to overcome the problem of Gimbal lock but the implementation of Poisson's seems much simpler.
@user-ns7wy1pk9t
@user-ns7wy1pk9t 5 ай бұрын
AA516: this is a real important topic, since controller rely on quaternions to compute the attitude. Po
@boeing797screamliner
@boeing797screamliner 3 жыл бұрын
AA516: Great lecture as usual!
@ChristopherLum
@ChristopherLum 3 жыл бұрын
Gary, great, I'm glad it was helpful. Keep me posted on how the HW goes.
@boeing797screamliner
@boeing797screamliner 3 жыл бұрын
@@ChristopherLum Will do. I actually sent you an email earlier today - I was wondering how you wanted us to submit the MATLAB/Simulink portions of hw3. But while I'm here, on problem 3c, what's the physical explanation of the singularity of the matrix T, other than the aircraft pointing straight up or down? Why is the matrix singular when the aircraft is at this attitude? I couldn't find any information on this. Thanks
@JulioMartinez-hy2mu
@JulioMartinez-hy2mu 3 жыл бұрын
Dear Christopher, great video. Now just a sugestion, could you do an update showing the simulink simulation by the end of the video using discrete time? I mean, any real system is a discrete time system. Thank you.
@julianchee2894
@julianchee2894 7 ай бұрын
is there a need to obtain the direction cosine matrix from the quaternions to obtain euler angles, or are there methods to derive the euler angles directly from the quaternions ?
@josegregorioreyesmontilla3853
@josegregorioreyesmontilla3853 2 жыл бұрын
Hello Christopher, I hope you are feeling well, I wanted to thank you for all the videos you have published, many of them have been of great help to me. I would like to ask you for the implementation of a Kalman filter, in which I use "Quaternions" for the calculation of the attitude, I would like to know how to solve the "interference" between angles (Euler). My implementation is a vehicle where I mostly evaluate only the Yaw. But the estimation of the Pitch and Roll angles are affected by the 2 pi jump of the quaternion.
@ChristopherLum
@ChristopherLum 2 жыл бұрын
Hi Jose, Thanks for the kind words, I'm glad you enjoyed the video. If the find the these videos to be helpful, have questions about content, or would like to request a video, I hope you'll consider supporting the channel via Patreon at www.patreon.com/christopherwlum. Given your interest in this topic, I'd love to have you a as a Patron as I'm able to talk/interact personally with all Patrons. Thanks for watching! -Chris
@SayedTorak
@SayedTorak 2 ай бұрын
AE 512: Thank you prof. Lum. The equation at 55:26 , should there be a negative sign on the right side of the equality for a stable diff eq? or is the negative baked into the Ω matrix? I have not calculated it but I am assuming eigenvalues of Ω are all negative.
@Yookiwooki
@Yookiwooki 3 жыл бұрын
I tried to reproduce the plots in the quaternion example section, and I'm confused. The blue axes as shown in the video seem to correspond to psi=25 deg / phi=70 deg rather than psi=70 deg / phi=25 deg. If I use psi=70 deg / phi=25 deg as well as inputting mu = -223.5 deg, I get the right behavior, but the blue axes are in different locations. Am I messing up the mu sign and psi/phi order in my implementation?
@everaldosantos6215
@everaldosantos6215 3 жыл бұрын
Congratulations on the great videos! I am also a teacher in Brazil. Are matlab scripts available for download?
@WarmWeatherGuy
@WarmWeatherGuy Жыл бұрын
25:16 You mentioned that you would leave a link to the source of these equations but I do not see the link.
@nathanlipshutz3140
@nathanlipshutz3140 2 ай бұрын
AE512: Is there any physical explanation for this DCM-Quaternion intricacies? Why does the mapping change depend on the magnitude of the qtilde entries?
@ojasvikamboj6083
@ojasvikamboj6083 Жыл бұрын
A A 516: Ojasvi Kamboj
@jaziebart
@jaziebart 3 жыл бұрын
AA516 - Great video professor! Are the Euler angles, [Phi], the angles relative to the NED coordinate system or the angles relative to the body frame?
@ChristopherLum
@ChristopherLum 3 жыл бұрын
John, yes, these are the angles that rotate from the NED to the body frame so they are measured relative to the two frames (with the two intermediate frames in between).
@alfonsovanacore1139
@alfonsovanacore1139 Жыл бұрын
at time 23:33 on board invers(q)= q*/|q|^2. I think ?
@user-hw8di2xk7f
@user-hw8di2xk7f 4 ай бұрын
AA 516: Celeste Yuan
@rowellcastro2683
@rowellcastro2683 5 ай бұрын
AA516: I knew it. Quaternion had something to do with the unit eigenvector.
@mehmetkilic9518
@mehmetkilic9518 2 жыл бұрын
A question came up to my mind when I was watching your video at 1:02:01 :). Imagine you are powering your drone or IMU sensor at a different orientation rather than a hover state for example about(80, 80, 0) degrees in Euler angles. How can we calculate the initial Euler angle or how does the system initially know it is in that angle state? Can we assume body angle measurements is directly equal to body Euler angles in this situation? So, what solution do you recommend to me, Sir?
@ChristopherLum
@ChristopherLum 2 жыл бұрын
Hi Mehmet, Thanks for reaching out, I'm glad you enjoyed the video. Unfortunately I'm unable to respond to questions on KZfaq due to the sheer volume of inquiries that I receive. That being said, I hope you'll consider supporting the channel via Patreon at www.patreon.com/christopherwlum as I'll be able to answer questions there. Given your interest in the topic, I'd love to have you as a Patron as I'm able to talk/interact personally with Patrons. Thanks for watching! -Chris
@Eomji_Kim
@Eomji_Kim 5 ай бұрын
AA516: Great video! I'd like to ask you about the graphs. About the psi graph, only the Euler one is different from others. Is it because only Euler equation doesn't deal with psi, but the others, Poisson and Quaternion, deal with psi angles?
@ChristopherLum
@ChristopherLum 5 ай бұрын
Do you have a timestamp that I can look at?
@Eomji_Kim
@Eomji_Kim 5 ай бұрын
It is about 1:12:33
@alexzhen179
@alexzhen179 3 жыл бұрын
For the method transferring DCM to quat, is it only working for the Euler sequence or is it working for any arbitrary DCM?
@ChristopherLum
@ChristopherLum 3 жыл бұрын
The Euler sequence we defined is the same as the DCM so can you restate your question?
@alexzhen179
@alexzhen179 3 жыл бұрын
@@ChristopherLum Yeah. What I am wondering is for cases like in spacecraft, the sequence is usually zxz. Would there be any difference during calculations between quaternion and DCM in that case?
@ChristopherLum
@ChristopherLum 3 жыл бұрын
In that case you need to re derive as the definitive of the Euler angle are different
@marcosszmania5874
@marcosszmania5874 2 жыл бұрын
AE512: Hey Professor Lum, when I use the block "To WorkPlace" in Simulink it saves all to "ans" output, so I've been using ans.NAME_OF_OUTPUT in my code, this seems to cause some problems when I am plotting graphics, do you know why? Thank you.
@ChristopherLum
@ChristopherLum 2 жыл бұрын
Marcos, MathWorks made some updates to how Simulink saves data. I'll try to talk a bit about this at office hours on Tues.
@romanvancouver1464
@romanvancouver1464 2 жыл бұрын
The problem is you might have another variable that overwrites the "ans" after you ran the simulation. When you want to plot it your simulation data is not saved as "ans" anymore. This is because in Matlab the most recent command whose result wasn't assigned to be stored in a variable is by default stored as "ans". Let say you type "2+3" into the command line. Then Matlab will show "ans = 5". I'd recommend you to run the simulation from a Matlab script with "sim_out = sim("your_model");". This will save the simulation output to the "sim_out" variable instead of "ans". Below that command you can then access any saved variable by "sim_out.your_variable".
@rowellcastro2683
@rowellcastro2683 5 ай бұрын
AA516: Hi Professor, you do not have the quaternion implementation on the Simulink model that have Euler's and Poisson's implementation in the lecture notes. Is there a reason why you don't have it in the lecture notes?
@ChristopherLum
@ChristopherLum 5 ай бұрын
Can we chat at office hours and you can show me what parts are missing, thanks.
@rowellcastro2683
@rowellcastro2683 5 ай бұрын
Of course! will do.@@ChristopherLum
@aaroncapozella5365
@aaroncapozella5365 5 ай бұрын
here for AA 516
@SLNDR10
@SLNDR10 4 жыл бұрын
What is the name of this equation (ut=u^3uxxx)
@edengebretsadik7793
@edengebretsadik7793 2 ай бұрын
AE512
@petermay6090
@petermay6090 5 ай бұрын
AA516
@bonniefinrow4415
@bonniefinrow4415 4 жыл бұрын
Amen HAPPY EASTER JESUS IS A LIVE🐑
@tcveatch
@tcveatch 2 жыл бұрын
Rodrigues has three syllables and rhymes with God-he-says.
Euler Angles and the Euler Rotation Sequence
1:10:52
Christopher Lum
Рет қаралды 47 М.
🌊Насколько Глубокий Океан ? #shorts
00:42
ОСКАР ИСПОРТИЛ ДЖОНИ ЖИЗНЬ 😢 @lenta_com
01:01
How to think about Quaternions without your brain exploding
10:25
How to Use Quaternions
14:20
Positive Altitude
Рет қаралды 10 М.
Square Root of 2, Newton's method vs Euler's method
12:27
blackpenredpen
Рет қаралды 391 М.
Euler vs Quaternion - What's the difference?
8:49
Class Outside
Рет қаралды 34 М.
Dijkstra's Algorithm - Computerphile
10:43
Computerphile
Рет қаралды 1,3 МЛН
Fantastic Quaternions - Numberphile
12:25
Numberphile
Рет қаралды 1 МЛН
Quaternions and 3d rotation, explained interactively
5:59
3Blue1Brown
Рет қаралды 1,1 МЛН