An exciting Simulink utility for
LEGO MINDSTORMS NXT
Takashi Chikamasa
Advanced Support Engineer, MathWorks Japan
Background
Industry: engineers need to have a set of Model
Based Design skills to develop embedded
software/hardware
Academic: students need to be able to translate
theory into practical industry settings for their career
Key factors to explore Simulink in
Academia
Capable of simulating and visualizing complex dynamic
systems
Connection between the theory and the practical
applications of controls concepts
Easy integration to inexpensive hardware to compare
theoretical design with actual implementation
Project-based learning with industry tool and flavor of
industry development process
3
Why LEGO MINDSTORMS NXT?
Enough performance to experiment control theory and
applications
ARM7 core MPU with 256kB ROM/64kB RAM
Bluetooth/USB/RS485/I2C communication
Servo motors with 1[deg] resolution encoder
Variety types of sensors (Light, Touch, Sonar, Acceleration, Gyro, Color)
Versatile in hardware and software
Can be built from basic robotics to advanced controls & embedded systems
Programming languages: NXT-G, NXC, Java(leJOS), C/C++ (nxtOSEK), Ada
Low cost, high quality and world wide support
4
Embedded Coder Robot (ECRobot) NXT
http://www.mathworks.com/matlabcentral/fileexchange/13399
Model-Based Design environment for NXT
Application is simulated and visualized on the host computer
Compiled and downloaded to the NXT with a single mouse click
Real-Time Workshop Embedded Coder is used for code generation
Support for MATLAB R2006a to R2010b
Flavor of industry use cases
Industry proven RTOS (e.g. OSEK) in the NXT
Considered for MAAB controller style guidelines
Architecture of ECRobot NXT applications
Controller
for code generation
Visualized by
Simulink 3D Animation (option)
Plant for application (option)
NXTway-GS: self balancing two wheeled robot
http://www.mathworks.com/matlabcentral/fileexchange/19147
Includes detailed description and building instructions
Implemented state-space feedback and LQR using Control
System Toolbox
NXT Ballbot: self balancing robot on a ball
http://www.mathworks.com/matlabcentral/fileexchange/23931
NXT version of Ballbot that is originally developed by Ralph Hollis
at Carnegie Mellon University.
Includes detailed description and building instructions
Implemented state-space feedback and LQR using Control
System Toolbox
NXT SCARA: two-link planar robot arm
http://www.mathworks.com/matlabcentral/fileexchange/22126
Includes detailed description and building instructions
Robot movement is based on inverse kinematics
User projects using ECRobot NXT
Shizuoka University (Japan):
holds MBD course curriculum
http://architect.inf.shizuoka.ac.jp/curriculum/index.html
Delft University of Technology (Netherland):
developed NXTbike-GS application
http://www.mathworks.com/matlabcentral/fileexchange/27694
ET ROBOCON (Japan):
Embedded software community holds line tracing robotics competition using
NXTway-GS balancer C API: http://www.etrobo.jp/2010/
10
MathWorks at ET ROBOCON 2010
Tokyo, Japan (MNN) -- In September 4th, An ET ROBOCON local competition was
held in Tokyo. MathWorks (#23) got the 1st prize in the race and could be qualified
for the Championship in December.
11
VU-LEGO Real Time Target by
Villanova University
Professor James Peyton-Jones
developed a new turnkey solution
for the NXT to be suited for
class room use cases
More intuitive model construction
for students and
support for multi-rate modeling/
code generation
12
http://www.mathworks.com/academia/lego-mindstorms-nxt-software/legomindstorms-simulink.html
13
Conclusions
Simulink and LEGO MINDSTORMS NXT are a good
combination to teach from theory to practical control
applications
Embedded Coder Robot NXT / VU-LEGO Real Time
Target can help to design MBD course in academia
Project-based learning for Model-Based Design will be
more popular in academia and industry
14