- •16. ADVANCED LADDER LOGIC FUNCTIONS
- •16.1 INTRODUCTION
- •16.2 LIST FUNCTIONS
- •16.2.1 Shift Registers
- •16.2.2 Stacks
- •16.2.3 Sequencers
- •16.3 PROGRAM CONTROL
- •16.3.1 Branching and Looping
- •16.3.2 Fault Detection and Interrupts
- •16.4 INPUT AND OUTPUT FUNCTIONS
- •16.4.1 Immediate I/O Instructions
- •16.4.2 Block Transfer Functions
- •16.5 DESIGN TECHNIQUES
- •16.5.1 State Diagrams
- •16.6 DESIGN CASES
- •16.6.1 If-Then
- •16.6.2 Traffic Light
- •16.7 SUMMARY
- •16.8 PRACTICE PROBLEMS
- •16.9 PRACTICE PROBLEM SOLUTIONS
- •16.10 ASSIGNMENT PROBLEMS
- •17. OPEN CONTROLLERS
- •17.1 INTRODUCTION
- •17.3 OPEN ARCHITECTURE CONTROLLERS
- •17.4 SUMMARY
- •17.5 PRACTICE PROBLEMS
- •17.6 PRACTICE PROBLEM SOLUTIONS
- •17.7 ASSIGNMENT PROBLEMS
- •18. INSTRUCTION LIST PROGRAMMING
- •18.1 INTRODUCTION
- •18.2 THE IEC 61131 VERSION
- •18.3 THE ALLEN-BRADLEY VERSION
- •18.4 SUMMARY
- •18.5 PRACTICE PROBLEMS
- •18.6 PRACTICE PROBLEM SOLUTIONS
- •18.7 ASSIGNMENT PROBLEMS
- •19. STRUCTURED TEXT PROGRAMMING
- •19.1 INTRODUCTION
- •19.2 THE LANGUAGE
- •19.3 SUMMARY
- •19.4 PRACTICE PROBLEMS
- •19.5 PRACTICE PROBLEM SOLUTIONS
- •19.6 ASSIGNMENT PROBLEMS
- •20. SEQUENTIAL FUNCTION CHARTS
- •20.1 INTRODUCTION
- •20.2 A COMPARISON OF METHODS
- •20.3 SUMMARY
- •20.4 PRACTICE PROBLEMS
- •20.5 PRACTICE PROBLEM SOLUTIONS
- •20.6 ASSIGNMENT PROBLEMS
- •21. FUNCTION BLOCK PROGRAMMING
- •21.1 INTRODUCTION
- •21.2 CREATING FUNCTION BLOCKS
- •21.3 DESIGN CASE
- •21.4 SUMMARY
- •21.5 PRACTICE PROBLEMS
- •21.6 PRACTICE PROBLEM SOLUTIONS
- •21.7 ASSIGNMENT PROBLEMS
- •22. ANALOG INPUTS AND OUTPUTS
- •22.1 INTRODUCTION
- •22.2 ANALOG INPUTS
- •22.2.1 Analog Inputs With a PLC
- •22.3 ANALOG OUTPUTS
- •22.3.1 Analog Outputs With A PLC
- •22.3.2 Pulse Width Modulation (PWM) Outputs
- •22.3.3 Shielding
- •22.4 DESIGN CASES
- •22.4.1 Process Monitor
- •22.5 SUMMARY
- •22.6 PRACTICE PROBLEMS
- •22.7 PRACTICE PROBLEM SOLUTIONS
- •22.8 ASSIGNMENT PROBLEMS
- •23. CONTINUOUS SENSORS
- •23.1 INTRODUCTION
- •23.2 INDUSTRIAL SENSORS
- •23.2.1 Angular Displacement
- •23.2.1.1 - Potentiometers
- •23.2.2 Encoders
- •23.2.2.1 - Tachometers
- •23.2.3 Linear Position
- •23.2.3.1 - Potentiometers
- •23.2.3.2 - Linear Variable Differential Transformers (LVDT)
- •23.2.3.3 - Moire Fringes
- •23.2.3.4 - Accelerometers
- •23.2.4 Forces and Moments
- •23.2.4.1 - Strain Gages
- •23.2.4.2 - Piezoelectric
- •23.2.5 Liquids and Gases
- •23.2.5.1 - Pressure
- •23.2.5.2 - Venturi Valves
- •23.2.5.3 - Coriolis Flow Meter
- •23.2.5.4 - Magnetic Flow Meter
- •23.2.5.5 - Ultrasonic Flow Meter
- •23.2.5.6 - Vortex Flow Meter
- •23.2.5.7 - Positive Displacement Meters
- •23.2.5.8 - Pitot Tubes
- •23.2.6 Temperature
- •23.2.6.1 - Resistive Temperature Detectors (RTDs)
- •23.2.6.2 - Thermocouples
- •23.2.6.3 - Thermistors
- •23.2.6.4 - Other Sensors
- •23.2.7 Light
- •23.2.7.1 - Light Dependant Resistors (LDR)
- •23.2.8 Chemical
- •23.2.8.2 - Conductivity
- •23.2.9 Others
- •23.3 INPUT ISSUES
- •23.4 SENSOR GLOSSARY
- •23.5 SUMMARY
- •23.6 REFERENCES
- •23.7 PRACTICE PROBLEMS
- •23.8 PRACTICE PROBLEM SOLUTIONS
- •23.9 ASSIGNMENT PROBLEMS
- •24. CONTINUOUS ACTUATORS
- •24.1 INTRODUCTION
- •24.2 ELECTRIC MOTORS
- •24.2.1 Basic Brushed DC Motors
- •24.2.2 AC Motors
- •24.2.3 Brushless DC Motors
- •24.2.4 Stepper Motors
- •24.2.5 Wound Field Motors
continuous sensors - 23.32
23.2.9 Others
A number of other detectors/sensors are listed below,
Combustion - gases such as CO2 can be an indicator of combustion
Humidity - normally in gases
Dew Point - to determine when condensation will form
23.3 INPUT ISSUES
Signals from sensors are often not in a form that can be directly input to a controller. In these cases it may be necessary to buy or build signal conditioners. Normally, a signal conditioner is an amplifier, but it may also include noise filters, and circuitry to convert from current to voltage. This section will discuss the electrical and electronic interfaces between sensors and controllers.
Analog signal are prone to electrical noise problems. This is often caused by electromagnetic fields on the factory floor inducing currents in exposed conductors. Some of the techniques for dealing with electrical noise include;
twisted pairs - the wires are twisted to reduce the noise induced by magnetic fields. shielding - shielding is used to reduce the effects of electromagnetic interference. single/double ended inputs - shared or isolated reference voltages (commons).
When a signal is transmitted through a wire, it must return along another path. If the wires have an area between them the magnetic flux enclosed in the loop can induce current flow and voltages. If the wires are twisted, a few times per inch, then the amount of noise induced is reduced. This technique is common in signal wires and network cables.
A shielded cable has a metal sheath, as shown in Figure 23.32. This sheath needs to be connected to the measuring device to allow induced currents to be passed to ground. This prevents electromagnetic waves to induce voltages in the signal wires.
Analog voltage source
+
-
continuous sensors - 23.33
A Shield is a metal sheath that |
Analog Input |
|
surrounds the wires |
|
|
|
|
IN1
REF1
SHLD
Figure 23.32 Cable Shielding
When connecting analog voltage sources to a controller the common, or reference voltage can be connected different ways, as shown in Figure 23.33. The least expensive method uses one shared common for all analog signals, this is called single ended. The more accurate method is to use separate commons for each signal, this is called double ended. Most analog input cards allow a choice between one or the other. But, when double ended inputs are used the number of available inputs is halved. Most analog output cards are double ended.
device +
#1 -
device +
#1 -
continuous sensors - 23.34
|
|
|
|
device |
+ |
|
|
|
|
Ain 0 |
|
|
|
||
|
|
|
|
|
|||
|
|
|
#1 |
- |
|
|
|
|
|
|
|
|
|
||
|
|
Ain 1 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
device |
+ |
|
|
|
|
Ain 2 |
|
|
|||
|
|
|
|
|
|||
|
|
|
#1 |
- |
|
|
|
|
|
|
|
|
|
||
|
|
Ain 3 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Ain 4 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Ain 5 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Ain 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Ain 7 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
COM |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Ain 0
Ain 0
Ain 1
Ain 1
Ain 2
Ain 2
Ain 3
Ain 3
Single ended - with this arrangement the signal quality can be poorer, but more inputs are available.
Double ended - with this arrangement the signal quality can be better, but fewer inputs are available.
Figure 23.33 Single and Double Ended Inputs
Signals from transducers are typically too small to be read by a normal analog input card. Amplifiers are used to increase the magnitude of these signals. An example of a single ended signal amplifier is shown in Figure 23.34. The amplifier is in an inverting configuration, so the output will have an opposite sign from the input. Adjustments are provided for gain and offset adjustments.
Note: op-amps are used in this section to implement the amplifiers because they are inexpensive, common, and well suited to simple design and construction projects.
When purchasing a commercial signal conditioner, the circuitry will be more complex, and include other circuitry for other factors such as temperature compensation.
continuous sensors - 23.35
+V |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Ro |
offset |
|
Rf |
|
|
|
Rg |
|||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
-V |
|
|
|
|
|
|
|
|
|
- |
|
|
|
gain |
||||
|
|
|
|
|
|
|
|
|
||||||||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||
Ri |
|
|
|
|
|
|
|
|
|
+ |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Vout |
|||||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
||||
Vin |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|||
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Vout = |
Rf |
+ Rg |
+ offset |
----------------- Vin |
|||
|
|
Ri |
|
Figure 23.34 A Single Ended Signal Amplifier
A differential amplifier with a current input is shown in Figure 23.35. Note that Rc converts a current to a voltage. The voltage is then amplified to a larger voltage.
|
|
|
R1 |
|
|
- |
Rf |
|
|
|
Iin |
Rc |
|
|
|
|
|
||||
|
|
|
|
|||||||
+ |
|
|
|
|
||||||
|
R2 |
|
|
|
|
|||||
|
|
|
|
|
|
|
||||
|
|
|
|
|
|
|
|
|
Vout
R3
R4
Figure 23.35 A Current Amplifier
continuous sensors - 23.36
The circuit in Figure 23.36 will convert a differential (double ended) signal to a single ended signal. The two input op-amps are used as unity gain followers, to create a high input impedance. The following amplifier amplifies the voltage difference.
-
+
Vin |
|
|
- |
|
|
||||
|
+ |
|||
|
||||
|
|
|||
|
|
|
|
|
Vout
-
+
CMRR adjust
Figure 23.36 A Differential Input to Single Ended Output Amplifier
The Wheatstone bridge can be used to convert a resistance to a voltage output, as shown in Figure 23.37. If the resistor values are all made the same (and close to the value of R3) then the equation can be simplified.