Welcome to Kerala Project Center.
Image: Two wheel balancing.jpg by Mitultakiar via Wikimedia Commons, CC BY-SA 4.0
A robot that stays upright on just two wheels, with no third support point, is a genuinely different control challenge from a standard wheeled robot — it has to continuously correct itself the instant it starts to tip.
This project builds a two-wheeled robot that uses an MPU6050 accelerometer/gyroscope to continuously measure its tilt angle, feeding a PID control loop that adjusts motor speed and direction dozens of times per second to keep the robot balanced upright, similar in principle to a Segway.
// Simplified self-balancing PID outline - Arduino + MPU6050 #include#include MPU6050 mpu; float kP = 20, kI = 0.5, kD = 0.8; float errorSum = 0, lastError = 0; void loop() { float tiltAngle = readTiltAngle(mpu); // fused accelerometer + gyro angle float error = 0 - tiltAngle; // target = upright (0 degrees) errorSum += error; float derivative = error - lastError; float motorSpeed = kP * error + kI * errorSum + kD * derivative; lastError = error; driveMotors(motorSpeed); // positive = drive forward, negative = drive backward }
Monday - Saturday: 9:00 AM - 5:00 PM
Sunday: Not Working
2nd Floor, Comptron Arcade, Kallattumukku,
Thiruvananthapuram, Kerala 695012
+91 9633118080