Simulink model and associated m-file for designing and implementing a Lego Segway on the NXT.
Updated 18 Jul 2014

View License

There are two files:
Run kalmandesign3.m first to generate a linear state space model of the plant, design a Kalman filter to estimate the states from the gyro, accelerometer, and wheel encoders, and design a full state feedback controller.

Then use NXT_segway_kalman3.mdl to generate code that can be embedded onto the NXT using the NXT target.

In order to get this to work you will first have to install support for the NXT target:

See the video of this working:

Cite As

Robert White (2024). Lego (, MATLAB Central File Exchange. Retrieved .

MATLAB Release Compatibility
Created with R2012a
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

Added a link to a you tube video.