nxt programming bill johnson · 2019-12-17 · resources ii –nxt curriculum (pdf) –5 minute bot...

55
NXT PROGRAMMING Bill Johnson Agenda: - Intro (ASU BEST video) - Resources (AZFLL.com) - Workshop (learning the basics) - FLL Team Prep (stages) - Wrap up

Upload: others

Post on 11-Jul-2020

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

NXT PROGRAMMING Bill Johnson

Agenda:

- Intro (ASU BEST video)

- Resources (AZFLL.com)

- Workshop (learning the basics)

- FLL Team Prep (stages)

- Wrap up

Page 2: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

azfll.com

• “Starter Documents”

– FREE NXT Training Course

– 2013 Arizona FLL Introductory Coach/Mentor

Workshop: 2013 Arizona Coaches

Workshop Introduction/Intermediate –

Recording includes veteran coach advice

- NXT Programs – Robot Building Instructions

– STEMcentric NXT Robotics Tutorial

– STEMcentric EV3 Robotics Tutorial *NEW*

Page 4: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

• Show video

Page 5: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Bot Basics (ASU Best Video)

• Bot build

• X-Y movement (distance/turns)

• Simple sensors (light/ultrasonic)

• Line following

• “Mission mapping”

Page 6: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Session I

• Overview the pre-built bot

• Overview the Mindstorms software

• Workshop methodology

Page 7: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

5 Min Bot Sound sensor

Ultrasonic

sensor

Page 8: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

NXT Controller – The Brick Motor Ports (A, B, C)

Power On and Select

Select Buttons

Back Button or Program Cancel

Icons representing menu options

Sensor Ports (1, 2, 3, 4)

USB Port

Section 1: Software Overview and

Building

Page 9: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Mindstorms Software Overview

• Fire up Mindstorms software

• Type in “First Program” and hit “GO>>”

• Expand workspace (click red cross upper

right corner)

Page 10: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Configuration Panel NXT Brick Status

Download Program

Tool Panel Select

Light Green – Robot Actions

Yellow – Read Sensors

Orange – Program Flow

Dark Orange – Math/Data

Dark Red - Advanced

Dark Green – Common Commands

Program Map Window

Page 11: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig
Page 12: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Program Flow

Not in Program Flow

Page 13: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Motors that

will be given

the

command.

Duration –

Is it

rotations,

degrees,

time, or

unlimited? Power Level

Motor

Direction

Page 14: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Move Block Configuration Panel

Section 1: Software Overview and

Building

Page 15: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Toolbar Icons

New File/Open Program/Save Program/Cut/Copy/Paste/

Undo/Redo/Pointer/Pan Tool/Comment Tool/MY Blocks

Pull Down Menus (File - open/save/print/etc.; Edit; Tools; Help)

Page 16: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

NXT Brick Status

Download Program

Program Map Window

Page 17: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Generate A Simple Program

Forward/Backward Loop 4 times

Forward/turn

Play a sound

Page 18: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Workshop Methodology

Three hands-on sessions – in each session:

– brief instructions (how to’s)

– tasks/challenges will be presented

– hands-on activities

– discussion of observations/learning

Operations:

– work in teams of 2-3

– note observations/list questions

– ask mentors for help

– stop working and listen during instructional times

Page 19: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

• Show Boys/Girls Club video

Page 20: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Obstacle Race Challenge

(strategies/mission mapping)

First Robot Across Finish Line WINS!!

Step Meas. Control

1 F 16” 2.3

2 R 45° 0.48

3 F 8.5” 1.2

4 R 90° 0.96

5 F 30” 4.3

1 1

2

4

3

5

Page 21: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Problem Solving Process

• Develop strategy (pick a path)

• Map path (measure distances/angles)

• Convert physical measurements to computer

control parameters

• Generate program & download to robot

• Test

• Adjust parameters/program as needed

Page 22: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Problem Breakdown (what’s needed to be done)

• How do you move the bot a specified

distance?

• How do you make the bot turn?

• How do you convert physical

measurements to control parameters?

(bot calibrations – distance and turns)

Page 23: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Tasks/Challenges

• Calibrations

– tire circumference

– turn angles

• Challenges

– parking (without and with turn)

– “closest to wall” (without and with turn)

– “design your own”

• Extensions (different speeds, backwards, use your imagination)

Page 24: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Tattletale to help

count rotations.

Tool to visualize wheel operation

(distance traveled vs tire circumference)

Page 25: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Move Calibrations

Math Learning:

distance vs wheel geometry, data plotting,

formulas

Issues:

measurement skills, math (fractions, etc.),

documentation

Page 26: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Linear Moves

distance traveled, Dt = n × C where n = number of tire rotations, C = tire circumference

Calibration Task 1: accurately measure

tire circumference

C = Dt / n

Note: Dt = S × t where S = speed, t = time is NOT

recommended (speed is not constant)

Page 27: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Bot Distance Calibration

Page 28: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Challenge 1: Moving into Parking Space

Starting Line Finish Lines

Start anywhere behind the starting line and stop the NXT in between

the finish lines. The NXT must not be over any line.

The NXT must be

completely within

lines.

Page 29: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Challenge 2: Closest to the Wall

Starting Line Wall

Start the NXT any where behind the starting line. The NXT should move forward

and come within 1 centimeter without any piece of the NXT touching the wall.

The NXT should

stop within 1 cm

of the wall.

Page 30: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Please stop

working and be

ready to

discuss.

Page 31: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Session II - Turning

• Types:

– one wheel (pivot turn)

• forward

• reverse

– tank turn (one wheel backwards, one

forward)

– two wheel (different wheel speeds)

Page 32: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Tire Rotations

Visualizing Turn Mechanics

Turning Jig

One wheel turns while the

other is locked into position.

Page 33: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Tire rotations = path length/tire circumference

# rotations = ( desired angle/360°)( 2πr ) / C

r => turning radius (distance between the tires – center to center)

C => tire circumference

Predictable Turn Angles

r

Page 34: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Turn Calibration Exercises

• 360° Turns calibration (This will serve as a basis for other turn parameters)

• Four turn test (This test highlights errors over multiple movements.

Errors compound, so minor parameters errors will

create large inaccuracies in final placement.

Issues:

right vs left turns, weight distribution,

sliders vs castor wheel, etc.

Page 35: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Turn Calibration (360°Test)

Program three MOVE blocks:

forward 2 rot/one wheel turn (~ 6 rot)/forward 1 rot

Perfect Turn Parameter

Oversteer (decrease turn)

Understeer (increase turn)

Page 36: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Four Turn Test

Program: place two MOVE blocks into a LOOP block

Under steer

Over steer

Terminology Issue:

Turn angle degrees vs

wheel rotation degrees

Page 37: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Challenge 3: Turn to Park

Starting Line

Parking Space

Start the NXT any where behind the starting line. The NXT should move forward

and turn to park within the parking space. No part of the NXT can be touching or

over the boundaries.

No part of the NXT can be out of

the parking space.

Page 38: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Challenge 4: Turn to Closest to Wall

Starting Line

Wall

Start the NXT any where behind the starting line. The NXT should move forward,

turn towards the wall, park between the lines, and stop within 1 centimeter of the

wall. No part of the NXT can be touching the wall.

Distance should

be less than 1 cm.

Page 39: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Please stop

working and be

ready to

discuss.

Page 40: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Discussion Points

Linear/turn moves

– How does the initial placement affect the ending

position?

– How can you accurately place the robot in the

beginning?

– Does wheel size affect turn parameters?

– castor wheels and sliders – which is better?

– How do surfaces effect turn accuracy?

– Does weight placement affect the turn? Where

should the weight be placed on a robot?

Page 41: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Session III – Using Sensors

Sensors allow the robot to gather information to

find intermediate reference points or landmarks.

Shorter move distances = Less error

Dynamic information gathering = Larger margin of error

Guiding Question: How might we use sensors to find reference points to move the robot more accurately, consistently, and predictably?

Page 42: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Section 3: Using Sensors

Page 43: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Section 3: Using Sensors

Page 44: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Section 3: Using Sensors

Page 45: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Section 3: Using Sensors

Page 46: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Session III – Using Sensors

(How might I move the robot more accurately,

consistently, and predictably?)

Touch

Color Light

Sound Ultrasonic

Rotation Section 3: Using Sensors

Page 47: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Basic Sensor Program (WAIT Block)

Use common blocks

MO

VE

un

lim

ited

WA

IT u

nti

l tr

igg

er

ST

OP

Do NOT use Sensor from

“Senor Read Menu”

Page 48: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

WAIT Block

• WAIT Block Operation:

keep doing whatever action that is being done BEFORE the WAIT block, UNTIL the desired sensor is triggered – then continue actions along the sequence beam

examples: – stopped - sensor trigger - move

– moving forward “unlimited”- sensor trigger - stop

– etc.

Page 49: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig
Page 50: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Light

Rotation

Ultrasonic

Color

Touch

Page 51: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Move Block Configuration Panel

Section 3: Using Sensors

Page 52: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Sensor Exercises

• ultrasonic wall sensing

• line sensing (need light calibration)

• sensor combinations

• line following

Page 53: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Please stop

working and be

ready to

discuss.

Page 54: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Stages for FLL Team Prep

• Learn the basics 3-6 wks

• Generate initial game strategies/missions

START SIMPLE! 2-4 wks

• GO TO A SCRIMMAGE (mid to end Oct)

• Reassess strategies/missions 2-4 wks

• Use last 1-2 wks to practice “final missions”

Page 55: NXT PROGRAMMING Bill Johnson · 2019-12-17 · Resources II –NXT Curriculum (PDF) –5 Minute Bot Assembly Instructions (PDF) –Wheelie Assembly Instructions (PDF) –Turning Jig

Wrap Up

• Robotics is educational AND FUN!!!

• Coaches should always be assessing

their team’s capabilities and adjust

their program as needed

• There are a multitude of learning

opportunities – less instruction leads to

more learning