NXTway-GS (Self-Balancing Two-Wheeled Robot) Controller Design

NXTway-GS Model-Based Design based on Embedded Coder Robot NXT.
Updated 1 May 2009

View License

Editor's Note: This file was selected as MATLAB Central Pick of the Week

NXTway-GS is a self-balancing two-wheeled robot built with LEGO Mindstorms NXT and a Hitechnic gyro sensor. This demo presents sample models and documents describe the following contents.

How to Build NXTway-GS
Mathematical Dynamics Model of NXTway-GS
Controller Design for Balance and Drive Control
NXTway-GS Model Illustration
Simulation and Experimental Results

You can simulate NXTway-GS model and generate controller program that can be executed on the NXT. You can watch the movies of NXTway-GS simulation and control experiment at the following URL.


This demo uses Embedded Coder Robot NXT Demo as MBD environment. You need to download it from the following URL before trying this demo.


LEGO(R) is a trademark of the LEGO Group of companies which does not sponsor, authorize or endorse this demo. LEGO(R) and Mindstorms(R) are registered trademarks of The LEGO Group.

Cite As

Yorihisa Yamamoto (2024). NXTway-GS (Self-Balancing Two-Wheeled Robot) Controller Design (https://www.mathworks.com/matlabcentral/fileexchange/19147-nxtway-gs-self-balancing-two-wheeled-robot-controller-design), MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2007b
Compatible with any release
Platform Compatibility
Windows macOS Linux

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!
Version Published Release Notes

1.4 Modified text

updated building instructions
added japanese document

Modified the generalized forces and state equations.
Added simulation movie

1.2+ Add an annotation to download the generated code into NXT standard firmware

1.0 : First edition
1.1 : Added fixed-point controller model
1.2 : modified motion equations