PLC and Automation Store

Sunday, November 4, 2012

PLC Basic- Sensors

4. LOGICAL SENSORS


4.1 INTRODUCTION

Sensors allow a PLC to detect the state of a process. Logical sensors can only detect a state that is either true or false. Examples of physical phenomena that are typically detected are listed below.
· inductive proximity - is a metal object nearby?
· capacitive proximity - is a dielectric object nearby?
· optical presence - is an object breaking a light beam or reflecting light?
· mechanical contact - is an object touching a switch?
Recently, the cost of sensors has dropped and they have become commodity items, typically between $50 and $100. They are available in many forms from multiple vendors such as Allen Bradley, Omron, Hyde Park and Turck. In applications sensors are interchangeable between PLC vendors, but each sensor will have specific interface requirements.
This chapter will begin by examining the various electrical wiring techniques for sensors, and conclude with an examination of many popular sensor types.

4.2 SENSOR WIRING

When a sensor detects a logical change it must signal that change to the PLC. This is typically done by switching a voltage or current on or off. In some cases the output of the sensor is used to switch a load directly, completely eliminating the PLC. Typical outputs from sensors (and inputs to PLCs) are listed below in relative popularity.
Sinking/Sourcing - Switches current on or off.
Plain Switches - Switches voltage on or off.
Solid State Relays - These switch AC outputs.
TTL (Transistor Transistor Logic) - Uses 0V and 5V to indicate logic levels.

4.2.1 Switches

The simplest example of sensor outputs are switches and relays. A simple example is shown in Figure 26 An Example of Switched Sensors.

Figure 26 An Example of Switched Sensors
In the figure a NO contact switch is connected to input 01. A sensor with a relay output is also shown. The sensor must be powered separately, therefore the V+ and V- terminals are connected to the power supply. The output of the sensor will become active when a phenomenon has been detected. This means the internal switch (probably a relay) will be closed allowing current to flow and the positive voltage will be applied to input 06.

4.2.2 Transistor Transistor Logic (TTL)

Transistor-Transistor Logic (TTL) is based on two voltage levels, 0V for false and 5V for true. The voltages can actually be slightly larger than 0V, or lower than 5V and still be detected correctly. This method is very susceptible to electrical noise on the factory floor, and should only be used when necessary. TTL outputs are common on electronic devices and computers, and will be necessary sometimes. When connecting to other devices simple circuits can be used to improve the signal, such as the Schmitt trigger in Figure 27 A Schmitt Trigger.

Figure 27 A Schmitt Trigger
A Schmitt trigger will receive an input voltage between 0-5V and convert it to 0V or 5V. If the voltage is in an ambiguous range, about 1.5-3.5V it will be ignored.
If a sensor has a TTL output the PLC must use a TTL input card to read the values. If the TTL sensor is being used for other applications it should be noted that the maximum current output is normally about 20mA.

4.2.3 Sinking/Sourcing

Sinking sensors allow current to flow into the sensor to the voltage common, while sourcing sensors allow current to flow out of the sensor from a positive source. For both of these methods the emphasis is on current flow, not voltage. By using current flow, instead of voltage, many of the electrical noise problems are reduced.
When discussing sourcing and sinking we are referring to the output of the sensor that is acting like a switch. In fact the output of the sensor is normally a transistor, that will act like a switch (with some voltage loss). A PNP transistor is used for the sourcing output, and an NPN transistor is used for the sinking input. When discussing these sensors the term sourcing is often interchanged with PNP, and sinking with NPN. A simplified example of a sinking output sensor is shown in Figure 28 A Simplified NPN/Sinking Sensor. The sensor will have some part that deals with detection, this is on the left. The sensor needs a voltage supply to operate, so a voltage supply is needed for the sensor. If the sensor has detected some phenomenon then it will trigger the active line. The active line is directly connected to an NPN transistor. (Note: for an NPN transistor the arrow always points away from the center.) If the voltage to the transistor on the active line is 0V, then the transistor will not allow current to flow into the sensor. If the voltage on the active line becomes larger (say 12V) then the transistor will switch on and allow current to flow into the sensor to the common.

Figure 28 A Simplified NPN/Sinking Sensor
Sourcing sensors are the complement to sinking sensors. The sourcing sensors use a PNP transistor, as shown in Figure 29 A Simplified Sourcing/PNP Sensor. (Note: PNP transistors are always drawn with the arrow pointing to the center.) When the sensor is inactive the active line stays at the V+ value, and the transistor stays switched off. When the sensor becomes active the active line will be made 0V, and the transistor will allow current to flow out of the sensor.

Figure 29 A Simplified Sourcing/PNP Sensor
Most NPN/PNP sensors are capable of handling currents up to a few amps, and they can be used to switch loads directly. (Note: always check the documentation for rated voltages and currents.) An example using sourcing and sinking sensors to control lights is shown inFigure 30 Direct Control Using NPN/PNP Sensors. (Note: This example could be for a motion detector that turns on lights in dark hallways.)

Figure 30 Direct Control Using NPN/PNP Sensors
In the sinking system in Figure 30 Direct Control Using NPN/PNP Sensors the light has V+ applied to one side. The other side is connected to the NPN output of the sensor. When the sensor turns on the current will be able to flow through the light, into the output to V- common. (Note: Yes, the current will be allowed to flow into the output for an NPN sensor.) In the sourcing arrangement the light will turn on when the output becomes active, allowing current to flow from the V+, thought the sensor, the light and to V- (the common).
At this point it is worth stating the obvious - The output of a sensor will be an input for a PLC. And, as we saw with the NPN sensor, this does not necessarily indicate where current is flowing. There are two viable approaches for connecting sensors to PLCs. The first is to always use PNP sensors and normal voltage input cards. The second option is to purchase input cards specifically designed for sourcing or sinking sensors. An example of a PLC card for sinking sensors is shown in Figure 31 A PLC Input Card for Sinking Sensors.

Figure 31 A PLC Input Card for Sinking Sensors
The dashed line in the figure represents the circuit, or current flow path when the sensor is active. This path enters the PLC input card first at a V+ terminal (Note: there is no common on this card) and flows through an optocoupler. This current will use light to turn on a phototransistor to tell the computer in the PLC the input current is flowing. The current then leaves the card at input 00 and passes through the sensor to V-. When the sensor is inactive the current will not flow, and the light in the optocoupler will be off. The optocoupler is used to help protect the PLC from electrical problems outside the PLC.
The input cards for PNP sensors are similar to the NPN cards, as shown in Figure 32 PLC Input Card for Sourcing Sensors.

Figure 32 PLC Input Card for Sourcing Sensors
The current flow loop for an active sensor is shown with a dashed line. Following the path of the current we see that it begins at the V+, passes through the sensor, in the input 00, through the optocoupler, out the common and to the V-.
Wiring is a major concern with PLC applications, so to reduce the total number of wires, two wire sensors have become popular. But, by integrating three wires worth of function into two, we now couple the power supply and sensing functions into one. Two wire sensors are shown in Figure 33 Two Wire Sensors.

Figure 33 Two Wire Sensors
A two wire sensor can be used as either a sourcing or sinking input. In both of these arrangements the sensor will require a small amount of current to power the sensor, but when active it will allow more current to flow. This requires input cards that will allow a small amount of current to flow (called the leakage current), but also be able to detect when the current has exceeded a given value.
When purchasing sensors and input cards there are some important considerations. Most modern sensors have both PNP and NPN outputs, although if the choice is not available, PNP is the more popular choice. PLC cards can be confusing to buy, as each vendor refers to the cards differently. To avoid problems, look to see if the card is specifically for sinking or sourcing sensors, or look for a V+ (sinking) or COM (sourcing). Some vendors also sell cards that will allow you to have NPN and PNP inputs mixed on the same card.
When drawing wiring diagrams the symbols in Figure 34 Sourcing and Sinking Schematic Symbols are used for sinking and sourcing proximity sensors. Notice that in the sinking sensor when the switch closes (moves up to the terminal) it contacts the common. Closing the switch in the sourcing sensor connects the output to the V+. On the physical sensor the wires are color coded as indicated in the diagram. The brown wire is positive, the blue wire is negative and the output is white for sinking and black for sourcing. The outside shape of the sensor may change for other devices, such as photo sensors which are often shown as round circles.

4.2.4 Solid State Relays

Solid state relays switch AC currents. These are relatively inexpensive and are available for large loads. Some sensors and devices are available with these as outputs.

4.3 PRESENCE DETECTION

There are two basic ways to detect object presence; contact and proximity. Contact implies that there is mechanical contact and a resulting force between the sensor and the object. Proximity indicates that the object is near, but contact is not required. The following sections examine different types of sensors for detecting object presence. These sensors account for a majority of the sensors used in applications.

4.3.1 Contact Switches

Contact switches are available as normally open and normally closed. Their housings are reinforced so that they can take repeated mechanical forces. These often have rollers and wear pads for the point of contact. Lightweight contact switches can be purchased for less than a dollar, but heavy duty contact switches will have much higher costs. Examples of applications include motion limit switches and part present detectors.

4.3.2 Reed Switches

Reed switches are very similar to relays, except a permanent magnet is used instead of a wire coil. When the magnet is far away the switch is open, but when the magnet is brought near the switch is closed as shown in Figure 35 Reed Switch. These are very inexpensive an can be purchased for a few dollars. They are commonly used for safety screens and doors because they are harder to trick than other sensors.

Figure 35 Reed Switch

4.3.3 Optical (Photoelectric) Sensors

Light sensors have been used for almost a century - originally photocells were used for applications such as reading audio tracks on motion pictures. But modern optical sensors are much more sophisticated.
Optical sensors require both a light source (emitter) and detector. Emitters will produce light beams in the visible and invisible spectrums using LEDs and laser diodes. Detectors are typically built with photodiodes or phototransistors. The emitter and detector are positioned so that an object will block or reflect a beam when present. A basic optical sensor is shown in Figure 36 A Basic Optical Sensor.

Figure 36 A Basic Optical Sensor
In the figure the light beam is generated on the left, focused through a lens. At the detector side the beam is focused on the detector with a second lens. If the beam is broken the detector will indicate an object is present. The oscillating light wave is used so that the sensor can filter out normal light in the room. The light from the emitter is turned on and off at a set frequency. When the detector receives the light it checks to make sure that it is at the same frequency. If light is being received at the right frequency then the beam is not broken. The frequency of oscillation is in the KHz range, and too fast to be noticed. A side effect of the frequency method is that the sensors can be used with lower power at longer distances.
An emitter can be set up to point directly at a detector, this is known as opposed mode. When the beam is broken the part will be detected. This sensor needs two separate components, as shown in Figure 37 Opposed Mode Optical Sensor. This arrangement works well with opaque and reflective objects with the emitter and detector separated by distances of up to hundreds of feet.

Figure 37 Opposed Mode Optical Sensor
Having the emitter and detector separate increases maintenance problems, and alignment is required. A preferred solution is to house the emitter and detector in one unit. But, this requires that light be reflected back as shown in Figure 38 Retroreflective Optical Sensor. These sensors are well suited to larger objects up to a few feet away.

Figure 38 Retroreflective Optical Sensor
In the figure, the emitter sends out a beam of light. If the light is returned from the reflector most of the light beam is returned to the detector. When an object interrupts the beam between the emitter and the reflector the beam is no longer reflected back to the detector, and the sensor becomes active. A potential problem with this sensor is that reflective objects could return a good beam. This problem is overcome by polarizing the light at the emitter (with a filter), and then using a polarized filter at the detector. The reflector uses small cubic reflectors and when the light is reflected the polarity is rotated by 90 degrees. If the light is reflected off the object the light will not be rotated by 90 degrees. So the polarizing filters on the emitter and detector are rotated by 90 degrees, as shown in Figure 39 Polarized Light in Retroreflective Sensors. The reflector is very similar to reflectors used on bicycles.

Figure 39 Polarized Light in Retroreflective Sensors
For retroreflectors the reflectors are quite easy to align, but this method still requires two mounted components. A diffuse sensors is a single unit that does not use a reflector, but uses focused light as shown in Figure 40 Diffuse Optical Sensor.

Figure 40 Diffuse Optical Sensor
Diffuse sensors use light focused over a given range, and a sensitivity adjustment is used to select a distance. These sensors are the easiest to set up, but they require well controlled conditions. For example if it is to pick up light and dark colored objects problems would result.
When using opposed mode sensors the emitter and detector must be aligned so that the emitter beam and detector window overlap, as shown in Figure 41 Beam Divergence and Alignment. Emitter beams normally have a cone shape with a small angle of divergence (a few degrees of less). Detectors also have a cone shaped volume of detection. Therefore when aligning opposed mode sensor care is required not just to point the emitter at the detector, but also the detector at the emitter. Another factor that must be considered with this and other sensors is that the light intensity decreases over distance, so the sensors will have a limit to separation distance.

Figure 41 Beam Divergence and Alignment
If an object is smaller than the width of the light beam it will not be able to block the beam entirely when it is in front as shown in Figure 42 The Relationship Between Beam Width and Object Size. This will create difficulties in detection, or possibly stop detection altogether. Solutions to this problem are to use narrower beams, or wider objects. Fiber optic cables may be used with an opposed mode optical sensor to solve this problem, however the maximum effective distance is reduced to a couple feet.

Figure 42 The Relationship Between Beam Width and Object Size
Separated sensors can detect reflective parts using reflection as shown in Figure 43 Detecting Reflecting Parts. The emitter and detector are positioned so that when a reflective surface is in position the light is returned to the detector. When the surface is not present the light does not return.

Figure 43 Detecting Reflecting Parts
Other types of optical sensors can also focus on a single point using beams that converge instead of diverge. The emitter beam is focused at a distance so that the light intensity is greatest at the focal distance. The detector can look at the point from another angle so that the two centerlines of the emitter and detector intersect at the point of interest. If an object is present before or after the focal point the detector will not see the reflected light. This technique can also be used to detect multiple points and ranges, as shown in Figure 45 Multiple Point Detection Using Optics where the net angle of refraction by the lens determines which detector is used. This type of approach, with many more detectors, is used for range sensing systems.

Figure 44 Point Detection Using Focused Optics

Figure 45 Multiple Point Detection Using Optics
Some applications do not permit full sized photooptic sensors to be used. Fiber optics can be used to separate the emitters and detectors from the application. Some vendors also sell photosensors that have the phototransistors and LEDs separated from the electronics.
Light curtains are an array of beams, set up as shown in Figure 46 A Light Curtain. If any of the beams are broken it indicates that somebody has entered a workcell and the machine needs to be shut down. This is an inexpensive replacement for some mechanical cages and barriers.

Figure 46 A Light Curtain
The optical reflectivity of objects varies from material to material as shown in Figure 47 Table of Reflectivity Values for Different Materials [Banner Handbook of Photoelectric Sensing]. These values show the percentage of incident light on a surface that is reflected. These values can be used for relative comparisons of materials and estimating changes in sensitivity settings for sensors.

Figure 47 Table of Reflectivity Values for Different Materials [Banner Handbook of Photoelectric Sensing]

4.3.4 Capacitive Sensors

Capacitive sensors are able to detect most materials at distances up to a few centimeters. Recall the basic relationship for capacitance.

In the sensor the area of the plates and distance between them is fixed. But, the dielectric constant of the space around them will vary as different materials are brought near the sensor. An illustration of a capacitive sensor is shown in Figure 48 A Capacitive Sensor. an oscillating field is used to determine the capacitance of the plates. When this changes beyond a selected sensitivity the sensor output is activated.

Figure 48 A Capacitive Sensor
These sensors work well for insulators (such as plastics) that tend to have high dielectric coefficients, thus increasing the capacitance. But, they also work well for metals because the conductive materials in the target appear as larger electrodes, thus increasing the capacitance as shown in Figure 49 Dielectrics and Metals Increase the Capacitance. In total the capacitance changes are normally in the order of pF.

Figure 49 Dielectrics and Metals Increase the Capacitance
The sensors are normally made with rings (not plates) in the configuration shown in Figure 50 Electrode Arrangement for Capacitive Sensors. In the figure the two inner metal rings are the capacitor electrodes, but a third outer ring is added to compensate for variations. Without the compensator ring the sensor would be very sensitive to dirt, oil and other contaminants that might stick to the sensor.

Figure 50 Electrode Arrangement for Capacitive Sensors
A table of dielectric properties is given in Figure 51 Dielectric Constants of Various Materials [Turck Proximity Sensors Guide]. This table can be used for estimating the relative size and sensitivity of sensors. Also, consider a case where a pipe would carry different fluids. If their dielectric constants are not very close, a second sensor may be desired for the second fluid.


Figure 51 Dielectric Constants of Various Materials [Turck Proximity Sensors Guide]
The range and accuracy of these sensors are determined mainly by their size. Larger sensors can have diameters of a few centimeters. Smaller ones can be less than a centimeter across, and have smaller ranges, but more accuracy.

4.3.5 Inductive Sensors

Inductive sensors use currents induced by magnetic fields to detect nearby metal objects. The inductive sensor uses a coil (an inductor) to generate a high frequency magnetic field as shown in Figure 52 Inductive Proximity Sensor. If there is a metal object near the changing magnetic field, current will flow in the object. This resulting current flow sets up a new magnetic field that opposes the original magnetic field. The net effect is that it changes the inductance of the coil in the inductive sensor. By measuring the inductance the sensor can determine when a metal have been brought nearby.
These sensors will detect any metals, when detecting multiple types of metal multiple sensors are often used.

Figure 52 Inductive Proximity Sensor
The sensors can detect objects a few centimeters away from the end. But, the direction to the object can be arbitrary as shown in Figure 53 Shielded and Unshielded Sensors. The magnetic field of the unshielded sensor covers a larger volume around the head of the coil. By adding a shield (a metal jacket around the sides of the coil) the magnetic field becomes smaller, but also more directed. Shields will often be available for inductive sensors to improve their directionality and accuracy.

Figure 53 Shielded and Unshielded Sensors

4.3.6 Ultrasonic

An ultrasonic sensor emits a sound above the normal hearing threshold of 16KHz. The time that is required for the sound to travel to the target and reflect back is proportional to the distance to the target. The two common types of sensors are;
electrostatic - uses capacitive effects. It has longer ranges and wider bandwidth, but is more sensitive to factors such as humidity.
piezoelectric - based on charge displacement during strain in crystal lattices. These are rugged and inexpensive.
These sensors can be very effective for applications such as fluid levels in tanks and crude distance measurement.

4.3.7 Hall Effect

Hall effect switches are basically transistors that can be switched by magnetic fields. Their applications are very similar to reed switches, but because they are solid state they tend to be more rugged and resist vibration. Automated machines often use these to do initial calibration and detect end stops.

4.3.8 Fluid Flow

We can also build more complex sensors out of simpler sensors. The example in Figure 54 Flow Rate Detection With an Inductive Proximity Switch shows a metal float in a tapered channel. As the fluid flow rate increases the pressure forces the float upwards. The tapered shape of the float ensures an equilibrium position proportional to flowrate. An inductive proximity sensor can be positioned so that it will detect when the float has reached a certain height, and the system has reached a given flowrate.

Figure 54 Flow Rate Detection With an Inductive Proximity Switch

4.4 SUMMARY

· Sourcing sensors allow current to flow out from the V+ supply.
· Sinking sensors allow current to flow in to the V- supply.
· Photo-optical sensors can use reflected beams (retroreflective), an emitter and detector (opposed mode) and reflected light (diffuse) to detect a part.
· Capacitive sensors can detect metals and other materials.
· Inductive sensors can detect metals.
· Hall effect and reed switches can detect magnets.
· Ultrasonic sensors use sound waves to detect parts up to meters away.

4.5 PRACTICE PROBLEMS

(Note: Problem solutions are available at http://sites.google.com/site/automatedmanufacturingsystems/)
1. Given a clear plastic bottle, list 3 different types of sensors that could be used to detect it.
2. List 3 significant trade-offs between inductive, capacitive and photooptic sensors.
3. Why is a sinking output on a sensor not like a normal switch?
4. a) Sketch the connections needed for the PLC inputs and outputs below. The outputs include a 24Vdc light and a 120Vac light. The inputs are from 2 NO push buttons, and also from an optical sensor that has both PNP and NPN outputs.
b) State why you used either the NPN or PNP output on the sensor.
5. Select a sensor to pick up a transparent plastic bottle from a manufacturer. Copy or print the specifications, and then draw a wiring diagram that shows how it will be wired to an appropriate PLC input card.
6. Sketch the wiring to connect a power supply and PNP sensor to the PLC input card shown below.
7. Sketch the wiring for inputs that include the following items.
3 normally open push buttons
1 thermal relay
3 sinking sensors
1 sourcing sensor
8. A PLC has eight 10-60Vdc inputs, and four relay outputs. It is to be connected to the following devices. Draw the required wiring.
· Two inductive proximity sensors with sourcing and sinking outputs.
· A NO run button and NC stop button.
· A 120Vac light.
· A 24Vdc solenoid.

9. Draw a ladder wiring diagram (as done in the lab) for a system that has two push-buttons and a sourcing/sinking proximity sensors for 10-60Vdc inputs and two 120Vac output lights. Don't forget to include hard-wired start and stop buttons with an MCR.

4.6 ASSIGNMENT PROBLEMS

1. What type of sensor should be used if it is to detect small cosmetic case mirrors as they pass along a belt. Explain your choice.
2. Summarize the trade-offs between capacitive, inductive and optical sensors in a table.
3. Clearly and concisely explain the difference between wiring PNP and NPN sensors.
4. a) Show the wiring for the following sensor, and circle the output that you are using, NPN or PNP. Redraw the sensor using the correct symbol for the sourcing or sinking sensor chosen.

No comments:

Post a Comment

We will publish you post once it has been approved. Thank you for posting.