Modeling and Control of a Wheeled Inverted Pendulum System in MATLAB
π Overview
A complete MATLAB simulation of a Wheeled Inverted Pendulum (self-balancing robot) featuring nonlinear dynamics, cascaded PD control, real-time animation, and high-quality video export. Built for control systems learning, robotics projects, and academic use.
π¦ Whatβs Included
- β Full nonlinear WIP dynamic model (
dynamics.m) - β Cascaded PD controller (position + balance control)
- β RK4 numerical solver for accurate simulation
- β Real-time 2D animation (wheel + pendulum visualization)
- β Automatic MP4 video generation (60 FPS, high quality)
- β Complete MATLAB script (ready to run)
- β System parameter configuration (mass, inertia, friction, etc.)
- β Post-simulation plots:
- Position
- Angle
- Velocity
- Angular velocity
- Control torque
βοΈ Key Features
- Nonlinear physics-based modeling
- Dual-loop (cascaded) control system
- Torque and angle saturation handling
- Smooth and stable simulation (RK4)
- Professional visualization and animation
π― Applications
- Self-balancing robot simulation
- Control systems coursework
- Robotics & mechatronics projects
- Final Year Projects (FYP)
- MATLAB-based research
π» Requirements
- MATLAB (R2018 or later)
π Outcome
Understand and implement:
- Nonlinear system dynamics
- Cascaded control design
- Real-time robotic simulation in MATLAB