Post on 09-Nov-2014
LEGO Mindstorms
LEGO Mindstorms is a line of Lego sets combining programmable
bricks with electric motors, sensors, Lego bricks, and Lego Technic pieces
(such as gears, axles, and beams).
Mindstorms originated from the programmable sensor blocks used in
the line of educational toys. The first retail version of Lego Mindstorms was
released in 1998 and marketed commercially as the Robotics Invention
System (RIS). The current version was released in 2006 as Lego Mindstorms
NXT.
The hardware and software roots of the Mindstorms Robotics Invention
System kit go back to the programmable brick created at the MIT Media lab.
2
This brick was programmed in Brick Logo. The first visual programming
environment, called LEGOsheets, for this brick was created by the University
of Colorado in 1994 and was based on AgentSheets.
The original Mindstorms Robotics Invention System kit contained two
motors, two touch sensors, and one light sensor. The NXT version has three
servo motors and four sensors for touch, light, sound, and distance. Lego
Mindstorms may be used to build a model of an embedded system with
computer-controlled electromechanical parts. Many kinds of real-life
embedded systems, from elevator controllers to industrial robots, may be
modelled using Mindstorms.
Mindstorms kits are also sold and used as an educational tool,
originally through a partnership between Lego and the MIT Media
Laboratory. The educational version of the products is called Lego
Mindstorms for Schools, and comes with the ROBOLAB GUI-based
programming software, developed at Tufts University using the National
Instruments Lab VIEW as an engine. The only difference between the
educational series, known as the "Challenge Set", and the consumer series,
known as the "Inventor Set", is another included light sensor and several
more gearing options.
Mindstorms is named after the book Mindstorms: Children, Computers,
and Powerful Ideas by Seymour Papert.
Robotics Invention System
3
The first generation of Lego Mindstorms was built around a brick
known as the RCX. It contains a 8-Bit collision detector Renesas H8/300
microcontroller as its internal CPU. It also contains 32K of RAM that stores
the Firmware and User Programs. The brick is programmed by downloading
a program (written in one of several available programming languages) from
a PC or Mac to the brick's RAM via a special infrared (IR) interface. After the
user starts a program, an RCX-enabled Mindstorms creation may function
totally on its own, acting on internal and external stimuli according to the
programmed instructions. Also, two or several more RCX bricks can
communicate with each other through the IR interface, enabling inter-brick
cooperation or competition. In addition to the IR port, there are three sensor
input ports and three motor output ports (also usable for lamps, etc). There
is also an LCD that can display the battery level, the status of the
input/output ports, which program is selected or running, and other
information.
Version 1.0 RCX bricks feature a power adapter jack to allow
continuous operation instead of the limited operation time when using
batteries. In version 2.0 (as well as later 1.0s included in the RIS 1.5), the
power adapter jack was removed. Power adapter-equipped RCX bricks are
popular for stationary robotics projects (such as robot arms) or for
controlling Lego model trains. In the latter context, the RCX needs to be
programmed with Digital Command Control (DCC) software required for
automated model train operation..
The IR interface on the RCX is able to communicate with Spybots,
Scout Bricks, Lego Train, and the NXT (using a third-party infrared link
sensor.) The RCX 1.0 IR receiver carrier frequency is 38.5 KHz, while the
RCX 2.0 IR carrier frequency is 76 KHz. Both versions can transmit on either
4
frequency. The carrier signal is generated by one of the RCX's internal
timers.
All versions of the RCX have a unique number printed on it. Little is known
about the reasoning behind this number, except for the use of technical
support and as a ID number of the RCX for your Lego Mindstorms account
on the now-defunct Lego Mindstorms RCX website. The first RCX produced is
marked "000001" and was on display at the Mindstorms 10th Anniversary
event.
Programming languages
Lego-supplied languages:
• RCX Code (included in the Mindstorms consumer version sold at
toystores)
• ROBOLAB (based on Lab VIEW and developed at Tufts University)
Popular third-party languages:
• http://roboteq.sourceforge.net/ open source programming with
graphical interface
• C and C++ under BrickOS (formerly LegOS)
• Java under leJOS or TinyVM
• NQC ("Not Quite C")
• pbFORTH (extensions to the Forth programming language)
• pbLua (An NXT API for the Lua programming language)
• Visual Basic (Through the COM+ interface supplied on the CD)
• RobotC (New Language and NXT Compatible)
• Interactive C (Language similar to C used in robotics competitions.)
• XSLisp an implementation of Lisp for the RCX (1 + 2) and NXT
5
Parts Inventory
The parts included in retail version of the LEGO MINDSTORMS NXT set (8527) are pictured below.
6
7
8
9
ROBOT ARM
10
11
12
13
14
15
16
17
18
19
20
Using The Robot Arm
• Pressing the orange Enter button on the NXT brick will toggle the controls between "Rotate" and "Lift" modes.
• In "Rotate" mode, the gray left and right arrow buttons on the NXT brick will rotate the arm left and right as long as you hold the button down.
• In "Lift" mode, the left and right buttons will lift the arm up and down as long as you hold the button down.
• Pressing the touch sensor button will make the claw switch between grabbing and releasing.
The turntable and lifting arm motors both use gears to "gear down" the motion (decrease speed and increase force). You will notice that this keeps you from being able to turn the motors by hand.
To work around this problem, you can use the handle on the side of the arm
21
lifting motor to adjust the arm's up/down position by hand when the program is not running. (When the program is running the NXT has the electric brakes on the motors and will not allow them to be turned by hand).
This design does not include a similar lever on the turntable motor. Can you figure out a way to add one?
Challenges
• Practice using the controls to pick up and move objects. Here is an example challenge. Place the red and blue balls on tire stands in different locations but both at the correct distance from the arm so that the claw will reach it, as shown below. Now try to use the robot arm to swap the positions of the two balls. What is smallest number of button presses that you think this can be done in?
• Think of some mechanical improvements you might make to this design. For example:
Come up with a way to keep the wires out of the way.
The claw is designed to be as simple as possible to keep it
light weight. However, it would be nice if both sides of it
opened and closed. Can you come up with a simple way to
do this?
The Arm Control program allows you to control the arm
using the buttons. Try making a program of your own that
controls the arm automatically by itself with a pre-
programmed sequence of moves. Here's a big challenge:
Can you write a program that will swap the balls as shown
in the challenge above?
22
23