
Master real-time UAV trajectory tracking using state feedback linearization and LPV MPC for precise position and attitude control, with offline and real-time simulations.
Explore a real-time UAV control testing environment that integrates the Godo game engine with a Linux-based Python server, using LPV MPC and state feedback linearization at 60 Hz.
Run the real-time control server on Linux to guarantee deterministic data transfer. Leverage Ubuntu Pro for real-time kernels, and deploy Windows and Linux executables over LAN for 60 Hz updates.
Download the real time control systems testing environment from GitHub releases, extract it, verify Linux executable permissions, and run the Python server to connect with the resource pack.
Set up the UAV project by exploring the file structure and installing Python packages, then run the server for real-time control; learn how nonzero inertia products cause wobbling rotation.
Explore synchronous, asynchronous, and parallel programming with a Linux-based Python server analogy, and learn how async IO enables non-blocking task switching for UAV client communications.
Explore asynchronous programming in a Python server using the async io library, where core routines run in infinite loops and are controlled by await to manage time-based task switching.
Set up and run the server in Linux using run server.py, linking the rotation and drone project modules. Enable trajectory generation and offline simulation by toggling parameters and exporting ref_coordinates.csv.
apply a moving average filter to real-time uav data, adjust window size, and manage localhost or ip address connections via websocket for cross-machine simulation.
Define the server's entry point in the main file, with parameters guiding execution and distinguishing direct run from import or subprocess initiation.
Build and run a linux-based websocket server from a template, manage libraries and parameters, and enable executables to connect via server address (IP or localhost) and ports, with trajectory recording.
Explore how the Python server interfaces with a Godot executable for the UAV, retrieving the server address from port_number.txt and maintaining 60 Hz data exchange via websocket.
Explain how the executable transfers real-time drone data by encoding project IDs and sensor values in binary, handling axis conventions, and sending quaternions, positions, and Euler angles at 60 Hz.
The executable decodes binary data from the server into U1–U4 and a status flag, initializes mass and inertia, and applies central forces and torques to the UAV.
Learn to build an asynchronous websocket server in Python using async io and websockets, and monitor a running executable by its pid to gracefully stop the server.
Explore how a server uses an asynchronous handle websocket to manage multiple independent client instances, each with its own drone or rotation control and real-time MPC algorithms.
Explore real-time data processing in Python using a deck (deque) array with a fixed window size to compute time derivatives and moving averages from 14-float messages encoded as little-endian binary.
Study deque arrays in real-time drone control, exploring a two-element deck window, real-time data processing, and server and client workflows in python.
This lecture shows altering the deck array size for theta ref and U1, including four-element windows, creating independent real-time data streams with newest values entering from the right.
Explore the real time changes class in Python for UAV real-time control. Learn moving averages, time derivatives, and data increments with null handling and safeguards when data is insufficient.
Apply real-time UAV control using state feedback linearization and LPVMPC to compute four control inputs, adjust for rotor effects, and transmit encoded data at 60 Hz via asynchronous websocket tasks.
Coordinate asynchronous tasks to send data at 60 Hz and initialize UAV mass and inertia by project ID, using a manage projects task with a one-second delay before control inputs.
Create and write a csv file for real-time reference values, using a server-relative path, checking for existing files, prompting to overwrite, and writing the header row.
Identify the executable path with get game executable path and launch it as a subprocess from the server, handling Windows and Linux paths and permissions.
Clarify python scope rules, showing that if statements and loops do not create scopes, while functions do, allowing observation of outer variables but not their direct modification.
Explore Python scope rules by tracing how variables bind across functions, loops, and inner scopes, and apply global and non-local to manage cross-scope changes.
Set up a websocket server asynchronously using websockets, writing connection details to a port number file and handling port conflicts with error management.
Watch stopper function monitor child process with psutil and terminate server when executable ends, handling Linux zombie states and Windows behavior, and prepare the async websocket server.
Learn how a websocket server decodes binary messages to extract project IDs, rotation velocities, and drone data, routing them to rotation and drone projects for MPC control, with error handling.
Upon receiving the drone project ID equals 2, instantiate the drone control class, access constants, and configure MPC and real-time processing at 60 Hz (attitude MPC at 30 Hz).
Process the incoming yaw angle by computing its increment and crossing pi boundaries, then adjust with a 2 pi offset to keep the reference continuous for real-time control.
Standardize the UAV quaternions by enforcing nonnegative scalar parts, ensuring current and reference quaternions share the same convention to yield meaningful attitude errors for the MPC controller.
Standardize the UAV's current and reference quaternians and compute their derivatives and moving averages with real-time changes instances. Record reference trajectories to csv in real time under a single-server constraint.
Compute real-time body frame angular velocities pqr from successive quaternions using a delta quaternion. Adjust theta_hat near 2 pi to maintain stable, shorter path rotations for a quaternion-based mpc controller.
Derive angular velocities from quaternions by computing delta quaternions, normalizing, and extracting theta hat and the unit vector n hat to obtain omega and PQR for real-time UAV control.
Apply real-time controllers at 30 hertz, cycling mpc-driven attitude control and position control by processing every second incoming message.
Adjust rotors’ effects by updating U2, U3, and U4 using omega total and omega total dot, leveraging quaternions and a transfer matrix to derive body-frame PQR for real-time MPC.
Learn to manage asynchronous coroutines and websockets in python to compute center of mass and inertia tensor, and send rotation and drone control inputs to an executable at 60 Hz.
Send UAV control inputs to the executable at 60 Hz by encoding four control values and an MPC success flag into a bite-format packet, with error handling and variable management.
Compute inertia tensor for cuboid with density varying in x, y, z via triple integrals. Derive mass moments and products of inertia, locate center of mass, simulate motion with Python.
Compute a cuboid's inertia tensor in python with the nquad library, deriving mass, center of mass, and mass moments, then simulate real-time UAV rotation at 60 Hz.
Explain how the drone support class enables real-time UAV control in Python, detailing position and attitude controllers, MPC attitude control in quaternion form, and integration with the Godo game engine.
Explore the init function of the drone class, selecting quaternion or Euler representations, configuring real-time changes, and setting MPC parameters, masses, inertia, and timing for stable real-time UAV control.
Explore how poor data transfer and irregular packet timing at 60 Hz destabilize a UAV, prompting conservative MPC tuning and tighter constraints to maintain real-time stability.
Explore how conservative angular velocity and rotor constraints stabilize a real-time UAV under irregular data transfer, and how MPC horizons and poles tune the position and attitude controllers.
Explore the position controller for real-time UAV control, computing reference values and their time derivatives with the drone’s position and translational velocities in the earth frame.
Apply a state-feedback linearization position controller for UAVs, computing E and E dot from earth-frame velocities and deriving k1, k2 from negative lambdas to drive the error to zero.
Apply real-time increment and absolute value constraints to theta ref, fire ref, and U1 in UAV position control, updating a deck with constrained values for the attitude controller.
Generate and discretize an LPV model for the MPC attitude controller using Euler angles, extracting phi and theta with omega total to form A, B, C, D by forward Euler.
Apply an MPC attitude controller using the oiler angle representation to dynamically adjust yaw (pi dot) constraints based on reference changes, improving tracking and stability.
Augment the MPC matrices for future state prediction in the attitude controller, using hstack and vstack to assemble augmented A, B, C, D blocks and manage deltaU within constraints.
Apply model predictive control with constraints to UAV real-time control, formulating G and H, extracting states, and solving for deltaU.
Explore MPC control with quaternion representation to compute attitude error and extract the oiler vector from the error quaternion. Review quaternion to angle conversion and normalization for real-time UAV control.
Shows how a UAV's MPC handles large quaternion error spikes on the z-axis by applying a boundary correction to theta hat E, subtracting 2 pi, and updating EZ for stable yaw.
Use quaternions in MPC to dynamically update body-frame z-axis constraints, convert inertial to body frame, and compute rotor speeds for real-time UAV control.
This course, Applied Control Systems 5: UAV: Real-Time Control in Python, is designed to equip engineers, robotics enthusiasts, and control systems developers with practical skills in building and managing real-time UAV control systems using Python on a Linux-based server. Learn to efficiently process real-time data streams for UAV control, handling both incoming sensor data and outgoing control commands.
Explore advanced control techniques such as state feedback linearization to achieve precise UAV position control in real time. Dive into the implementation of Model Predictive Control (MPC) for UAV attitude, comparing Euler angle and quaternion-based approaches to ensure robust and accurate performance under dynamic conditions.
Throughout the course, you will develop expert-level Python programming skills tailored for real-time control applications, including asynchronous data processing, communication protocol management, and tight integration of control algorithms with simulation environments. Practical projects guide you step-by-step to create reliable and efficient UAV control servers.
Key topics include:
Building and deploying a Linux-based Python server for real-time UAV control
Managing and processing real-time sensor and control data
Applying state feedback linearization for UAV position regulation
Implementing real-time MPC for attitude control using both Euler angles and quaternions
Integrating advanced control algorithms in real UAV applications
By the end of this course, students will have the confidence and technical capability to design, program, and deploy real-time UAV control systems that harness modern nonlinear control strategies and real-time software engineering practices.
This course is ideal for learners focused on UAV systems, real-time control engineering, and Python implementation.