{ "cells": [ { "cell_type": "markdown", "id": "exempt-legislation", "metadata": {}, "source": [ "# Gain Scheduling\n", "\n", "##### Richard M. Murray, 19 Nov 2021\n", "\n", "This notebook contains an example of using gain scheduling for feedback control of a nonlinear system. A gain scheduled controller has feedback gains that depend on a set of measured parameters in the system. For exampe:\n", "\n", "$$\n", " u = u_\\text{d} − K(x_\\text{d}, u_\\text{d}) (x − x_\\text{d}),\n", "$$\n", "\n", "where $K(x_\\text{d}, u_\\text{d})$ depends on the desired system state and input.\n", "\n", "In this notebook, we work through the gain scheduled controller in Example 2.1 of OBC." ] }, { "cell_type": "code", "execution_count": null, "id": "corresponding-convenience", "metadata": {}, "outputs": [], "source": [ "# Import the packages needed for the examples included in this notebook\n", "import numpy as np\n", "import matplotlib.pyplot as plt\n", "from cmath import sqrt\n", "import control as ct" ] }, { "cell_type": "markdown", "id": "corporate-sense", "metadata": {}, "source": [ "## Vehicle Steering Dynamics\n", "\n", "The vehicle dynamics are given by a simple bicycle model:\n", "\n", "
![]() | \n",
" \n", "$$\n", "\\begin{aligned}\n", " \\dot x &= \\cos\\theta\\, v \\\\\n", " \\dot y &= \\sin\\theta\\, v \\\\\n", " \\dot\\theta &= \\frac{v}{l} \\tan \\delta\n", "\\end{aligned}\n", "$$\n", " | \n", "