Lego Mindstorms

From Wikipedia, the free encyclopedia

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, beams, and pneumatic parts) to build robots and other automated or interactive systems. 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 and is called Lego Mindstorms NXT.

Mindstorms kits are also sold and used as an educational tool, originally through a partnership between Lego and the MIT Media Laboratory [1], [2]. 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[3] using the National Instruments LabVIEW as an engine.

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.

There is a strong community of professionals and hobbyists of all ages involved in the sharing of designs, programming techniques, and other ideas associated with Lego Mindstorms. With the ability to harness collaborative efforts of tens or hundreds of thousands (if not millions) of individuals, Lego Mindstorms system/website is a great example of a wiki. Lego also allows, actually encourages, sharing and peering by making software codes available for downloading and by holding various challenges.

The original Mindstorms RIS 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.

Contents

[edit] RCX

RCX programmable brick.
RCX programmable brick.

The first generation of LEGO Mindstorms was built around a brick known as the RCX. It contains a Renesas H8/300 microcontroller as its internal CPU. 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 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, 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.

[edit] Programming Languages

Lego-supplied Languages:

  • RCX Code (included in the Mindstorms consumer version sold at toystores)
  • ROBOLAB (based on LabVIEW and developed at Tufts University)

Popular Third-party Languages:

[edit] LEGO Camera

The LEGO Camera on its own is technically not a robotic toy; rather, it is a normal webcam (a Logitech Quickcam Web) packaged into a LEGO shell. Being a normal webcam, the LEGO Camera is, unlike most Mindstorms products, not programmable and is only usable connected to a PC or some other device that supports USB webcams.

The LEGO Camera is meant to be used with the included Vision Command software which can also interface with an RCX and thus enables creating robots with "vision". The software is capable of detecting different lightings, motion, and colors. It can also be used with any other software that uses a webcam. The webcam is capable of recording up to 30 frames per second. It also contains a microphone to record sound for videos.

[edit] Cybermaster

Lego Cybermaster
Lego Cybermaster

Cybermaster was mainly sold in Europe and Australia/New Zealand, but was available for a short time via the Lego Club magazines. It was aimed at a younger audience as an early attempt of merging computer gaming with robotics and LEGO. The Pbrick shares many, esp software, features with the RCX but differs in appearance and technical specification. 1 output (plus 2 built-in) and 3 sensors.

  • It uses RF (27 MHz R/C band) instead of IR for communication.
  • It has two built-in motors with integrated tachometers and speedos.
  • It is limited to passive sensors (a simple A/D with internal pull-up resistors).
  • The sensors shipped with it are colour coded and have internal resistors in their open state (allowing the Pbrick to sense which sensor is attached to which port).
  • It has a fixed firmware (so it can't be upgraded or replaced).
  • It has limited RAM for programs and only one program slot.

Despite its obvious limitation it has a number of edges over its 'big brother', the RCX.

  • The RF link has greater range and is omnidirectional.
  • The built-in tacho and speed sensors on the internal motors provides the same function as the external rotation sensor to the RCX, but without using up sensor ports.

This makes it very useful for various mobile platforms and performing basic motion/positioning tasks.

It talks the same protocol as the RCX but can't communicate directly to it (due to IR vs RF) but with a repeater (a computer with 2 serial ports and a simple program) they can be integrated.

[edit] Codepilot

Sold as part of the Barcode Truck kit. This unit was the first programmable brick (or Pbrick). It features a single motor, a single touch sensor and a light sensor. It is programmed by setting it to 'learn' and using the light sensor to feed barcoded commands. The command set is very limited. Since barcode is just a series of variances in light, this form of command entry was dubbed VLL (Visual Light Link) as has been used in several later Lego models.

[edit] Scout

Lego Mindstorms Scout microcomputer
Lego Mindstorms Scout microcomputer

Lego also released a brick named the Scout, which has 2 sensor ports, 2 motor ports, a built in light sensor, and no PC interface. The Scout can be programmed, but the user usually selects one of a collection of built-in programs. In order to program the Scout, a user must enable "power mode" on it. The Scout can store one program. The RCX can control the Scout brick using the Send IR Message program block. The RCX does all of the controlling, and therefore can be programmed with the PC, while the Scout acts as a "slave". The Scout brick must have all of its options set to "off". Press run and then send IR codes to it.

The Scout is also cabable of using a third engine using VLL to slave a Micro Scout.

[edit] RCX/Scout IR Communication Codes

(IR Code/Left/Right)

  • 4/Fwd/Fwd
  • 5/Rev/Rev
  • 6/Fwd/Rev
  • 7/Rev/Fwd
  • 8/Fwd/Off
  • 9/Rev/Off
  • 10/Off/Fwd
  • 11/Off/Rev
  • 12/Off/Off

[edit] Micro Scout

The Micro Scout was added as an entry level to Lego robotics. It is a very limited Pbrick with a single light sensor and a single built-in engine. It is not programmable but has seven precoded behaviours. The unit was sold as part of the Droid Developer Kit (featuring R2D2) and later the Darkside Developer Kit (featuring an ATAT Imperial Walker).

However, the unit can be slaved to a Scout, Spybotics or RCX unit using its light sensor as a VLL (Visual Light Link, or Barcode) receiver, adding an extra (weak) engine.

[edit] Spybotics

Main article: Spybotics

Spybotics was more of an attempt to expand on the Cybermaster line. The kits were sold together with a computer game where part was played on the computer and part was played by controlling the Spybot to solve a number of fixed missions. The Pbrick itself shares many features of the Cybermaster, 2 internal motors with full tachometer and speed feedback, but is has a single integrated touch sensor.

It also features an optical out and light sensor, which doubles as computer interface. This interface can also be used to connect to the Scout, Micro Scout and possibly the Codepilot using VLL. It has an expanded IR functionality allowing it to communicate with other Spybots or RCX units. The IR unit also has limited direction and range function, allowing it to track and locate other Spybots, Remote Controls or RCX units.

It was shipped with an IR remote control that can double as an IR beacon.

[edit] Lego Mindstorms NXT

Main article: Lego Mindstorms NXT
"Alpha Rex" - a robot built with the NXT set.
"Alpha Rex" - a robot built with the NXT set.

Lego Mindstorms NXT is a programmable robotics kit released by Lego in July 2006, replacing the first-generation Lego Mindstorms kit. [4]. The kit consists of 519 Technic pieces, 3 servo motors, 4 sensors(ultrasonic, sound, touch, light), 7 wires, a usb cable, and the NXT brick. It also includes NXT-G, a graphical programming environment that lets you create programs and download them to the NXT.

The NXT is the brain of a Mindstorms robot. This computer-controlled LEGO brick lets the robot autonomously perform different operations. The NXT has three output ports(A, B, C), four input ports(1, 2, 3, 4), and a USB port that lets you download user-programs to the NXT brick. Users also have an option to download wirelessly through Bluetooth. A 100x64 LCD matrix display also resides on the NXT along with 4 buttons and an 8 kHz Piezo speaker.


Technical Specifications:

  • 32-bit ARM7 microcontroller
  • 256 Kbytes FLASH, 64 Kbytes RAM
  • 8-bit AVR microcontroller
  • 4 Kbytes FLASH, 512 Byte RAM
  • Bluetooth wireless communication (Bluetooth Class II V2.0 compliant)
  • USB full speed port (12 Mbit/s)
  • 4 input ports, 6-wire cable digital platform (One port includes a IEC 61158 Type 4/EN 50 17 compliant expansion port for future use)
  • 3 output ports, 6-wire cable digital platform
  • 100 x 64 pixel LCD graphical display
  • Loudspeaker - 8 kHz sound quality. Sound channel with 8-bit resolution and 2-16 KHz sample rate.
  • Power source: 6 AA batteries


[edit] Programming Languages

Language(s): Custom flowchart-like language
Language(s): Ada
Language(s): C/C++[5]
Language(s): C/C++, Objective C, Fortran, Java, Ada among others
Language(s): C/C++, ASM
Language(s): Anything that can compile to .NET, works best with C#[6]
Comment: Doesn't come with a compiler, converts bytecode to machine code
Language(s): Java
Language(s): C/C++
Comment: A library for GCC
Language(s): Visual Basic, Visual C++
Comment: Can be combined with an RCX control library such as spirit.ocx from the MindStorms SDK to make use of the Lego Cam
Language(s): NQC, a C-like language
Comment: This is the most widely used unofficial language
Language(s): Visual Basic, Visual C++, MindScript, LASM
Comment: You don't need VB to use the VB features as MS Office comes with a cut down version of VB for making macros
Language(s): A custom language which can be programmed directly on the RCX
Language(s): Forth
Language(s): A kind of Visual Basic/spirit.ocx-based language
Comment: Designed for robots which are in contact with the workstation at all times
Language(s): C
Comment: A library for use with GCC and comes with GCC for Windows.
Language(s): RCX Code, a custom flowchart-based language
Language(s): A flowchart language based on LabVIEW
Comment: This is the programming environment offered to schools who use MindStorms, supports the Lego Cam
Language(s): Squeak[7]
Language(s): Tcl
Language(s): LOGO
Language(s): Java
Language(s): occam
Language(s): RCX Code
Comment: The official programming language for use with the Lego Cam
Language(s): Lisp
Language(s): Prolog

URBI

Comment: Uses an NQC program to interpret commands send from the pc running the Prolog code
Language(s): PBrickDev, a flowchart based language.
Comment: Has more fuctionality than the RIS language, such as datalogs and subroutines/multithreading.

[edit] References

[edit] See also

[edit] External links

Official Mindstorms sites:

Various information resources and portals:

Programming languages and operating systems:

Third-party external devices

Tutorials:

The RCX's built-in H8/3292 microcontroller:

Mindstorms NXT Links: