
Explore quaternions as the robust 3D rotation representation for UAV attitude control, cover Euler angles, gimbal lock, PID and LPV-MPC in quaternion form, and learn Python simulations.
Explore how rotation matrices map UAV velocity from the body frame to the inertial frame, revisiting Euler angles phi, theta, psi and the X-Y-Z rotation sequence.
Explore how rotation order and inertial versus moving frames yield the same orientation. See fixed-frame XYZ and moving-frame ZYX share the same rotation matrix, with Euler angles and quaternions hinted.
Compare fixed-frame and moving-frame Euler-angle conventions and explain how the transfer matrix maps body-frame angular velocities to Euler-rate derivatives, especially near hover, for attitude control with LPV-MPC.
Examine gimbal lock and Euler angle limitations in uav orientation, showing how theta near 90 degrees collapses a degree of freedom, while quaternions offer accurate orientation.
Learn the direction cosine matrix (DCM) to convert body-frame velocities to the inertial frame and avoid gimbal lock, comparing it to Euler angles and quaternions.
Explore quaternions as a three-dimensional orientation system that avoids gimbal lock, using a scalar part and a vector part, with conjugates, norms, and quaternion products.
Understand quaternion algebra and the Hamilton product by multiplying quaternions, separating scalar and vector parts, noting noncommutativity, and exploring conjugate and norm properties.
Learn how to use quaternions to map body-frame velocities to inertial-frame rotations, including pure quaternions, Hamilton products, and maintaining unit-norm quaternions for reliable three-dimensional rotation.
Derive the quaternion-based rotation matrix to map body-frame linear velocity to the inertial frame, using conjugation and Hamilton products with QC, QB, and QE, ensuring QE remains pure.
Apply the unit-norm constraint on qc to simplify the quaternion-based rotation matrix, replacing its elements with expressions in q0, q1, q2, and q3 for a compact 3×3 rotation form.
Explore how to connect quaternion elements to a z-axis rotation angle psi by deriving Q0 and Q1–Q3 from the rotation matrix trace, enabling body-to-earth frame mapping.
Map quaternions to Euler angles by equating the quaternion-based rotation matrix RQ with R psi, derive quaternion components from the trace, and validate z-axis rotations.
Derive quaternions from rotation matrices for psi, theta, and phi using traces and algebra. Explain how Hamilton products yield unit-norm quaternions that encode orientation.
Map vectors between body and earth frames using quaternions and a Hamilton product, showing how a 90-degree z-axis rotation yields a quaternion-based rotation matrix that matches the expected RQ form.
Convert Euler vector rotations to quaternions by rotating about a unit vector N-hat by theta-hat radians, avoiding gimbal lock using a quaternion with scalar cos(theta_hat/2) and vector sin(theta_hat/2) times N-hat.
Extract theta hat and n hat from a quaternion using Q0, Q1, Q2, Q3. Compute NX, NY, NZ and X, Y, Z rotations; handle zero-angle singularity with a small-angle approximation.
Explain why rotation vectors cannot be added like vectors for large rotations, how small rotations approximate this, and how quaternions with Hamilton product decode the resulting rotation vector.
Join two rotations with quaternions using the Hamilton product and explore right-hand and left-hand conventions with axis definitions, applied in Godot through practical quaternion rotation steps.
Explore how post and pre multiplication of quaternions change orientation across frames zero and one, using a single rotation about a unit vector with theta hat.
Compare post and pre multiplication of quaternions and matrices, showing how rotations about original versus moving frames alter orientation, with a preference for post multiplication in UAV attitude control.
Learn to represent quaternions with Euler's formula to simplify derivatives, deriving e^(n_hat x) = cos x + n_hat sin x and expressing quaternions by scalar and vector parts for UAV control.
Learn how to compute the time derivative of a quaternion using Euler's formula, including the role of angular velocity in body vs inertial frames, and alternative matrix-vector representations.
Learn how to integrate body orientation with quaternions using the delta quaternion method and the Hamilton product. Normalize to counter numerical drift and distinguish body-frame post-multiplication from earth-frame pre-multiplication.
Learn quaternion integration with constant angular velocity over delta t, form delta Q from omega and n hat, and update orientation by post multiplying with delta Q, including division safeguards.
compare Euler angles and quaternions for UAV attitude control using PID and MPC, highlighting gimbal lock issues with Euler methods and the smooth, reliable orientation provided by quaternions.
Compare Euler angles and quaternions with a code walkthrough that maps body-frame velocities to the earth frame, highlights gimbal lock, and demonstrates quaternion integration versus Euler-based rotation.
Learn how to interpolate between orientations using lerp for vectors and slerp for quaternions, and why quaternions require spherical interpolation for smooth 3d rotations.
Learn how to use unit quaternions to interpolate from a current orientation to a goal orientation, perform quaternion multiplication, and extract the Euler vector describing the rotation.
Demonstrates interpolating quaternion orientations with slerp, contrasts it with lerp, and moves from identity to the target by varying the Euler vector angle with alpha.
Explore how to interpolate quaternions with lerp and slerp, express a general quaternion as norm times unit quaternion, and extract the Euler vector via the natural log of Q.
Observe lerp and slerp animations rotate a spacecraft with quaternions around a single axis, the oil vector, illustrating pre and post multiplication and alpha controlled motion.
Learn how quaternions describe orientation and how LERP and SLERP interpolate rotations, while pre- and post-multiplication show how direction changes with positive or negative quaternions yet final orientation remains unchanged.
Explore quaternion algebra, including post- and pre-multiplication, and how oil vectors encode rotations between inertia, body, and goal frames; then apply PID and MPC to UAV attitude with the Ian representation.
Watch this quick follow-up video to thank you for enrolling, invite a 2 to 3 sentence review, and wish you a great learning experience in this UAV control systems course.
Apply quaternion-based rotation to map thrust from the body to the earth frame and derive the translational dynamics for UAV trajectory tracking using a six-degree-of-freedom model and PID control.
Derive the UAV's attitude dynamics in the body frame using a diagonal mass moment of inertia. Sum rotor moments to obtain rotor angular momentum and control yaw, pitch, and roll.
Derive the UAV rotational dynamics in the body frame by differentiating angular momentum, including gyroscopic effects, and present the nonlinear PQR state-space equations for attitude control with MPC and PID.
Revise the UAV control structure with outer position and inner attitude loops, using L-P-V-M-P-C and quaternion-based attitude control to turn planner references into stable trajectory tracking.
Describe the PID controller for a plant, showing how error, its integral, and its derivative shape the control input to reduce overshoot and steady-state error.
Compare pid and mpc for UAV attitude control, noting pid's reactive approach and 1000 hz inner loop with 5 hz outer loop, vs mpc's 30 hz tempo for stability.
Convert reference Euler angles to a reference quaternion qr by multiplying rotation matrices via the Hamilton product, linking the planner inputs to the UAV's attitude for trajectory tracking.
Compute the error quaternion qe with the Hamilton product to encode the rotation from current to desired UAV attitude, capturing x, y, z body-frame rotational errors.
Calculate the quaternion error via post multiplication, encoding errors in the body frame to align with body-frame inputs. Derive qe from qc conjugate and qr.
Extract attitude error signals from quaternion error and compare a bad three-PID method with a good single-PID approach using a vector formulation to control a UAV's attitude.
Apply one pid controller to drive theta_hat_E to zero, then decompose the moment along the current body frame via n_hat_E from QE, QC, QR for smoother attitude with three constants.
Explore how model predictive control minimizes a cost function by balancing errors and control inputs with weights q and s, while using discretized state-space models and common filter for estimation.
Review the MPC revision by augmenting the system with delta U and the augmented state, deriving AD tilde, BD tilde, CD tilde, and horizon cost matrices Q, R, and S.
Revisit MPC for UAVs by expressing the augmented state and predicting future steps within a horizon, using time-varying A and B in an LPV model, and a compact vector-matrix form.
The lecture explains using LPV to apply linear MPC to non-linear systems. It notes short horizons enable using fixed A and B, speeding computation.
Examine how the MPC cost function is rewritten in delta U terms with positive Q and R weights, yielding a single global minimum, solved numerically under constraints and uncertainties.
Revise the constraints in model predictive control (mpc) by combining a quadratic cost with linear inequalities and using cvxopt to enforce bounds on states and inputs across the horizon.
Represent the UAV attitude with quaternions in the plant model, omit a small omega total dot term, and derive quaternion-based state equations for MPC integration.
Apply quaternion-based attitude control with MPC and PID, manage multiple inner-outer loop references, convert references to quaternions, and use small-rotation approximations for body-frame error.
Develop a linear MPC framework for attitude control using quaternions, presenting an LPV state-space model that relates PQR and attitude error, and explain small-angle simplifications and vector conversions.
Apply model predictive control to UAV attitude with quaternions, using an LPV model and small-rotation assumptions to simplify the cost and update body-frame errors across inner and outer loops.
Project vector B onto U1 and U2, compute the vector projections using dot products and cosine theta, then express the results in Cartesian components with normalized directions.
Examine MPC for attitude control with quaternions and a compact LPV model, showing projection causing high-frequency jitter and mode one yielding smoother real-time tracking.
Install and verify Python on Windows 11, then install core libraries for numerical computing and control, including NumPy, Matplotlib, SciPy, CVXOPT, QP solvers, and control.
Define the init function to configure MPC or PID controllers, set drone parameters, trajectory options, and control gains, then derive translational and attitude commands from error dynamics.
Explore how the init function sets MPC and pid constraints for UAV attitude control, including angular velocity limits, rotor input boundaries, augmented state usage, horizon sizing, and safe guards.
Generates multiple reference trajectories and their first two derivatives, computes delta arrays, and outputs integrated yaw for smooth, robust UAV tracking.
Describe position controller that uses feedback linearization to drive position and velocity errors to zero, deriving ux, uy, uz and enforcing constraints on fire ref, theta ref, and u one.
Explore the P attitude control function, forming reference quaternions from the position controller, implementing error integration, and comparing matrix-vector and Hamilton product methods.
Showcase a quaternion-based pid attitude controller, comparing mode one with three p controllers to mode two with a single p controller, and track trajectory changes with body-frame u2, u3, u4.
Apply MPC to attitude control with quaternions in an LPV model, handling four inner loops per outer loop, mode one and mode two, using augmented A, B, C matrices.
Explore how to build and optimize model predictive control for UAV attitude using quaternions, focusing on constructing augmented A/B matrices, the cbar and cdoublebar matrices, constraints, and solver robustness.
Compare MPC mode one with P mode two in tracking a reference trajectory, highlighting smoother MPC paths, angular velocity constraints, and quicker recovery from direction changes.
Explore the plant function for drone simulation, transforming body-frame controls to earth-frame motion via quaternions, and update translational and rotational states using omega, delta q, and U1–U4.
The outer loop computes position and attitude references from time-indexed arrays, builds firef and theta ref arrays, and derives reference quaternions from a linear trajectory for NPC horizon.
Explore how the main file implements an inner MPC and P attitude loop, processing reference quaternions, computing rotor commands U1–U4, and deriving rotor speeds via coefficients.
This course provides a comprehensive introduction to using quaternions for UAV (unmanned aerial vehicle) attitude representation and control, with a practical focus on implementing PID and Model Predictive Control (MPC) algorithms in Python. Ideal for engineers, robotics enthusiasts, and control systems students, this course demystifies quaternions, a powerful mathematical tool that resolves issues like Gimbal lock encountered with traditional Euler angles.
You will begin with fundamental concepts of quaternions, learning their algebra, derivatives, and integration techniques crucial for accurately modeling 3D rotational dynamics. The course emphasizes quaternion-based state representation and the benefits it offers in maintaining smooth and singularity-free attitude descriptions.
Building on this foundation, you will explore how to formulate and apply PID controllers on quaternion attitude errors to stabilize UAV orientations effectively. Furthermore, advanced control design using MPC will be covered, demonstrating how to incorporate quaternions into predictive control frameworks for enhanced performance in UAV attitude control.
All control algorithms and quaternion mathematics are implemented step-by-step in Python, with practical coding examples and guidance on simulation and real-time applications. This hands-on approach ensures you gain both theoretical understanding and practical programming skills.
Key highlights include:
Comprehensive study of quaternions vs Euler angles and how to avoid Gimbal lock
Mathematical modeling and numerical integration of quaternion-based systems
PID control design tailored for quaternion attitude errors
Model Predictive Control formulation with quaternions for UAVs
Python coding tutorials for control algorithms and simulations
Applications specifically focused on UAV attitude control systems
By the end of the course, students will be equipped to confidently model, simulate, and control UAV attitude dynamics using quaternions and advanced control methods, making it a perfect fit for professionals and students working in robotics, aerospace, and autonomous systems development.
This course is perfect for those interested in UAV control, robotics, aerospace engineering, nonlinear control, and Python programming for control systems.