**2.1.1 Control algorithm**

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.

#### **2.1.2 Data logging program**

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

Lego Based Computer Communication for Business and Learning 73

Information and Automation Technology will be part of the future careers of virtually all students in Mechanical Engineering, Faculty of Engineering & Technology (FET of the university of Botswana (Marumo., 2007). Traditionally students are exposed to a course in a higher order computer language, which is perceived by many students as unexciting and tedious. To introduce students to automation in a far more challenging and exciting manner, LEGO Mindstorms will be used in the following courses: measurement and instrumentation and mechatronic, robotics, process control and systems & control. The LEGO Mindstorms kits contain a programmable brick which essentially is a micro controller built in a plastic LEGO package with three connectors for actuators (motors) and three sensor inputs such as switches, optical analog sensors, angle encoders etc. The micro controller has an infrared serial link through which programs can be uploaded and executed. The brick also has buttons to start, stop, and select programs and to check the status of actuators and sensors in real time. The Mindstorms brick can be programmed in a variety of languages. LEGO supplies its proprietary pictorial ladder-style language, there is NQC (Not Quite C), which is a C-derivative, and advanced users can even use C/C++ that runs on a dedicated operating system called BrickOS. Robolab is a pictorial programming environment, where actuators, sensors and control structures are joined together has shown to be very suitable for students with no procedural language background. The reason for selecting this language was the widespread use of Lab View in industry and the basic philosophy behind it. Users select components and attach modifiers to change their properties. Components are

To introduce the concepts of Automation to undergraduate students in B Eng

**3. Lego MindStorm as teaching tool for mechatronics, measurement &** 

linked using a wiring tool very similar to building electrical circuits.

Exercise critical thinking and engineering design principles

 Experience the feeling of accomplishment by completing a group design The mechatronic design projects assigned in mechatronics course involve students' teams designing and developing mobile robotic platforms using Lego components. The activities will not only inspire students' creativity but also enhance their strength in engineering

The RCX programming software has two options or phases. These are Pilot and Inventor. Pilot is the introductory section of the ROBOLAB software. A "click and choose" interface is utilized within a template. There are four levels of Pilot and these serve as an introduction to

**3.1 Mechatronics, measurements & instrumentation courses** 

Develop communication skills among students

 Promote enthusiasm for studying engineering Develop skills of graphical programming Enforce precision automation concepts Promote creativity and engaged learning

The objectives of the LEGO Mindstorms projects are:

Degree programmes

design course

**3.2 Pilot programming**

**instrumentation courses**

in order for it to be used for analysis. Typical examples that students performed include step test (sudden increase in control valve position) and height of the liquid in the tank recorded by he data logging program of the Siemens programmable controllers (PLC). The program also allows for user control of a flow control valve so that, a change in valve position can be logged along with the resulting sensor reading. The data could be transferred to control station (Cooper, Doug, 2002) or a spreadsheet and a First Order Plus Dead Time model for the system can be obtained.

Another feature of this program is its calibration element. The user may enter a maximum and minimum calibration value to coincide with the raw value of 0 and 1023. Raw numbers are the values recorded by the RCX when receiving a signal from a sensor. The user can get the computer to output the actual raw values by altering calibration values in a range of 0 to 100% of a given attribute (i.e. full scale defection, span or reading) or the actual height of a liquid in a vessel.
