e ngineering d esign l ab ii engr-102 w inter 2015 w eek 4 l ecture – r obot m odule pramod...

36
ENGINEERING DESIGN LAB II ENGR-102 WINTER 2015 WEEK 4 LECTURE – ROBOT MODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 LAB WEEK 4 – GRIPPER DESIGN DESIGN PROPOSAL NOTES PROGRAMMING EXAMPLES USING NXC

Upload: bathsheba-palmer

Post on 22-Dec-2015

212 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

1

ENGINEERING DESIGN LAB IIENGR-102 WINTER 2015WEEK 4 LECTURE – ROBOT MODULE

Pramod Abichandani, Ph.D.

Richard Primerano, Ph.D.

LAB WEEK 4 – GRIPPER DESIGNDESIGN PROPOSAL NOTESPROGRAMMING EXAMPLES USING NXC

Page 2: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

WEEK 3 LAB

Design a robot that will move toward the light source in one corner of the arena

Determine how best to place the light sensor Characterize the light sensor’s directionality Develop an algorithm that will allow the robot

to detect and move toward the light

2

Page 3: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

THE NXT LIGHT INTENSITY SENSOR

3

The light sensor measures the intensity of light that strikes the sensing element.

It can be operated with its integral light source on or off With light source turned on, the sensor can be

used to detect the presence of an object by shining light on the object and measuring light reflected by it.

With light source turned off, the sensor can be used to measure ambient light.

Reflected light(light source on)

Ambient light(light source off)

Page 4: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

LIGHT SENSOR CALIBRATION

The light sensor produces a voltage output that varies from 0V to 5V depending on the amount of light being received.

The NXT converts this voltage to a number ranging from 0 to 100.

How can we associate a numerical value from the NXT with a target color (or ambient light level)?

4White targetNXT reads 80

Black targetNXT reads 13

Page 5: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

SOURCES OF ERROR WHEN USING THE LIGHT SENSOR

If used to detect objects (in reflected light mode), the sensor can be fooled by ambient light.

Typically, a sensor would be shrouded to block ambient light or a modulated light signal would be used to reject ambient light. 5

Object detected False detection causedby bright ambient light

Page 6: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

INSIDE THE NXT LIGHT SENSOR

6

Red LED

Phototransistor (sensor) NXT connector

LED on/offcontrol

Sensoramplifier

Page 7: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

SHROUDING THE LIGHT SENSOR

The light sensor can not determine the difference between ambient light and the lighthouse

Shrouding can help block ambient light and improve sensor performance

7

Ambient light

shrouded

unshrouded

Lighthouse

Page 8: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

MOUNTING AND ALIGNING THE SENSOR If the sensor is not aligned correctly, it will not ‘see’ the

lighthouse correctly. Shrouding the sensor makes it more sensitive to

misalignment.

8

proper alignment

misaligned

misaligned

Page 9: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

SENSOR FIELD-OF-VIEW

The shape of the shroud affects the sensor’s field-of-view.

9

long shroud

short shroud

Page 10: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

THE DIRECTIVITY OF SENSORS

With sensor at a fixed position, a light source is moved in a circular path around the sensor

At points along the path, we stop and record the light sensor’s output.

10

Page 11: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

MOVING TOWARD THE LIGHT SOURCE

Most techniques will involve these steps1. Search for light source2. Move in the direction of the light source3. If the light source is lost, search again and go to

2

Things to consider How do you determine if the robot is looking at

the light source or away from it? How will the robot respond if the light source

becomes blocked (by the other robot)? How does the directionality of the sensor affect

the robot’s performance?11

Page 12: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

EFFECT OF SENSOR FIELD-OF-VIEW

What are the tradeoffs in sensor field-of-view selection?

12

Page 13: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

REVIEW OF ROBOT CHALLENGE A derailed train has derailed, scattering trash and

nuclear waste in an area. A consulting firm has issued a call for companies to

submit designs and prototype robots capable of cleaning the affected area.

Your group is to submit a design and compete against other groups in receive the contract.

13

Page 14: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

THROUGH WEEK 3 OF LAB…

Touch, ultrasonic, and light sensors use Basic movements hardcoded into the robot Light seeking behavior programmed

For the competition, you will need to detect and avoid other robots and the arena fence detect contact between robot and trash/nuclear detect and move toward light source

You should be thinking of how to integrate the week 1-3 (and week 4) materials into your challenge robot

14

Page 15: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

WEEK 415

Page 16: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

16

TEAMWORK EVALUATIONS

Due this week This is meant mainly to help us identify

potential teamwork issues and is not the only factor in deriving teamwork scores

If you are having any issues with team members, please let us know ASAP (don’t wait for evaluations).

Page 17: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

17

DUE NEXT WEEK

Design Proposal See proposal template

Signoff sheets Lab notebook pages from weeks 1-4

See journal guidelines

Page 18: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

18

BEFORE ARRIVING TO LAB IN WEEK 4

Begin building your robot You don’t need a completed robot at this point This should act as a chassis for your gripper Before you begin, you should have a general

idea of how you intend to construct your competition robot. Sensor placement Gripper placement Bumpers

Page 19: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

19

ADDITIONAL NON-KIT BUILDING MATERIALS ALLOWED

Paper, cardboard, foam core Tape, hot glue Rubber bands, string, copper wire Ping-pong balls, drinking straws Other Lego pieces, excluding additional

sensors or motors

Your robot must fit in a 1’ x 1’ x 1.5’ box, any orientation, at the start of the competition.

Page 20: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

20

WEEK 4 LAB

Design a mechanism that can capture waste objects in the arena and move them to a desired location

There are no restrictions on how you do this Drag, lift, etc…

In subsequent weeks you will need to determine if the object is trash or nuclear by buzzer, color, magnetism, or other means.

Page 21: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

21

CANISTER CONSTRUCTION

Each canister is made from 2.5” PVC end caps

Nuclear canisters Yellow colored Magnetic

Trash canisters Blue colored Nonmagnetic

Page 22: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

22

KNOW THE COMPETITION RULES

Read the Robot Module Week 7&10 Lab Writeup

Unintentional Delivery (score not affected) A robot moving in reverse or rotating pushes a

canister into the drop-off area A robot moving forward pushes the canister a

distance of less than 1 foot without capturing the canister (up to referee’s judgment)

Intentional Delivery (score affected) A robot transporting a canister any distance using its

intended transport mechanism (e.g. a plow bumping the canister into the drop-off area)

A robot pushing a canister a distance of 1 foot or more while moving forward (up to referee’s judgment).

Page 23: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

23

ROBOT DESIGN PROPOSAL

Should contain the following Summary of the design constraints under which

you must design your robot Detailed description of your intended robot

design Hardware design: sensor placement, mechanism

design Algorithm design: behavior of robot

Include any sketches, pictures, calculations relevant to your design

Page 24: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

24

ROBOT DESIGN PROPOSAL

Should be comprehensive in addressing all of the required “basic behaviors” listed in the robot competition guidelines Canister search Gripper design Canister delivery Object avoidance

You must indicate the sensors that will be used for each behavior

Page 25: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

25

BEGIN DOCUMENTING STRATEGY

Before leaving lab this week, you must document and discuss with your instructor The design of your robot: sensor placement, gripper

design The strategy your robot will take, including any

defensive/negative strategies The algorithm your robot will follow

Note: your robot must be designed to avoid contact with the walls of the arena and other robots The robot should detect and avoid the fence when

approaching head-on There will be cases when these obstacles are in the

robot’s blind spot and collisions do occur

Page 26: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

26

THINGS TO CONSIDER

Collisions will most likely occur. Design your robot with this in mind (bumpers maybe?).

There are only four sensor ports on the robot. When thinking about your robot design, keep this in mind Can one sensor provide multiple functions?

Consider defensive strategies. How can you keep your opponent from scoring points? You can’t damage the other robot

Page 27: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

27

DUE NEXT WEEK!

Design Proposal Discuss the basic design of the robot

Physical/mechanical Sensing Algorithms

Follow the template provided!

First notebook check You should have a minimum of 15 page at the

end of the project Document all experimental data, mechanism

sketches, pseudo code, etc…

Page 28: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

28

PROGRAMMING ALTERNATIVESTHE LEGO NXT-G ENVIRONMENT

Uses graphical programming Blocks are placed and wired together to make program Requires no prior programming knowledge Can be limiting for those with prior programming knowledge This is the ‘official’ programming alternative supported through our

course. Additional/Advanced NXT-G Tutorials:

http://www.stemcentric.com/nxt-tutorial/

Dj
Added this line...its also on the course website under the tutorials tab.
Page 29: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

29

PROGRAMMING ALTERNATIVESNXC WITH BRICX COMMAND CENTER

C-like syntax, more appropriate when writing complex code. Some prior programming knowledge is recommended Software is provided on lab computes and is free to install

We offer this as an ‘unofficial’ option this year. No formal support is offered through the course but we will help when we can.

Tutorial - http://bricxcc.sourceforge.net/nbc/nxcdoc/NXC_tutorial.pdf

Dj
Also on course website under tutorial tab.
Page 30: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

30

PROGRAMMING EXAMPLES USING NXC

Basic motor control

Page 31: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

31

PROGRAMMING EXAMPLES USING NXC

Using #define to clarify your code

Page 32: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

32

PROGRAMMING EXAMPLES USING NXC

Declaring variables Random number generation

Page 33: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

33

PROGRAMMING EXAMPLES USING NXC

Using conditionals

Page 34: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

34

PROGRAMMING EXAMPLES USING NXC

Reading sensor data

Page 35: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

35

PROGRAMMING EXAMPLES USING NXC

Using subroutines

Page 36: E NGINEERING D ESIGN L AB II ENGR-102 W INTER 2015 W EEK 4 L ECTURE – R OBOT M ODULE Pramod Abichandani, Ph.D. Richard Primerano, Ph.D. 1 L AB W EEK 4

THANK YOU36