Real-Time Control Teaching Using LEGO® MINDSTORMS® NXT Robot

Real-Time Control Teaching Using LEGO® MINDSTORMS® NXT Robot

Proceedings of the International Multiconference on ISBN 978-83-60810-14-9 Computer Science and Information Technology, pp. 625 – 628 ISSN 1896-7094 Real-time Control Teaching Using LEGO® MINDSTORMS® NXT Robot Wojciech Grega, Adam Piłat AGH University of Science and Technology, AGH University of Science and Technology, Department of Automatics, 30-059 Krakow, Poland, Department of Automatics, 30-059 Krakow, Poland, Email: [email protected] Email: [email protected] During the research phase of the ILERT we did an inten- Abstract—A current trend in learning programs, even at sive literature study demonstrating, that several technical high-degree studies, is applying the concepts of “learning by universities have practically implemented robotic design and projects”. In this context, the LEGO® MINDSTORMS® NXT control experiments with the LEGO MINDSTORMS kits modular robot appears as a simple, flexible and attractive educational platform to achieve the referred challenge in many [4], [5]. The LEGO kits give the students a rich and flexible domains of information technologies, especially in real-time material, which they can use in their design of their robotics control. The project team can operate with the real system (e.g. projects. The LEGO ability to link directly with Simulink® constructed robot) to realize a number of particular tasks. The and access the MATLAB® toolboxes has classified this ro- ready-to-use embedded platform and dual microcontrollers bot kits as an “open” laboratory. The LEGO MIND- architecture represents actual trends in the modern control STORMS NXT design is based on the advanced 32-bit systems designs. The open hardware and software architecture gives unlimited possibility to handle all devices connected to the ARM7 microcontroller, which can be programmed with the main control brick and write effective control algorithms. LabView based block-oriented language. However, many The proposed rescue robot project is a good example of the other programming tools and languages applicable for real- simple system where, a number of real-time control problems time LEGO robot control experiments are available in the In- can be analyzed. The project on this scale requires detailed ternet. The published hardware [9] and software [10] docu- planning, cooperation in teams, extensive literature survey, and mentation makes the LEGO® MINDSTORMS® NXT sys- comprehensive software design. That is exactly, what we need tem open for any kind of modifications and new applica- for “learning by projects” concept. tions. Several authors are replacing the operating system of the MINDSTORMS microcontroller with a real-time operat- I. INTRODUCTION ing system suitable for C/C++ or similar applications. Most current trend in learning curricula, especially at engi- popular is NXC language [17], which supports all of the Aneering studies, is applying the concepts of “learning commands provided by the ARM7 microcontroller. This up- by experiments” or “learning by projects” [1]. The method grade might be advantageous for some real-time control ap- gives the students the opportunity to get familiar with some plications. The “upgraded” LEGO MINDSTORMS experi- practical problems that faces project development teams and ment can teach students the importance of real-time comput- organizations in real situations. It was found, that learning ing, periodic tasks development, timers and tradeoffs involv- achievements resulting from the application of a collabora- ing embedded processor size and cost versus performance tive work methodology based on the “learning by projects” relations within the context of control systems. are much higher [2]. This concept was also proposed for ILERT (International II. TEACHING REQUIREMENTS Learning Environment for Real-Time Software Intensive Control System) EU/US project [3]. This study leads to es- From educational point of view, if control aspects are the tablishing a methodology for a multinational, engineering key element of the curricula, student are expected to design program, producing graduates capable of working efficiently control algorithms based on the mathematical model, simu- in multidisciplinary teams engaged in international collabo- late how the controlled system works and then implement the ration on industrial projects. One important output the pro- controller for the robot during the limited time of a regular posed study is creation of an interdisciplinary specialization academic course. In this case integration of real-time envi- in Real-Time Software-Intensive Control (RSIC). As a part ronment with rapid prototyping platforms such as MATLAB/ of the pilot implementation phase of ILERT project selected Simulink or LabView is essential. courses were introduced as a RSIC curriculum units, ac- If other topics of real-time control system must be cov- ceptable for engineering programs in four partner organiza- ered, for example, task scheduling, resource management, tions. real-time communication or fault-tolerance then text based or object oriented languages are preferable. This work was supported by the AGH research grant 978-83-60810-14-9/08/$25.00 © 2008 IEEE 625 626 PROCEEDINGS OF THE IMCSIT. VOLUME 3, 2008 It is also important to demonstrate to the students how to agement and Bluetooth communication features implementa- fulfill the needs for embedded systems, e.g. how to minimize tion. the application memory requirements. It will be also valu- Using text language the programming skills of students to- able, if the real-time system monitoring tools provide on-line gether with their understanding of data precision, time de- facilities for measuring execution times. pendencies and I/O devices access methods to can be im- Working with communication algorithms the LEGO proved. MINDSTORMS built-in Bluetooth media or IEEE 802.11 The leJOS is a Java-based replacement firmware for the extension can be explored. The communication tasks can be LEGO MINDSTORMS RCX microcontroller [14]. The focused on information interchange between two or more ro- leJOS environment is based on object oriented language bots and host PC. The PC can support a higher level control (Java) and has the following features: preemptive threads algorithms or just to be used for monitoring and data acquisi- (tasks), arrays including multi-dimensional, recursion, syn- tion purposes. chronization, exceptions. Java variable types includes Float, Long, and String. III. REAL-TIME OPERATING SYSTEMS FOR LEGO® The nxtOSEK [13] (previous name – up to June 2008 was MINDSTORMS® NXT leJOS OSEK) is a hybrid of existing two open source The NXT-G standard graphical programming environment projects (leJOS NXJ and TOPPERS OSEK): for LMNXT is useful only for very beginning experiments - leJOS NXJ is a API device for NXT sensors, motors, with robots. Its limited performance does not allow to create and other external devices [14], and diagnose in real-time the specific algorithms. To im- - TOPPERS OSEK provides real-time multitasking fea- prove the performance of robot control a number of software tures proven in automotive industry [16]. OSEK was origi- tools were developed and are available [8]. The program- nally designed for embedded real-time control systems which ming environments available for the LEGO® MIND- are used in real cars [15]. STORMS NXT robot and representing real-time features are The nxtOSEK is focused on real-time control applications listed in Table 1. Two most popular solutions for academia for LEGO MINDSTORMS RCX, thus user-friendly GUI/file and teaching purposes are: LEGO MINDSTORMS Toolkit system was out of target. Additionally, one can use a graphi- for LabView and Embedded Coder Robot NXT - based on cal modeling, simulation, and code generation environment the graphical environment. Both of them need the licensed which is called Embedded Coder Robot NXT - specific software and a number of toolboxes installed. The LabView MATLAB/Simulink Toolbox. can operate with a standard LEGO firmware while MAT- A unique feature of nxtOSEK application is that users do LAB requires the replacement by the leJOS system. not need to apply time wait API, which is frequently used by Text programming solutions are represented by NXC and other NXT programming languages to execute control algo- leJOS – both of them are free and open source solutions. The rithm at desired timing. The nxtOSEK provides accurate pre- NXC (Not Exactly C) is a text language for MIND- emptive and periodical/event driven task scheduling. STORMS® NXT robot microcontroller programming with An interesting programming interface, based on multitasking features, based on standard LEGO firmware [6]. client/server architecture , is URBI (Universal Real-time With free programming environment IDE [17] it is possi- Behavior Interface) [7]. This scripting language can be inter- ble to create complex and advanced data acquisition and faced with several popular programming languages (C++, control algorithms operating in real-time, including file man- Java, MATLAB,...) and OS (Windows, Mac OSX, Linux). TABLE I. SELECTED PROGRAMMING TOOLS FOR LEGO MINDSTORMS NXT LabVIEW Matlab/ NXC RobotC leJOS nxtOSE URBI Toolkit Simulink NXJ K Programming Graph Graph Text Text Text Text Text Syntax NI blocks Simulink blocks, Like C C Java C/C++ Like C/C++ C Firmware Standard Repl. Standard Repl. Repl. Repl. Standard License LabView Matlab/Simulink Freeware Yes Open Open Open source source source Events No Yes No Yes Java Yes Yes events (OSEK RTOS) Multithreading Yes Yes Yes Yes Yes Yes Yes Bluetooth Yes Yes Yes Yes Yes Yes n.a. communication: Brick to PC BluetoothBrick Yes Yes Yes Yes Yes Not yet n.a. to Brick Floating point No No No Yes Yes Yes Yes WOJCIECH GREGA ET. AL.: REAL-TIME CONTROL TEACHING USING LEGO® MINDSTORMS® NXT ROBOT 627 The URBI language uses an C++ like syntax. It allows to ob- tain parallel execution of commands, event programming, command tagging, dynamic variables. With the event feature a user can react on sensor inputs or create individual events and emit them ones or periodically. IV. EXAMPLE: NXC – BASED SYSTEM FOR ROBOT DC MOTOR CONTROL The demo LEGO MINDSTORMS NXT robot has been developed for RSIC teaching purposes.

View Full Text

Details

  • File Type
    pdf
  • Upload Time
    -
  • Content Languages
    English
  • Upload User
    Anonymous/Not logged-in
  • File Pages
    4 Page
  • File Size
    -

Download

Channel Download Status
Express Download Enable

Copyright

We respect the copyrights and intellectual property rights of all users. All uploaded documents are either original works of the uploader or authorized works of the rightful owners.

  • Not to be reproduced or distributed without explicit permission.
  • Not used for commercial purposes outside of approved use cases.
  • Not used to infringe on the rights of the original creators.
  • If you believe any content infringes your copyright, please contact us immediately.

Support

For help with questions, suggestions, or problems, please contact us