Tuesday, July 26, 2005



Introdutction To Lego Mindstorms


The LEGO MINDSTORMS RIS KIT

The LEGO MINDSTORMS system is a complete series of products for the development of robots and automation applications in general. The central set of the LEGO robotics line is the RIS, a set of tools that offers us computing power, great ease of use, and versatility. With this kit, one can design a personal robot, build it using ready-to-use pieces, and program it with a specific programming language, and finally test it to see if it matches our expectations—and most important, to rebuild and reprogram it as per our wish. The brain of the system is the RCX microcomputer, initially developed in collaboration with the Massachusetts Institute of Technology (MIT) Media Lab; the kit also contains many other fundamental pieces, including input and output devices (sensors and motors). From this very powerful combination one can make countless completely independent. Robots provide a great way to enhance creativity and imagination and provide hours of great fun & development.



Robot Kit Components

If we were to open a brand new RIS 2.0 box and analyze the contents of the kit in detail, we would find more than 700 pieces, most of which are standard TECHNIC parts, such as Beams, Plates, Gears, Axles, Pulleys, Wheels, Cables and Connectors. Robotics development and represent the heart of the system. They are:
I. The RCX Programmable Microcomputer, Version 2.0
II. 2 Motors (9V)
III. 2 touch sensors
IV. 1 light sensor
V. A USB infrared (IR) transmitter tower
VI. A fiber-optic cable
VII. A printed Constructopedia Manual
VIII. Software on CD-ROM

The RCX can be thought of as the kernel of the entire set. It can read external events through sensors and control movements through motors; and it can be easily programmed with the RCX Code, which is a specific programming language provided on the software CD. The kit contains both Input devices; active (light) and passive (touch) sensors, and output devices (the two motors). These components are fundamental to robotics, as they provide a way for them to interact with the world.

Touch and light sensors can give us robot information on its movements, positioning, and general behavior. Motors are the starting point for every movement and activity; they can control gears, wheels, axles and other moving parts. The black and gray tower find in the set is the component through which LEGO robots communicate with the PC. It is in fact an infrared (IR) transmitter that sends code and information from the computer to the programmable unit. Also, the fiber-optic cable has a very specific function: if connected to the IR tower it allows us to program the Micro Scout (the smallest member of the MINDSTORMS family) through a communication protocol called Visible Light Link (VLL).






Figure 1.1 RCX







RCX: The Robot’s Brain

The Robotics Command Explorer (RCX) is the brain of any MINDSTORMS robot. It is often called the “Programmable Brick” or “Smart Brick” because it resembles a standard LEGO piece in many of its characteristics, though a great power hides within it. The RCX is actually a small computer based on the Hitachi H8 Series Microprocessor and fully equipped with memory, timers and input and output devices. When a user writes program on his personal computer, the program is download it to the RCX via infrared tower and executed on the RCX, the result is a completely self-sufficient entity that can behave autonomously, which is the difference between a true “Intelligent” robot and an automated machine.

It is a Hitachi H8/300-based microcomputer system that features:
I. 32 Kilobytes of onboard memory.
II. Three 12-volt output ports for controlling electric drive motors.
III. Three input ports for reading a variety of digital sensors (touch, rotation, light, and temperature).
IV. An infrared port for communication with personal computers and other RCXs.

Figure 1.1 & 1.2 shows the RCX & various component connections with the RCX.




Figure1.2 RCX Connections

The Logical Structure
Imagine a structure made of multiple layers (see Figure 1.3). At the very bottom there is the processor, which is a Hitachi H8300 series. This processor executes the machine code instructions. Additional components have the task of converting input signals from the three sensor ports into digital data. The next layer in the system is the ROM code. A new RCX comes with a set of instructions that provides all the basic functionalities to the unit, like port control, display and IR communications. If you’re familiar with its architecture, you can compare the ROM to the BIOS of a personal computer that boots and communicates with its peripherals.


Figure 1.3 Logical Structures

Just above the ROM code in the schematic structure is the firmware. This is a sort of operating system for our RCX unit, providing functionality to the entire system. The word “firmware” identifies a particular kind of software that is usually not alterable by the final user, though in this case there’s an important exception, as we will see. The firmware’s duty is to interpret the byte code and convert it into machine code instructions, calling the ROM code routines to perform standard system operations. It is stored in the RAM, meaning that it is downloaded at your first installation of the MINDSTORMS system; yet it needs to be downloaded again through the IR tower every time user power down the RCX for more than a few seconds, namely by removing the batteries.
On top of the firmware there is user code and the stored data. The software on the PC converts the RCX Code into a format that is more compact and readable by the RCX processor (that is, bytecode). The RAM is logically divided into different sections: 16 Kb for the firmware, 6 Kb for storing user grams, and the rest used for interpreting the byte code and handling data for the program’s execution. Even if they are all in the same physical area, following o layer-based logical structure, we can consider the programs to be in a higher
Note that when turning the RCX off, the RAM remains connected the power supply so that it can retain its contents (both the firmware and the program data), so it will slowly consume the batteries even when switched To avoid this, user can remove the batteries if he plans not to use the unit for a long time, but remember that he will have to redownload the firmware (and a program you had already stored in RAM) before attempting to use it again.

Summarization of the process in a top-to- bottom scheme:
Using RCX Code (or other software), user writes a program on a PC
User program’s instructions are transformed into low-level instructions (byte codes)
User downloads the program (in byte code form) to the RCX’s RAM using the IR transmitter tower
The firmware interprets the byte code and converts it into machine code instructions using ROM routines
The processor executes the machine code





0 Comments:

Post a Comment

<< Home