Idol robot tasks and solutions. Educational portal

The teacher’s task is to walk this path with the student, not insuring against failure, but preventing disappointment due to possible difficulties. It is very important to organize classes so that children themselves discover new things through activities that are meaningful to them.
How does a robot help study computer science? I will indicate only a few computer science topics on which robotics is based.
Topic "Files and file system".
The student had at his disposal a LEGO®NXT microcomputer from the LEGO Mindstorms NXT Education educational set. Control it file system is happening standard commands, but since the memory capacity is not large, control of what is needed and what is not required must be carried out constantly. In order to voice the robot’s actions, display a picture, or add to the library of working programs, you need to operate with basic computer science concepts: file, file type, file path, menu, folder.
Topic: “Information processes”, “Information coding”.
The robotic kit is equipped with sensors that record audio, tactile and video information. Once digitized, the information can be displayed on a display screen. A special function of the microcomputer makes it possible to experiment with sensors and motors using ready-to-run programs. After conducting a series of experiments with sensors, an understanding emerges: why an ultrasonic distance sensor works slower than infrared sensor illumination, how sound turns into digital code, and so on. The study of information processes and principles of information coding provides a deeper understanding of the essence of information technology.

Theme: Communication Technologies.
The LEGO®NXT microcomputer supports technology wireless communication. Using the Bluetooth function, you can set wireless connection between the NXT microcomputer and other devices that have Bluetooth device, for example, with other NXT, with mobile phones or with computers. By establishing a Bluetooth connection, it is possible to: download programs from a computer remotely; send programs from other devices (not from a computer), including from NXT; send programs to both individual NXTs and their groups. This technology makes it possible to control the robot using a mobile phone.

Topics “Algorithms. Algorithm Executor”, “Programming Environment”.
For initial acquaintance with the robot, you can directly program the NXT unit without accessing a computer. Directly on the display screen, using a template of five commands, you can create a simple program and loop it. However, it is impossible to do without knowledge of basic algorithmic structures and mastering the programming environment. It is the ability to program the robot that makes it a universal performer, capable of solving a variety of problems. You should start mastering programming technology with visual media programming, then moving on to more powerful and modern event-driven environments.
Thus, robotics will require basic knowledge of computer science, and the student’s inexhaustible desire to make his robot “the best” pushes him to master new knowledge.
Why can a robot be called an ideal teaching tool? Because this tool makes it possible to create a learning environment that will make use of the child’s natural desires to play, create, and communicate with peers. So, we can highlight the advantages of robotics as a teaching tool:
. Knowledge acquisition occurs during the game.
. Building a robot offers creative freedom.
. Most students have a desire to improve their work.

As an example, I would like to cite the model of a “Robot delivering free treats”, created by a 6th grade student as part of the “Robot Programming” course during extracurricular activities. The robot is assembled from the LEGO MINDSTORMS NXT Education 9797 set according to the standard Alpharex 1.0 model, and is complemented by a color sensor to indicate the robot's status and a tray for treats.
The goal of the work is to implement a human gait model as far as possible with the available resources. The movement of each leg is controlled by a motor and a mechanical assembly of gears and levers. One lever moves the leg up and down, the other moves it forward. In this case, the body deflects towards the supporting leg, due to which the robot maintains balance. This gait is called "shuffling"
A separate motor controls the distance sensor and the lever arms that hold the touch sensor and color sensor. The treat tray is fixed.
The robot is programmed to act as a delivery person, for example, free treats, to the following algorithm behavior. The robot accompanies its movement with a direct phrase: “I am the Alpharex robot, I offer a free treat!” A person who wants to make contact with the robot can stop it with a gesture. After stopping, the robot says the phrase: “Help yourself and press the button!” Having taken the candy, the person must press the button once as a sign of gratitude. Three seconds after stopping, the robot will continue moving. When the treats run out (the robot is programmed to have a specific number of candies on the tray), the robot will say goodbye, the red indicator will light up, and the robot will stop.

The program for controlling the robot is written in the NXT Programming 2.0 environment.




Executor Robot Command system for performer Robot Move commands: up, down, left, right The robot moves one cell up, down, left, right. The paint command paints the cell in which the Robot is standing. Checking the truth of the condition: free at the top, free at the bottom, free at the left, free at the right The Robot checks the truth of the condition that there is no wall at the cell where the Robot is located. You can use the notation of compound conditions formed by the logical operations AND, OR, NOT.




Performer Robot Direct editing of the environment All commands for editing the environment are performed using the mouse: place/remove a wall - click on the border between cells, paint/clear a cell - click on the cell, move the Robot - drag the mouse to the desired cell.


Executor Robot Menu commands Robot Show Robot field Makes the Robot observation window visible. Print Setting Creates a file in PDF format, depicting the current situation in color or black and white. Save environment to file Creates text file with a description of the situation in the internal *.fil format. This file can later be loaded as a starting environment (Change starting environment command) or when editing the starting environment (Open start environment editing window command). Change as starting environment Sets a new starting environment file name (using the standard dialog) and loads a new starting environment. Return to Starting Environment Makes the starting environment current.


Performer Robot Image of the current situation in the observation window The image of the current environment is always completely placed in the working field of the Robot observation window. The background of the working field is green. Filled cells are gray. There are thin black lines between the cells. Walls are shown as thick yellow lines. In the cell of the working field of the observation window, the Robot is depicted as a diamond.


Performer Robot Example 1. Let’s create an algorithm called “Knight’s move” so that the Robot can get from point A to point B (Fig. 3). The algorithm looks like (Fig. 4.). After its execution, the Robot will move to the desired point (Fig. 5). An algorithm written in the performer's language is called a program. Fig.3Fig.4 Fig.5











Performer The robot exists in a rectangular field, divided into cells, between which there can be walls and fits entirely in one cell. The robot can move around the field, paint cells, measure temperature and radiation. The robot cannot walk through walls, but it can check to see if there is a wall next to it.

The “Robot” performer’s command system includes:

  • 5 commands that trigger the Robot's actions (left, right, up, down, paint)
  • 10 condition checking commands:
  • 8 commands of the form [left/right/bottom/top] [wall/free]
  • 2 commands of the cell type [filled/blank]
  • 2 measurement commands (temperature, radiation)

Action commands

Check commands

Team Description
log on the left is free Returns yes if the robot can move to the left, otherwise no.
log on the right is free Returns yes if the robot can move to the right, otherwise no.
log from above free Returns yes if the robot can move up, otherwise no.
log below free Returns yes if the robot can move down, otherwise no.
log left wall Returns yes if there is a wall to the left of the robot, otherwise no.
log right wall Returns yes if there is a wall to the right of the robot, otherwise no.
log on top wall Returns yes if there is a wall above the robot, otherwise no.
log below wall Returns yes if there is a wall below the robot, otherwise no.
log cell is filled in Returns yes if the cell is filled, and no if the cell is not filled.
log cell clean Returns no if the cell is filled, and yes if the cell is not filled.

Measurement commands

Let it be necessary to transfer from the cell to the left of the wall to the cell to the right of the wall:

The algorithm might look like this:

use Robot
alg example 1
beginning
. down
. right
. up
con

If you try to guide the Robot through the wall, a failure will occur. The robot will crash into the wall and will no longer be able to follow commands.


Let's write an algorithm for a robot passing a maze from point A to B:

use Robot
Alg from A to B
beginning
. right

. up ; up ; right ; down ; down ; right
. up ; up ; right ; down ; down ; right
con

The commands for passing each section can be grouped into one line - this shortens the recording of the algorithm and makes it more understandable. In order to write commands on one line, they must be separated by a semicolon.

Introduction to the Idol program and mastering the basics of programming.

In it, students can gain practical skills in creating and debugging an algorithm, working with such performers as Robot, Draftsman, Aquarius, Grasshopper, Turtle.

When studying one of the most difficult sections of computer science, “algorithmization and programming.”

Purpose of development :

Download:


Preview:

Methodological development in computer science.

Topic: “Robot performer in the KuMir program in computer science lessons”

technology teacher "Informatics and ICT"

Explanatory note

Development goal: study programming possibilities using the example of a specific Robot performer using the KUMIR environment; provide practical skills in working with a performer.

Methodological developmentcompiled for computer science lessonsPractice on the computer: work with educational algorithm executor; drawing up linear, branching and cyclic algorithms for executor control; drawing up algorithms with a complex structure; use of auxiliary algorithms (procedures, subroutines).

Students should know:

  • what is a performer; SKI Robot, environment of the Robot performer;
  • what is an algorithm;what are the main properties of the algorithm;
  • ways of writing algorithms: flowcharts, educational algorithmic language;basic algorithmic structures: following, branching, loop; structures
  • algorithms; ⇒ assignment of auxiliary algorithms; technologies for constructing complex algorithms:

Students should be able to:

  • understand descriptions of algorithms in educational algorithmic language;
  • perform an algorithm trace for a known performer;
  • create linear, branching and cyclic control algorithms for the Robot performer; highlight subtasks; define and use auxiliary algorithms.

Lesson 1 (2 hours) Lesson 1.

Performer Robot.Executor command system.

Lesson plan.

  1. Description of the performer's SKI, the performer's environment.

2. Analysis of typical Robot algorithms.

During the classes.

Let's look at the artist's description.

Artist environment: Performer The robot can navigate through a labyrinth drawn on a plane divided into cells.

SKI Robot : simple commands: up, down, left, right, paint.

Logical commands: (condition checks)

top free bottom free

left free right free.

Logical connectives: AND, NOT, OR:

Example: (Not left free) or (Not right free)

Branch command: loop command:

If the condition then no condition yet

A series of commands a series of commands

that's all kts

(In the 2009 CMMs, the Robot’s commands were different from those familiar to children, which led to confusion :)

Branch command: loop command:

If the condition then nts for now the condition to do

A series of commands a series of commands

end end

General view of the Idol program window. Graphical environment of the Robot:

In KIMs demo version 2010 team format changed to habitual

The procedure for creating an algorithm:

1.Teams Tools -Edit starting environmentdraw walls on the Robot field and set the Robot to its initial position.

2.Teams Robot - Change starting environmentmaintain the new environment.

3.Teams Insert - Use Robotindicate the artist.

4.In the document window, write down the algorithm using the menu Insert.

5. Using Execution commands – run the algorithm continuously (or step by step).

6. Consider the result of executing the algorithm and, if necessary, debug it.

Lesson 1 (2 hours) Lesson 2.

Practical work "Compilation of linear algorithms".

Tasks: 1. Robot at an arbitrary point in the field. Paint the cell above, below and to the right of the original position.

  1. Robot at an arbitrary point in the field. Move the Robot 4 squares to the right, coloring them.
  2. Create a new starting environment by drawing a square with a side of 4 squares on the field. Save the setting as the starting one.
  3. Create a new starting environment by drawing a corridor on the field with passages in the walls. Save the environment as obst2.fil. Change the starting environment to the newly created one.

Lesson 2 (2 hours) Lesson 1.

Subject : Branching and sequential refinement of the algorithm.

Analysis of CMM tasks using the Robot performer.

use Robot

alg kim 2009

beginning

if not free from below

then to the right

All

if not free from below

then to the right

All

if not free from below

then to the right

All

con

use Robot

alg kim 2010

beginning

if not free from below

then to the right

All

if not free from below

then to the right

All

if not free from below

then to the right

All

con

Etc. slave. No. 14. Compilation and debugging of branching algorithms

Tasks. See Attachment.

Lesson 3. Cyclic algorithms. Lesson 1-2

Target: reveal the essence of the concept of a cycle in algorithms, show the forms of recording cycles in algorithms, give skills in creating and recording cyclic algorithms.

Etc. slave. No. 15. Compilation and debugging of cyclic algorithms

1.Create an algorithm that paints all internal cells adjacent to the wall.

use Robot

alg

beginning

nts the right is free for now

paint over; right

kts

nts the bottom is free for now

paint over; down

kts

nts not free from below yet

paint over; left

kts

con

2.Create an algorithm that paints all the cells between the Robot and the wall. The distance to the wall is unknown.

use Robot

alg

beginning

nts the right is free for now

right; paint over

kts

con

3.Create an algorithm that paints all the cells located between two walls.

use Robot

alg uch3

beginning

nts yet (not free from above) or (not free from below)

right

if (not free from above) and (not free from below)

That

paint over

All

kts

con

4.Create an algorithm that paints all the cells around a rectangular wall.

alg uch4

beginning

paint over;up

nts not free on the right yet

paint over;up;

kts

paint over; right

nts not free from below yet

paint over;right;

kts

paint over;down

nts not free on the left yet

paint over;down;

kts

paint over; left

nts not on top yet free

paint over; left;

kts

con

use Robot

alg uch5

beginning

right

nts not free from below yet

paint over; right

kts

paint over; down

nts the left is free for now

paint over; left

kts

nts not free on the left yet

paint over; down

kts

paint over;left;paint over; up;

nts free on top for now

paint over; up

kts

nts not on top yet free

paint over; left

kts

con

Lesson 4 Lesson 1

Auxiliary algorithms.

Target: introduce the concept of main and auxiliary algorithms; explain the rules for using the auxiliary algorithm; analyze examples of algorithms using auxiliary ones.

Lesson Plan

1.Introduction of new terms (main and auxiliary algorithms, calls) and explanation of new concepts.

2. Analysis of examples of solving problems using an auxiliary algorithm.

When solving some problems, it is convenient to break them down into smaller subtasks, each of which can be formulated as an independent algorithm. In this case, the so-called main algorithm is first compiled, in which calls to auxiliary algorithms are used to solve subtasks, which are added later. This solution is calledmethod of sequential refinement.It allows a group of programmers to work on a project, each solving their own subtask.

In the process of solving a problem, each auxiliary algorithm can, if necessary, be divided into smaller auxiliary algorithms.

The command to execute the auxiliary algorithm is called challenge and is written in the body of the main algorithm.

The same algorithm can be considered as the main and auxiliary in relation to other algorithms. In an algorithmic language, the main algorithm is written first, and auxiliary ones are written down in a row.

Task 1:

The robot is in the upper left corner of the field. There are no walls or painted cells. Create an algorithm, using an auxiliary one, that draws four crosses on one horizontal line. The final position of the Robot can be arbitrary.

Solution

Analysis on the board:

Task 2. The robot is in the upper left corner of the field. There are no walls or painted cells. Create an algorithm that paints an 8 x 8 square in a checkerboard pattern. The final position of the Robot can be arbitrary.

Lesson 4 Lesson 2

Practical work on a PC “Solving a problem using auxiliary algorithms”.

Target : to instill practical skills in constructing algorithms using the method of sequential refinement.

Lesson Plan

1.The task takes place entirely on a PC. Students receive assignments and complete them in the Idol software environment. The results of the work are saved as files for later verification.

Problem 1 . The robot is in the lower left corner of the field. There are no walls or painted cells. Write an algorithm that paints 6 vertical stripes the same length of 6 cells. The final position of the Robot can be arbitrary.

Problem 2 .Using auxiliary ones, create an algorithm for painting the cells that form the number 1212.

Homework: Come up with an algorithm that draws the following image: To solve the problem, use two auxiliary algorithms.

Lesson 5 Lesson 1-2

Test

“Drawing up an algorithm in the Robot executor environment.”

Target: test the acquired knowledge on the creation and ability to analyze algorithms in the Idol software environment.

The tasks for the test are divided by difficulty level and include 3 tasks with the executor Robot (task 1 and 2 - on branching and loops, task 3 - on the use of an auxiliary algorithm.) The texts of the tasks are given in the appendix.

The initial and final situations and created algorithms are recorded as a file.

The grade is given according to the level of difficulty of the task. The student has the right to choose the type of assignment.

The whole process consists of two stages: assembly and programming. To assemble a good robot, you need knowledge of mechanics. To program a robot to perform certain actions, you need to know a language that will understand motherboard or software block. School knowledge of computer science is not enough here.

Where can I get the material?

First you need to decide how you want to assemble the robot: from ready-made kits or selecting materials yourself. The advantage of the kit is that you don't have to search for the parts separately. Most often, several devices can be assembled from one set.

A structure not assembled from a ready-made kit is called open system. It also has its advantages: your robot will have its own personality, and you yourself will be able to improve the design. But you will definitely spend more time and effort.

What does a robot consist of?

Housing – metal or plastic "body", to which the remaining parts are attached. Each robot has an energy source - batteries or accumulator. Depending on what task the robot will perform, sensors are selected: they can detect color and light, and respond to touch.

To make the robot move, you will need motors. "Head" the entire mechanism - the system board or software unit. With their help, the robot connects to a computer and receives a set of tasks.

How can I get him to do something?

In order for the robot to perform some action, you need to create computer program. The difficulty of this step depends on the assembly. If the robot is assembled from a Lego Mindstorms or mBot set, then even children can handle their software.

If you're building the robot yourself, you'll need to learn the basics of programming and the language you'll be writing the program in, such as C++.

Why might a robot fail to execute a program?

When it gets to a new place, it can get confused and execute the program incorrectly. In order for the robot to do everything correctly, the sensors must be adjusted. For example, lighting that is too bright can prevent you from recognizing colors adequately. Depending on the surface on which the robot moves, the power of the motors is adjusted.

Can you learn to assemble and program at school?

Despite the fact that robotics is not included in the school curriculum, physics and computer science teachers can teach a child how to assemble and program. In Belgorod, some schools have clubs where they make robots.

“After lessons with physics and computer science teachers, we learn to program. We already know how to work in LegoMindstorms and Robolab ( software for robots - approx. auto). We also sometimes learn to make 3D drawings of parts,” said students of the Belgorod Engineering Youth Boarding Lyceum and participants of RoboFest 2018. Anton Pershin And Dmitry Chernov.

Where, besides school, can you become a roboticist?

At the BelSU engineering school there is a class where they teach how to assemble and program robots. In 2017, Quantorium opened in Belgorod, where robotics is taught to schoolchildren from the age of nine.

To become a real roboticist, you can enroll in the robotics department. There are no such people in Belgorod yet, but at BSTU. Shukhov has a department of technical cybernetics. Her students take prizes at all-Russian robotics competitions.

Is it possible to learn on your own?

Yes. There are many resources on the Internet where you can learn what to build and how to program a robot.

Will the robot be useful?

It can be adapted for everyday tasks and made into an assistant in the house. There are many examples on the Internet of how home inventors create robots for baking pancakes or cleaning an apartment.

How can you prove your success in creating robots?

Take part in competitions such as RoboFest. Depending on age and direction, there are different nominations. Basically, each type of robot has a track on which it performs tasks: grab a cube or draw a line. There are also static systems in which judges evaluate the presentation of the project and the operation of the mechanisms.

As a rule, participants come to competitions with assembled robots and during preparation they spend time only on calibrating sensors and adjusting the program.

The editors would like to thank the participants of RoboFest 2018 for their assistance in creating the material. Dmitry Agafonov, Dmitry Chernov, Anton Pershina And Danila Migrina.

Natalia Malykhina