Mindstorms NXT mindstorms.lego.com
A3B99RO Robots: course organization At the beginning of the semester the students are divided into small teams (2 to 3 students). Each team uses the basic set of the LEGO Mindstorms Education 9797, the set of the technical parts 9648 or 9695 (additional passive components), the network adapter 9833 (see Fig. 1) and gyroskopic senzor. The teams design and complete the mobile robot with implemented control and program it to fulfill the specified and well-revisable tasks. Eventually, the teams prepare for the final competition with their robots directly fighting the opponents in activities attractive for broad audience. Figure 1 Basic set of LEGO Mindstorms Education 9797, set of technical parts 9648 and the network adapter 9833
An essential element of the set LEGO Mindstorms Education 9797 and at the same time the brain of the robot is the central control unit known as LEGO NXT Intelligent Brick (see Figure 2) with a matrix display 100 x 64 pixels, 4 input ports for connection of the sensors, 3 output ports for connection of the motors, a speaker with 8kHz sampling frequency, having a possibility of Bluetooth wireless communications or an ability connecting to a USB 2.0 port. The intelligent brick and connected devices can be tested and partly controlled with the help of 4 buttons. Up to 3 servomotors can be connected to the LEGO NXT Intelligent brick which can be used as sensors for rotational speed measurement as well. The touch sensor, the light sensor (giving the robot an ability to see by measuring the intensity of the light and even recognizing different colors), the sound sensor or ultrasonic sensors (enabling the robot an orientation in the space, to find obstacles and to determine the distance from them) can be connected as well. Figure 2 Intelligent LEGO NXT brick and connected sensors
Intelligent LEGO NXT brick Matrix display 100 x 64 pixels USB 2.0 port Bluetooth wireless communications 4 input ports for connection of the sensors (1, 2, 3, 4) 3 output ports for connection of the motors (A, B, C) Loudspeaker with 8kHz sampling frequency
NXT Brick Features 64K RAM, 256K Flash 32-bit ARM7 microcontroller 100 x 64 pixel LCD graphical display Sound channel with 8-bit resolution Bluetooth radio Stores multiple programs Programs selectable using buttons
Ideas youtube.com...
4 sensor inputs 3 motor outputs Programmable Brick
Purchasing NXT Kits Two options (same price; $250/kit) Standard commercial kit Lego Education kit http://www.lego.com/eng/education/mindstorms/ Advantages of education kit Includes rechargeable battery ($50 value) Plastic box superior to cardboard Extra touch sensor (2 total) Standard commercial kit Includes NXT-G visual language
Interactive servomotor may be used also as speedometer
Touch sensor robot get touch
Ultrasonic sensor enabling the robot an orientation in the space, to find obstacles and to determine the distance from them
Light sensor giving the robot an ability to see by measuring the intensity of the light and even recognizing different colors
Acoustic sensor robot may to hear
NXT Non-standard sensors: HiTechnic.com Compass, Accellerometer, Gyroscope, Color, IRSeeker, 18
Programming languages NXT-G, NXC lejos NXJ
LEGO Digital Designer ldd.lego.com 20
LEGO Digital Designer http://ldd.lego.com/
Programming LEGO robots: 1. NXT-G The programming language was named according to the programming language used by the LabVIEW program, developed by National Instruments, which is called only G. Abbreviation G comes from the fact that the programming language is graphical. Programs written in the NXT-G are thus built up of graphic blocks, with set up properties and subsequence, connected together. NXT-G is a joined product of LEGO and National Instruments and it is the basic programming tool for the LEGO MINDSTORMS NXT. The emphasis of the NXT-G is put on intuitiveness and simplicity of development environment including the programming process so that it can be used by primary school pupils with little experience in programming.
2. NXC This text language derived from C language runs in the BricxCC on the standard firmware LEGO Mindstorms. It is very comfortable for those who want to program in both the NXT-G and the NXC because they do not need to upload new firmware after each change in programming environment. Working with the language abbreviating the phrase Not Exactly C is very comfortable and a programmer understanding at least the basics in C language becomes quickly familiar with the environment due to the almost identical semantics. Another advantage is that it is a freeware application. A disadvantage consists in complicated debugging of the programs. Unlike the NXT-G it is a purely textual programming without any graphics.
3. LeJOS-NXJ - The programming language distributed by Sourceforge is free and is available for Windows, Linux and MAC OS. Due to widespread expansion and knowledge of Java many users chose the LEGO MINDSTORMS LeJOS NXJ with its extensive libraries, which support interesting functions of the robot. The disadvantage is the necessity to change the firmware NXT which includes Java Virtual Machine replacing the standard LEGO firmware. LEGO firmware may be loaded into the NXT brick back using the LEGO software. It depends on the students if they use one of recommended programming languages or use other ones (e.g. MATLAB toolbox developed at the University of Aachen (a product for users accustomed to programming in Matlab), RobotC (programming language based on C programming language), LeJOS OSEK (programming in ANSI C / C + +), or another one).
The tasks solved in the academic year 2009/10 In the academic year 2009/10 the students solved two tasks: A) Follow the line the aim was to build and program a robot that would independently, without any further assistance (e.g. control using voice, Bluetooth or other communication channels), pass along the black line marked on the mat as quickly as possible and stop at its end. The students do not know the path in advance, they know only the basic parameters of the runway and the total length of the line that is approximately 10 m. The line may be arbitrarily extended not crossing itself with a minimum curve radius 20 cm.
B) Labyrinth the aim of the second task was to build and program a robot that would pass through the maze from its beginning to its end as quickly as possible The minimum distance between any two maze walls was about 40 cm. All maze walls were straight-line, 28 cm high, absent from any unforeseen bends and perpendicular to the bottom, i.e. there were no inclined walls. The total size of the maze was 330 x 160 cm
The tasks solved in the academic year 2010/11 In the academic year 2010/11 the students solved two different tasks: A) Avoiding objects while following the line the aim was to build and program a robot that would pass along the black line marked on the paper board from the starting area to the finishing area as quickly as possible and stop at its end while avoiding obstacles (even touching them) placed anywhere on the line (see Fig. 8). The students again do not know the path in advance, they know only the basic parameters of the runway and the total length of the line that is between 1 and 10 m. The line may be arbitrarily extended not crossing itself with a minimum curve radius 20 cm.
B) Sumo the aim was to build and program a robot that would take part in the robotic wrestling tournament. A couple of opponents is competing on a circle playground (see Fig. 9). The task of the robot is to push the opponent out of the playground without leaving it itself. As soon as one opponent touches by any part of his body any place out of the playground he looses. A robot also looses if any of his parts falls down and is subsequently pushed out or the part touches the area outside the playground. The ground plan of the robot should fit in a square with the edge 25 cm, his height is not limited. After starting the match the robot may arbitrarily change his size and shape and turn over. The maximum weight of the robot is 1,5 kg. The playground is a circle laminated plate 1 m in diameter and the height of 18 mm that is circumscribed by a black line 2 cm wide. The rest of the circle is white. The spots for initial placement of the robot before starting the match are marked. Before starting the match the opponents are placed on the playground oriented with their backs each to another, each in the distance 10 cm from the middle of the playground. After a tworound competition in the groups of 6 teams competing each to the other best eleven teams advanced to the final contest.
The tasks solved in the academic year 2011/12 Project 1 - Following line with intersection The aim of the task is to build and program a robot that will independently, without any further assistance (control using voice, Bluetooth or other communication channels is not allowed), pass two laps along a marked track without crashing into the second competing robot..
Project 2 Balancing with the ball The goal of the task is to make and program the robot with a platform to independently, without any further assistance (e.g. control using voice, Bluetooth or other communication channels) transport the ball placed on the platform as quickly as possible there and back on a non-straight path. The ball must neither fall down from the platform nor touch any other part of the robot.
The tasks solved in the academic year 2012/13 Project 1 Following line with intersection The aim of the task is to build and program a robot that will independently, without any further assistance (control using voice, Bluetooth or other communication channels is not allowed), pass two laps along a marked track without crashing into the second competing robot.
Project 2 Mobile bridge The aim of the task is to build and program a robot that will independently, without any further assistance (control using voice, Bluetooth or other communication channels is not allowed), driving in a straight line, found the "river bed" (hole-trench across the width of the track) through which puts mobile bridge crosses over it the other way, mobile pouches and a bridge in the shortest time with him reached the target.
Introduction to NXTG Programming Please go through Getting Started and Software Overview
First NXT program: Go forward for 2 sec. and stop Let s name the program first Click on Go >> button You ll see a programming palette (canvas)
First NXT program using SB1: Go forward for 2 sec. and stop (2/3) Click on Move button Drag and drop the move block to the canvas
First NXT program using SB2: Go forward for 2 sec. and stop (3/3) Change parameters for the Move Port Direction Steering Power Duration Next Action Block Configuration Panel
How to run your first program (1/2)
How to run your 1 st program (2/2) If Found New Hardware pops up, just follow the instruction Click on Download button Recommended to un-plug the cable from the Bot Press the orange button 4 times (Turn on, My files, Software files, Run your program entitled go2stop)
How to rerun the program Check the program name on the LCD Press the orange button just once again
How to stop the program Gray button
First NXT Program: Go forward for 2 sec. and stop (Review)
Do not forget: Save your programs Meaningful file (program) names Use comments
2 nd Program: ForwardBack 1. Go Forward 2 rotations 2. Wait 3 seconds, then 3. Backward 1 rotation
Go Forward 2 rotations, Wait 3 seconds then Backward 1 rotation ForwardBack
Making Turns (Instructor Slide) Objective Challenge the students to think about how a turn is made Two ways to turn using one motor (demonstrate by turning with your leg) Demonstrate advantage of turning by spinning Turn left stop Left wheel Right wheel Spin left Face left Left wheel Left wheel Right wheel stop Right wheel
Making Turns Turn left stop Left wheel Right wheel Spin left Left wheel Right wheel Face left stop Left wheel Right wheel
Turn90Left Using a Motor Block! Forward 2 rotations, Turn Left 90 Degrees, and Forward 2 rotations
Forward 2 rotations, Turn Left 90 Degrees, and Forward 2 rotations Turn90Left
How do we make to turn 90 Timer? Trial errors Let s do the math!!! degrees? Width of the robot: 14 cm Diameter of the wheel: 5.5 cm Perimeter of the wheel: 5.5 cm x pi = 17.27 Travel distance needed: (14 x 2 x pi) / 4 = 21.98 cm 14 cm Number of rotations needed? 21.98 / 17.27 = 1.2727
Start-Light Locate the robot in the middle of the ring Wait until the light sensor detects very bright (lantern) light Then start the robot to go forward Stop after a second
Start-Light