/// HYBRID · BV-002← BACK TO INDEX
// MECHATRONICS

Self-Balancing Robot

Inverted-pendulum robot using full-state feedback control via Linear Quadratic Regulator in MATLAB / Simulink.

Software
MATLAB / Simulink / Arduino
Material
Vex Robotics + custom
Duration
Nov — Dec 2021
Self-Balancing Robot
// Project Notes
Objective: Create a full-state feedback controller that makes this robot stand upright on its own. Problem: Finding the correct LQR weights was tedious; the pendulum's angle offset was tricky to calibrate; the motor would oscillate erratically. Solution: Adjust each weight individually until the motor stabilized and stood upright without assistance. Built as the term project for my mechatronic system design class. The robot was first modeled in state-space form derived from equations of motion (free body diagrams + differential electrical circuit equations). The system was given a feedback control gain vector with MATLAB's Linear Quadratic Regulator function. Weights were assigned to each state — x, theta, x-dot, theta-dot — which influenced voltage input more or less for each. The Simulink block diagram was then deployed to an Arduino, which used the resulting control system to drive motor voltage based on current state.