Attitude Control of a Quadrotor using Reinforcement Learning

This project was completed as the final project for the course ENPM808F Robot Learning. The project involves tuning the PID controller for a half a quadrotor using reinforcement learning. The success of the learning algorithm was demonstrated using a custom-fabricated test rig.

The system works by using random values of gains and using a reward and punishment system to make the system stabilize at the 0 degrees. The algorithm considered to have converged if the system remains with +/- 1 degrees of the desired position for at least 10 seconds.

An Arduino based controller was developed from scratch for this project. 

The training algorithm is as follows:

Loop

  • Generate random gain Є [-10,10]            (gain)

  • For 2000 iterations

    • Generate gain for fine tuning Є [-1,1]     (fine_gain)

    • For 200 iterations

      • Kp=gain+fine_gain

      • If (angle Є [-1,1] degrees), increment reward

    • If (total reward after 200 iterations) > highest reward, update gain=Kp

    • If(total reward = 200), Training complete