EV3 Programing
EV3 Programing
EV3 Programing
com
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
Chapter 1:
Introduction.............................................................................................. 1
Chapter 2:
RileyRover Basics..................................................................................... 5
Chapter 3:
Chapter 4:
Chapter 5:
Flowcharting .......................................................................................... 23
Chapter 6:
Chapter 7:
How Fast?............................................................................................... 31
Chapter 8:
Chapter 9:
Chapter 10:
Chapter 13:
Chapter 14:
Chapter 15:
Chapter 16:
Chapter 17:
Chapter 18:
Chapter 19:
Mini-Golf ............................................................................................. 79
Chapter 20:
Chapter 21:
Chapter 22:
Chapter 23:
Student Worksheets............................................................................. 93
Chapter 24:
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
Table of Contents
This book is a guide for teachers implementing a robotics unit in the classroom. It
is aimed at middle years schooling (ages 9 - 15) but the wide range of activities can
be adapted to suit older or younger students. The book is based around a single
robot, the RileyRover, which is used in all activities. This approach is valuable in
resource limited classrooms, as it allows the teacher to work with a 'standard'
robot, rather than using valuable classroom time building and breaking down
robots each lesson. The RileyRover design can be found at the back of the book,
as well as being freely available online www.damienkee.com. Please send me an
email and let me know if you are using the design!
All activities are based around the 45544 LEGO MINDSTORMS Education EV3 core set. While the
activities can be performed with the EV3 brick from Retail or Education, the building instructions have
been compiled with the 45544 set in mind.
It is assumed that the teacher has a basic knowledge of how to open the EV3 programming environment
and how to download a program to the EV3 unit. Please see the excellent tutorials built into the EV3
software environment for more information.
The book is divided into sections that follow a 10 week plan, although this can be modified to suit the
needs of the teacher. The first 6 weeks takes students through a series of activities, progressively exposing
them to new aspects of the EV3 programming environment. Following is a set of open ended challenges
from which teachers may pick and choose to suit their particular class.
Scenario setup + background information. Teachers are free to develop each scenario further as
they see fit.
Equipment list. Aside from the standard EV3 robotics kit, all other required resources are easily
sourced within a school environment.
Teacher notes are provided on common issues that may arise with each challenge and how they are
best dealt with.
Programming examples in the EV3 software environment.
Student worksheets to fill out (photocopy / print permission is provided).
Extension activities.
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
Chapter 1: Introduction
Equipment required
Teachers Notes
This section will cover the following topics amongst others
Basic numeracy
Decimal and fractional numbers
Relationship between diameter and circumference
Conversion between millimetres and inches
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
The Move Steering Block has several different parts to it as shown below.
The Port Selector identifies which Ports the motors are connected to. If you are using the RileyRover design,
ensure that you have the left motor connected to Port B and the right motor connected to Port C (cables
will crossover). If these are in the wrong spots, then our robot will turn left when we say turn right and
vice versa.
The Mode Selector selects how you would like to control the duration the wheels will turn; OFF, ON, On for
a certain number of seconds, On for a certain number of degrees or On for a certain number of rotations.
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
RileyRover Basics
RileyRover Basics
Block Inputs
Steering: You can either type in a number, or drag the slider bar. 0 means straight ahead, -100 means
tight turn left and 100 means tight turn right. Numbers in between these limits will give you varying
turns, from quite gradual turns through to very tight turns.
Power: Again you can type in a number or use the slider bar. 100 means as fast as possible forward,
-100 means as fast as possible backwards and 0 means no power (effectively a stop). Numbers in
between these limits will make the robot travel at different speeds either forwards or backwards.
Rotations / Degrees / Seconds: This input (visible depending on which Mode Selectors was chosen)
specifies how far the wheels of the robot will travel, ie. 2 in Rotations mode will make the robots wheels
turn two rotations, 4.5 in Seconds mode will make the robots wheels turn for four and a half seconds.
Brake at End: After the robot has completed its movement, the robot can either immediately apply the
brakes to the motors (TRUE) or let the motors coast to a stop (FALSE).
Lets choose the On for Rotations option for the moment. With this mode selected, we can now set the
different Block Inputs to complete the first question on the Student worksheet: Drive Forward 2
Rotations.
If all goes to plan, the wheels of your robot should drive forward exactly two rotations.
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
The Block Inputs change depending on which Mode Selector has been chosen.
What is a Robot?
Sensors
information
Computation
information
Actuators
20
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
Robots can be broken down into three distinct components; Sensors, Computation and Actuators.
How Far?
Theory
Students will program their robot to travel for 1 second at a specific power level. The same experiment is
run again this time for 1.5 seconds at the same power level. Students should take as many measurements
as time allows with a wide variety of times. Encourage the students to take multiple runs and take the
average of all their data to reduce the impact of experimental error. Keep increasing the length of time the
robot is travelling and record the distance.
By plotting the distance travelled (vertical axis) against the time taken (horizontal axis) students are able to
build up a graph of their data. Students should find that there is a linear (straight line) relationship between
the time programmed and the distance travelled. The slope of this line is the velocity of the robot
(distance/time).
A random power level between 50% and 100% is assigned to each group, ensuring different results for
each group. They cannot copy another groups data as it would be inaccurate for their robot.
This data was taken for the standard RileyRover running with a full battery. Lower battery levels will
change the speed of the robot so ensure that all data is gathered in one session, using the same robot each
time.
28
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
This activity will look at the effect that changing the time of travel of the robot has on the distance it
moves. It will become evident that the longer a robot travels the further it travels, but can the relationship
between time and distance be predicted?
How Fast?
The relationship between the time it takes to travel 5 rotations and the power level of the wheels is not a
linear relationship. Given we know the time taken and the distance travelled, we can now calculate the
speed of the robot for each power level.
To determine the speed of the robot for each data point, divide the distance travelled over 5 rotations, by
the time taken over 5 rotations.
eg.
If our robot takes 8.2 seconds to travel 5 rotations, then the speed can be calculated as follows;
With this data, students should now find a roughly straight line relationship between speed the robot
travels and power level applied to the motors.
33
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
A graph of Speed against Power can be graphed by determining the distance travel over 5 rotations
(879mm OR 34.6 inches)
Text mode allows us to specify a particular phrase of our own choosing such as Take me to your leader!
or Do you have any bananas?. The Text mode can be used in either Pixel or Grid configuration. When
in Pixel mode, the X and Y parameters refer to the pixel location of the text. The EV3 screen has 178
horizontal pixels (0-177) and 128 vertical pixels (0-127). When in Grid mode, the X and Y parameters
refer to the row and column location of the text. The EV3 screen has 12 rows (0-11) and 22 columns (021). For both the Grid and Pixel mode, counting of the rows and columns starts from the top left, ie.
Row 0, Column 0 is the very top, left pixel.
As with the Sound Block, the Display Block is an excellent way for students to keep track of where in the
program their robot is currently at. Eg. Have your robot display on the screen a smiley face when it is
driving forward, and a frowning face when it is driving backwards.
38
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
This approach will still use the Move Steering Block, but
rather than choosing the Seconds, Degrees or Rotations mode,
we will use the On mode. This will turn the motors on and
proceed to the next programming block. The motors will
continue to drive, until another Move Steering Block instructs
it otherwise.
47
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
Equipment required
Teachers Notes
The algorithm for this particular challenge is very similar to the previous challenge, but using the Colour
Sensor to detect No Colour. Make sure your students are ready to catch the robot; just in case!
Example Program
TIP: If your robot only
barely stays on the table,
try lowering the power of
the Move Steering Block.
55
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
Chapter 12:
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
Example Program
59
TIP: In the above example we have closed and opened the Gripper Attachment using
the On for Seconds mode of the Move Steering Block. This is often a better choice
than either the On for Rotations or On for Degrees modes as it prevents the program
from locking up if the gripper cannot close completely because of an unexpectedly
large object to grab. ie. If the gripper motor is programmed to close for 6 rotations,
but grabs the object after only 4 rotations, then program will never reach the required 6
rotations and will never be able to move on to the next programming block.
If the gripper motor is programmed to close for 4 seconds (as in the above example),
then even if the object is grabbed after 3 seconds, the program can continue on after
the 4 seconds has passed.
73
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
Example Program
RileyRover Basics
Group Members_________________________
Project: NASA is in the market for a new planetary rover to explore the recently discover planet Tobor-3.
You are required to construct and test a robot that is capable of following a set of commands to explore
the planet's surface. Before the robot is deployed, it must be extensively tested to ensure it will perform as
expected. You can't fly a technician to Tobor-3 to reboot the robot!
Before we send our robot into space, we must first test it thoroughly here on earth. Run the following
experiments and observe how your robot behaves. Do not move to the next experiment until your teacher
has seen your current experiment.
Drive Forward for 2 rotations of the wheels
How far did your robot travel?
_________________
_________________
_________________
_________________
How far will the robot drive if the wheels turn 3 rotations?
_________________
Program your robot to move 3 rotations and measure how far it goes.
Does it go as far as you expected?
Drive Forward 5 rotations slowly and then 1800 degrees backwards as fast as possible.
Make your robot turn around a complete circle (360 degrees).
What happened? How far did your robot turn if you type in 360?
_________________
How many Degrees of the Wheel does your robot need to turn a complete circle?
(hint: keep experimenting until it is perfect!)
_________________
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
Group Name______________________
Project: NASA are very impressed, but they note with your last program, while the robot is looking for the
edge of the plateau, it is not doing any prospecting. Is there a way to do both at the same time?
As there is only one Wait Block that can be used to determine colour, you will need to find a way for the
robot to be able to determine which colour it has seen. This can be achieved with a Switch Block.
Use this flow chart as a starting point, and fill in the blank spaces
Detects Green
What Colour?
Detects No Colour
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
Group Name______________________
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com
Sample Pages - Classroom Activities for the Busy Teacher: EV3 - www.damienkee.com