All mechatronics work

Self-balancing robot

Context
Control Systems project, RMIT
Team
Team project
Discipline
Mechatronics, Embedded
The built prototype on the bench
The built prototype on the bench

A two-wheeled inverted pendulum, modelled and simulated in MATLAB/Simulink, then built and tuned until it balanced on the bench.

A two-wheeled robot that balances itself like an inverted pendulum. It uses geared DC motors on an L298N driver, an MPU-6050 gyro and accelerometer, an Arduino Uno and two 3.7 V lithium cells on a stacked plate frame.

What I did

  • Derived and linearised the system model, obtained the transfer function and compared PD and PID controllers against the specified transient response in MATLAB/Simulink.
  • Built the prototype and tuned the controller on hardware, then analysed why measured behaviour diverged from simulation.
  • Added a detachable 3D-printed limiter (the red part) that catches the robot when it falls, so it is not damaged during tuning.

What went wrong, and the fix

  1. Problem:

    Gains calculated from theory (Kp 705, Ki 70, Kd 19) did not work on the real robot, because of friction and errors in the model parameters.

    Fix:

    Retuned on the bench to Kp 23, Ki 90, Kd 1.8, after which the robot balanced reliably.

From the bench