The Inverted Pendulum is a classic problem in dynamics and control systems, often used to demonstrate control theory concepts. The goal of this project is to balance an inverted pendulum on a moving cart using LQR control and compare it with Deep Reinforcement Learning. The simulation was made using python.
By denoting
Which can be linearized as :
Given :
To run the LQR control script, use the following command :
python lqr_control.py
To run the RL control script, use the following command :
python rl_control.py
This script will load a model that has already been trained and simulate its actions. To run your own training with your own parameters, please modify the train_dqn.py
script
The result of my own training for the DQN agent can be seen below :
We expose here the results of the simulation, first with the uncontrolled system where the pendulum will simply fall, and then both control methods (LQR and RL)