Wolfram Computation Meets Knowledge

Mechanical Engineering

Use System Modeler to model and simulate dynamics problems including mechanisms and machinery with kinematic, dynamic, and thermal behaviors. Study and solve vibration problems.

LEGO Segway: Controlling an Inverted Pendulum

Controlling inverted pendulums in different forms is common in engineering. They can be found in everything, from rockets during liftoff to skyscrapers and Segways. Build a control system for a Segway constructed out of LEGO Mindstorms NXT components.

To run this example, you'll need

The latest versions of System Modeler and Mathematica.

Please make a selection:

Get a
free trial
with download

Create Custom Libraries

Construct components for parts of the LEGO Segway using existing libraries.

Design Controller

Use Mathematica to find suitable controller gains to keep the Segway upright.

Use CAD files of the LEGO parts to customize the generated 3D animation.

Linearize Model

Linearize the model around the upright stationary point.

Animate in 3D Automatically

View the 3D animation that is automatically generated from the model.

Watch the Video