Download - Robotic sensors
![Page 1: Robotic sensors](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/1.jpg)
Email: [email protected]
![Page 2: Robotic sensors](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/2.jpg)
2
• What is a robotic sensor?
Agenda
![Page 3: Robotic sensors](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/3.jpg)
3
• What is a robotic sensor?• How do they work?
Agenda
![Page 4: Robotic sensors](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/4.jpg)
4
• What is a robotic sensor?• How do they work?• What can they be used for?
Agenda
![Page 5: Robotic sensors](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/5.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/6.jpg)
6
• Detects information about the physical world
What is a Robotic Sensor?
![Page 7: Robotic sensors](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/7.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/8.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/9.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/10.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/11.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/12.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/13.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/14.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/15.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/16.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/17.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/18.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/19.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/20.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/21.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/22.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/23.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/24.jpg)
24
• Measuring Distance using Sharp GP2Y0A02YK – Measures distance from 20 cm to
150 cm
Specific Example – IR rangefinder
![Page 25: Robotic sensors](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/25.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/26.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/27.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/28.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/29.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/30.jpg)
30
• Available from acroname, digikey, sparkfun and others• Connect as follows:
Sharp GP2Y0A02YK rangefinder
![Page 31: Robotic sensors](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/31.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/32.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/33.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/34.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/35.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/36.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/37.jpg)
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](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/38.jpg)
38
Thank you.
![Page 39: Robotic sensors](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/39.jpg)
39
END
![Page 40: Robotic sensors](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/40.jpg)
40
SwitchClick anywhere to return
![Page 41: Robotic sensors](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/41.jpg)
41
Click anywhere to return
Optical Interrupter Optical Reflector
![Page 42: Robotic sensors](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/42.jpg)
42
Rotary Encoder Encoder Disc, read by optical sensors inside decoder
Click anywhere to return
![Page 43: Robotic sensors](https://reader036.vdocuments.net/reader036/viewer/2022062418/55507a0cb4c9052d158b519a/html5/thumbnails/43.jpg)
43
Ultrasonic Rangefinder
Click anywhere to return