BrickEngineer: LEGO Design

LEGO Engineering for LEGO NXT and Robot Enthusiasts

MATLAB Packages for the NXT

There are now several MATLAB packages for robotics, and specifically for the NXT.  One paradigm is to run the code on a PC and have it communicate direct commands to the NXT Brick via Bluetooth or USB.  I have found this paradigm to be a bit dangerous since in the event of a MATLAB crash or a miscommunication, the NXT Brick will continue with its last command until ordered to stop.  This has the potential to destroy your robot.  The paradigm that I prefer to use is to write several programs that run on the brick.  These programs take commands from files on the brick that can be uploaded rapidly from the PC.  The MATLAB code then is in charge of sending the command files and starting and stopping programs.  In the event of a MATLAB crash or communication failure, the software running on the NXT Brick can be designed to terminate gracefully.

Here are the MATLAB packages that I know of.  The first two are specifically geared toward the NXT; whereas the last is a general robotics package.

Be Sociable, Share!
  • Linus Atorf says:

    To clarify the little mixup from the list of the 3 MATLAB packages: The 2nd one seems to be for general robotics purpose (although the link is dead now). The RWTH – Mindstorms NXT Toolbox for MATLAB is specifically geared toward the NXT.

    As to the problem you describe that MATLAB crashes could potentially destroy your robot: With version 2.03 (and better) of the RWTH NXT toolbox, we introduced a program called MotorControl which is running on the NXT brick. It makes sure the motors do what you commanded them to do, no matter what happens to MATLAB or the communication channel. Also we made the orange center button on the NXT an “EMERGENCY STOP” button — once pressed, all motors will stop at once, with power turned off. Even better with version 4.02, the MotorControl program will also be stopped, so that no further MATLAB commands are possible until a restart (of the MATLAB program). This helps a great deal protecting robot constructions. Last not least: Even with on-brick-programs (started by the user or started from MATLAB), you can never fully avoid possible damage to your robot when making mistakes in programming… So always be careful :-)

    It’s also worth checking out the latest version of the RWTH – Mindstorms NXT toolbox for its greatly improved motor precision (introduce with version 4.00). Smooth braking guarantees high accuracy of +/- 1 degree about 90% of the time.

    Regards, Linus

    November 20, 2009 at 12:20 am
  • thee says:

    I’ve gone in advance and bookmarked at so my pals can see it too. I basically utilized MATLAB Packages for the NXT | BrickEngineer as the entry title in my book mark, as I realized if perhaps it really is superior sufficient for you personally to title your weblog publish which, then you definitely probably would like to view it added the identical way.

    May 4, 2011 at 2:36 pm

Your email address will not be published. Required fields are marked *


Content Protected Using Blog Protector By: PcDrome.