**1.7 Introduction to LEGO Mindstorms for schools & ROBOLAB overview**

ROBOLAB is a powerful programming language that can be used by students at all levels. It was developed by the partnership between Tufts University, LEGO Education and National

downloading programs) to allow off-board control. The description of the robot blocks

First Block Introduction the basics of MindStorms, such as the RCX, RCX code, motors

Second Block Introduction to the NQC (Not Quite C) and the RCX command center

Third Block Construction of robot that is capable of following a black line on a white

Sixth Block Introduction to the final project; the creation of a robot animal, an environment, and a non-Lego component of the robot

resource sets, a software program, and curriculum relevant activity packs.

intermediate, and advance programming techniques including data logging.

**1.7 Introduction to LEGO Mindstorms for schools & ROBOLAB overview** 

The RCX is capable of outputting a maximum of 700mA and 9V through each of its power outputs. This translates into 6.3 Watts, which is very small amount of power. Because of this limited supply, LEGO manufactured motors are the most efficient to use for the ROV because they are already rated for such a low power level. LEGO MINDSTORMS for school is a modular concept for teaching groups of children from pre-University level in a classroom or after-school club environment. It is made up of core construction and add-on

LEGO MindStorms education features an advanced 32-bit computer controlled NXT brick, interactive servo motors, sound, ultrasonic and other sensors, Bluetooth communication and multiple downloading capabilities. The icon-based LEGO MindStorm education NXT software is built on the Lab View software from National Instruments, an industry standard with applications in many engineering and research fields. The LEGO MINDSTORMS for school software, called ROBOLAB, is developed specifically for teachers or adults working with groups of children. The program is icon-based, which means that youngsters can visualize the instructions they are stringing together for their robot. It provides basic,

ROBOLAB is a powerful programming language that can be used by students at all levels. It was developed by the partnership between Tufts University, LEGO Education and National

Construction of a robot that uses a single touch sensor to avoid objects

Program first robot using the RCXCC and modification to use two touch

Introduction to the first major project, students must map the reflectivity

maybe as shown in Table 1.

and sensors.

(RCXCC)

Seventh Block Presentation of the results

Table 1. Description of robot blocks.

**1.5 The heart of Lego Mindstorm**

**1.6 The next technology now** 

sensors to go around obstacles

of the bottom of a prepared box

paper using RCXCC Fourth Block Introduction to the datalog on the RCX

Fifth Block Completion of remote sensing project

Instruments. The ROBOLAB software is based on Lab VIEW, the software that was used to control the Sojourner rover on Mars in 1997. In Lab VIEW, programs are called virtual instruments (VI). In the professional edition of Lab VIEW, the software uses a computer as a virtual instrument. The Lab VIEW program is then used to acquire and analyze data. ROBOLAB programs are saved as .vi files. There are different programming levels within ROBOLAB. The Pilot and Inventor sections of ROBOLAB are based on the Lab VIEW programming language. It is an icon-driven language based on a logical sequencing if images and is basically independent of written language.

The Pilot section of ROBOLAB is made up of a series of templates that have a format associated with them. It is an easy way to introduce the logical sequence to students. The user can not modify the templates and therefore the program will always work. The program will always run each time and do the commands as listed in the sequence presented. The Inventor section of ROBOLAB uses the same command icons as in Pilot. There are more command icons as the user moves into higher levels of the program. Inventor is less structured allowing for greater potential for the software. The Investigator section allows users to collect and analyze data and create projects. It includes all the features of the ROBOLAB Programmer. Project management features are built into ROBOLAB Investigator. They include all the components needed to investigate questions with the RCX inventions. This includes writing programs, uploading data, viewing data, computing with data and documentation of that data. This software runs on either PC or Mac. The PC version requires Windows 98. There are several new features in this version:

USB support Piano Player - updated musical support Extended help features Digital camera interface New RCX firmware Web support Auto wiring of icons Pilot - level capability for uploading a program from RCX to computer

The RCX Brick (Robotic Command Explorer)

As already mentioned, the heart of the system is the RCX, i.e. an autonomous LEGO microcomputer that can be programmed with either a PC or Mac computer. The RCX can be considered the "brain" of the system. It uses sensors to take input from its environment, to process data and to signal output motors and lamps to turn on and off. Students build their device using the RCX and the LEGO pieces in the building sets. They then create a program for their device using the ROBOLAB programming language. They then download their program to the RCX using the infrared transmitter. Their device can now interact with the environment, totally autonomous of the computer. There are 3 output ports - A, B, and C. These are connection points for LEGO motors, lights and other sensors. There are 3 input ports - 1, 2 and 3. These are connection points for sensors such as: touch sensor that turns the motors on and off when activated. Light sensor that allows RCX to differentiate between light and dark. Temperature sensor that distinguishes between varying degrees of temperature. Additional sensors are available for data logging.

The RCX brick has an infrared eye that allows the brick to communicate with the computer via the infrared transmitter (IR). It must be aimed towards the IR transmitter to function. Firmware is the RCX operating system level software. It must be downloaded to the RCX before the RCX can receive and execute a program from the computer. The firmware

Lego Based Computer Communication for Business and Learning 71

The MINDSTORMS® equipment is located in the Instrumentation and Control laboratory room 2069/2 of Mechanical engineering Department. This project reflects the results of a review of literature about engineering classes taught at other Universities and proposed courses for the University of Botswana, Faculty of Engineering & Technology in the Department of Mechanical Engineering. Many Universities have incorporated MindStorms into introductory engineering classes because of their ease of use, relative cost effectiveness and ability to give hands – on experience with engineering projects while encouraging

In manual operation, the RCX delivers a constant 9V to each of its power outputs, and the remote operated vehicle (ROV)'s motors are controlled by switching the current flow with Double Pole Double Throw (DPDT) rockers switches. When the rocker switch is in the neutral position, no current flows. When it is switched forward, the current flows and the motor turns forward. When the DPDT is switched backward, the poles are reversed, resulting in the current flowing backwards, making the motor to turn backwards. Additionally, in each motor's control circuit is a manual override Double Poles single Throw (DPST) switch to give RCX direct control of the motor. With this switch, autonomous control can be turned on and off for motor individually, so the operator has the option of the RCX is controlling one function while another function controlled manually. One application of this ability would be the (ROV) hovering. The RCX would monitor the pressure and adjust the vertical thrusters while the operator could still manually drive in the horizontal plane. The general control box design is a container for the RCX that is held with two hands on either side. The top has two horizontal motor control switch sets in reach of the thumbs in addition to the three switches. Each subroutine switch hooks directly into one of the sensor inputs and so when it is tripped it shorts out that input. In the ROBOLAB program a shorted input will return the maximum value of the sensor programmed to be hooked up to that input. When the maximum value is reached, the program can be triggered to do the task. This makes it possible for a manual switch to run a subroutine. The front of the box has the connection to the tether as a well as the vertical motor control switch set which is in reach of

the index fingers. Additionally, the box has an AC adaptor input on its left side.

As mentioned earlier, the LEGO RCX brick provides the computer interface. Control systems were constructed using ROBOLAB investigator software which is an adaptation of the National Instrument's LabVIEW software. The sensor is read and its raw reading is converted to 0 to 100% range. This signal is sent to a discrete (Proportional Integral Derivative) PID velocity algorithm (Riggs, James B, 2001), which outputs a change in valve position. The signal from the controller can be positive or negative depending on which way the motor should go. The programs integrate both LabVIEW and ROBOLAB languages.

This program's function is to collect data from a sensor connected to the RCX and to display that data in real time. Once the data collection is completed, the user may save it to a text file

**2. Research procedures**

creative processes.

**2.1 Control paradigm**

**2.1.1 Control algorithm**

**2.1.2 Data logging program**

remains in the RCX memory until the batteries are removed. If batteries are changed quickly, this will not affect the memory. An external power supply can also be used to save on batteries.

Fig. 1. LECO MindStorm.

The Lego MindStorms can yell & spin, catch & run, record & play.

What it comes down to is that, with the combination of the mechanical flexibility of the Legos and the connectivity and ease of programming of the brick, students are no longer limited by execution and even those without masters in mechatronics can take crazy ideas and make them into a reality. These applications can all be downloaded from the MINDSTORMS website, and they represent just a small sampling of the crazy inventions that these Lego users are devising when they are limited only by their imagination.
