Файл: Programmable logic controllers. Methods and Applications (Hackworth J., Prentice Hall).pdf

ВУЗ: Не указан

Категория: Не указан

Дисциплина: Не указана

Добавлен: 15.06.2025

Просмотров: 2140

Скачиваний: 0

ВНИМАНИЕ! Если данный файл нарушает Ваши авторские права, то обязательно сообщите нам.

Chapter 7 - Analog I/O

Constant Offset Error

Constant offset errors appear as an error in which you find that the correct values always differ from the measured values by an additive (or subtractive) constant. It is also accompanied by a zero error (where zero volts is not measured as zero). Although there are many potential causes for this, the most common is that the analog input is sharing a ground circuit with some other device. The other device is drawing significant current through the ground such that a voltage drop appears on the ground conductor. Since the analog input is also using the ground, the voltage drop appears as an additional analog input. This problem can be avoided by making sure that all analog inputs are 2-wire inputs and both of the wires extend all the way to the source. Also, the negative (-) wire of the pair should only be grounded at one point (called single point grounding). Care should be taken here because many analog sensors have a negative (-) output wire that is grounded inside the sensor. This means that if you ground the negative wire at the analog input also, you will create the potential for a ground loop with its accompanying voltage drop and analog input error.

Percentage Offset Error

This type of error is also called gain error. This is apparent when the measured value can be corrected by multiplying it by a constant. It can be caused by a gain error in the analog input, a gain error in the sensor output, or most likely, loading effect caused by interaction between the output resistance of the sensor and the input resistance of the analog input. Also, if a resistive voltage divider is used on the input to reduce a high voltage to a voltage that is within the range of the analog input, an error in the ratio of the two resistors will produce this type of problem.

Unstable Reading

This is also called a noisy reading. It appears in cases where the source voltage is stable, but the measured value rambles, usually around the correct value. It is usually caused by external noise entering the system before it reaches the analog input. There are numerous possible reasons for this; however, they are all generally caused by electromagnetic or electrostatic pickup of noise by the wires connecting the signal source to the analog input. When designing a system with analog inputs (or troubleshooting a system with this type of problem), remember that the strength of an electromagnetic field around a current carrying wire is directly proportional to the current being carried by the wire and the frequency of that current. If an analog signal wire is bundled with or near a wire carrying high alternating currents or high frequency signals, it is likely that the analog signal wires will pickup electrical noise. There are some standard design practices that will help reduce or minimize noise pickup.

7-8

Chapter 7 - Analog I/O

1.For the analog signal wiring, use twisted pair shielded cable. The twisted pair will cause electromagnetic interference to appear equally in both wires which will be cancelled by the differential amplifier at the analog input. The copper braid shield will supply some electromagnetic shielding and excellent electrostatic shielding. To prevent currents from circulating in the shield, ground the shield only on one end.

2.Use common sense when routing analog cables. Tying them into a bundle with AC line or controls wiring, or routing the analog wires near high current conductors or sources of high electromagnetic fields (such as motors or transformers) is likely to cause problems.

3.If all else fails, route the analog wires inside steel conduit. The steel has a high magnetic permeability and will shunt most if not all interference from external magnetic fields around the wires inside, thereby shielding the wires.

7-9


Chapter 7 - Analog I/O

Chapter 7 Review Question and Problems

1.What is the voltage resolution of a 10-bit unipolar 5 volt analog input?

2.How many bits would be needed for an analog output if, after applying the

25% rule of thumb, we need a resolution of 4.8 millivolts for a signal that has a range of 0 to +10 volts?

4.An 8-bit bipolar 5 volt analog input has an input of -3.29 volts. What will be the decimal value of the number the converter sends to the CPU in the PLC?

5.You program a PLC to output the binary number 10110101 to its analog output. The analog output is 8-bits, 10 volts, bipolar. What DC voltage do you expect to see on the output.

6.An AC motor controller has a frequency control input of 0-10 volts DC which varies the output frequency from 0-60Hz. It drives a 3-phase induction motor that is rated at 1750 RPM at 60 Hz. The DC input to the motor controller is provided by an analog output from a PLC. The analog output is unipolar, 10 volts, 10 bits. What binary number must you program into the PLC to cause it to output the appropriate voltage to run the motor at 1000 RPM (assume for the motor that the relationship between frequency and speed is a simple ratio)?

7.A pressure sensor is rated at 0-500 psi and has an output range of 0-10 volts DC (10 volts corresponds to 500 psi). It is connected to a PLC’s analog input

that is 10 bits, 10 volts, unipolar. If the PLC reads the analog input as 8B316, what is the pressure in psi?

7-10


Chapter 8 - Discrete Position Sensors

Chapter 8 - Discrete Position Sensors

8-1. Objectives

Upon completion of this chapter, you will know

the difference between a discrete sensor and an analog sensor.

the theory of operation of inductive, capacitive, ultrasonic, and optical proximity sensors.

which types of proximity sensors are best suited for particular applications.

how to select and specify proximity sensors.

8-2. Introduction

Generally, when a PLC is designed into a machine control system, it is not simply put into an open loop system. This would be a system in which the PLC provides outputs, but never “looks” to see if the machine is responding to those outputs. Instead, PLCs are generally put into a closed loop system. This is a system in which the PLC monitors the performance of the machine and provides the appropriate outputs at the correct times to make the machine operate properly, efficiently, and intelligently. In order to provide the

PLC with a sense of what is happening within the machine, we use sensors.

In a way, a limit switch is a sensor. The switch senses when its actuator is being pressed and sends an electrical signal to the PLC input. The limit switch provides the PLC with a crude sense of touch. However, in many cases, the PLC needs to sense something more sophisticated than a switch actuation. For these applications, sensors are available that can sense nearly any parameter that may occur in a machine environment.

This text has by no means a comprehensive coverage of all the currently available sensor technology. Because of uses of lasers, chroma recognition, image recognition, and other newer technologies, the state of sensor sophistication and variety of sensors is constantly evolving. Because of this rapid evolution, even experienced designers find it difficult to keep pace with sensor technology. Generally, machine controls and automation designers rely on manufacturer’s sales representatives to keep them abreast of newly developing technologies. In many cases a visit by a sales representative to view and discuss the potential sensor application will result in suggestions, catalogs, on-site demonstrations of sample units, and, if necessary, phone contact with a vendor’s field engineer to further discuss the application. This network of sales representatives and applications engineers should not be ignored by the designer - they are a valuable resource. In fact, most of the material covered in this and subsequent chapters is provided by manufacturer’s sales representatives.

8-1

Chapter 8 - Discrete Position Sensors

8-3. Sensor Output Classification

Fundamentally, sensor outputs are classified into two categories - discrete

(sometimes called digital, logic, or bang-bang) and proportional (sometimes called analog). Discrete sensors provide a single logical output (a zero or one). For example, a thermostat that operates the heating and air conditioning in a home is a discrete sensor. When the room temperature is below the thermostat’s setpoint, it outputs a zero, and when the temperature rises so that it is above the setpoint, the thermostat switches on and provides a logical one output. It is important to remember that discrete sensors do not provide information about the current value of the parameter being sensed. It only decides if the parameter being sensed is above or below the setpoint. Again, using the thermostat example, if the thermostat is set for 70 degrees and it is off, all that can be concluded is that he room temperature is below 70 degrees. The room temperature could be 69 degrees, minus 69 degrees, or any other value below 70 degrees, and the thermostat will give the same logical zero output.

The schematic symbol for the discrete sensor is shown as a limit switch in a diamond shaped box. This is shown in Figure 8-1. Since this is a generic designation, we usually write a short description of the sensor type next to the symbol.

(a)

(b)

Figure 8-1 - Sensor Schematic Symbol

Proportional sensors, on the other hand, provide an analog output. The output may be a voltage, current, resistance, or even a digital word containing a discrete value. In any case, the sensor measures the value of the parameter, converts it to a signal that is proportional to the value, and outputs that value. When proportional sensors are used with

PLCs, they are generally connected to analog inputs on the PLC instead of the digital inputs. An example of a proportional sensor is the fluid level sending unit in the fuel tank of an automobile that sends a signal to operate the fuel level gage. This is generally a potentiometer in the fuel tank that is operated by a float. As the fuel level changes, the float adjusts the potentiometer and its resistance changes. The fuel gage is nothing more than an ohmmeter that indicates the resistance of the fuel level sensor.

For discrete sensors, there are two types of outputs, the NPN or sinking output, and the PNP or sourcing output. The NPN or sinking output has an output circuit that functions similar to a TTL open collector output. It can be regarded as an NPN bipolar transistor with

8-2


Chapter 8 - Discrete Position Sensors

a grounded emitter and an uncommitted collector, as shown in Figure 8-2. In reality, this output circuit could be composed of an actual NPN transistor, an FET, an opto-isolator, or even a relay or switch contact. However, no matter how the output circuitry is composed, in operation it presents either an open circuit or a grounded line for its two output logical signals.

Vcc

Output

Proximity

Sensor

Circuitry

Gnd

Figure 8-2 - Sensor with NPN Output

Although at first this may seem rather convoluted and confusing, there is a specific application for an output circuit such as this. Since one of the logical states of the output is an open circuit, it can be used to drive loads that are outside of the power supply range of the sensor. This means that it is capable of operating a load that is being powered from a separate power supply, as shown in Figure 8-3. For example, it is relatively easy to have

a sensor that requires a +10 vdc power supply (Vsensor) operate a load operating from +24 vdc (Vload). Of course, it is also permissible to operate the NON output from the same power supply as the sensor. Typically, sensors with NPN outputs are capable of controlling

load voltages up to 30 vdc. The power supply for the load can be any voltage between zero and the maximum collector voltage specified for the output transistor.

Sensor

Vcc

Output Load

Proximity

Sensor Vload Vsensor

Circuitry

Gnd

Figure 8-3 - NPN Sensor Load Connection

8-3

Chapter 8 - Discrete Position Sensors

The PNP or sourcing output, has output logic levels that switch between the sensor’s power supply voltage and an open circuit. In this case, as illustrated in Figure 8-4, the PNP output transistor has the emitter connected to Vcc and the collector uncommitted. When the output is connected to a grounded load, the transistor will cause the load voltage to be either zero (when the transistor is off) or approximately Vcc (when the transistor is on).

Vcc

Proximity

Sensor

Circuitry

Output

Gnd

Figure 8-4 - Sensor with PNP Output

This is ideal for supplying loads that have power supply requirements that are the same as that of the sensor, and one of the two connection wires of the load is already connected to ground. Notice in Figure 8-5 that this allows a simpler design because only one power supply is needed. However, the disadvantage in this type of circuit is that the sensor and the load must be selected so that they operate from the same supply voltage.

Vcc

Proximity

Sensor

Circuitry

Output Load

Vcc

Gnd

Figure 8-5 - PNP Sensor Load Connection

8-4


Chapter 8 - Discrete Position Sensors

8-4. Connecting Discrete Sensors to PLC Inputs

Since discrete PLC inputs can be either sourcing or sinking, it is important to know how to select the sensor output type that will properly interface with the PLC input, and how to wire the PLC input so that it will interface to the sensor correctly. Generally speaking, sensors with sourcing (PNP) outputs should be connected to sinking PLC inputs, and sensors with sinking (NPN) outputs should be connected to sourcing PLC inputs. Connecting sourcing sensor outputs to sourcing PLC inputs, or sinking outputs to sinking inputs, will result in erratic illogical operation at best, or most likely, a system that will not function at all.

For sourcing (PNP) sensor outputs, the PLC input circuit is wired with the common terminal connected to the common of the sensor as shown in Figure 8-6. When the PNP transistor in the sensor is off, no current flows between the sensor and the PLC, and the

PLC input will be OFF. When the sensor circuitry switches the PNP transistor ON, current flows from the Vcc power supply, through the PNP transistor, through the IN0 opto-isolator in the PLC input, and out of the common terminal to return to the negative side of the power supply. In this case, the PLC input will be ON. For this type of connection, the value of the Vcc voltage must be at least high enough to satisfy the minimum input voltage requirement for the PLC inputs. Notice the simplicity of the connection scheme. The sensor connects directly to the PLC input. No other external signal conditioning circuitry is required.

IN3

IN2

Vcc

IN1

Programmable

Logic

Proximity

Controller

Discrete

Sensor

Inputs

Circuitry

IN0

Output

Vcc

Gnd

COM

Sensor

Figure 8-6 - Sourcing Sensor Output Connected to a Sinking PLC Input

8-5

Chapter 8 - Discrete Position Sensors

We can also connect a sinking (NPN) sensor output to the same PLC input.

However, since the sensor has a sinking output, the PLC must be rewired as a sourcing input. This can be done by disconnecting the common terminal of the PLC input from the negative side of Vcc and instead connecting it to the positive side of Vcc as shown in Figure 8-7. This connection scheme converts all of the PLC inputs to sourcing; that is, in order to switch the PLC input ON, we must draw current out of the input terminal. In operation, when the NPN transistor in the sensor is OFF, no current flows between the sensor and PLC. However, when the NPN transistor switches ON, current will flow from the positive side of the Vcc supply, into the common terminal of the PLC, up through the opto-isolator, out of the PLC input terminal IN0 and through the NPN transistor to ground. This will switch the PLC input ON. If it is necessary to operate the PLC inputs and the sensor from separate power supplies, it is permissible as long as the negative terminal of both power supplies are connected together.

IN3

IN2

Vcc

IN1

Programmable

Logic

Controller

Output

Discrete

Inputs

Proximity

IN0

Sensor

Vcc

Circuitry

Gnd

COM

Sensor

Figure 8-7 - Sinking Sensor Output Connected to a Sourcing PLC Input

8-5. Proximity Sensors

Proximity sensors are discrete sensors that sense when an object has come near to the sensor face. There are four fundamental types of proximity sensors, the inductive proximity sensor, the capacitive proximity sensor, the ultrasonic proximity sensor, and the optical proximity sensor. In order to properly specify and apply proximity sensors, it is important to understand how they operate and to which applications each is best suited.

8-6