robotic sensors

43

Upload: deepak-agasibagil

Post on 11-May-2015

1.776 views

Category:

Education


3 download

TRANSCRIPT

Page 1: Robotic sensors

Email: [email protected]

Page 2: Robotic sensors

2

• What is a robotic sensor?

Agenda

Page 3: Robotic sensors

3

• What is a robotic sensor?• How do they work?

Agenda

Page 4: Robotic sensors

4

• What is a robotic sensor?• How do they work?• What can they be used for?

Agenda

Page 5: Robotic sensors

5

• What is a robotic sensor?• How do they work?• What can they be used for?• Practical examples, including code &

demonstration

Agenda

Page 6: Robotic sensors

6

• Detects information about the physical world

What is a Robotic Sensor?

Page 7: Robotic sensors

7

• Detects information about the physical world?

• Converts this information into an electrical signal suitable for the robot’s computer controller

What is a Robotic Sensor?

Page 8: Robotic sensors

8

Simple Switch for sensing physical contact:

Function: Consists of two electrical contacts – they make or break a connection when the switch is activated

Examples of Robotic Sensors

(click for image)

Page 9: Robotic sensors

9

Simple Switch for sensing physical contact:

Function: Consists of two electrical contacts – they make or break a connection when the switch is activated

Where Used: • joystick trigger• limit switch on robot arm• bumper switch on robot• detect presence of a ball in a hopper…

Examples of Robotic Sensors

Page 10: Robotic sensors

10

How to Connect: • connect Common (COM) lead on switch to GND pin on Robot

Controller digital input• connect normally open (NO) lead on switch to SIG pin on Robot

Controller digital input

Simple Switch

Page 11: Robotic sensors

11

How to Program:

• Define the desired digital I/O pin as input, if this is not already done in the default code:

– e.g.: digital_io_02 = INPUT;

• Use the switch input as follows:

If (rc_dig_in02 = 0){

pwm01 = 127 /* stops motor if switch pushed*/}

Simple Switch

Page 12: Robotic sensors

12

Optical Sensor for physical presence: interrupted & reflected type are available

Function: Consists of light source (LED) and light detector (photocell), can sense by interruption or reflection of beam

Examples of Robotic Sensors

(click for image)

Page 13: Robotic sensors

13

Optical Sensor for physical presence: interrupted & reflected type are available

Function: Consists of light source (LED) and light detector (photocell), can sense by interruption or reflection of beam

Where Used: • Interruption – detects presence of object inside optical gap,

could be a flange on a robotic arm, a tooth on a sprocket…

Examples of Robotic Sensors

Page 14: Robotic sensors

14

Optical Sensor for physical presence: interrupted & reflected type are available

Function: Consists of light source (LED) and light detector (photocell), can sense by interruption or reflection of beam

Where Used: • Interruption – detects presence of object inside optical gap,

could be a flange on a robotic arm, a tooth on a sprocket…• Reflective – could count light and dark stripes on robot’s

drive wheel to measure distance traveled

Examples of Robotic Sensors

Page 15: Robotic sensors

15

Examples of Robotic Sensors

Optical Sensor

• How to Program:

• Define the desired digital I/O pin as input, if this is not already done in the default code:– e.g.: digital_io_02 = INPUT;

• Read the sensor input as follows:– If (rc_dig_in02 = 0)

{/* increment wheel count if sensor goes from 1 to

0*/}

Page 16: Robotic sensors

16

Rotary or shaft encoder for measuring shaft angle

Function: Consists of magnetic reed switches, or light source (LED) and light detector (photocell) with an encoder wheel

Examples of Robotic Sensors

(click for image)

Page 17: Robotic sensors

17

Rotary or shaft encoder for measuring shaft angle

Function: Consists of magnetic reed switches, or light source (LED) and light detector (photocell) with an encoder wheel

Where Used: • On a drive axle to measure speed and distance• On an arm to measure position• On a turret to measure angle

Examples of Robotic Sensors

Page 18: Robotic sensors

18

Rotary or shaft encoder for measuring shaft angle

How to Program: Usually consists of multiple digital outputs – connect these to

digital inputs on Robot Controller, and read these to determine when they change.

• Read the sensor input as follows:– If (rc_dig_in02 = 1 && rc_dig_in03 = 1 && rc_dig_in04 = 1)

{/* shaft is at 220º to 270 º angle*/

}

Examples of Robotic Sensors

Page 19: Robotic sensors

19

Ultrasonic transducer for measuring distance

Function: Consists of an ultrasonic transmitter and receiver. Circuitry

Where Used: • On the front or side of a robot to measure distance to a

wall

Examples of Robotic Sensors

(click for image)

Page 20: Robotic sensors

20

• Examples of sensors include:– Simple Switch for physical contact: joystick trigger, limit switch– Light beam for physical presence: interrupted & reflected– Rotary or Shaft Encoder for measuring rotary angle– Ultrasonic for measuring distance– Infra-red for measuring distance

What is a Robotic Sensor?

Page 21: Robotic sensors

21

• Examples of sensors include:– Simple Switch for physical contact: joystick trigger, limit switch– Light beam for physical presence: interrupted & reflected– Rotary or Shaft Encoder for measuring rotary angle– Ultrasonic for measuring distance– Infra-red for measuring distance– Microphone for listening

What is a Robotic Sensor?

Page 22: Robotic sensors

22

• Examples of sensors include:– Simple Switch for physical contact: joystick trigger, limit switch– Light beam for physical presence: interrupted & reflected– Rotary or Shaft Encoder for measuring rotary angle– Ultrasonic for measuring distance– Infra-red for measuring distance– Microphone for listening– Camera for seeing

What is a Robotic Sensor?

Page 23: Robotic sensors

23

• Examples of sensors include:– Simple Switch for physical contact: joystick trigger, limit switch– Light beam for physical presence: interrupted & reflected– Rotary or Shaft Encoder for measuring rotary angle– Ultrasonic for measuring distance– Infra-red for measuring distance– Microphone for listening– Camera for seeing– Accelerometer for measuring acceleration & position– …….

What is a Robotic Sensor?

Page 24: Robotic sensors

24

• Measuring Distance using Sharp GP2Y0A02YK – Measures distance from 20 cm to

150 cm

Specific Example – IR rangefinder

Page 25: Robotic sensors

25

• Measuring Distance using Sharp GP2Y0A02YK – Measures distance from 20 cm to

150 cm– Provides analog output: 0 to 5 V

Specific Example – IR rangefinder

Page 26: Robotic sensors

26

• Measuring Distance using Sharp GP2Y0A02YK – Measures distance from 20 cm to

150 cm– Provides analog output: 0 to 5 V– Can be connected directly to

Robot Controller’s analog input

Specific Example – IR rangefinder

Page 27: Robotic sensors

27

• Measuring Distance using Sharp GP2Y0A02YK – Measures distance from 20 cm to

150 cm– Provides analog output: 0 to 5 V– Can be connected directly to

Robot Controller’s analog input– Has a spot beam, for accurate

aiming

Specific Example – IR rangefinder

Page 28: Robotic sensors

28

• Measuring Distance using Sharp GP2Y0A02YK – Measures distance from 20 cm to

150 cm– Provides analog output: 0 to 5 V– Can be connected directly to

Robot Controller’s analog input– Has a spot beam, for accurate

aiming– Is immune to color or reflectivity

of the environment

Specific Example – IR rangefinder

Page 29: Robotic sensors

29

• Measuring Distance using Sharp GP2Y0A02YK – Measures distance from 20 cm to

150 cm– Provides analog output: 0 to 5 V– Can be connected directly to

Robot Controller’s analog input– Has a spot beam, for accurate

aiming– Is immune to color or reflectivity

of the environment– Costs ~ $12.00

Specific Example – IR rangefinder

Page 30: Robotic sensors

30

• Available from acroname, digikey, sparkfun and others• Connect as follows:

Sharp GP2Y0A02YK rangefinder

Page 31: Robotic sensors

31

• Read voltage using analog input command on Robot Controller:

ir_sensor = Get_Analog_Value(rc_ana_in16);

• This value will range between ~ 10 (at 150 cm) and ~ 580 (~ 20 cm)

Programming for the Sharp GP2Y0A02YK

Page 32: Robotic sensors

32

if (ir_sensor > lower_limit && ir_sensor < upper_limit )

{

pwm01 = 127; /* set servo to middle position */

}

Sample code: sets a servo to a different position depending on sensor distance

Page 33: Robotic sensors

33

if (ir_sensor > lower_limit && ir_sensor < upper_limit )

{

pwm01 = 127; /* set servo to middle position */

}

Else /* not in middle range */

{ if (ir_sensor < lower_limit) /* check sensor for far away*/

{

pwm01 = 0; /* set servo to far position */

}

Sample code: sets a servo to a different position depending on sensor distance

Page 34: Robotic sensors

34

if (ir_sensor > lower_limit && ir_sensor < upper_limit )

{

pwm01 = 127; /* set servo to middle position */

}

Else /* not in middle range */

{ if (ir_sensor < lower_limit) /* check sensor for far away*/

{

pwm01 = 0; /* set servo to far position */

}

Else

{

pwm01 = 253; /* set servo to near position */

}

}

Sample code: sets a servo to a different position depending on sensor distance

Page 35: Robotic sensors

35

• You can use the sensor output to control the speed of the left & right drive wheels so your robot will keep a specified distance from a wall.

IR Rangefinder

Page 36: Robotic sensors

36

• You can use the sensor output to control the speed of the left & right drive wheels so your robot will keep a specified distance from a wall.

• Use a second IR rangefinder to stop the robot or turn it when it approaches a wall in front of it.

IR Rangefinder

Page 37: Robotic sensors

37

• You can use the sensor output to control the speed of the left & right drive wheels so your robot will keep a specified distance from a wall.

• Use a second IR rangefinder to stop the robot or turn it when it approaches a wall in front of it.

• The IR rangefinder is a very useful and easy-to-use sensor, and is just one of many sensors you can use on your robot.

IR Rangefinder

Page 38: Robotic sensors

38

Thank you.

Page 39: Robotic sensors

39

END

Page 40: Robotic sensors

40

SwitchClick anywhere to return

Page 41: Robotic sensors

41

Click anywhere to return

Optical Interrupter Optical Reflector

Page 42: Robotic sensors

42

Rotary Encoder Encoder Disc, read by optical sensors inside decoder

Click anywhere to return

Page 43: Robotic sensors

43

Ultrasonic Rangefinder

Click anywhere to return