
Extend the prior mpc work to 360-degree trajectory tracking on a 2d plane, adding a realistic mpc with two controls—steering delta and longitudinal acceleration—and velocity and change-of-control constraints.
Explore a bonus trajectory in applied control systems for autonomous cars, highlighting 360 tracking techniques to enhance trajectory execution and car performance.
Review the previous APC controller for autonomous lane changes using a bicycle model for lateral motion. Reformulate the lateral dynamics into a state-space form with states and the steering input.
Apply a small angle approximation to the vehicle model, turning sine and cosine terms into linear relations, and yielding a constant A, B, C, D state-space form for lane-change control.
Explore how the small yaw angle assumption limits the controller by linking the plant and controller loops, state propagation, and horizon-based reference inputs.
Show how the small yaw angle assumption aligns plant and controller models by replacing sine psi and cosine psi with psi and one; larger psi breaks alignment and tracking.
Compare model based control and PID, showing how NPC uses a plant-like model to predict future states and compute trajectory tracking inputs.
We compute the new states at k+1 from the input delta at k and preview states at k using state equations. Use the Euler integrator with multiple sub-steps.
See how model predictive control derives from the linear NPC by augmenting the state with delta changes, expanding matrices with horizon, and using predicted input for trajectory tracking under uncertainty.
discretize the continuous lti model using forward Euler to obtain discrete a and b matrices for both the plant and controller boxes, enabling model-based control with mpac.
Apply model predictive control to predict future states along a reference trajectory using a discrete augmented state vector model and optimize across a horizon to balance tracking and control effort.
Revise the MPC cost function for autonomous cars, augment the system to use delta delta as the control input, and track two outputs from four states over a five-step horizon.
Form a tilde-augmented state space by combining x_k+1 and delta terms, build the discrete system and B matrices, and derive the augmented equations for the mpac controller.
Reformulate the MPC cost function with delta deltas and augmented state vectors, and derive the optimal delta delta sequence for lateral control of a vehicle on a straight road.
Derive and apply an advanced bicycle-model controller to follow 2d plane trajectories, deriving equations of motion in inertial and body frames for longitudinal and lateral dynamics with yaw.
Analyze longitudinal forces by balancing engine or brake input f_A with rolling resistance f_r, which dissipates energy as heat from tire deformation, f_r = mu m g.
Explain how wheel forces generate lateral and longitudinal components, decomposing front-wheel force with delta to model 2d vehicle trajectories and write the equations of motion in the body frame.
Form the longitudinal and lateral equations of motion for a vehicle, balancing engine and brake forces with rolling resistance and tire slip angles, including delta and alpha_f.
Explore lateral force formation by linking theta, avf, x dot, and vel in dynamics, using tan theta avf = vel / x dot with a small angle approximation within ±π/6.
Redraw the diagram to include the rear wheel, define the center of mass in the body frame, and relate the rear slip angle alpha_R to CTA VR via velocity components.
Explains linear relations between lateral tire forces and slip angles in the small-angle region using cornering stiffness C_alpha_f and C_alpha_r, via F_yf = C_alpha_f alpha_f and F_yr = C_alpha_r alpha_r.
Analyze how net accelerations in the vehicle's body frame relate to the inertial frame and show how rotating the body frame adds terms to the longitudinal and lateral accelerations.
Analyze net acceleration in a rotating body frame using unit vectors I and J, relate forces to longitudinal and lateral accelerations, and apply the product rule for evolving orientation.
Derive dI/dt and dJ/dt as omega cross I and J for a slightly rotated body frame, with omega defined from infinitesimal angles and the right-hand rule.
Derive acceleration in a rotating body frame using omega cross v terms and x/y accelerations, with determinant and unit-vector notation, noting CCW vs CW effects on longitudinal and lateral directions.
Explain body-frame equations of motion with counter-clockwise positive, focusing on the net moment about the z-axis and deriving it via the product rule for the mass moment of inertia.
This lecture revisits previous simplifications by deriving the full longitudinal and lateral equations of motion, including x double dot, y dot, beta slip angle, centripetal and yaw dynamics (psi dot).
Derive state-space models from the vehicle's equations of motion, incorporate inertial x and y coordinates, and relate body-frame and inertial-frame velocities using psi in an applied exercise.
Convert equations of motion into state-space form by extracting state derivatives and inputs. Derive discrete equations for longitudinal and lateral dynamics, using Euler integration and the linear MVC technique.
The instructor thanks students and invites a one or two sentence review to provide feedback and improve the applied control systems course on autonomous cars.
Apply the linear parameter varying (LPV) approach to a non-linear plan box, aligning the controller box with the plant model and avoiding small-angle approximations.
Explore the LPV form for nonlinear state-based models and apply NPC with evolving A and B matrices while C stays constant, enabling horizon-based MVC.
Learn how nonlinear models are reformulated as linear parameter varying lpv forms by embedding nonlinearities in the A and B matrices, enabling a linear controller on x2- and u-dependent dynamics.
Explore how to reformulate nonlinear state-space models into LPV form, yielding exact equivalence with the original model and enabling robust control of autonomous car trajectories.
Convert nonlinear state-space equations into lpv form by constructing the lpv infrastructure and building the six-by-six a matrix and six-by-two b matrix from the state and input vectors.
Continue building LPV form by substituting equations, factoring terms, and assembling results into A and B matrices; confirm the third row yields psi dot and aligns with LTV form.
Convert the car model to the LPV form, derive the A and B matrices, and show they vary with xdot, ydot, psi, and delta, avoiding division by zero.
Choose outputs as CI, X, and Y to form the C matrix, and simulate tracking a parabola using planner-generated references XR, YR, CIR.
Examine selecting outputs as psi, x, and y, and constructing the c matrix to guide the mpac controller toward trajectory tracking, while noting chaotic longitudinal velocity and 1–30 m/s constraints.
Learn to control the car’s velocity by generating reference velocities in the planner and transforming inertial X dot and Y dot into body-frame values for NPC-based control.
Explain converting inertia frame velocities to body frame velocities with a rotation matrix, and relate reference tangential motion to the car's longitudinal and lateral outputs.
Design the car's outputs to track the longitudinal and inertial x and y states, keeping lateral velocity near zero, and plan trajectories with cubic polynomials using NPC in LPV.
Revisiting the application of linear MPC to an augmented discrete LTI system, the lecture derives augmented matrices, delta as input, and the MPC optimization over a horizon.
Explore how in this MPC application (LTI vs LPV), Qbar, Tbar and Rbar stay constant while Cbar, Abar, and Bbar matrices change each loop due to A and B.
Explore how model predictive control updates augmented discrete matrices and predicts horizon states, reformulating a and B, and updating them after each predicted state and input.
Illustrates a two-part MPC with internal delta u and global use across loop boundaries, derives A and B matrices for a three-step horizon, and contrasts LTI and LPV MPC conventions.
Explore mpc differences: update a and b with each future step and derive c bar and a bar flex matrices for lti vs lpv, with delta u and horizon considerations.
Explain how MPC adapts to time-varying matrices in LPV settings, updating the cost gradient each loop and computing new control inputs. Compare conventions for representing u and delta.
Explains horizon-length effects on LPV-MPC for a UAV drone, compares the full A/B matrix construction with a short-horizon simplification using A0/B0, and outlines a two-controller architecture with four inner loops.
This lecture explains how to operate a tracking controller by starting near the trajectory's beginning, aligning initial states with the reference, and designing smooth, well-aligned trajectories.
Explore how MPC constraints shape autonomous car control by limiting net longitudinal acceleration and velocities, and using cubic polynomials to design smooth trajectories.
Introduce MPC constraints for autonomous cars by enforcing bounds on longitudinal acceleration, velocity, and steering, and show how a quadratic cost yields a global minimum via gradient zero.
Illustrates how a two-input MPC cost surface, using Delta Delta zero and Delta Delta one, forms contour lines and a green feasible region under constraints.
Understand how MPC constraints define the allowed region and drive the minimum cost to the corner nearest the origin, delivering the constrained optimum delta u global.
Minimize the constrained controller cost by enforcing multiple inequalities and locating the green feasible region; the minimum sits at a corner with delta delta one = 0.07.
Learn to solve constrained quadratic optimization for autonomous car control using linear inequality constraints with solvers like cube solvers in Python and MATLAB, including Kewpie and Grob.
Learn how quadratic cost functions and linear inequality and equality constraints define solver inputs for kewpie solvers, using G delta global ≤ H and A delta global = B.
Minimize a quadratic cost function for autonomous cars using kewpie solvers in Python, with the h double bar matrix, Q transpose, delta global, and linear inequality constraints.
Learn to apply fixed and changing constraints in an augmented car model by bounding input changes Delta Delta and Delta Air and enforcing net longitudinal acceleration constraints via MPAC.
Explain fixed versus changing constraints for the car’s x dot and y dot, enforcing x dot 1–30 m/s and y dot between -0.17 x dot and 0.17 x dot.
Show how to find minimum of a multi-dimensional cost function with no constraints for MPAC by setting the gradient to zero for the unique delta deltas and delta a sequence.
Constrain the minimum of a cost function by computing the delta u global under limits with Quad Prog or kewpie solvers, using G, H, and f to respect constraints.
Form the MPC input constraints into a G matrix and H vector by converting delta U, delta Delta, and delta A bounds into standard inequality form across the horizon.
Form MPC constraints into a mega matrix form by stacking inequality equations for delta u and bounds over the horizon, then extend to include delta a x dot constraints.
Extract x dot, y dot, delta, and a from the augmented state via C tilde asterisk to form horizon constraints on future states.
Formulate the minimum boundaries for x dot, y dot, delta, and a, and assemble horizon-based minimum vectors for fixed and changing constraints using an augmented state and predicted states.
Replace numbers to form the max constraints, remove terms, and define max/min bounds for longitudinal and lateral velocity, delta, and acceleration for a three-part vector used by the solver.
Formulate horizon state constraints using min and max bounds as a G matrix and H vector system, merging delta constraints to enable kewpie solvers to minimize cost while respecting bounds.
Form a single G matrix and h vector by merging delta and state constraints, then apply them to a quad prog solver to obtain feasible state and delta trajectories.
Formulate state constraints in MPC by solving for delta variables that respect bounds with a solver, and minimize a quadratic cost under linear inequality constraints.
By applying MPC constraints, this lecture bounds the net longitudinal acceleration and x double dot, ensuring x double dot stays between -4 and 1 m/s^2 while tracking smooth trajectories.
Investigate how discontinuities in trajectory and velocity references destabilize the body-frame velocity in autonomous car tracking, and why a constrained minimization problem may have no solution.
solve a quadratic cost optimization with horizon one for autonomous cars; use gradients to find the unconstrained minimum and show how constraints and different f^T alter the solution.
This lecture shows that the unconstrained zero-cost solution often violates the four linear inequality constraints, yielding no feasible solution, and suggests tuning npc weights to obtain a feasible, smoother trajectory.
Learn why the h double bar matrix must be symmetric and positive definite to yield the correct gradient, and how leading principal minor determinants verify positivity.
Apply positive definite h-bar matrices to a cost function, verify positivity via determinants, and compare three h-bar matrices to reveal their impact on the cost with x and y inputs.
Understand how a positive definite Hessian yields a unique minimum for a quadratic cost function, guiding gradient methods, while zero gradients can signal saddle points and constraints shape the landscape.
The lecture explains why MPC weights must be positive, showing how positive definite cost matrices yield a unique minimum, while mixed signs create saddle points and non-minimizing solutions.
Positive definite and symmetric double bars make zero vector the minimum when second term is zero; otherwise use gradient method and plan trajectories without first derivative jumps with cubic polynomials.
This lecture demonstrates using cubic polynomials to design smooth trajectories that eliminate velocity discontinuities in the inertial frame, ensuring matching X and Y values and their derivatives across segments.
Merge two sub trajectories into one cubic trajectory, selecting A0–A3 and B0–B3, align start/end times, and ensure smooth x, y, x dot, and y dot for the controller's reference trajectory.
Design cubic trajectories for the x-dimension of autonomous car motion by setting start/end positions and velocities, solving A0–A3 from a matrix, then extend to the next dimension.
Compute trajectory two by matching end conditions from trajectory one, form the M2 matrix, solve M2 inverse times CX2 to obtain coefficients A0–A3, and express X(t) for trajectory two.
Design smooth, continuous trajectories for autonomous cars using cubic polynomials in x and y, merging two segments with matched endpoints and derivatives to avoid jumps.
Learn how discrete time sampling of cubic polynomials affects trajectory merging, creating segments with zero derivatives that disrupt tracking. Discover a fix by adjusting trajectory endpoints to maintain nonzero derivatives.
Design trajectories with cubic polynomials using M1 and Cx1/Cy1 to merge segments and adjust end points for smoother X and Y tracking.
Model predictive control minimizes errors and input changes by weighting inertial x and inertial y errors more heavily to improve 360 tracking; keep psi error weight largest to avoid oscillations.
Explore how the simulation code is implemented and structured to support the NPC controller and constraints, with Python setup, kewpie solvers installation, and how to run and animate results.
Learn to launch python programs from Windows cmd and Ubuntu/macOS terminal, navigate folders with cd, and run python files with the correct commands.
Install Python 3.8, NumPy, and Matplotlib on Ubuntu 20.04 using terminal commands. Run Python scripts from the terminal, install packages with pip for simulations.
Install Qpsolvers and cvxopt on Ubuntu via two terminal commands, then install cube solvers with pip three, and run the Python main file to plot the trajectory.
Install python on Windows 11, add to path, and verify with hello world. Install numpy, matplotlib, SciPy, CVXOPT, SymPy, and control for MPC, LQR, and CFD UAV work.
Install Python 3.8.7 on macOS Big Sur from python.org and set up pip to install numpy; verify with a hello world in terminal and avoid IDEs like Spyder or Jupyter.
Install qpsolvers on macOS Big Sur, follow GitHub installation and usage steps, resolve the command line developer tools prompt, then run a drone file to verify the solver.
Explain how the main Python file interacts with a support file, detailing an init function that defines car constants, class structure, and trajectory options.
Extract variables from the Constance dictionary, create a timer, and use the trajectory generator function with the time array to obtain longitudinal velocity, angle, and inertial x/y references.
Show how cubic polynomials use a delay array to build an 11-subtrajectory path by deriving x and y coefficients from endpoints and velocities, then concatenating for plotting.
Compute delta x and delta y from trajectory points, derive x dot and y dot, compute reference yaw with arctangent2, and output angles and coordinates via a ci integrator.
explains constructing the main python file for trajectory-driven car control, including ref signal creation from x, y, psi and initializing states, using a state-space function to derive discrete matrices.
Explain how the code derives continuous A, B, and C matrices (D zero), discretizes them for the lpv controller, and builds the augmented present-state vector for horizon-based reference signals.
Demonstrates the MPC simplification function that augments discrete A, B, C, D, builds constraint matrices G and H, and defines delta limits using Ube global, Lbe global, and mega global.
Explain how to implement the MPC simplification function 2 by constructing q double bar, t double bar, and r double bar matrices and building augmented a and b across horizon.
Explore how model predictive control (MPC) constraints are updated across horizon steps, including max and min limits for acceleration, steering, and lateral velocity using predicted augmented states.
Update the A and B matrices in each loop using X1, X2, and delta u from the previous iteration, then compute predicted augmented states and constraints.
This Python code walkthrough explains building the C double bar matrix with nested loops and AB products, then formulating the final MPC constraint matrices G and H.
Formulate constraints for mpc by merging the red matrix with c double bar to produce y adc difference global vector for future steps.
Explain how to assemble and transpose matrices for constraint-safe solvers, form control vectors, and log open-loop states and accelerations to plot and analyze solver failures.
Explain how to compute new states in an open-loop plant using discrete Euler integration, update state and acceleration data, and visualize trajectories and animations in Python.
Explore a bonus track presentation on autonomous cars within applied control systems, focusing on 360 tracking concepts and advanced control approaches.
How do you make autonomous cars track a general trajectory on a 2D plane and how do you make sure that the velocities, accelerations and steering wheel angles of the autonomous cars stay within their realistic minimum and maximum values?
My name is Mark. I'm an Aerospace & Robotics Engineer and in this course, I will give you intuition, Mathematics and Python implementation for all that.
This course is a direct continuation to the course "Applied Control Systems 1: autonomous cars: Math + PID + MPC. In the previous course, the Model Predictive Control (MPC) algorithm only allowed the autonomous cars to change lanes on a straight road. We applied a small angle approximation to convert our nonlinear model to linear time invariant (LTI). It made our lives easier but it also restricted our Model Predictive Control algorithm.
In this course however, we will remove that simplification and I will show you how you can apply a linear MPC controller to a nonlinear system by putting it in a Linear Parameter Varying form first. With this highly popular technique, your car will be able to track a general 2D trajectory.
In addition, you will learn how to use quadratic solvers such as qpsolvers & quadprog to apply MPC constraints to autonomous cars. In most control problems, you have to consider constraints in order to keep your system within reasonable values.
The knowledge that you get from this course is universal and can be applied to so many systems in control systems engineering.
Take a look at some of my free preview videos and if you like what you see, then ENROLL NOW, and let's get started.
Hope to see you inside!