16-299: Lab Assignment 2.

This assigment focuses on simulating your TWIP robot to balance upright. I provide a model. You use LQR to develop a controller and evaluate it in simulation.

You should turn in 1) A description of how you found the A and B matrices for the linearized system, 2) A description of your LQR design, and how you chose the Q and R matrices, and 3) Some data plots showing your controller bringing the simulated robot to standing upright and not moving. Please put this information on a web page and send the professor the URL.


The model

To make control easier, I derived a new model whose state variables include the angle between the wheel and the body, replacing the angle between the wheel and vertical, since what is measured by the encoder is actually the angle between the wheel and the body. The angular velocity is now the angular velocity between the wheel and the body.
x = r_w*(wheel_angle + body_angle)