nxt programming bill johnson · 2019-12-17 · resources ii –nxt curriculum (pdf) –5 minute bot...
TRANSCRIPT
NXT PROGRAMMING Bill Johnson
Agenda:
- Intro (ASU BEST video)
- Resources (AZFLL.com)
- Workshop (learning the basics)
- FLL Team Prep (stages)
- Wrap up
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*
Resources II
– NXT Curriculum (PDF)
– 5 Minute Bot Assembly Instructions (PDF)
– Wheelie Assembly Instructions (PDF)
– Turning Jig Assembly Instructions (PDF)
– Robot Challenge Worksheet (PDF)
– Programming Examples (PDF)
– Intermediate Robotics Presentation (PowerPoint - PDF)
– LEGO MINDSTORMS Sensor Programming (PDF)
• Show video
Bot Basics (ASU Best Video)
• Bot build
• X-Y movement (distance/turns)
• Simple sensors (light/ultrasonic)
• Line following
• “Mission mapping”
Session I
• Overview the pre-built bot
• Overview the Mindstorms software
• Workshop methodology
5 Min Bot Sound sensor
Ultrasonic
sensor
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
Mindstorms Software Overview
• Fire up Mindstorms software
• Type in “First Program” and hit “GO>>”
• Expand workspace (click red cross upper
right corner)
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
Program Flow
Not in Program Flow
Motors that
will be given
the
command.
Duration –
Is it
rotations,
degrees,
time, or
unlimited? Power Level
Motor
Direction
Move Block Configuration Panel
Section 1: Software Overview and
Building
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)
NXT Brick Status
Download Program
Program Map Window
Generate A Simple Program
Forward/Backward Loop 4 times
Forward/turn
Play a sound
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
• Show Boys/Girls Club video
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
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
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)
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)
Tattletale to help
count rotations.
Tool to visualize wheel operation
(distance traveled vs tire circumference)
Move Calibrations
Math Learning:
distance vs wheel geometry, data plotting,
formulas
Issues:
measurement skills, math (fractions, etc.),
documentation
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)
Bot Distance Calibration
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.
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.
Please stop
working and be
ready to
discuss.
Session II - Turning
• Types:
– one wheel (pivot turn)
• forward
• reverse
– tank turn (one wheel backwards, one
forward)
– two wheel (different wheel speeds)
•
Tire Rotations
Visualizing Turn Mechanics
Turning Jig
One wheel turns while the
other is locked into position.
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
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.
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)
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
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.
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.
Please stop
working and be
ready to
discuss.
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?
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?
Section 3: Using Sensors
Section 3: Using Sensors
Section 3: Using Sensors
Section 3: Using Sensors
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
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”
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.
Light
Rotation
Ultrasonic
Color
Touch
Move Block Configuration Panel
Section 3: Using Sensors
Sensor Exercises
• ultrasonic wall sensing
• line sensing (need light calibration)
• sensor combinations
• line following
Please stop
working and be
ready to
discuss.
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”
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