File Exchange

image thumbnail

Lego Segway.zip

version 1.1.0.0 (10.9 KB) by Robert White
Simulink model and associated m-file for designing and implementing a Lego Segway on the NXT.

3 Downloads

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:

http://www.mathworks.com/help/simulink/ug/install-target-for-lego-mindstorms-nxt-hardware.html

See the video of this working:

http://youtu.be/pOOPFw959Rw

Comments and Ratings (4)

http://www.mathworks.com/help/simulink/ug/install-target-for-lego-mindstorms-nxt-hardware.html
This link is no longer exist and this support by Matlab has been updated, your model should be updated too.

pzampella

Hi! What if I wanted the robot to move forward instead of keeping still? Where do I implement (or how) the drive control?

mt nguyen

Hello Robert,
I try to implement your controller on my EV3. Could you help me with the meaning of "T=0.2; %motor time constant (sec)"
Thanks and best regards

zetad yosif

Updates

1.1.0.0

Added a link to a you tube video.

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