Top Banner
Lawrence Technological University 1 BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Lawrence Technological University
49

BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Jul 02, 2018

Download

Documents

lebao
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Lawrence Technological University 1

BottleSumo EV3 Workshop

Instructor: Dr. Fred Brauchler

Assistant: Devson

4/23/2016 Lawrence Technological University

Page 2: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Thanks to our Sponsors!

4/23/2016 Lawrence Technological UniversityLawrence Technological University 2

Page 3: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Download EV3

• A free EV3 download can be found here:http://www.lego.com/en-us/mindstorms/downloads/

software/ddsoftwaredownload/download-software

• Also note that EV3 software works with NXT robots and NXT sensors!

4/23/2016 Lawrence Technological University 3

Page 4: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Course Overview

• 2016 RoboFest BottleSumo Rule Highlights

• EV3 Robot Configuration

• EV3 Software introduction

• Using the EV3 for BottleSumo

• Sense the table edge

• Finding the bottle/opponent

• Push bottle/opponent off

• Physics and Strategy

4/23/2016 Lawrence Technological University 4

Page 5: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Rules Overview

• Objective: Intentionally push the bottle or opponent off ANDremain on the table for > 3 second after

• How to start the robot – unveiled 30 min before impound

• Starting location, orientation, and exact location of bottle zone unveiled after impounding

• Time trials – push 2 bottles off the table (3 bottle for Sr. teams)

• Please remember to read the rules!

4/23/2016 Lawrence Technological University 5

Page 6: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Robot Configuration

4/23/2016 Lawrence Technological University

Left Motor B Left Light Sensor 4

EV3Brick

Right Light Sensor 1Right Motor C

UltrasonicSensor 3

6

Page 7: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Motor and Sensor Connections

• Left Motor connects to port B

• Right Motor connects to port C

• Left Light sensor connects to port 4

• Right Light sensor connects to port 1

• Ultrasonic sensor connects to port 3

4/23/2016 Lawrence Technological University 7

Page 8: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

What does your robot need to do to win?

• Not fall off the table

• Find objects: bottle or opponent

• Push objects off of table

4/23/2016 Lawrence Technological University 8

Page 9: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

EV3 Software

• Click the LEGO MINDSTORMS icon on

• Click File > New Project > Program > Open

4/23/2016 Lawrence Technological University

For Home Edition optional

• Select the “+”

9

Page 10: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Creating a Program

4/23/2016 Lawrence Technological University

Click on the green tab, drag a

“Move Steering” block to the middle of the screen

10

Page 11: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Move “Forever”

4/23/2016 Lawrence Technological University

Set the motors to “On”

Make sure you’re using the right motors!

11

Page 12: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Save Your Program

4/23/2016 Lawrence Technological University

1. Click “File” then “Save As”

2. Choose a memorable name

3. Click Save

12

Page 13: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Downloading a Program

4/23/2016 Lawrence Technological University

• Verify the robot is turned on

• Connect the USB cable

• Click refresh

• Click the box under USB

• Click the blue arrow to download

13

Page 14: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Running a Program

4/23/2016 Lawrence Technological University

• Press the middle button to run your program

• Press the top left button to stop your program

• Use the surrounding buttons to switch menus and view programs

14

Page 15: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Motors “On”

4/23/2016 Lawrence Technological University

• What happened when run? – the program finished and turned motor off before it moved.

• Did the motor turn on?– electrically yes, but not long enough to see it move

15

Page 16: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Loops

4/23/2016 Lawrence Technological University

Put the Move Stearingblock in an infinite loop.

16

Page 17: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Moving Backwards

4/23/2016 Lawrence Technological University

• We can still use the Move block.

• Change the power to a negative number

17

Page 18: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Spin

4/23/2016 Lawrence Technological University

• We can make the robot spin by changing the “Steering”

18

Page 19: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Light (Color) Sensor Readings

4/23/2016 Lawrence Technological University

Put one Light Sensor on the table and the other Light Sensor off the edge of the table

19

On Table Off Table

Page 20: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Color Sensors

4/23/2016 Lawrence Technological University

Click on the yellow tab and drag a color Color Sensor block up

20

Page 21: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Finding the Edge

4/23/2016 Lawrence Technological University

• Put move and sensor blocks inside the loop

• Change the loop to Logic

21

Page 22: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Finding the Edge

4/23/2016 Lawrence Technological University

• Change the light sensor to Compare > Reflected Light Intensity

• Light sensor threshold: Average of the “on the table” and “off the table” values.Put your value here.

22

Page 23: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Finding the Edge

4/23/2016 Lawrence Technological University

Use your mouse to draw a green data wire

Start Here and Click the Mouse

Drag to Here

23

Page 24: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Stopping at the Edge

4/23/2016 Lawrence Technological University

Make sure to turn off the motors once your robot finds the edge!

24

Page 25: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Edge Problems

4/23/2016 Lawrence Technological University

• If your robot stops too soon or too late, try adjusting your light sensor threshold

• We only are looking at one light sensor – what if the other one goes off the table first?

25

Page 26: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Finding Edge with Both Sensors

4/23/2016 Lawrence Technological University 26

Left Light Sensor

Right Light Sensor

Page 27: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Finding Edge with Both Sensors

4/23/2016 Lawrence Technological University 27

Logic Operations Block - OR

Logic Operations Block - OR

Page 28: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Finding Edge with Both Sensors

4/23/2016 Lawrence Technological University 28

find-edge.ev3p

Connect to the right wire hub. The wire should be green for logic.

Hands-on Try it

Page 29: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Finding and Avoiding Table Edges

4/23/2016 Lawrence Technological University

avoid-table-edge.ev3p

29

What should you do when you get to an edge. Back up and turn.

Hands-on Try it

Page 30: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Alternate Program

4/23/2016 Lawrence Technological University

This program uses a switch block instead of a loop to avoid tying up the program.

30

move-avoid-edge.ev3p

Page 31: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Ultrasonic Sensor

• Measures the distance to the closest object

• Uses sonar waves like a bat

• Can be used to see if an object is within a certain range of the robot

4/23/2016 Lawrence Technological University 31

Page 32: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Finding the Bottle/Opponent

• Point Turn (Spin) robot

• Stop when object found

32Lawrence Technological University1/26/20134/23/2016 Lawrence Technological University

Page 33: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Finding the Bottle/Opponent

4/23/2016 Lawrence Technological University

These two programs do the same thing:

• Point turn• Wait until sensing

an object < 50cm• Then stops motors

Lower program allows more options – example:What if nothing within 50cm? – see next page

33

Page 34: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Finding the Bottle/Opponent

4/23/2016 Lawrence Technological University

The added condition will limit how long (time) or how far (rotations) to turn and search

34

turn-scan-encoder.ev3p

Reset Encoder

Reset Timer

turn-scan-time.ev3p

Page 35: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Simple Sumo Program

4/23/2016 Lawrence Technological University 35

basic-sumo.ev3p

Hands-on Try it

Putting it together:

Hands-on Try it

Hands-on Try it

Page 36: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Push it all the way off the edge

• Set variable “rside” when right light sensor is off edge

• Value of “rside” determines which way to move

• Push bottle/opponent all the way off table

4/23/2016 Lawrence Technological University 36

Page 37: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Unknown Factor examples

• Display “RoboFest” while waiting 10 seconds to move after starting program

• Wait for a black card to be removed from a sensor

4/23/2016 Lawrence Technological University 37

Page 38: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

My Blocks

4/23/2016 Lawrence Technological University 38

• Use My Blocks for parts of a program you want to use multiple times or just to make it easier to read

• Highlight the part of your program you want to make into a My Block, then click Tools -> My Block Builder

Page 39: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

My Blocks

4/23/2016 Lawrence Technological University 39

• Choose a Name and optional description and icon

Page 40: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Physic of Sumo

Your robot will be more effective at pushing other robots off the table if you consider

• Mass

• Velocity

• Force

• Power

4/23/2016 Lawrence Technological University 40

Page 41: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Mass

• Quantity of matter [kilograms]

• m=mass, n=velocity, p=(linear) momentum

p=m*n

• F=force, a=acceleration

F=m*a

• With a larger the mass, more Force is required for same acceleration

• Where to add mass? Consider the center of gravity (should be low and inside wheel base)

4/23/2016 Lawrence Technological University 41

Page 42: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Velocity

• Velocity = Speed and Direction [meter/second]

• m=mass, n=velocity, p=(linear) momentum

p=m*n

• If we increase the velocity, we increase the momentum

• The larger the momentum, the greater the impact force will be applied to the opponent

• How do we increase the velocity of the robot? (With the motor)

4/23/2016 Lawrence Technological University 42

Page 43: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Force

• Pushing (Pulling) or Twisting

• Linear Force [Newton] or Torque [N-m]

• T=torque, r=wheel radius

• Force=Torque/radius

• How do we increase the Force applied by the wheels?

• Increase the torque

• Decrease the radius (smaller wheels)

4/23/2016 Lawrence Technological University 43

Page 44: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Power

• Power is Force *Distance / time [W=N*m/s]

• P=Power, F =Force, T=Torque, n=velocity, w=angular velocity

P=F*n

P=T*w

• How do we increase the Force and/or velocity?

• Increase the power (Motor power)

• Make sure batteries are fully charged!

4/23/2016 Lawrence Technological University 44

Page 45: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Build a better Robot (later)

• Sturdy construction

• At least 2 attachment points for each part so robot stays together

• Compact design

• Triple pegs on multiple beams

• Wheel base

• Wide base for slow turns

• Narrow base for fast turns

• Which is best for stability of robot?

4/23/2016 Lawrence Technological University 45

Page 46: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Robot Design cont.

• Wheels

• How many tires? 2 or more?

• Tires- rubber or plastic? (for traction?)

• Size – large or small?

• Placement of wheels – front or back?

4/23/2016 Lawrence Technological University 46

Page 47: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Robot Design cont

• Sensors

• Placement of light sensors (height above table? How far in front or to side of wheels?)

• Placement of sonar sensor (low or high?)

• Use additional sensor(s)?

• Touch sensor(s) to detect if an opponent is pushing your robot?

• Touch sensor(s) to detect if you are pushing an opponent or the bottle?

4/23/2016 Lawrence Technological University 47

Page 48: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

Strategy (for the future)

• Try to lift an opponent off the table?

• Try to hide from an opponent (cloaking)?

• Bounce off an opponent if attacked?

• Add a motor to power a mechanical device to attack your opponent (try to flip your opponent over)?

• Better search for opponent? Find again if opponent moves before you get to him.

4/23/2016 Lawrence Technological University 48

Page 49: BottleSumo EV3 Workshop - Robofest - Home · BottleSumo EV3 Workshop Instructor: Dr. Fred Brauchler Assistant: Devson 4/23/2016 Thanks to our Sponsors! 4/23/2016 Lawrence Technological

[email protected]

Questions?

Little Robots, Big Missions

49Lawrence Technological University4/23/2016 Lawrence Technological University

Hands-on Try it