Top Banner
Robotics Light sensor. Calibration. Reverse engineering challenge. Lab work: Create and show your program. Add light sensor (different orientations). Robot moves with light. Robot follows line. Homework: Postings.
18

Robotics Light sensor. Calibration. Reverse engineering challenge. Lab work: Create and show your program. Add light sensor (different orientations). Robot.

Jan 02, 2016

Download

Documents

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: Robotics Light sensor. Calibration. Reverse engineering challenge. Lab work: Create and show your program. Add light sensor (different orientations). Robot.

Robotics

Light sensor. Calibration. Reverse engineering challenge.

Lab work: Create and show your program. Add light sensor (different orientations). Robot moves with light.

Robot follows line.Homework: Postings.

Page 2: Robotics Light sensor. Calibration. Reverse engineering challenge. Lab work: Create and show your program. Add light sensor (different orientations). Robot.

Light sensor

• Detects ambient (surrounding) light– Calibration establishes minimum and

maximum values– Set block at specified level and comparison

(greater or less than) and sensor returns true if and only comparison is true.

– Can be set to generate light and (therefore) measure the reflection.

Page 3: Robotics Light sensor. Calibration. Reverse engineering challenge. Lab work: Create and show your program. Add light sensor (different orientations). Robot.

Light sensor blocks• Wait for light to be more (or less) than specified

levelOR

• Sense light (and keep going). – Data links inputs:

• Port• Level• Less or more• Generate light or not

– Data links outputs:• Intensity (scale 0 to 100)• Raw scale (0 to 1024)

Page 4: Robotics Light sensor. Calibration. Reverse engineering challenge. Lab work: Create and show your program. Add light sensor (different orientations). Robot.
Page 5: Robotics Light sensor. Calibration. Reverse engineering challenge. Lab work: Create and show your program. Add light sensor (different orientations). Robot.
Page 6: Robotics Light sensor. Calibration. Reverse engineering challenge. Lab work: Create and show your program. Add light sensor (different orientations). Robot.

Calibration• There are default values, but it is HIGHLY

RECOMMENDED that you set those values based on actual room conditions.

• 2 ways– Connected to computer using Tools/Calibrate

Sensors– Create calibration code/phase in program

• Gives chance to place robot (light sensor) on minimum

• Gives chance to place robot (light sensor) on maximum

Page 7: Robotics Light sensor. Calibration. Reverse engineering challenge. Lab work: Create and show your program. Add light sensor (different orientations). Robot.

Calibration procedure using computer

• Connect NXT to computer

• Tools/Calibrate Sensors downloads a program

• On NXT, follow instructions– Place with sensor on minimum value, press

Enter– Place with sensor on maximum value, press

Enter

Page 8: Robotics Light sensor. Calibration. Reverse engineering challenge. Lab work: Create and show your program. Add light sensor (different orientations). Robot.

Tools menu

Page 9: Robotics Light sensor. Calibration. Reverse engineering challenge. Lab work: Create and show your program. Add light sensor (different orientations). Robot.

Calibration block on NXT

• Download program with calibration block.

• NOTE: requires use of touch sensor

• Aside: need to ‘mesh’ your reading of program with assumptions on actions.

Page 10: Robotics Light sensor. Calibration. Reverse engineering challenge. Lab work: Create and show your program. Add light sensor (different orientations). Robot.

Wait for left button on NXT

Calibrate minimum valueposition

robotposition robot

Page 11: Robotics Light sensor. Calibration. Reverse engineering challenge. Lab work: Create and show your program. Add light sensor (different orientations). Robot.

Need to abort program using button

Use calibrated value and enter key

Page 12: Robotics Light sensor. Calibration. Reverse engineering challenge. Lab work: Create and show your program. Add light sensor (different orientations). Robot.

Use raw value (0 to 1024) and time

Page 13: Robotics Light sensor. Calibration. Reverse engineering challenge. Lab work: Create and show your program. Add light sensor (different orientations). Robot.

Reverse engineering test• Shine beam of light

• Place robot (with light sensor)

• Program: intensity going to power. Motors are turning…

Page 14: Robotics Light sensor. Calibration. Reverse engineering challenge. Lab work: Create and show your program. Add light sensor (different orientations). Robot.
Page 15: Robotics Light sensor. Calibration. Reverse engineering challenge. Lab work: Create and show your program. Add light sensor (different orientations). Robot.

What does the robot do?

• Guess

• Try it!

Page 16: Robotics Light sensor. Calibration. Reverse engineering challenge. Lab work: Create and show your program. Add light sensor (different orientations). Robot.

Lab

• Your program involving sound and bump/touch sensor.

Page 17: Robotics Light sensor. Calibration. Reverse engineering challenge. Lab work: Create and show your program. Add light sensor (different orientations). Robot.

Lab exercises• Add light sensor to basic robot• Write, download and test calibration program• Write, download and test “sense and display”

program (two variations shown)– calibrated scaled value versus raw value.– button versus time

• Follow line– Note: program for this given in Mindstorms

program

Page 18: Robotics Light sensor. Calibration. Reverse engineering challenge. Lab work: Create and show your program. Add light sensor (different orientations). Robot.

Homework

• Postings

• Examine links on AI

• [Start] thinking about your library research project.