35
36
Level Of Difficulty
Level Of Difficulty
Materials Needed:
®
-
Engino
Robotics PRO (STEM70).
- Computer with ERP software installed.
- 4 x A3 white carton papers.
- Black sticky tape or black marker.
- 4 white objects for detection.
Materials Needed:
®
-
Engino
Robotics PRO (STEM70).
- Computer with ERP software installed.
- 4 x A3 white carton papers.
- Black sticky tape or black marker.
- 1 small water bottle (half full with 250 mL).
Procedure:
1.
Find the instructions in
pages 56-58
and
build the
humanoid robot
model.
2.
Stick the A3 papers together as to create a
big white rectangle. Draw a black ellipse, 5cm
thick, using a marker or sticky tape (see
picture on the right). You can also download
another path at www.enginorobotics.com
(teaching resources).
3.
Open the
ERP PRO
1.2
software and follow the
instructions in
exercise 1
,
in order to create a
black
line following program
.
For this, the two
IR sensors
should face the
ground
, so turn them downwards.
4.
Read
exercise 2
in order to transform
your humanoid into an
object detecting
robot
. For this, turn the two
IR sensors to
face forward
. Once you create the program,
test it by placing four white objects (as tall as
the height of the sensors) as to create an
imaginary square for the robot to move
along its sides (see picture on the right).
Procedure:
1.
Find the instructions in
pages
59-63
and
build the
grabber robot
model.
2.
Follow
exercise 1
in order to
create a loop program using the
“repeat” block.
3.
Sometimes we need a loop to be
executed continuously until a
sensor’s condition is met. Follow
exercise 2
to learn how to do this
using the “repeat until” block.
4.
Stick the A3 pieces of papers together as
to create a big white rectangle. Draw a black
half circle ending with two vertical lines and a
red circle, as you see in the next picture. Or
download this at www.enginorobotics.com
(teaching resources). The grip should be in
the circle when the grabber stops on a line.
Place the bottle on the red circle.
5.
Read
exercise 3
in order to make a
robotic carrying device that would pick up
the bottle and take it to the other side.
Exercise 1.
On the computer, place the correct icons on the
ERP simulator according to the humanoid robot model. Drag
and drop the necessary blocks inside the flow diagram in order
to create the following program:
Ÿ
while
the IR sensor in port 2 detects black colour, the motor in
port B should move the humanoid forward and both lights
should be on;
Ÿ
while
the IR sensor in port 4 detects black colour, the motor in
port A should move the humanoid forward and both lights
should be on.
Once you place the appropriate blocks, you will need to
configure the infrared sensors
, so that they
follow
black
line
. For this, consult the user manual under the section
“Sensors / Infrared sensor configuration” in
pages 25-26
.
With this program
the humanoid will
follow a black line.
In order to test
your program,
place your robot
on the black
ellipse you
created and see if
it goes around
with its lights on.
Exercise 1.
On the computer, place the correct icons on the
ERP simulator according to the grabber robot model. Drag and
drop the necessary blocks inside the flow diagram in order to
create the following program:
Ÿ
the grabber should move forward for 2 seconds precisely. This
should be repeated 5 times.
Ÿ
when the loop finishes the buzzer should sound for 2 seconds.
Tip: change the variable of the “start” block from “forever” to “1”
and use the “repeat” block to create the program.
Exercise 2.
Drag and drop the necessary blocks inside the flow
diagram in order to create the following program:
Ÿ
humanoid moves forward;
Ÿ
if
it detects a white object with
either sensor or both
, the robot
should stop and warn with beeping sound and lights on;
Ÿ
after 5 seconds the humanoid should turn 90 degrees to the
right in order to detect the next object.
Exercise 2.
Create the following program (the grip of the
grabber should be open at the beginning):
Ÿ
the grabber should move forward continuously
until
the touch
sensor is pressed.
Ÿ
when the touch sensor is pressed, the grabber should stop and
the grip should close with beeping sound.
Tip: change the variable of the “start” block from “forever” to “1”
and use the “repeat until” block.
Exercise
3
.
Create the following program (the grip of the
grabber should be open at the beginning):
Ÿ
while
the IR sensor in port 2 detects white colour, the motor in
port A should move the grabber forward;
Ÿ
while
the IR sensor in port 4 detects white colour, the motor in
port C should move the grabber forward;
Ÿ
if
the touch sensor is pressed, the grip should close and grab
the bottle. Then the grabber should turn around for a specific
amount of time until it finds the black line;
Ÿ
the program will be considered successful if the model reaches
the other black line.
With this program
the grabber will
follow the line by
avoiding the black
colour, pick up the
bottle and go
back. Place your
model on the
paper and see If it
works.
®
Engino humanoid robot
Tips: the angle is always the
same, so only one program is
needed for turning. To set
both or either sensor to
detect objects you must
choose the appropriate logic
gate (AND or OR). You should
also
configure the sensors
again so they will activate on
object detection
this time.
How to use the infrared sensor.
What a WHILE conditional statement is.
What logic gates are.
What a REPEAT statement is.
What a REPEAT UNTIL conditional
statement is.
Infrared sensors are used very frequently in robotics in two very
important applications: for distinguishing between black and
white colours and for object detection. Try both programming
challenges and learn how to configure the IR sensors, how to use
the WHILE conditional statement and logic gates.
Doing repetitive tasks with precision is one of the most important
features in programming and robotics. We can create a program
and make it repeat many times, thus entering into a “loop”. Find
out how to create loops with the ERP and how the robot can get
out of it and continue with the rest of the program.
IR sensor, WHILE statement and logic gates
Learning about:
ROBOTICS
REPEAT and REPEAT UNTIL statements
ROBOTICS
Learning about:
®
Engino
grabber robot
Discover:
Discover:
Discover: