Free Course: How to build a real robot Lecture 3 Sensing the World MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 1/221 Objectives When you have finished this lecture you should be able to: MUSES_SECRET: ORF-RE Project - PAMI Research Group University of Waterloo Understand Difference between Sensing and Perception, and Recognize their importance to a Robot. Understand what a Sensor is, and the different Sensors Classification. Recognize Various Sensors Examples that are used in Robots. Understand how IR Sensor can be used to provide the necessary Sensing for a line following robot. MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 2/222 1
Outline Introduction to Sensors Internal Sensors MUSES_SECRET: ORF-RE Project - PAMI Research Group University of Waterloo Surface Sensors External Sensors MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 3/223 Outline Introduction to Sensors Internal Sensors MUSES_SECRET: ORF-RE Project - PAMI Research Group University of Waterloo Surface Sensors External Sensors MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 4/224 2
Introduction to Sensors As human, we often take for granted our amazing perceptual systems. We see a cup sitting on a table, automatically reach out to pick it up and think noting of it. At least, we are not aware of thinking much of it. In fact, accomplishing simple task of drinking from a cup requires a complex interplay of: sensing, interpretation, cognition, and coordination. MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 5/225 Introduction to Sensors If we assign a robot some service task, the first expectation is that the robot should emulate a human in getting the task done. Thus, the robot servant probably has arms and hands, is mobile and is sensate. It is sensory perception that will mark the success or failure of a service robot. Machine perception includes a vast array of transducers that can inform robots about their surroundings. Bats and dolphins use sonar, cats use whiskers birds use magnetic fields in navigation. So can robot! MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 6/226 3
Introduction to Sensors Why Sensors are Important to Robots? The measurements of robot and environmental parameters is fundamental to the successful application of robots such as: MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 7/227 Introduction to Sensors Why Sensors are Important to Robots? These include, but is not limited to: Measuring robot parameters for control loops. Finding the location of objects. Detecting and avoiding failure situations Monitoring the environment for changes (e.g.: temperature) Inspecting the results for processes. MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 8/228 4
Introduction to Sensors Sensor Classification Internal Sensors: measure variables within the robot (ex : position, velocity, torque and acceleration sensors.) Surface Sensors: information from the robot s surface. External Sensors: measure the environment (ex : tactile, proximity, range, vision, and voice. ) MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 9/229 Introduction to Sensors Sensor Classification: Example An Autonomous security robot, employs a total of 132 sensors for navigation. The internal sensors measures variables such as position, velocity, torque,.. The surface sensors are tactile bumpers The External sensors measures the environment; such as range, smoke, voice, MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 10/22 5
Outline Introduction to Sensors Internal Sensors MUSES_SECRET: ORF-RE Project - PAMI Research Group University of Waterloo Surface Sensors External Sensors MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 11/22 Internal Sensors Position Sensors: Encoders A rotary encoder is a sensor for converting rotary motion or position to a series of electronic pulses. MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 12/22 6
Internal Sensors Position Sensors: Hall-Effect Sensors A Sensor depending in its operation on the Magnetic phenomenon. It produces pulses every time a magnet piece passes in front of the detector MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 13/22 Internal Sensors Battery-Level Sensing By sensing its battery voltage, a robot can determine when it is time to return to the charging station or curtail power-draining operations. Only a voltage divider is needed to design a battery-level indicator. Stall Current Sensing One reliable way to determine if a robot is stuck is to monitor the current being used to drive the motors. If all other sensors fail to detect an imminent collision, the robot will, in short order, come to rest against the obstacle. In this situation, the wheels will stop rotating while current to the motors will go to a maximum. Thus, motor current serves as a collision detector of last resort. MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 14/22 7
Outline Introduction to Sensors Internal Sensors MUSES_SECRET: ORF-RE Project - PAMI Research Group University of Waterloo Surface Sensors External Sensors MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 15/22 Surface Sensors Limit Switches / Push Buttons A contact sensor must physically touch an object before the sensor is activated. When the switch is pressed the circuit is closed and current flows, and when it is released the circuit is open and no current flows. Thus the output of these sensors is a binary value. Push buttons detect operator input Limit switches detect collisions. MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 16/22 8
Surface Sensors Limit Switches / Push Buttons The using of micro Limit switches in a Robot is shown in the following figure. It s used to detect if the robot touches any obstacle in its environment while operating. MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 17/22 Surface Sensors Tactile Sensors/Artificial Skin Tactile sensors are able to detect an object and recognize its shape. Artificial skin can be formed by aggregating multiple sensing points in form of digital sensor array using VLSI. Measuring 2-D pressure distribution Image formation from tactile sensor data MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 18/22 9
Outline Introduction to Sensors Internal Sensors MUSES_SECRET: ORF-RE Project - PAMI Research Group University of Waterloo Surface Sensors External Sensors MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 19/22 External Sensors Proximity Sensors Proximity sensors detect the presence of an object when the object comes within a specified range of the sensor without physically touching it Optical Proximity Sensors They consist of a light emitter and receiver. They detect the presence of an object by reflection. If the object is in sensitive range, it will reflect the emitted beam back to a receptor. Light Barrier MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 20/22 10
External Sensors Inductive Proximity Sensors Inductive sensors use electro-magnetic induction to sense metal objects, typically iron and steel, by inducing a current in them. where dba V = N dt N-- is the number of turns, B-- is the amplitude of magnetic field A-- is the area of the circuit where is in the magnetic field. MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 21/22 External Sensors Capacitive Proximity Sensors Capacitive proximity sensors reliably detect non-metallic objects, liquid, powder & granular materials. They can also detect materials through glass or plastic walls. MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 22/22 11
External Sensors Range Sensors Sensors for distance measurements are among the most important ones in robotics. Mobile robots are equipped with various sensor types for measuring distances to the nearest obstacle around the robot for navigation purposes. Range Sensors Sonar Sensors Laser Sensors Infrared Sensors MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 23/22 External Sensors Range Sensors: Sonar 1 d = * Vt 2 V = speed of sound = 331 + 0.6T m/s T is the temperatu re in t is the time of travel o C MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 24/22 12
External Sensors Range Sensors: Sonar Sonar Sensor Robot Navigation Self-Parking Cars Guiding Blind people MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 25/22 External Sensors Range Sensors: Laser Depends on using the laser beam to determine the distance of an object. It operates on the time of flight principle by sending a laser pulse in a narrow beam towards the object and measuring the time taken by the pulse to be reflected off the target and returns to the sender. Robot using Laser sensors to scan environment MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 26/22 13
External Sensors Range Sensors: Infrared The sensor transmits an IR beam, the beam hits an object and portion of the light reflected back through the receiver optics and strikes at a point on the Photo Sensing Device (PSD). PSD is capable of generating a voltage characteristic to the point on which the reflected beam struck. MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 27/22 External Sensors Range Sensors: Infrared The parking assistant system is fully autonomous and intelligent. A central controller keeps track of external environmental information from infrared sensors as well as internal states. MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 28/22 14
External Sensors Range Sensors Aspect IR Sonar Range 4 140 cm 41 cm 10.5 m Accuracy Color sensitivity Climate conditions Power consumption Higher in the range of 24 cm Sensitive Non-sensitive Higher in the range bigger than 40 cm Non-sensitive Sensitive Low (30-50 ma) High (100-200mA) Cost Low Higher MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 29/22 Outline Introduction to Sensors Internal Sensors MUSES_SECRET: ORF-RE Project - PAMI Research Group University of Waterloo Surface Sensors External Sensors MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 30/22 15
Using IR sensors to implement line following behavior on a Robot Tracker or Line Following Sensors MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 31/22 We will use 3 IR sensors to control the behavior of the robot to follow the trace of a black line. The interface between the sensors and the Control is two wires at either: +5 Volts (when it s over the black tape) 0 Volts (when it s not over the black tape) Note: This type of implementation may cause the robot to act in an oscillatory behavior, (i.e.: making sudden turns from one side to the other) MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 32/22 16
The Sensor of the Line following Robot needs to be able to distinguish between the black tape and the white floor. One difference between black Surfaces and white surfaces is that black Surfaces absorb all wavelengths of incident light, while white surfaces reflect all wavelengths of incident light. MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 33/22 IR sensors will be used instead of Visible light sensors because visible light sensors are easily interfered with by ambient light and shadow. The longer wavelength of IR creates a stronger, more reliable signal while still being absorbed by the black tape.. MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 34/22 17
Simple Infrared Light Proximity Sensors Basic LED-phototransistor MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 35/22 Simple Infrared Light Proximity Sensors The infrared phototransistor should be baffled blocked from both ambient room light as well as direct light from the LED. MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 36/22 18
Simple Infrared Light Proximity Sensors The positioning of the LED and phototransistor is very important, and you must take care to ensure that the two are properly aligned. MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 37/22 Simple Infrared Light Proximity Sensors You may wish to mount the LED phototransistor pair in a small block of wood. Drill holes for the LED and phototransistor. Or, if you prefer, you can buy the detector pair already made up and installed in a similar block. The Texas Instruments TIL139 infrared emitter/detector sensor unit. These types of units are often available on the surplus market. MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 38/22 19
A Comparator will be used as a simple analog to Digital converter to create a digital signal to send to the control stage of the robot. These Sensors operate by either creating or removing a path to ground. When the IR transistor is not receiving a signal, the collector voltage is forced into the comparator. When the IR transistor receives a signal, a path to ground is created and a lower voltage is sent to the comparator. MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 39/22 The Circuit implemented for a single Sensor: LED1: Infrared LED Q1: Infraredsensitive phototransistor IC1: LM339 quad comparator Connecting the LED and phototransistor to an LM339 quad comparator IC. The output of the comparator switches between HIGH and LOW depends on the amount of light falling on the phototransistor. Note the addition of the 10K pull-up resistor on the output of the comparator. This is needed to assure proper HIGH/LOW action. MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 40/22 20
Another implementation for a single Sensor: LM324N MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 41/22 Operation Logic As mentioned earlier, the Implementation will include 3 IR sensors, fixed side by side in the form of an array (As shown). For these 3 Sensors we have 3 cases, in which they may be found. Next we will study the different modes, and what is expected from the controller for each mode. MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 42/22 21
Operation Logic Let s take a closer Look at the Line Sensor Array. IR detector IR Emitter Black Line to follow MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 43/22 Operation Logic Mode (1): The Black Line is under the Sensor at the Middle of the Array. So the Middle Sensor will be the only sensor to give digital 1 to IR detector the controller. Required Action: Nothing to change, keep moving forward with the same velocity IR Emitter Black Line to follow MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 44/22 22
Operation Logic Mode (2): The Black Line is under the Sensor at the Right side of Array. So the Right Sensor will be the Robot Motion only sensor to give digital 1 to the controller. IR detector Required Action: Rotate the robot a little to make the line be centered again. So must move the Robot s Body in the shown direction. IR Emitter Black Line to follow MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 45/22 Operation Logic Mode (3): The Black Line is under the Sensor at the Left side of Array. So the Left Sensor will be the Robot Motion only sensor to give digital 1 to the controller. Required Action: Rotate the robot a little to make the line be centered again. So must move the Robot s Body in the shown direction. IR detector IR Emitter Black Line to follow MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 46/22 23
Operation Logic Using only two IR sensors MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 47/22 Operation Logic How can this Logic be realized??? In order to move the robot in the prescribed behavior, we must connect the measurements of the Sensors to the motion of the Motors on the wheels of the robot. This can be Achieved through the Microcontroller. Which is the Brain of the Robot, to tell it what to do according to the measurements it make, at a certain time. Next Lecture s Topic MUSES_SECRET: L3, Adding the Brain: ORF-RE 2011-2012 Project - Dr. Alaa PAMI Khamis, Research IEEE Group RAS University Egypt Chapter of Waterloo 48/22 24