Skip to content

Linear Quadratic Regulator (LQR) for Wheeled Inverted Pendulum (WIP)

Notifications You must be signed in to change notification settings

wiany11/intelligent_robotics__lqr_wip

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

lqr-wip

Linear-Quadratic Regulator (LQR) for Wheeled Inverted Pendulum (WIP)

Introduction

The theory of optimal control is concerned with operating a dynamic system at minimum cost. The case where the system dynamics are described by a set of linear differential equations and the cost is described by a quadratic function is called the LQ problem. One of the main results in the theory is that the solution is provided by the linear–quadratic regulator (LQR), a feedback controller... (Wikipedia)

LQR is one of the optimal control techniques making optimal control decisions using the current state of dynamical system. As a way of understanding LQR, wheeled inverted pendulum is used in modeling and simulation.

I implemented this for term project of the course Intelligent Robotics. It looks crude, however, it may be quite good for beginners like me to understand how LQR really works with the naked eyes. The code is simple and contains as lease as possible so it may be a good starting point of LQR. This is why I want to share!

Requirements

$ sudo apt-get install python-tk
$ sudo apt-get install python-scipy
$ sudo apt-get install python-matplotlib

$ pip install slycot
$ pip install control

If you have some trouble installing slycot you may find useful informatio at Slycot GitHub page. There are alternatives to install the package. (I used conda.) Also, you can find more information about python-control at Python Control Systems Library.

Run

$ python view/sim.py

LQR for WIP Demo.

If you click the image you can see the demonstration video at YouTube.

About

Linear Quadratic Regulator (LQR) for Wheeled Inverted Pendulum (WIP)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages