With the advancement of Industry 4.0, mobile robots are being applied to more and more tasks, in areas such as exploring unfamiliar environments, inspecting and monitoring infrastruc- ture, finding and rescuing people, or transporting and handling loads, among others. In this project we will focus on the modeling and control of two-wheeled inverted pendulum robots. Although they must be actively stabilized to prevent them from tipping over, these systems have several advantages over stable robots with more wheels: they can rotate around a point without moving, compensate external force disturbances that would tip over a conventional robot, and achieve taller and slimmer geometries while being stable. Along the project we will see how the kinematic and dynamic models for a twinbot (two-wheeled inverted pendulum robot) are obtained, we will go over the design of a control system, that, using the dynamic model, stabilizes the robot in the upright position along a real time defined trajectory, and we will end up validating the robustness of this control by applying force disturbances while the robot is trying to follow a defined trajectory