Table of Contents
System Modeling
After following this tutorial you will be able to find the full state feedback gains to be used on the NQC Code to control your Lego Rotary Inverted Pendulum.
The first derivation is for the virtual simulation using Simulink - The output is the Torque. The second derivation is for your real project , that will use the DC-motor voltage as output.
References [1] [2] [3] [4] [5]
You can find the Matlab Script to run the [K] matrix calculation here rip_kit.rar
Derivation for Simulink Simulation
Use this derivation if you want to simulate the system virtually trough Simulink. This derivation will neglect the friction in the motor rotation , friction in the pendulum rotation and will USE TORQUE as input to the state-space representation . The real model , have rotation friction , and use Voltage in the DC motor as input ( you can find this derivation on this same page).