A self balancing robot with two wheels that stands upright https://emamaker.com
Go to file
EmaMaker e70f3fe1e5 sim: nonlinear simulation
Demonstrates both the analytical solution and the current PID values work
2024-01-13 13:15:52 +01:00
firmware-arduino [UNSURE] open-loop wheel sync 2024-01-12 13:43:05 +01:00
matlab-sim pid: recalibrate with ziegler-nichols2 and matlab simulation 2024-01-05 12:55:24 +01:00
matlab-sim-v2 sim: nonlinear simulation 2024-01-13 13:15:52 +01:00
structure robot chassis 2024-01-03 21:49:50 +01:00
.gitignore update .gitignore 2024-01-13 13:14:54 +01:00
README.md update README.md 2024-01-05 15:58:03 +01:00
torque-measure-arm.stl parts and data on torque of the motors 2024-01-03 21:48:54 +01:00
torque-measure-dynamometer.stl parts and data on torque of the motors 2024-01-03 21:48:54 +01:00
torque-servos.ods parts and data on torque of the motors 2024-01-03 21:48:54 +01:00

README.md

Two-wheeled Self-Balancing Robot

My attempt at building a two-wheeled self-balancing robot. The project started as a personal one and later evolved as a University project. I'll upload the university report to this repo as soon as it is complete. This repo will also be supported by a blog post on emamaker.com

The physical model of the robot has been derived by calculating the Lagrangian function. This model is heavily non-linear and has been linearized around the 0° point of equilibrium.

The linearized model has been reconstructed in MatLab Simulink and a discrete-time PID controller has been calculated by trial and error. This PID Controller was used to dimension the motors (max. torque in particular) and was later refined with the Ziegler-Nichols method.

The robot has later been built using a Raspberry Pi Pico microcontroller paired with a MPU6050 6-axis IMU, from which the pitch angle is derived with the use of a Madgwick filter. (Initially this was a simple complementary filter, but it was way too subject to noise from the accelerometer, check the blog post). The two motors (Hitec HS-322HD servomotors, check blog post for the choice of motors) are driven by a L298N motor driver. Everything is powered by a 2S 7.4V LiPo battery.

The microcontroller firmware has been implemented in Arduino-C with the use of the ArduPID library for the PID Controller and FastIMU for reading the IMU. A reimplementation using the RPi Pico own SDK will probably follow. This repo includes both the old firmware using a complementary filter and the new one using the Madgwick filter, the latter is the one actually used on the robot.

The structure (as in chassis) of the robot has been designed in OnShape and realized using laser-cut wood and 3d-printed parts, check the blog post for details about the structure.