{ "cells": [ { "cell_type": "markdown", "id": "f8bfc15c", "metadata": {}, "source": [ "# PVTOL Linear Quadratic Regulator Example\n", "\n", "Richard M. Murray, 25 Jan 2022\n", "\n", "This notebook contains an example of LQR control applied to the PVTOL system. It demonstrates how to construct an LQR controller and also the importance of the feedforward component of the controller. A gain scheduled design is also demonstrated." ] }, { "cell_type": "code", "execution_count": null, "id": "c120d65c", "metadata": {}, "outputs": [], "source": [ "import numpy as np\n", "import matplotlib.pyplot as plt\n", "import control as ct" ] }, { "cell_type": "markdown", "id": "77e2ed47", "metadata": {}, "source": [ "## System description\n", "\n", "We use the PVTOL dynamics from the textbook, which are contained in the `pvtol` module. The vehicle model is both an I/O system model and a flat system model (for the case when the viscous damping coefficient $c$ is zero).\n", "\n", "
![]() | \n",
" \n", "$$\n", "\\begin{aligned}\n", " m \\ddot x &= F_1 \\cos\\theta - F_2 \\sin\\theta - c \\dot x, \\\\\n", " m \\ddot y &= F_1 \\sin\\theta + F_2 \\cos\\theta - m g - c \\dot y, \\\\\n", " J \\ddot \\theta &= r F_1.\n", "\\end{aligned}\n", "$$\n", " | \n", "