Interactive Pendulum Simulator

The pendulum simulator has been created to accompany a coming series of video tutorials entitled ‘How to Balance a Robot’. The series will cover the following:

  • Modelling and Simulating a pendulum using PyGame
  • Modelling and simulating a self balancing robot using Pygame
  • Build your own PID controller for dynamically stabilising an inverted pendulum
  • Dynamically stabilising a real system, namely the T-Bot

You can find the code for the pendulum here.

Macro Plotter

The macro plotter allows you to display a plot built from the recorded macro commands. This is very useful for exploring open loop control. You can run the T-Bot over a known route and compare the plot to the actual path taken. The rotation rate and speed factor on the slider bars are used to compensate for the real turning rate and speed of the T-Bot. The control values received by the robot are integers ranging from 100 to 300 with 300 corresponding to a maximum speed in one direction and 100 corresponding to a maximum speed in the opposite direction. The speeds are going to be effected by several factors such as trim, surface, slope, tuning, calibration etc.