top of page

Self-Balancing Segway Robot

I designed two controllers for a 2 wheel Segway Robot in order for it to remain standing in the same spot for as long as possible and to complete an obstacle course.

Using the equipment provided by MIT's Dynamics and Controls II, I was able to design a controller for a self-balancing robot. My robot broke the classes record for long-term stability without accumulation of error, going until the battery died.

In this project, I first had to solve for the dynamics describing the system. To do this, I modeled the self-balancing robot as an inverted pendulum acting under the force of gravity and an applied torque at the base. I then solved for the transfer function relating the angle with respect to the ground and the applied torque. The desired torque was then related to the PWM of the motors, which allowed me to then design a controller for the PWM of the motors and the angle of the robot with respect to the ground. The robot used a 6 axis IMU to measure its angle with respect to the ground, and late the yaw.


For the long-term stability competition, I had to keep the robot upright without rolling off of a 1' by 1' block, which meant stability and no accumulation of error. I used a PID control along with an and my robot not only won the class competition and broke the previous long-held record by more than three times. Below are simulated graphs of my systems Bode Plot and Step Response.

The second part of the project involved designing a controller to follow a path on an obstacle course. This required control of both the robot's angle with respect to the ground and its linear position and velocity in space. For this I designed a full state feedback controller and then pre-programmed its trajectory using the readout from the IMU in order for it to complete the course quickly and without falling over.

Dynamics and Controls

Field

Long-Term Stability and Path Following

Goal

Project Gallery

bottom of page