🦾 EV3 102: #04 - EV3 Movement

By Matt Richardson
Last updated over 1 year ago
36 Questions
This course includes resources provided by the following:
  • LEGO Education
  • CS-STEM Network from Carnegie Mellon University
  • EV3-Scratch documentation provided by Raphael Holzer
  • Joe Olayvar & Evelyn Lindberg in association with the Washington State Library
🌏 Click here to access the LEGO Education website.
📑 Click here to access the EV3-Scratch documentation.
🎓 Click here to access the online EV3 course from CS2N.
📕 Click here to access the LEGO Mindstorms EV3 Programming Basics document in its entirety.
▶️ Click here to access the entire LEGO Mindstorms EV3 YouTube playlist from the Washington State Library.
The Robot Movement lesson introduces EV3 Classroom and how to write programs that move the robot forward, backward, make turns, and control the robot’s gripper arm.

⬇️ Install It

Before continuing, ensure that your computer has the EV3 Classroom app installed.

🔧 Build It

Before you continue, ensure that you have completed the following build:

Base Unit (aka Driving Base)

🛞 Introduction to Moving Forward

🎓 Learn It

Carefully read and/or watch the instructional media and respond to the related questions.
1.

Why is it important to inspect industrial facilities often?

2.

What is the advantage of Sensabot over human inspectors?

3.

In addition to basic movement, what specific skill will you need to complete this challenge?

Moving / Steering Forward

In this lesson, you will program the robot to move forward for 3 wheel rotations.


Step 1: Open EV3 Classroom

Begin by opening the LEGO MINDSTORMS EV3 Classroom app.


Step 2: Create a New Program

Create a new program by clicking the [+] New Project button in the EV3 Classroom app window.


Step 3: Place Move Forward Block

Grab a “move [forward] for [1] rotations” block, and drag it under the “when program starts” block. The two blocks should automatically attach.
This “move forward” block is set to move the robot “forward” for 1 rotation.


Step 4: Change Rotations Value

To make the robot go forward for 3 rotations, change this Rotations value to 3.


Step 5: Add Exit Block

Lastly, drag a “stop [and exit program]” block from the Control palette, and place it at the bottom of stack of blocks. This will tell the robot to stop, and end the program.


Step 6: Rename Program

Click on the triple dot menu next to the program name, and select “Rename”. Save the program as “MovingForward”.
Note: The project saves automatically even if you do not rename it!

Step 7: Connect EV3 to Computer

Make sure your EV3 is turned on and connected to your computer using the USB cable (or through Bluetooth).
Note: The software tells you when the robot is connected when the red robot icon in the top left corner becomes green.


Step 8: Download Program

Download the program to the EV3 by pressing the Download button in the lower-right corner of the programming software.


Step 9: Place Robot

Once the program is done loading, disconnect your robot from the USB cable, and place it in an open area.


Step 10: Run Program

To run the program, use the left and right buttons to scroll to the “File Navigation” icon, use the up and down buttons to select MovingForward if it isn’t already selected, and press the center button to select it.
Use the down button to scroll to MovingForward’s “Program”, and press the center button again to run.


Try it! Hold Position vs. Float

Place a “set movement motors to [hold position] at stop” block at the start of your program. What is the difference between the “hold position” and “float” settings?


Try It! Measure One Rotation

Have your robot move forward for one rotation. Use a ruler to measure how far a single rotation travels in centimeters (cm).


💡 Did You Know? EV3 Menus

Did you notice the four main areas at the top of the EV3's on-screen menu?
  • Run Recent: Lists the most recent programs you have to run. Not that if they are all named "Program", they might be hard to tell apart!
  • File Navigation: Browse through all the Projects you have loaded on the EV3. Select and run Programs from inside each Project! Folders starting with "BRK" contain Brick Apps programs (see left).
  • Brick Apps: This mode contains utilities that let you view and set motor and sensor values for troubleshooting purposes. The Brick Program app lets you write simple programs or log sensor values directly on the brick.
  • Settings: Adjust the speaker volume, auto-sleep timer, networking, and other system settings.

💡 Did You Know? Auto-detecting Ports

Did you notice that the EV3 automatically detected the Ports that your motors were plugged into?


The EV3 features a technology called "AutoID" that allows it to automatically detect, identify, and configure any EV3 hardware plugged into it! However, it can only tell what type of device is plugged in. It cannot detect certain other information, like what size your wheels are, or which motor is on the left vs. the right side of the robot.
4.

How do you create a new program in EV3 Classrooms?

5.

True or False: Programs made in EV3 Classrooms are saved automatically.

6.

Which option would you choose if you want the motors to stop exactly at the requested amount?

🏆 Mini-Challenge:


📏 50 cm

Place two pieces of tape 50 cm apart. Your robot should travel exactly from one tape to the other to complete the challenge!


Make sure to set your motors to "Hold Position" to stop directly on the line.

🌐 A virtual version of this challenge is available HERE.
8.

📸 Document It: Capture a screenshot (or multiple screenshots) of your completed program and upload or paste it onto the Formative canvas.

9.

⬆️ Upload It: Upload your completed program.

🦾 Arm Control

In this step, we will program the robot to lower and raise its arm.


Step 1: Open EV3 Classroom

Open EV3 Classroom and click the [+] button to create a new program.


Step 2: Add Motor Block

The REM Bot’s arm is controlled by a Motor block. Add a Motor block (set to Motor A) to the program.


Step 3: Set Rotations

To raise the arm, the motor needs to make about one-quarter of a full rotation.
Click the number next to "rotations" and change it to 0.25 – one-quarter of a full rotation.


Step 4: Add Exit Block

Drag a “stop [and exit program]” block from the Control palette, and place it at the bottom of the stack.


Step 5: Download and Run Program

Download the program to your EV3, set the arm to the "down" position, then run the program.
The motor should turn 90 degrees, lifting the arm into the "up" position.


Step 6: Add Second Motor Block

Now return to your program, and drag a second Motor block after the first. Change the direction setting on this Motor block from “clockwise” to “counterclockwise”.


Step 7: Set rotations

Also, change its Rotations from 1 to 0.25.


Step 8: Rename Program

Save your program as “ArmControl”.


Step 9: Download and Run Program

Download the program to your robot, set the arm to the "down" position, and then run the program.
💡 Did You Know? Getting the Program Stuck


What happens if a block cannot complete its action?

Try running your program with its arm in the "up" position. Watch carefully so you can answer the following questions.
10.

What happens if a block cannot complete its action?

11.

True or false: Programming the Arm motor block to spin for .50 rotations will make the arm move 90-degrees.

12.

Which of the following blocks is used to make the arm spin backwards?

🏆 Mini-Challenge:


📦 Cargo Retrieval

Program your robot to:
  • Raise its arm
  • Move 50cm to the box
  • Drop the arm down
  • Back up to the robot's starting position with the box

  • Place two pieces of black electrical tape 50 cm apart.
  • Your robot should travel to the block and bring it back to the starting line.
🌐 A virtual version of this challenge is available HERE.
  • Hint 1: Remember to raise the arm before moving the robot forward.
  • Hint 2: Line up the block for the robot to use its arm around it.
  • Hint 3: Use some fine-tuned commands (i.e. pausing after stopping, moving slower)
  • Hint 4: Pause for a couple of seconds after commands for consistency.
14.

📸 Document It: Capture a screenshot (or multiple screenshots) of your completed program and upload or paste it onto the Formative canvas.

15.

⬆️ Upload It: Upload your completed program.

🏆 Challenge:


📡 Sensabot


Challenge Overview

For this challenge, program your EV3 robot to move from its starting location to three different lines, stopping at each line to perform an inspection, represented by lowering and raising the robot’s arm. After completing inspections at all three lines, the robot should then back up and return home to its starting location.

Challenge Details

Rules and Procedures:
  1. Create the robot’s starting area with electrical tape that is slightly larger than the robot.
  2. Use the electrical tape to mark three (3) inspection points along the robot's path. The exact location is not important, but they should not be moved once the board is finalized.
  3. The robot must start inside the starting box (no parts over the line) and with its arm raised.
  4. The robot must move and stop at each line, lowering and raising its arm, representing the inspection process. The arm must be directly over each line when the inspection is performed.
  5. The robot must return to its starting box after completing the inspection process at the third line. The entire robot must be inside the box (no parts over the line)

Hints:
  • Use a meter stick or ruler to measure the distances to each line on the board so you know how far you need to move each time!
  • Try finding the number of centimeters your robot travels in each rotation, and using that to find the number of rotations you need
  • You can also make a test run, then calculate “how many times as far” you need to move to get to each line, compared to the test run
17.

📸 Document It: Capture a screenshot (or multiple screenshots) of your completed program and upload or paste it onto the Formative canvas.

18.

⬆️ Upload It: Upload your completed program.

⤴️ Introduction to Turning

19.

Why is it important for the robot be able to drive through an orchard?

20.

What is the advantage of an Autonomous Tractor over human drivers?

21.

In addition to basic turning, what additional, new knowledge will help you complete this challenge?

🔄 Turning in Place

Introduction: Turning in Place

In this step, you will program the robot to turn to its right while remaining in the same spot.


Step 1: Start New Project

Create a new project and program by clicking the + button on the Project Bar in the EV3 Programming Software.


Step 2: Add Move Straight Block

Add a “Move [straight] for [1 rotations]” block to the program.


Step 3: Set Direction

Click the “straight: 0" area of the Block. A “dial” will appear, allowing you to set the “sharpness” of the turn in the robot's movement – the balance between forward motion and turning motion. 0 means no curve – the command will move straight forward or backward.
Drag the dial all the way to the right (clockwise), until the number reads “right: 100”. This tells the robot to perform a movement that is 100% turning motion to the right.


Step 4: Add Exit Block

Drag a “stop [and exit program]” block from the Control palette, and place it at the bottom of the stack.


Step 5: Rename Project

Rename your project as “TurnRight”


Step 6: Download and Run

Turn on your EV3, plug it into your computer, and download and run your program.

💡 Did You Know? Wheel Pointers

The white pointers on the EV3's tires help you to see how much the wheels are rotating.

Run your TurnRight program again, and watch the pointer on the robot's right wheel.
22.

How much did the robot's wheel turn during this movement?

23.

According to the block below, the robot will…

24.

True or false: The dial inside the move block is used to determine the sharpness of a turn.

🏆 Mini-Challenge:


⤴️ 90-Degree Turn

Place two pieces of tape so they form a 90-degree angle. Place the robot so that it faces along the edge of one piece of tape. Program the robot to turn right 90 degrees (using a 100 "Steering" value), to face directly along the other piece of tape.

🌐 A virtual version of this challenge is available HERE.
26.

📸 Document It: Capture a screenshot (or multiple screenshots) of your completed program and upload or paste it onto the Formative canvas.

27.

⬆️ Upload It: Upload your completed program.

🔀 Other Turns

In this step, you will learn about the mechanical nature of turning, and learn to program one-wheel turns and custom turns using the “Move [straight] for rotations” Block.


Turning

All of your robot's movements are performed using two motors. The motion you get is determined by using different combinations of powers on those motors.

If both motors go forward, the robot moves straight forward.

If both motors run backward, the robot moves straight backward. If they run in opposite directions, the robot spins in place.

If the left side moves forward while the right moves back, the robot spins to the right. If the right side moves forward while the left moves back, the robot spins to the left.

But what about other combinations?

Step 1: Open EV3 Classroom

Open EV3 Classroom and create a new program.


Step 2: Add Move For Rotations Block

Instead of a “Move [straight]” Block, add a “Move for [rotations] at 50-50 % speed” block to the program.


Step 3: Set Power Levels

Set the left motor's power to forward 50, and set the right motor's power to 0.


Step 4: Add Exit Block

Drag a “stop [and exit program]” block from the Control palette, and place it at the bottom of the stack.


Step 5: Rename Project

Rename the project as "TankMove"


Step 6: Download and Run

Download and run the program. The robot's left motor moves forward at 50% power, while the right motor stays stationary. The robot, as a consequence, performs a different kind of "swinging wide" turn.


Try it! Different Motions

You can create many different types of motion by combining different motor speeds. Try each of the following to see what you get! Try each of the following to see what you get!
28.

What will the robot do if both motors spin in opposite directions at the same velocity?

29.

Which of the following blocks should be used if you want to program motors at different speeds?

🏆 Mini-Challenge:


🔄️ Dizzy Drills

Program your robot to go out to an object, drive around it, and then come back!

With a line and an obstacle placed away from the line, start the robot at the line, program it to drive out to the obstacle, go around it, and then come back to the line.

🌐 A virtual version of this challenge is available HERE.
31.

📸 Document It: Capture a screenshot (or multiple screenshots) of your completed program and upload or paste it onto the Formative canvas.

32.

⬆️ Upload It: Upload your completed program.

🏆 Challenge:


🚜 Orchard Tractor


Challenge Overview

For this challenge, program your EV3 robot to move through TWO rows of orchard trees, represented as lines. The first line is straight on, and the next line is at an angle. The robot must make a pass on BOTH sides of each line.


Need More of a Challenge? Orchard Level 2

For this challenge, program your EV3 robot to move through THREE rows of orchard trees, represented as lines. The first line is straight on, and the next two lines are at an angle, but parallel. The robot must make a pass on BOTH sides of each line.


Challenge Details

Rules and Procedures:
  1. For this challenge, the user can create a starting area wherever on the board.
  2. Use three strips of electrical tape to mark two or three rows of trees. The exact locations are not important, but they should not be moved once the board is finalized.
  3. Make sure there is enough space between the rows for the robot to pass on both sides of each row without crossing the lines.
  4. Orchard Level 1 only uses lines 1 and 2. Level 2 uses all three lines.

Hints:
  • Use a meter stick or ruler to measure the distances to each line on the board so you know how far you need to move each time.
  • Try finding the number of centimeters your robot travels or the number of degrees its body turns in each wheel rotation.
  • You can also make the test run, then calculate “how many times as far” you need to move or turn to get the amount of movement you want, compared to a test run.
🌐 A virtual version of this challenge is available HERE.
34.

📸 Document It: Capture a screenshot (or multiple screenshots) of your completed program and upload or paste it onto the Formative canvas.

35.

⬆️ Upload It: Upload your completed program.

36.

🧠 Retrieval Practice:
Summarize the content of this lesson. What topics, ideas, and vocabulary were introduced?