Control Systems GD Notess
Control Systems GD Notess
CFL TE2106
1|Page
Aim
The aim of this subject is to enable students to apply control systems concepts and techniques
to Electrical Engineering field
Objectives
Course Outline:
.0 CONTENT
4.1 DEFINITIONS
- Microprocessor
- Microcontroller
2|Page
- Microcomputer
- Minicomputer
- Supercomputer
- Hardware
- Software
- Modem
- SCADA
- Transducer (Active and Passive)
- Programmable Logic Controller
- Loop Control
- Closed Loop Control
- Direct Digital Control (DDC)
- Cascade Control
- Ratio Control
- Feedforward Control
- Actuator
- Pulse width modulation
- Sensor
- Transducer
- Protocols
- Distributed Control System (DCS)
4.2.1 State the different types of sensors and transducers used in Control Systems.
- Electrical and non-electrical
4.2.2 Explain the basic principle of operation of sensors and transducers used in Control systems
in 4.5.1
4.2.3 Application of the sensors and transducers in 4.5.1.
4.3.2 With the aid of diagrams describe the operation of the following interfacing devices:
- Opto-Coupler
- Line Driver
4.3.3 State the central control room technical specification in terms of:
- Layout
- Safety
- Considerations and provisions for expansion
- Mimic diagrams
3|Page
4.3 THE MICROCONTROLLERS
4.4.1 State and explain the basic components of a microcontroller (Microcontroller architecture)
4.4.2 Demonstrate knowledge of processor interfacing techniques with regards to the following:
- Input from switches
- Debouncing switches
- Light sensors
- Driving relays
- Control of AC and DC power devices
- Generating AC waveforms
- Optical isolation
- Interrupts
- Timer modes
- Pulse width modulation (PWM)
4.4.3 State the elements of C- programming
4.4.4 Programme a microcontroller using C, including hardware configuration
4.5.1 Define a control system and state its importance in industrial processes.
4.5.2 Describe the open loop and closed loop systems by use of block diagrams.
4.5.3 Describe the use of a stepper motor as an example of an open loop control.
4.5.4 Distinguish between continuous and discontinuous control systems giving practical
examples.
4.5.5 Define:
- Proportional control
- Proportional band (PB)
4.5.7 Define, describe and give practical applications of the following control modes:
- Proportional plus integral
- Proportional plus derivative
- Proportional plus integral plus Derivative Control
4.5.8 Define and describe the effects of adjusting the following on the controller output:
- Integral action time
- Derivative action time
4|Page
4.5.9 Show graphical representations of 4.5.7 and 4.5.8 above.
4.3.6 Describe the principles of operation and give practical examples of the
following complex control systems:
- Ratio
- Cascade
- Feed forward
- Split range
4.3.7 State advantages and disadvantages for systems in 4.3.6 in comparison with a single loop
control system.
4.7.1 Perform system response for first and second order systems to the following inputs
- Unit Step
- Ramp
- Impulse
4.7.2 Perform stability tests using the following methods
- Nyquist stability criterion
- Bode plots
- Root locus
4.8.1 Distinguish between operating software and application software giving examples of each.
5|Page
Note: e.g. Operating software – Windows, MS-DOS, Unit, etc.
Application software – Fix, In Touch, Turbolink, Wonderware, Contrologix
4.8.2 a) Sketch a simple PLC block diagram consisting of input port, output port
and buses.
4.8.3 Describe PLC scanning time with reference to the number of inputs and outputs.
4.8.8 Draw the block diagram for DDC, SCADA and DCS and explain the role of each block.
4.8.9 Give practical applications of SCADA in Electronics Engineering, Telecommunication, Power
Engineering and Instrumentation.
4.8.10 Define and explain the relevance of the following terms to control systems:
- Redundancy
- Diagnostics
- Maintainability
- Expandability
4.8.11 List the programming languages used in PLC and SCADA systems:
- Ladder Logic (LAD).
- Statement List (STL)
- Control System Flowchart (CSF)
4.8.12 Convert a circuit from a relay logic to a ladder logic diagram and vice versa.
4.8.13 Convert a logic circuit (with gates) to a ladder logic diagram and vice versa.
4.8.14 Convert a given program from one programming language to the other, e.g. LAD to STL and
SCF to LAD, etc.
4.8.15 Develop a PLC program in any of the languages from the narrative description of a process.
6|Page
4.9 LABORATORY
4.9.4 Wire I/O devices to PLC and verify documentation between program and hard wiring.
4.9.5 Manipulate SCADA software involving calibration of display objects to real world devices.
4.9.6 Troubleshooting.
Note: Not supported by theory given in Units 1 to 6, but a detailed syllabus is attached as
supporting document.
7|Page
Contents
CHAPTER 1.................................................................................................................................................. 5
1.1 DEFINITION OF TERMS: .................................................................................................................... 5
CHAPTER 2................................................................................................................................................ 11
2.1 SENSORS AND TRANSDUCERS........................................................................................................ 11
2.2 Classification of Sensors ................................................................................................................. 12
CHAPTER 3................................................................................................................................................ 28
3.1 DATA INTERFACING ........................................................................................................................ 28
3.1.1 Interfacing - Input/output Module ............................................................................................. 29
3.1.3 LINE DRIVER................................................................................................................................. 32
3.2 THE CONTROL ROOM ..................................................................................................................... 34
3.2.1 Layout specifications................................................................................................................... 35
CHAPTER 4................................................................................................................................................ 38
4.1 THE MICROCONTROLLER ................................................................................................................ 38
4.1.1 Microcontroller block diagram ................................................................................................... 42
4.1.2 Memory in a Microcontroller...................................................................................................... 43
4.1.3 The I/O Ports ............................................................................................................................... 44
4.1.4 Types of microcontrollers ........................................................................................................... 47
4.1.5 Microcontroller applications....................................................................................................... 52
4.1.6 Programming Requirements for a Microcontroller .................................................................... 53
4.1.7 Elements of a C-program............................................................................................................. 55
4.2 PROCESSOR INTERFACING TECHNIQUES........................................................................................ 55
CHAPTER 5................................................................................................................................................ 59
5.1 PROCESS CONTROL......................................................................................................................... 59
5.1.1 The Basic Elements of a Control Process .................................................................................... 60
5.1.2 Signals and Their Classification ................................................................................................... 61
5.2 Open- and Closed-loop Control, Disturbance Elimination............................................................. 62
5.3 Stepper Motor as a control system................................................................................................ 65
5.3.1 Examples of control systems....................................................................................................... 65
5.4 Continuous versus discrete control................................................................................................ 66
5.4.1 Continuous Control Systems ....................................................................................................... 67
5.4.2 Discrete Control Systems ............................................................................................................ 67
5.5 CONTROLLERs ................................................................................................................................. 68
8|Page
5.5.1.1 Proportional Controllers .......................................................................................................... 69
5.5.1.2 Integral Controllers .................................................................................................................. 70
5.5.1.4 Proportional and Integral Controller ....................................................................................... 72
5.5.1.5 Proportional and Derivative Controller ................................................................................... 74
5.5.1.6 Proportional plus Integral plus Derivative Controller (PID Controller) ................................... 75
CHAPTER 6................................................................................................................................................ 81
6.1 SYSTEM MODELLING AND TRANSFER FUNCTIONS ........................................................................ 81
6.2 Complex Control Systems ............................................................................................................ 114
6.2.1 Ratio control system ................................................................................................................. 114
6.2.2 Cascade Control......................................................................................................................... 115
6.2.3 Feedforward Control System .................................................................................................... 116
6.2.4 Split Range Control.................................................................................................................... 117
CHAPTER 7 .......................................................................................................................................... 119
7.1 SYSTEM RESPONSE, PERFOMANCE AND STABILITY..................................................................... 119
7.1.1 RESPONSE OF FIRST ORDER SYSTEMS....................................................................................... 119
7.1.2 Impulse Response of First Order System .................................................................................. 120
7.1.3 Step Response of First Order System........................................................................................ 122
7.14 Ramp Response of First Order System....................................................................................... 125
7.2 Response of second order systems .............................................................................................. 127
7.2.1 Step Response of Second Order System ................................................................................... 129
7.2.2 Impulse Response of Second Order System ............................................................................. 135
7.3 The Concept of Stability ............................................................................................................... 136
CHAPTER 8.............................................................................................................................................. 142
8.1 PROGRAMMABLE LOGIC CONTROLLERS...................................................................................... 142
8.1.1 Operating software and Application software ......................................................................... 142
8.2 Advantages of PLC Control Systems............................................................................................. 143
8.4 PLC Programming ......................................................................................................................... 152
8.5 PLC Ladder Logic Program ............................................................................................................ 155
8.6 Factors considered when procuring PLCs. ................................................................................... 161
8.7 Pre-Cautions in PLC installations.................................................................................................. 162
8.8 Direct Digital Control:................................................................................................................... 163
8.9 Distributed Control System .......................................................................................................... 165
8.10 SCADA ......................................................................................................................................... 167
9|Page
8.11 Operational terms ...................................................................................................................... 170
8.12 Programming languages used in PLC and SCADA systems ........................................................ 170
8.12.1 Ladder Diagrams ..................................................................................................................... 171
8.12.2 Digital logic functions .............................................................................................................. 175
10 | P a g e
CHAPTER 1
1.1 DEFINITION OF TERMS:
Microprocessor
Microcontroller
The general microcontroller consists of the processor, the memory (RAM, ROM, EPROM), Serial
ports, peripherals (timers, counters), etc.
Microcontroller Microprocessor
Microcontrollers are used to execute a single Microprocessors are used for big applications.
task within an application.
Its designing and hardware cost is low. Its designing and hardware cost is high.
It is built with CMOS technology, which requires Its power consumption is high because it has to
less power to operate. control the entire system.
11 | P a g e
It consists of CPU, RAM, ROM, I/O ports. It doesn’t consist of RAM, ROM, I/O ports. It uses
its pins to interface to peripheral devices
Microcomputer
Minicomputer
A minicomputer is also known as mini. It is a class of small computers that was introduced into
the world in the mid-1960s. A minicomputer is a computer which has all the features of a large
size computer, but its size is smaller than those. A minicomputer lies between the mainframe and
the microcomputer because its size is smaller than the former one and larger than the latter one.
A minicomputer is also called as a mid-range computer. Minicomputers are mainly multi-users
systems where more than one user can work simultaneously.
Supercomputer
A supercomputer is a type of computer that has the architecture, resources and components to
achieve massive computing power. A supercomputer is a computer that performs at or near the
currently highest operational rate for computers. Traditionally, supercomputers have been used
for scientific and engineering applications that must handle very large databases or do a great
amount of computation (or both).
Hardware
Computer hardware includes the physical, tangible parts or components of a system, specifically
includes all controllers, application processors, I/O modules, workstations, and communications
networks. PCs used for system configuration and real-time control are included in DCS scope, as
are computers used for supervisory control
12 | P a g e
Software
Software is a set of instructions, data or programs used to operate computers and execute
specific tasks.
Modem
a combined device for modulation and demodulation, for example, between the digital data of a
computer and the analogue signal of a telephone line.
SCADA
SCADA is an acronym for supervisory control and data acquisition, a computer system for
gathering and analyzing real time data. SCADA systems are used to monitor and control a plant
or equipment in industries such as telecommunications, water and waste control, energy, oil and
gas refining and transportation.
Active transducers are those which do not require any power source for their operation. They
work on the energy conversion principle. They produce an electrical signal proportional to the
input (physical quantity).
Passive transducer
Is a device which converts the given non-electrical energy into electrical energy by external force.
Resistance strain gauge, Differential Transformer are the examples for the Passive transducers.
13 | P a g e
Open Loop Control System
A control system in which the control action is totally independent of output of the system then
it is called open loop control system. A manual control system is also an open loop control system.
The figure below shows a control system block diagram of an open loop control system in which
process output is totally independent of the controller action.
Control system in which the output has an effect on the input quantity in such a manner that the
input quantity will adjust itself based on the output generated is called closed loop control
system. Open loop control system can be converted in to closed loop control system by providing
a feedback. This feedback automatically makes the suitable changes in the output due to external
disturbance. In this way closed loop control system is called automatic control system. Figure
below shows the block diagram of closed loop control system in which feedback is taken from
output and fed in to input.
14 | P a g e
Direct Digital Control (DDC)
Direct digital control is the automated control of a condition or process by a digital device
(computer). Direct digital control takes a centralized network-oriented approach. All
instrumentation is gathered by various analog and digital converters which use the network to
transport these signals to the central controller. The centralized computer then follows all of its
production rules (which may incorporate sense points anywhere in the structure) and causes
actions to be sent via the same network to valves, actuators, and other heating, ventilating, and
air conditioning components that can be adjusted.
Cascade Control
Cascade control is a method of control combining two feedback loops, with the output of one
controller (the primary controller) adjusting the set-point of a second controller (the secondary
controller).
Ratio Control
A ratio controller is a special type of feed forward controller where disturbances are measured
and their ratio is held at a desired set point by controlling one of the streams. Ratio control is
used when two fluids must be mixed together in a specific ratio.
Feedforward Control
15 | P a g e
Actuator
Actuators are mechanical or electro-mechanical devices that provide controlled and sometimes
limited movements or positioning which are operated electrically, manually, or by various fluids
such as air, hydraulic, etc
Sensor
Sensor is defined as a device that converts a physical stimulus into a readable output
Protocols
Protocols are the accepted rules and standards that allow communication and data-sharing
between building automation equipment.
Distributed Control System (DCS) A distributed control system (DCS) is a computerized control
system for a process or plant usually with many control loops, in which autonomous controllers
are distributed throughout the system, but there is no central operator supervisory control.
16 | P a g e
CHAPTER 2
Piezoelectric Transducer
The main function of this transducer is toconvert mechanical energy into electrical energy. In the
same way, electrical energy can be transformed into mechanical energy.
The load of the engine can be determined by calculating diverse absolute pressure, that can be
done by using these transducers as the MAP sensor in fuel injection systems.
This sensor can be used as knock sensor in automotive engine management systems for
noticingknock of the engine.
Pressure Transducer
17 | P a g e
Pressure transducer is a special kind of sensor that alters the pressure forced into electrical
signals. These transducers are also called as pressure indicators, manometers, piezometers,
transmitters, and pressure sensors.
The applications of pressure transducer mainly involve in altitude sensing, pressure sensing, level
or depth sensing, flow sensing and leak testing. These transducers can be used for generating an
electrical power under the speed breakers on the highways or roads where the force of the
vehicles can be converted into electrical energy
Temperature Transducer
Temperature transducer is an electrical device that is used to convert the temperature of a device
into another quantity like electrical energy or pressure or mechanical energy, then the quantity
will be sent to the control device for controlling the temperature of the device.
18 | P a g e
Passive Sensors, on the other hand, do not require any external power signal and directly
generates output response.
2.The other type of classification is based on the means of detection used in the sensor. Some
ofthe means of detection are
Electric
Biological
Chemical
Radioactive
3.The next classification is based on conversion phenomenon i.e. the input and the output.
Some of the common conversion phenomena are
Photoelectric
Thermoelectric
Electrochemical
Electromagnetic
Thermooptic
Analog
Digital Sensors.
Analog Sensors produce an analog output i.e. a continuous output signal with respect to the
quantity being measured.
Digital Sensors, in contrast to Analog Sensors, work with discrete or digital data. The data in digital
sensors, which is used for conversion and transmission, is digital in nature.
19 | P a g e
The following is a list of different types of sensors that are commonly used in various applications.
All these sensors are used for measuring one of the physical properties like Temperature,
Resistance, Capacitance, Conduction, Heat Transfer etc.
Temperature Sensor
Proximity Sensor
Accelerometer
IR Sensor (Infrared Sensor)
Pressure Sensor
Light Sensor
Ultrasonic Sensor
Smoke, Gas and Alcohol Sensor
Touch Sensor
Color Sensor
Humidity Sensor
Tilt Sensor
Flow and Level Sensor
Temperature Sensor
One of the most common and most popular sensor is the Temperature sensor. A Temperature
Sensor, as the name suggests, senses the temperature i.e. it measures the changes in the
temperature.
20 | P a g e
In a Temperature Sensor, the changes in the Temperature correspond to change in its physical
property like resistance or voltage.
There are different types of Temperature Sensors like Temperature Sensor ICs (like LM35),
Thermistors, Thermocouples, RTD (Resistive Temperature Devices), etc.
Temperature Sensors are used everywhere like computers, mobile phones, automobiles, air
conditioning systems, industries etc.
A simple project using LM35 (Celsius Scale Temperature Sensor) is implemented in this project:
Proximity Sensors
A Proximity Sensor is a non-contact type sensor that detects the presence of an object. Proximity
Sensors can be implemented using different techniques like Optical (like Infrared or Laser),
Ultrasonic, Hall Effect, Capacitive, etc.
21 | P a g e
Some of the applications of Proximity Sensors are Mobile Phones, Cars (Parking Sensors),
industries (object alignment), Ground Proximity in Aircrafts, etc.
IR Sensors or Infrared Sensor are light based sensor that are used in various applications like
Proximity and Object Detection. IR Sensors are used as proximity sensors in almost all mobile
phones.
There are two types of Infrared or IR Sensors: Transmissive Type and Reflective Type. In
Transmissive Type IR Sensor, the IR Transmitter (usually an IR LED) and the IR Detector (usually a
Photo Diode) are positioned facing each other so that when an object passes between them, the
sensor detects the object.
22 | P a g e
The other type of IR Sensor is a Reflective Type IR Sensor. In this, the transmitter and the detector
are positioned adjacent to each other facing the object. When an object comes in front of the
sensor, the sensor detects the object.
Different applications where IR Sensor is implemented are Mobile Phones, Robots, Industrial
assembly, automobiles etc.
Ultrasonic Sensor
An Ultrasonic Sensor is a non-contact type device that can be used to measure distance as well
as velocity of an object. An Ultrasonic Sensor works based on the properties of the sound waves
with frequency greater than that of the human audible range.
Using the time of flight of the sound wave, an Ultrasonic Sensor can measure the distance of the
object (similar to SONAR). The Doppler Shift property of the sound wave is used to measure the
velocity of an object.
Proximity sensor
A device that detects the presence or absence of a nearby object, or properties of that object,
and converts it into signal which can be easily read by user or a simple electronic instrument
without getting in contact with them.
Proximity sensors are largely used in the retail industry, as they can detect motion and the
correlation between the customer and product they might be interested in. A user is immediately
notified of discounts and special offers of nearby products.
23 | P a g e
Another big and quite an old use-case is vehicles. You are reversing your car and are alarmed
about an obstacle while taking reverse, that’s the work of proximity sensor.
They are also used for parking availability in places such as malls, stadiums or airports
Inductive Sensors: Inductive proximity sensors are used for non-contact detection to find out the
presence of metallic objects using electromagnetic field or a beam of electromagnetic radiation.
It can operate at higher speeds than mechanical switches and also seems more reliable because
of its robustness.
Capacitive Sensors: Capacitive proximity sensors can detect both metallic as well as non-metallic
targets. Nearly all other materials are dielectric different from air. It can be used to sense very
small objects through a large portion of target. So, generally used in difficult and complicated
applications.
• Zero-speed indication
• Speed regulation
Motion control
• Movement indication
• Valve open/closed
• Transfer lines
24 | P a g e
• Packaging machine control
Process control
• Product complete
• Automatic filling
• Product selection
Photoelectric Sensors: Photoelectric sensor is made up of light-sensitive parts and uses a beam
of light to detect the presence or absence of an object. It is an ideal alternative of inductive
sensors. And used for long distance sensing or to sense non-metal object.
Ultrasonic Sensors: Ultrasonic sensors are also used to detect the presence or to measure the
distance of targets similar to radar or sonar. This makes a reliable solution for harsh and
demanding conditions.
Pressure sensor
A pressure sensor is a device that senses pressure and converts it into an electric signal. Here,
the amount depends upon the level of pressure applied.
There are plenty of devices that rely on liquid or other forms of pressure. These sensors make it
possible to create IoT systems that monitor systems and devices that are pressure propelled.
With any deviation from standard pressure range, the device notifies the system administrator
about any problems that should be fixed.
Deployment of these sensors is not only very useful in manufacturing, but also in the
maintenance of whole water systems and heating systems, as it is easy to detect any fluctuation
or drops in pressure.
Water quality sensors are used to detect the water quality and Ion monitoring primarily in water
distribution systems.
25 | P a g e
Water is practically used everywhere. These sensors play an important role as they monitor the
quality of water for different purposes. They are used in a variety of industries.
Chlorine Residual Sensor: It measures chlorine residual (i.e. free chlorine, monochloramine &
total chlorine) in water and most widely used as disinfectant because of its efficiency.
Total Organic Carbon Sensor: TOC sensor is used to measure organic element in water.
Turbidity Sensor: Turbidity sensors measure suspended solids in water, typically it is used in river
and stream gaging, wastewater and effluent measurement.
Conductivity Sensor: Conductivity measurements are carried out in industrial processes primarily
to obtain information on total ionic concentrations (i.e. dissolved compounds) in water solutions.
pH Sensor: It is used to measure the pH level in the dissolved water, which indicates how acidic
or basic (alkaline) it is.
Oxygen-Reduction Potential Sensor: The ORP measurement provides insights into the level of
oxidation/reduction reactions occurring in the solution.
Chemical sensor
Chemical sensors are applied in a number of different industries. Their goal is to indicate changes
in liquid or to find out air chemical changes. They play an important role in bigger cities, where it
is necessary to track changes and protect the population.
Main use cases of chemical sensors can be found in Industrial environmental monitoring and
process control, intentionally or accidentally released harmful chemical detection, explosive and
radioactive detection, recycling processes on Space Station, pharma industries and laboratory
etc.
26 | P a g e
Electrochemical gas sensor
Fluorescent chloride sensor
Hydrogen sulfide sensor
Nondispersive infrared sensor
pH glass electrode
Potentiometric sensor
Zinc oxide nanorod sensor
Gas sensor
Gas sensors are similar to the chemical ones, but are specifically used to monitor changes of the
air quality and detect the presence of various gases. Like chemical sensors, they are used in
numerous industries such as manufacturing, agriculture and health and used for air quality
monitoring, detection of toxic or combustible gas, hazardous gas monitoring in coal mines, oil &
gas industries, chemical laboratory research, manufacturing – paints, plastics, rubber,
pharmaceutical & petrochemical etc.
27 | P a g e
Smoke sensor
A smoke sensor is a device that senses smoke (airborne particulates & gases), and it’s level.
They have been in use for a long period of time. However, with the development of IoT, they are
now even more effective, as they are plugged into a system that immediately notifies the user
about any problem that occurs in different industries.
Smoke sensors are extensively used by manufacturing industry, HVAC, buildings and
accommodation infra to detect fire and gas incidences. This serves to protect people working in
dangerous environments, as the whole system is much more effective in comparison to the older
ones.
Smoke sensors detect the presence of Smoke, Gases and Flame surrounding their field. It can be
detected either optically or by the physical process or by the use of both the methods.
Optical smoke sensor (Photoelectric): Optical smoke sensor used the light scatter principle trigger
to occupants.
Ionization smoke sensor: Ionization smoke sensor works on the principle of ionization, kind of
chemistry to detect molecules causing a trigger alarm.
IR sensors
An infrared sensor is a sensor which is used to sense certain characteristics of its surroundings by
either emitting or detecting infrared radiation. It is also capable of measuring the heat being
emitted by the objects.
They are now used in a variety of IoT projects, especially in Healthcare as they make monitoring
of blood flow and blood pressure simple. They are even used in a wide array of regular smart
devices such as smartwatches and smartphones as well.
Other common use includes home appliances & remote control, breath analysis, Infrared vision
(i.e. visualize heat leaks in electronics, monitor blood flow, art historians to see under layers of
28 | P a g e
paint), wearable electronics, optical communication, non-contact based temperature
measurements, automotive blind-angle detection.
Their usage does not end there, they are also a great tool for ensuring high-level security in your
home. Also, their application includes environment checks, as they can detect a variety of
chemicals and heat leaks. They are going to play an important role in the smart home industry,
as they have a wide-range of applications.
Level sensors
A sensor which is used to determine the level or amount of fluids, liquids or other substances
that flow in an open or closed system is called Level sensor.
Like IR sensors, level sensors are present in a wide array of industries. They are primarily known
for measuring fuel levels, but they are also used in businesses that work with liquid materials. For
example, the recycling industry, as well as the juice and alcohol industry rely on these sensors to
measure the number of liquid assets in their possession
Best use cases of level sensor is, fuel gauging & liquid levels in open or closed containers, sea
level monitoring & Tsunami warning, water reservoirs, medical equipment, compressors,
hydraulic reservoirs, machine tools, beverage and pharmaceutical processing, high or low-level
detection etc.
This helps better streamline their businesses, as sensors collect all the important data at all times.
With the use of these sensors, any product manager can precisely see how much liquid is ready
to be distributed and whether the manufacturing should be stepped up.
Point level sensors: Point level sensors usually detect the particular specific level and respond to
the user if the sensing object is above or below that level. It is integrated into single device to get
an alarm or trigger
29 | P a g e
Continuous level Sensor: Continuous level sensors measure liquid or dry material levels within a
specified range and provide outputs which continuously indicate the level. The best example of
it is fuel level display in the vehicle.
Image sensors
Image sensors are instruments which are used to convert optical images into electronic signals
for displaying or storing files electronically.
The major use of image sensor is found in digital camera & modules, medical imaging and night
vision equipment, thermal imaging devices, radar, sonar, media house, Biometric & IRIS devices.
They are also implemented in improved security systems, where images help capture details
about the perpetrator.
A motion detector is an electronic device which is used to detect the physical movement (motion)
in a given area and it transforms motion into an electric signal; motion of any object or motion
of human beings
Motion detection plays an important role in the security industry. Businesses utilize these sensors
in areas where no movement should be detected at all times, and it is easy to notice anybody’s
presence with these sensors installed.
These are primarily used for intrusion detection systems, automatics door control, boom barrier,
smart camera (i.e motion based capture/video recording),toll plaza, automatic parking systems,
automated sinks/toilet flusher, hand dryers, energy management systems(i.e. Automated
Lighting, AC, Fan, Appliances Control) etc.
Passive Infrared (PIR): It Detects body heat (infrared energy) and the most widely used motion
sensor in home security systems.
30 | P a g e
Ultrasonic: Sends out pulses of ultrasonic waves and measures the reflection off a moving object
by tracking the speed of sound waves.
Microwave: Sends out radio wave pulses and measures the reflection off a moving object. They
cover a larger area than infrared & ultrasonic sensors, but they are vulnerable to electrical
interference and more expensive.
Presence sensing. Sensing that an object exists in a defined domain at a given time. This concept
is vital in industrial control systems where the arrival of an object may not be noticed.
Velocity sensing. Sensing the linear speed of an object in a specified direction. This concept is
used by police to detect speeding cars.
Direction-of-motion sensing. Determining whether a target is moving away from or toward the
microwave sensor device. This concept is particularly important for manufacturers of automated
guided vehicle systems for obstacle avoidance. It is also used to detect whether objects or
personnel are approaching or departing from automatic doors.
Range sensing. Measuring the distance from the sensor to an object of interest. Applications
include sensing the level of oil or chemical solutions in tanks and containers.
Accelerometer sensors
These sensors are now present in millions of devices, such as smartphones. Their uses involve
detection of vibrations, tilting and acceleration in general. This is great for monitoring your
driving fleet, or using a smart pedometer.
31 | P a g e
In some instances, it is used as a form of anti-theft protection, as the sensor can send an alert
through the system if an object that should remain stationary is moved.
They are widely used in cellular & media devices, vibration measurement, automotive control
and detection, free fall detection, aircraft and aviation industries, movement detection, sports
academy/athlete’s behavior monitoring, consumer electronics, industrial & construction sites
etc.
Gyroscope sensors
A sensor or device which is used to measure the angular rate or angular velocity is known as Gyro
sensors, Angular velocity is simply defined as a measurement of speed of rotation around an axis.
It is a device used primarily for navigation and measurement of angular and rotational velocity in
3-axis directions. The most important application is monitoring the orientation of an object.
Their main applications are in car navigation systems, game controllers, cellular & camera
devices, consumer electronics, robotics control, drone & RC control helicopter or UAV control,
vehicle control/ADAS and many more.
Humidity sensors
Humidity is defined as the amount of water vapour in an atmosphere of air or other gases. The
most commonly used terms are “Relative Humidity (RH)
These sensors usually follow the use of temperature sensors, as many manufacturing processes
require perfect working conditions. Through measuring humidity, you can ensure that the whole
process runs smoothly, and when there is any sudden change, action can be taken immediately,
as sensors detect the change almost instantaneously.
Optical sensors
A sensor which measures the physical quantity of light rays and convert it into electrical signal
which can be easily readable by user or an electronic instrument/device is called optical sensor.
32 | P a g e
Optical sensors are loved by IoT experts, as they are practical for measuring different things
simultaneously. The technology behind this sensor allows it to monitor electromagnetic energy,
which includes, electricity, light and so on.
Fiber Optics: Fibers optics carry no current, so its immune to electrical & electromagnetic
interference and even in damaged condition no sparking or shock hazard happens.
Pyrometer: It estimates the temperature of an object by sensing the color of the light and Objects
radiate light according to their temperature and produce same colors at same temperature.
Proximity & Infrared: Proximity use light to sense objects nearby and Infrared are used where
visible light would be inconvenient.
33 | P a g e
CHAPTER 3
Peripheral
It means various components or devices those are connected to CPU. Actually, these are input
output devices. Thus, it sometimes calls as I/O devices.
Interface
An interface is a concept that refers to a point of interaction between objects or components and
is applicable at the level of both hardware and software. Thus, PHERIPHERAL INTERFACING is a
kind of interaction between processor and external or peripheral devices.
To interface physically, a component or mediator between I/O device and processor is used
which is called I/O module.
I/O devices are most of case usually electrical/ mechanical/ electronic devices where processor
is an electronic device. Also, the data transfer rates of I/O are often slower than the processor
and memory. So, it is significant that the speed and electrical characteristics of I/O are different
from CPU.
There are a variety of peripherals that exist and may need to be connected to the same system
bus. But it may be difficult to incorporate all the peripheral device logic into CPU. This reduces
flexibility and creates hinderance in new developments.
Peripheral often use different data formats and word lengths that used by the CPU Incorporation
of I/O module helps to overcome these problems.
Serial Interface
A serial interface is a communication interface between two digital systems that transmits data
as a series of voltage pulses down a wire. A "1" is represented by a high logical voltage and a "0"
is represented by a low logical voltage
34 | P a g e
Parallel Interface
A parallel port is a type of interface found on computers for connecting peripherals. The name
refers to the way the data is sent; parallel ports send multiple bits of data at once, as opposed to
serial interfaces that send bits one at a time
It controls the data exchange between the external devices and main memory; or external
devices and CPU registers.
An I/O module provide an interface internal to the computer which connects it to CPU and main
memory and an interface external to the computer connecting it to external device or peripheral.
The I/O module should not only communicate the information from CPU to I/O device, but it
should also coordinate these two.
In addition, since there are speed differences between CPU and I/O devices, the I/O module
should have facilities like buffer (storage area) and error detection mechanism.
35 | P a g e
3.1.2 OPTO-COUPLING
When to Use
There are many situations where signals and data need to be transferred from one subsystem to
another within a piece of electronics equipment, or from one piece of equipment to another,
without making a direct electrical connection.
Often this is because the source and destination are at very different voltage levels, like a
microprocessor which is operating from 5V DC but being used to control a triac which is switching
240V AC.
In such situations the link between the two must be an isolated one, to protect the
microprocessor from overvoltage damage.
Opto-couplers are available in four general types, each one having an infrared LED source but
with different photo-sensitive devices.
36 | P a g e
Photo-transistor
A phototransistor is similar to a regular BJT except that the base current is produced and
controlled by light instead of a voltage source. The phototransistor effectively converts light
energy to an electrical signal.
In a phototransistor the base current is produced when light strikes the photosensitive
semiconductor base region. The collector-base PN junction is exposed to incident light through a
lens opening in the transistor package. When there is no incident light, there is only a small
thermally generated collector-to-emitter leakage current; this dark current is typically in the mA
range. When light strikes the collector-base PN junction, a base current, I, is produced that is
directly proportional to the light intensity. This action produces a collector current that increases
with I. Except for the way base current is generated, the phototransistor behaves as a
conventional BJT. In many cases, there is no electrical connection to the base.
Photo-Darlington
In the photodarlington transistor configuration, the first transistor acts as the photodetector, and
its emitter is coupled into the base of the second transistor. This gives a very much higher level
37 | P a g e
of gain, but it is very much slower than the ordinary phototransistor, having a maximum
frequency of around 20 kHz.
The photodarlington symbol is a combination of the standard phototransistor symbol and the
Darlington transistor symbol.
Photo-SCR
SCR stand for Silicon controlled rectifier, SCR also referred as Thyristor. In the upper image a
Photo-SCR based opto-coupler’s internal construction is shown. Same as like other opto-coupler
the LED emit Infrared. The SCR is controlled by the intensity of the LED. Photo-SCR based Opto-
coupler used in AC related circuitry.
Photo-TRIAC.
TRIAC is mainly used where AC based control or switching is needed. The led can be controlled
using DC, and the TRIAC used to control AC. Opto-coupler provide excellent isolation in this case
too.
c) PC communications
d) signal isolation
e) power supply regulation which suffer from current ground loops, etc.
Driver Interface
Drivers or buffers are also used in microprocessor interface design. However, they are usually
only needed when the loading on the microprocessor data, address or control lines is too high.
And that is usually because the microprocessor address, data or control lines are connected in
38 | P a g e
parallel to large number of external electronic components. Another situation that requires
drivers is when the microprocessor is connected to long cables.
Drivers are needed in both cases so that delay times, rise and fall times and noise levels do not
adversely affect the reliability of the microprocessor’s data and calculations.
A key element of the analog front end of such systems is the line driver which interfaces with the
transmission medium such as co-axial cable or twisted pair. The line driver is an amplifier that
provides the necessary output current to drive the low impedance of the line.
39 | P a g e
3.2 THE CONTROL ROOM
An operations center staffed by personnel charged with the responsibility for remotely
monitoring and controlling a pipeline facility.
Control rooms are areas of high performance with unique characteristic elements, where
operators perform tracking, monitoring, control, analysis and critical decision making, 24 hours
a day, 7 days a week and during all the year. These particular control room design features make
necessary to design it according to some key requirements.
40 | P a g e
3.2.1 Layout specifications
Lighting
Temperature
Is it easy to view all the panels of displays?
Can all controls be reached easily?
Is it easy to link each display with its control?
Layout Can you see quickly whether the reading is within normal limits?
Concept: each control room and command center is unique recording not only to the technical
needs, but also to the design of the control room for maximum operator performance, optimizing
efficiency and creating a perfect environment for decision making
Human-centered design: people must be at the center of the design when planning a control
room. Comfort and functionality must always be present to facilitate daily work to help the
operator to develop their responsibilities more efficiently.
Ergonomics: from the layout of the room, lighting, colors, the design of the control console,
materials, display systems, HVAC. Everything must be designed according to the people, adapting
all the elements to operators without these having to adapt to the environment.
Customization: the design of a control room requires a careful study of a large number of
variables that directly depend on the specific needs of the room itself and on the operators that
will develop their work in that technological environment. From the initial layout to distribution
of elements, choice of control console, integration with technological elements, distribution of
spaces, lighting, interior design, everything should be fully adapted to the specific work to be
developed.
FIRE PREVENTION
Evacuation plan
Evacuation procedures discussed regularly?
Extinguishers in place/ Type
41 | P a g e
Adequate direction notices for fire exits?
Exits should be clear of obstruction
BUILDING SAFETY
ELECTRICAL HAZARDS
Space
Accessibility
Mimic diagram
A line diagram of a pipe system or items of equipment which includes miniature alarm lights or
operating buttons for the relevant point or item in the system.
42 | P a g e
MIMIC DIGRAMS SPECIFICATION
43 | P a g e
CHAPTER 4
Simply an embedded controller is a controller that is embedded in a greater system. One can
define an embedded controller as a controller (or computer) that is embedded into some device
for some purpose other than to provide general purpose computing. Is an embedded controller
is the same as a microcontroller? The answer is definitely no. One can state devices such as
68000, 32032, x86, Z80, and so on that are used as embedded controllers but they aren’t
microcontrollers.
We might be correct by stating that an embedded controller controls something (for example
controlling a device such as a microwave oven, car braking system or a cruise missile). An
embedded controller may also embed the on-chip resources like a microcontroller.
Microcontrollers and microprocessors are widely used in embedded systems. Though
microcontrollers are preferred over microprocessors for embedded systems due to low power
consumption.
A controller is used to control some process. At one time, controllers were built exclusively from
logic components, and were usually large, heavy boxes. Later on, microprocessors were used and
the entire controller could fit on a small circuit board. This is still common– one can find many
controllers powered by one of the many common microprocessors (including Zilog Z80, Intel
8088, Motorola 6809, and others). As the process of miniaturization continued, all of the
components needed for a controller were built right onto one chip. A one chip computer, or
microcontroller was born. A CPU built into a single VLSI chip is called microprocessor. The
simplified block diagram of the CPU is shown. It contains arithmetic and logic unit (ALU),
Instruction decode and control unit, Instruction register, Program counter (PC), clock circuit
(internal or external), reset circuit (internal or external) and registers. For example, Intel 8085 is
8-bit microprocessor and Intel 8086/8088 is 16-bit microprocessor. Microprocessor is general-
44 | P a g e
purpose digital computer central processing unit (CPU). The microprocessor is general-purpose
device and additional external circuitry are added to make it microcomputer.
A digital computer having microprocessor as the CPU along with I/O devices and memory is
known as microcomputer. The block diagram in the Fig. 1.2 shows a microcomputer.
45 | P a g e
Microcomputer block diagram
• Microprocessor is a single chip CPU, microcontroller contains, a CPU and much of the
remaining circuitry of a complete microcomputer system in a single chip.
• Microcontroller includes RAM, ROM, serial and parallel interface, timer, interrupt schedule
circuitry (in addition to CPU) in a single chip.
–RAM is smaller than that of even an ordinary microcomputer, but enough for its applications.
CPU is the brain of the computer system, administers all activity in the system and performs all
operations on data. It continuously performs two operations: fetching and executing instructions.
It understands and execute instructions based on a set of binary codes called the instruction set.
Machine Cycle Machine Cycle Machine Cycle Machine Cycle Machine Cycle To execute an
instruction–the processor must:
46 | P a g e
1. Fetch the instruction from memory
These four steps refer to Machine Cycle. Generally, one machine cycle = X clock cycles (Xdepends
on the particular instruction being executed). Shorter the clock cycle, lesser the time it takes to
complete one machine cycle, so instructions are executed faster. Hence, faster the processor.
(c) Data (instruction opcode) are read from RAM and placed on data bus.
e) PC is incremented to prepare for the next fetch from memory. While execution involves
decoding the opcode and generating control signals to gate internal registers in and out of the
ALU and to signal the ALU to perform the specified operation.
A bus is a collection of wires carrying information with a common purpose. For each read or write
operation, the CPU specifies the location of the data or instruction by placing an address on the
address bus, then activates a signal on the control bus indicating whether the operation is read
or write.
Read operations retrieve a byte of data from memory at the location specified and place it on
the data bus data bus data bus data bus data bus. CPU reads the data and places it in one of its
internal registers.
47 | P a g e
Write operations put data from CPU on the data bus and store it in the location specified.
Address bus carries the address of a specified location. carries information between the CPU and
memory or between the CPU and I/O devices.
Control bus carries control signals supplied by the CPU to synchronize the movement of
information on the address and data bus.
THE MICROCONTROLLER
A microcontroller is a highly integrated chip, which includes on single chip, all or most of the parts
needed for a controller. The microcontroller typically includes: CPU (Central Processing Unit),
RAM (Random Access Memory), EPROM/PROM/ROM (Erasable Programmable Read Only
Memory), I/O (input/output) – serial and parallel, timers, interrupt controller. For example, Intel
8051 is 8-bit microcontroller and Intel 8096 is 16-bit microcontroller.
48 | P a g e
The figure above shows a single chip microcontroller and CPU. The CPU is the processing module
of the microcontroller.
ROM type memory, is used to store the program code. ROM memory can be either
The contents of the memory can be erased from the memory by exposing the memory chip to
ultraviolet radiation for a short period of time. It can therefore be reprogrammed many times
over.
These devices are designed so that part or all of the memory contents may be erased electrically
through an appropriate program. They are not fitted with a window and cannot be affected by
UV light. Microprocessors that use EEPROM are generically known as field-programmable
devices. Microchip devices have the letter F in the name, e.g. the PIC16F872, used in this course,
is a field-programmable device and can be erased and reprogrammed several times. This makes
it ideal as a learning tool.
All microprocessor systems need memory that can be both read from and written to. RAM
memory is used to store dynamic data (that will change during the operation of the program).
So a typical microprocessor system will contain both ROM (could be EPROM, EEPROM, or ROM)
to store the program code, and RAM to store dynamic data.
49 | P a g e
The Input and Output Subsystem
A number of digital bits formed into a number of digital inputs or outputs called a port. These are
usually eight bits wide and thus referred to as a BYTE wide port. ie. byte wide input port, byte
wide output port.
The digital I/O ports are the means by which the microcontroller interfaces to the environment.
Digital I/O tends to be grouped into byte wide ports (8 digital bits) that can be configured as
either input bits or output bits. There are some exceptions, such as the microchip PIC 16C54 with
one 6-bit RA port and a byte wide RB port.
The number of I/O port bits varies, depending upon the size of the microcontroller. Some very
simple 8 bit microcontroller have as few as 4 bits of I/O, whilst those at the high end range can
have as many as 33 bits of I/O (some 16 bit microcontrollers could have around 78 bits of I/O).
A typical interface might look like the one illustrated below in figure.
50 | P a g e
Typical devices are:
Timer module
Serial I/O module
Analogue to Digital Converter module
Timer modules
The timer unit can also be used for generating a delay. In the figure below, we see an LED prior
to being turned on via the port bit PB0. Just prior to turning on the LED, the timer unit is loaded
with a count value (the actual value being dictated by the delay time required). In due course the
timer unit count value will reach zero, at which point a flag bit will be set. The CPU, on seeing the
flag bit set, will turn the LED off. The time taken for the timer unit to decrement the count value
to zero will be the time that the LED is on.
51 | P a g e
The Serial Port
A serial interface is a convenient way to connect to other systems. The figure shows a serial port
in relation to components of a microcontroller.
52 | P a g e
Analogue to Digital Conversion
In the real-world signals are often analogue in nature. For example, we might need to monitor
(log) analogue signals from a strain gauge, or from a transducer converting temperature to an
electrical analogue signal (temperature transducer).
Since microcontrollers are sometimes required for these types of applications, some are fitted
with an Analogue to Digital Converter (ADC).
In most cases, the ADC is of the Successive Approximation type and there are a number of
analogue channels (between 4 and 8 is most common).
When the ALU performs arithmetic and logical operations on a byte (8-bits) at an instruction, the
microcontroller is an 8-bit microcontroller. The internal bus width of 8-bit microcontroller is of 8-
bit. Examples of 8-bit microcontrollers are Intel 8051 family and Motorola MC68HC11 family.
53 | P a g e
When the ALU performs arithmetic and logical operations on a word (16-bits) at an instruction,
the microcontroller is an 16-bit microcontroller. The internal bus width of 16-bit microcontroller
is of 16-bit. Examples of 16-bit microcontrollers are Intel 8096 family and Motorola MC68HC12
and MC68332 families. The performance and computing capability of 16 bit microcontrollers are
enhanced with greater precision as compared to the 8-bit microcontrollers.
When the ALU performs arithmetic and logical operations on a double word (32bits) at an
instruction, the microcontroller is an 32-bit microcontroller. The internal bus width of 32-bit
microcontroller is of 32-bit. Examples of 32-bit microcontrollers are Intel 80960 family and
Motorola M683xx and Intel/Atmel 251 family. The performance and computing capability of 32
bit microcontrollers are enhanced with greater precision as compared to the 16-bit
microcontrollers.
Types of microcontrollers
54 | P a g e
Embedded and external memory microcontrollers
Embedded microcontrollers When an embedded system has an microcontroller unit that has all
the functional blocks (including program as well as data memory) available on a chip is called an
embedded microcontroller. For example, 8051 having Program & Data Memory, I/O Ports, Serial
Communication, Counters and Timers and Interrupt Control logic on the chip is an embedded
microcontroller.
External memory microcontrollers When an embedded system has an microcontroller unit that
has not all the functional blocks available on a chip is called an external memory microcontroller.
In external memory microcontroller, all or part of the memory units are externally interfaced
using an interfacing circuit called the glue circuit. For example, 8031 has no program memory on
the chip is an external memory microcontroller.
There are mainly two categories of processors, namely, Von-Neuman (or Princeton) architecture
and Harvard Architecture. These two architectures differ in the way data and programs are stored
and accessed.
Von-Neuman architecture
Microcontrollers based on the Von-Neuman architecture have a single data bus that is used to
fetch both instructions and data. Program instructions and data are stored in a common main
memory. When such a controller addresses main memory, it first fetches an instruction, and then
it fetches the data to support the instruction. The two separate fetches slows up the controller’s
operation. Figure 1.5 shows the Von-Neuman Architecture. The Von-Neuman architecture’s main
advantage is that it simplifies the microcontroller design because only one memory is accessed.
In microcontrollers, the contents of RAM can be used for data storage and program instruction
storage. For example, the Motorola 68HC11 microcontroller Von-Neuman architecture.
Example : An Instruction “Read a byte from memory and store it in the accumulator” as follows:
Cycle 1 :- Read instrution Cycle 2 - Read data out of RAM and put into Accumulator
55 | P a g e
von-neuman architecture
Harvard architecture
Microcontrollers based on the Harvard Architecture have separate data bus and an instruction
bus. This allows execution to occur in parallel. As an instruction is being “pre-fetched”, the
current instruction is executing on the data bus. Once the current instruction is complete, the
next instruction is ready to go. This pre-fetch theoretically allows for much faster execution than
Von-Neuman architecture, on the expense of complexity. The Harvard Architecture executes
instructions in fewer instruction cycles than the Von-Neuman architecture. For example, the intel
MCS-51 family of microcontrollers and PIC microcontrollers uses Harvard Architecture. The same
instruction (as shown under Von-Newman architecture) would be executed as follows: Cycle 1: -
Complete previous instruction - Read the “Move Data to Accumulator” instruction Cycle 2: -
Execute “Move Data to Accumulator” instruction - Read next instruction Hence each instruction
is effectively executed in one instruction cycle.
56 | P a g e
Harvard architecture block diagram
Almost all of today’s microcontrollers are based on the CISC (Complex Instruction Set Computer)
concept. When an microcontroller has an instruction set that supports many addressing modes
for the arithmetic and logical instructions, data transfer and memory accesses instructions, the
microcontroller is said to be of CISC architecture. The typical CISC microcontroller has well over
80 instructions, many of them very powerful and very specialized for specific control tasks. It is
quite common for the instructions to all behave quite differently. Some might only operate on
certain address spaces or registers, and others might only recognize certain addressing modes.
The advantages of the CISC architecture are that many of the instructions are macro like, allowing
the programmer to use one instruction in place of many simpler instructions. An example of CISC
architecture microcontroller is Intel 8096 family.
The industry trend for microprocessor design is for Reduced Instruction Set Computers (RISC)
designs. When a microcontroller has an instruction set that supports fewer addressing modes for
the arithmetic and logical instructions and for data transfer instructions, the microcontroller is
said to be of RISC architecture. The benefits of RISC design simplicity are a smaller chip, smaller
57 | P a g e
pin count, and very low power consumption. Some of the typical features of a RISC processor-
Harvard architecture are:
5. Allows each instruction to operate on any register or use any addressing mode.
In addition to control applications such as the home monitoring system, microcontrollers are
frequently found in embedded applications. Among the many uses that you can find one or more
microcontrollers: automotive applications, appliances (microwave oven, refrigerators, television
and VCRs, stereos), automobiles (engine control, diagnostics, climate control), environmental
control (greenhouse, factory, home), instrumentation, aerospace, and thousands of other uses.
Microcontrollers are used extensively in robotics.
In this application, many specific tasks might be distributed among a large number of
microcontrollers in one system. Communications between each microcontroller and a central,
more powerful microcontroller (or microcomputer, or even large computer) would enable
58 | P a g e
information to be processed by the central computer, or to be passed around to other
microcontrollers in the system. A special application that microcontrollers are well suited for is
data logging. By stick one of these chips out in the middle of a corn field or up in a balloon, one
can monitor and record environmental parameters (temperature, humidity, rain, etc). Small size,
low power consumption, and flexibility make these devices ideal for unattended data monitoring
and recording
In the figure, we see a microcontroller being used to measure an analogue signal level and
determine hi/low limits. The microcontroller includes an ADC module and one of its digital input
ports has been configured (by software) to be an analogue input channel. The software running
on the microcontroller will perform an Analogue to Digital conversion of the input signal, then
determine whether the input signal is above or below some pre-defined limit. It will then turn on
the appropriate LED.
59 | P a g e
corresponding machine code instruction that will be executed on the target
microcontroller.
The object code file cannot be executed on the target micro-controller. It needs to be
passed through a program called a Linker.
The job of the Linker is to take the object file produced by the Assembler and link it with
standard library modules (that have already been pre-assembled into object files) to
produce a complete working executable file that can be loaded into the memory of the
microcontroller.
Sometimes the Assembler and Linker are combined into one program so that assembling
a source program automatically links it as well. This is the case with the PIC Assembler
The figure below, shows the different stages in the production of a program. Note that
the only stage that requires a lot of user input is the initial production of the user source
code file. The rest of the program production involves using the Assembler and Linker
tools.
'Filename' is the name of the program that the user is developing, thus the output of the
Editor is the source file 'filename.asm'.
The output of the Assembler is the object file 'filename.obj'.
The Linker links the 'filename.obj' with any Library object files that the program might
use. It will also link any user object files that the user might want to include.
The Linker output is the executable file to run on the target system.
60 | P a g e
The original source file will contain instructions about where to place the .hex file in the target
microcontroller memory. Typically, this instruction will be: ORG 0000H
This instruction ORGanises the target program to be loaded to the target microcontrollermemory
address 0000 hex. ie. at the address 0000 0000 0000 0000 binary.
Mechanical switches are one of the most common interfaces to a uC. Switch inputs are
asynchronous to the uC and are not electrically clean. Asynchronous inputs can be handled with
a synchronizer. Inputs from a switch are electrically cleansed with a switch debouncer.
The non-ideal behavior of the contacts that creates multiple electrical transitions for a single user
input.
The problem is that the uC is usually fast enough to see all the transitions uC acts on multiple
transitions instead of a single one
61 | P a g e
Nearly all switches do it
The duration of bouncing and the period of each bounce varies
Switches of exactly the same type bounce differently
Bounce differs depending on user force and speed
Typical bounce frequency is .1-5ms
Solutions
Analog filtering -usually an RC delay to filter out the rapid changes in switch output -task is to
choose R and C such that the input threshold is not crossed while bouncing is still occurring
Solutions
62 | P a g e
Cross coupled gates (MC14044) logic gates lock in one transition with a single-pole, double-throw
Relay
A relay is an electromagnetic switch which is used to switch High Voltage/Current using Low
power circuits. Relay isolates low power circuits from high power circuits.
A microcontroller is not able to supply current required for the working of a relay. The maximum
current that a PIC Microcontroller can source or sink is 25mA while a relay needs about 50 –
100mA current.
A relay is activated by energizing its coil. Microcontroller may stop working by the negative
voltages produced in the relay due to its back emf.
63 | P a g e
Interfacing Relay with PIC Microcontroller using Transistor
A relay can be easily interfaced with microcontroller using a transistor as shown below. Transistor
is wired as a switch which carries the current required for operation of the relay. When the pin
RB7 of the PIC microcontroller goes high, the transistor BC547 turns On and current flows through
the relay. The diode D1 is used to protect transistor and the microcontroller from Back EMF
generated in the relays coil. Normally 1N4148 is preferred as it is a fast switching diode having a
peak forward current of 450mA. This diode is also known as freewheeling diode.
Problems
64 | P a g e
CHAPTER 5
For example, control is used to maintain the temperature of our flat at a comfortable specific
value both in winter and summer. Controlling an aircraft, the pilot (or the robot pilot) has to
execute extremely diverse control tasks to keep the speed, the direction, and the altitude of the
aircraft at desired values.
Control systems are all around us, in the household (e.g., setting the program of a washing
machine, ironing by on-off temperature control, air conditioning, etc.), in transportation, space
research, communication, industrial manufacturing, economics, medicine, etc. A lot of control
systems do operate in living organisms as well. Control systems are everywhere in our
surroundings. A control system is realized e.g., when taking a shower, where the temperature of
the shower is to be kept at a comfortable value. If the temperature sensed by our body differs
from its desired value, we intervene by opening the cold tap or the warm tap. After being mixed,
the water goes through the shower pipe. The effect of the change takes place after a delay. The
effect of the delay has to be considered when deciding on a possible newer execution. The control
process taking place is symbolized by the block-diagram.
The speed or angular position of the motor, as well as the level of the tank, is to be kept at a
constant value. The temperature of the liquid flowing through the heat exchanger has to be
maintained. In the chemical reactor, the quality and quantity of the materials being created
during the chemical reaction have to be maintained. In the distillation column the individual
components of the crude oil are to be separated. For this purpose, the temperatures of the plates
in the column have to be appropriately controlled relative to each other. Furthermore, in
65 | P a g e
everyday practice in the household and in a variety of production processes different control
tasks have to be solved. In what follows, the control processes of technological systems will be
discussed. The control of industrial processes plays a significant role in ensuring better product
quality, minimizing energy consumption, increasing safety and decreasing environmental
pollution.
Sensing: gaining information about the process to be controlled and its environment
66 | P a g e
Decision making: processing the information and, based on the aim of the control taking
decisions about the necessary manipulations
Disposition: giving a command for manipulation Signal processing: determine the characteristics
of intervention, acting Intervention
Acting: the modification of the process input according to the disposition. The individual
operations are executed by the appropriate functional units.
To control a process, it is required to measure its changes. Changes of the process occur as
consequences of external and internal effects. The features of the process which manifest its
motion, and also the external and internal effects, are represented by signals. The signal is a
physical quantity, or a change in a physical quantity, which carries information. The signal is
capable of acquiring, transferring, as well as storing information.
Signals can be observed by measurement equipment. Signals have a physical form (e.g., current,
voltage, temperature, etc.)—this is the carrier of the signal. Signals also have informational
content—which shows the effect represented by the signal (e.g., change of the current versus
time).
67 | P a g e
Signals can be classified in different ways. According to its temporal evolution a signal is
continuous if it is continuously maintained without interruption over a given range of time, a
signal is discrete-time or sampled if it provides information only at determined points in time in
a given duration of time.
According to its set of value a signal is contiguous if its set of value is contiguous, a signal is
fractional if its set of value is noncontiguous and can take only definite values.
According to the form of representation of the information a signal is analog if the value of the
signal carrier directly represents the information involved, a signal is digital if the information is
represented by digits which are the coded digital values of the signal carrier. According to the
definiteness of the signal value a signal is deterministic if its value can definitely be given by a
function of time, a signal is stochastic if its evolution is probabilistic, which can be described using
statistical methods.
The characteristic signals of a process are its inputs, outputs, and internal signals. Those input
signals which are supposed to be used as inputs modifying the output of the process are called
manipulated variables or control variables. The other input variables are disturbances.
If the information is not gained directly from the measurement of the controlled signal, an open-
loop control is realized. If the information is derived by directly measuring the controlled signal,
a closed-loop control or feedback control is obtained. An example of an open-loop control system
is the control of a washing machine according to a time schedule of executing consecutive
operations (rinsing, washing, spin drying).
The output signal (the cleanness of the cloths) is not measured. An open-loop control is realized
also if the heating of a room is set depending on the external temperature. In the case of a closed-
loop (feedback) control the controlled signal itself is measured. The control error, i.e., the
deviation between the actual and the desired value of the controlled signal, influences the input
of the process. The functional units are the sensor (measuring equipment), the unit providing the
reference signal, the subtraction unit, the amplifier and signal forming unit, and the executing
68 | P a g e
and actuator unit. The characteristic signals of the processes are measured by sensors. The
measuring instruments provide signals which are proportional to the different physical quantities
measured. The requirements set for the sensors are the following:
A sensor measures the physical quantity which is to be controlled and transforms it to another
physical quantity which is proportional to the actual value of the controlled signal, and can be
compared to the reference signal provided by the reference unit. The error signal operates the
controller.
The output signal of the controller is amplified, formed and operates the acting element
(actuator) which provides the input signal (manipulated variable) for the process. The error signal
gives the deviation of the actual output signal from its desired value. If it is different from zero,
the system input is to be modified to eliminate the error. The different functional units are
selected according to practical considerations. The control system is built from the individual
control elements (sensors which measure the given physical variables in the required range,
69 | P a g e
controllers, actuators, miscellaneous elements) available on the market. The basis of a closed-
loop control system is negative feedback.
The command for modifying the input of the process is performed based on comparing the
reference signal and the actual value of the output signal to be controlled. (There are different
schemes for realizing control systems, but all of them are based on negative feedback.) Because
of the dynamics of the plant and the individual elements of the control system, signals need time
to go through the control loop.
A well-designed controller takes the dynamics of the closed-loop system into consideration and
ensures the fulfillment of the quality specifications imposed on the control system. Comparison
of open-loop and closed-loop control If the relationship between the control signal (manipulated
variable) and the controlled signal (process variable) is known and reliable information is
available on all the elements and all the disturbances in the control circuit, then open-loop
control can ensure good control performance.
But if our knowledge about the plant and about the disturbances is inaccurate, then the
performance of the open-loop control will not be satisfactory. Open-loop control provides a
cheap control solution, as it does not apply expensive sensors to measure the controlled quantity,
but instead it uses information gained about external physical quantities for decision making. In
open-loop control there are no stability problems.
Closed-loop control is more expensive than open-loop control. The controlled variable is
measured by sensor equipment, and manipulation of the input signal of the plant is executed
based on the deviation between the reference signal and the measured output signal. Closed-
loop control is able to track the reference signal and to reject the effect of the disturbances.
As the actual value of the controlled signal is influenced by the disturbances, closed-loop control
rejects the effect of the disturbances which are not known in advance, and also compensates the
effect of the parameter uncertainties of the process model. If any kind of effect has caused the
difference between the output signal and its required value, the closed-loop control is activated
to eliminate the deviation. But because of the negative feedback stability problems may occur,
oscillations may appear in the system. The stability of the control system can be ensured by the
70 | P a g e
appropriate design of the controller. If the disturbance is measurable, then closed-loop control
is often supplemented by feedforward using the measured value of the disturbance
The next example shows the speed control of a motor with open-loop and closed-loop control.
In a CD player the disc has to be rotated at steady speed. A DC motor can be used as actuator.
The angular velocity is proportional to the terminal voltage of the motor. The terminal voltage of
the motor is provided by a direct current power supply through an amplifier
Temperature Control
Speed Control
71 | P a g e
Level control
Composition control
Moisture control
Industrial control systems used in the process industries have tended to emphasize the control
of continuous variables and parameters. By contrast, the manufacturing industries produce
discrete parts and products, and the controllers used here have tended to emphasize discrete
variables and parameters. Just as we have two basic types of variables and parameters that
characterize production operations, we also have two basic types of control:
(1) Continuous control, in which the variables and parameters are continuous and analog; and
(2) Discrete control, in which the variables and parameters are discrete, mostly binary discrete.
In reality, most operations in the process and discrete manufacturing industries tend to include
both continuous as well as discrete variables and parameters. Consequently, many industrial
controllers are designed with the capability to receive, operate on, and transmit both types of
signals and data.
72 | P a g e
5.4.1 Continuous Control Systems
In continuous control, the usual objective is to maintain the value of an output variable at a
desired level, similar to the operation of a feedback control system as defined in the previous
sections. However, most continuous processes in the practical world consist of many separate
feedback loops, all of which have to be controlled and coordinated to maintain the output
variable at the desired value. Examples of continuous processes are the following:
Control of the input of a chemical reaction that depends on temperature, pressure, and input
flow rates of several reactants. All of these variables and/or parameters are continuous.
Control of the position of a work part relative to a cutting tool in a contour milling operation in
which complex curved surfaces are generated. The position of the part is defined by X, j'. and a
coordinate value. As the part moves, the x, y, and z values can he considered as continuous
variables and/or parameters that change over lime to machine the part.
In discrete control, the parameters and variables of the system are changed at discrete moments
in time. The changes involve variables and parameters that are also discrete, typically binary
(ON/OFF). The changes are defined in advance by means of a program of instructions, for
example, a work cycle program. The changes are executed either because the state of the system
has changed or because a certain amount of time has elapsed. These two cases can be
distinguished as
An event driven change is executed by the controller in response to some event that has caused
the state of the system to he altered. The change can be to initiate an operation or terminate an
operation, start a motor or stop it, open a valve or close it, and so forth.
73 | P a g e
5.5 CONTROLLERs
A controller is a mechanism that seeks to minimize the difference between the actual value of a
system (i.e. the process variable) and the desired value of the system (i.e. the setpoint).
Controllers are a fundamental part of control engineering and used in all complex control
systems.
Before we introduce you to various controllers in detail, it is very essential to know the uses of
controllers in the theory of control systems. The important uses of the controllers include:
Controllers improve the steady-state accuracy by decreasing the steady state error.
As the steady-state accuracy improves, the stability also improves.
Controllers also help in reducing the unwanted offsets produced by the system.
Controllers can control the maximum overshoot of the system.
Controllers can help in reducing the noise signals produced by the system.
Controllers can help to speed up the slow response of an overdamped system.
Different varieties of these controllers are codified within industrial automotive devices such as
programmable logic controllers and SCADA systems. The various types of controllers are
discussed in detail below.
There are two main types of controllers: continuous controllers, and discontinuous controllers.
The main feature of continuous controllers is that the controlled variable (also known as the
manipulated variable) can have any value within the controller’s output range. Now in the
74 | P a g e
continuous controller theory, there are three basic modes on which the whole control action
takes place, which are:
Proportional controllers,
Integral controllers
and Derivative controllers.
We use the combination of these modes to control our system such that the process variable is
equal to the setpoint (or as close as we can get it). These three types of controllers can be
combined into new controllers:
All controllers have a specific use case to which they are best suited. We cannot just insert any
type of controller at any system and expect a good result – there are certain conditions that must
be fulfilled. For a proportional controller, there are two conditions and these are written below:
The deviation should not be large; i.e. there should not be a large deviation between the
input and output.
The deviation should not be sudden.
75 | P a g e
Removing the sign of proportionality, we have,
It is recommended that K p should be kept greater than unity. If the value of K p is greater than
unity (>1), then it will amplify the error signal and thus the amplified error signal can be detected
easily.
The proportional controller helps in reducing the steady-state error, thus makes the
system more stable.
The slow response of the overdamped system can be made faster with the help of these
controllers.
Now there are some serious disadvantages of these controllers and these are written as
follows:
Due to the presence of these controllers, we get some offsets in the system.
Proportional controllers also increase the maximum overshoot of the system.
As the name suggests in integral controllers the output (also called the actuating signal) is directly
proportional to the integral of the error signal. Now let us analyze integral controller
mathematically. As we know in an integral controller output is directly proportional to the
integration of the error signal, writing this mathematically we have,
76 | P a g e
Removing the sign of proportionality, we have,
Where Ki is an integral constant also known as controller gain. The integral controller is also
known as reset controller.
Due to their unique ability, Integral Controllers can return the controlled variable back to
the exact set point following a disturbance that’s why these are known as reset
controllers.
It tends to make the system unstable because it responds slowly towards the produced
error.
We never use derivative controllers alone. It should be used in combinations with other modes
of controllers because of its few disadvantages which are written below:
It produces saturation effects and also amplifies the noise signals produced in the system.
Now, as the name suggests in a derivative controller the output (also called the actuating signal)
is directly proportional to the derivative of the error signal. Now let us analyze the derivative
controller mathematically. As we know in a derivative controller output is directly proportional
to the derivative of the error signal, writing this mathematically we have,
77 | P a g e
Removing the sign of proportionality, we have,
Where, Kd is proportional constant also known as controller gain. The derivative controller is also
known as the rate controller.
The major advantage of a derivative controller is that it improves the transient response
of the system.
As the name suggests it is a combination of proportional and an integral controller the output
(also called the actuating signal) is equal to the summation of proportional and integral of the
error signal. Now let us analyze proportional and integral controller mathematically. As we know
in a proportional and integral controller output is directly proportional to the summation of
proportional of error and integration of the error signal, writing this mathematically we have,
78 | P a g e
Removing the sign of proportionality, we have,
Through the PI controller, we are adding one pole at origin and one zero somewhere away from
the origin (in the left-hand side of complex plane). As the pole is at the origin, its effect will be
more, hence PI controller may reduce the stability; but its main advantage is that it reduces
steady-state error drastically, due for this reason it is one of the most widely used controllers.
79 | P a g e
The response of the system with K=5.8, Ki=0.2
As the name suggests it is a combination of proportional and a derivative controller the output
(also called the actuating signal) is equals to the summation of proportional and derivative of the
error signal. Now let us analyze proportional and derivative controller mathematically. As we
know in a proportional and derivative controller output is directly proportional to the summation
of proportional of error and differentiation of the error signal, writing this mathematically we
have,
Readers should note that adding ‘zero’ at the proper location in the open-loop transfer function
improves stability, while the addition of pole in the open-loop transfer function may reduce the
80 | P a g e
stability. The words “at proper location” in the above sentence are very important & it is called
designing of the control system (i.e. both zero & pole should be added at proper points in the
complex plane to get the desired result).
A PID controller is generally used in industrial control applications to regulate temperature, flow,
pressure, speed, and other process variables.
81 | P a g e
The transfer function of the PID Controller can be found as:
or
It can be observed that one pole at origin is fixed, remaining parameters Td, K, and Ki decide the
position of two zeros. In this case, we can keep two complex zeros or two real zeros as per the
requirement, hence PID controller can provide better tuning. In the olden days, the PI controller
was one of the best choice of control engineers, because designing (tuning of parameters) of
the PID controller was a little difficult, but nowadays, due to the development of software
designing of PID controllers have become an easy task.
Root locus
82 | P a g e
K’ is called a proportional controller (also called error amplifier). Characteristics equation of this
control system can be written as:
s3+3s2+2s+K=0
If the Routh-Hurwitz is applied in this characteristic’s equation, then the range of ‘K’ for the
stability can be found as 0<K<6. (It implies that for the values K>6 system will be unstable; for the
value of K=0, the system will be marginally stable).
Root locus of the system shown in Figure-1, Root Locus provides an idea that what should be
the value of ‘K’
(You can understand that root locus is drawn for the open-loop transfer function (G(s)H(s), but it
gives an idea about the poles of the closed-loop transfer function, i.e. roots of characteristics
equation, also called zeros of the characteristics equation. The Root locus is helpful in designing
the value of ‘K’, i.e. gain of the proportional controller). So, the system (in Figure-1) is stable for
values such as K= 0.2, 1, 5.8 etc.; but what value we should select. We will analyze each value and
show you the results. As a summary, you can understand that the high value of ‘K’ (i.e., for
example, K=5.8) will reduce the stability (it is a disadvantage) but improves the steady-state
performance (i.e. reduce the steady-state error, which will be an advantage).
83 | P a g e
, Steady state error (ess)= (It is applicable in case of step input)
It can be observed that for the high value of ‘K’, values of Kp, Kv and Ka will be high and steady -
state error will below.
1. At K=0.2
In this case characteristics equation of the system is s3+ 3s2+ 2s+0.2=0; roots of this equation are
-2.088, -0.7909 and -0.1211; We can ignore -2.088 (as it is far away from imaginary axis). On the
basis of the remaining two roots, it can be termed as an overdamped system (as both the roots
are real & negative, no imaginary parts). Against step input, its time response is shown below. It
can be seen that the response has no oscillations. (if roots are complex then time response
exhibits oscillations). The overdamped system has damping more than ‘1’.
84 | P a g e
It should be noted that in the designing of control systems, overdamped systems are not
preferred. Roots (poles of closed-loop transfer function) should have slight imaginary parts. In
the case of overdamped, damping is more than ‘1’, while damping around 0.8 is preferred.
2. At K=1
In this case characteristics equation of the system is s 3+ 3s2+ 2s+1=0; roots of this equation are -
2.3247, -0.3376 ±j0.5623; We can ignore -2.3247. On the basis of the remaining two roots, it can
be termed as an underdamped system (as both the roots are complex having negative real parts).
3. At K=5.8
As 5.8 is very close to 6, so you can understand that system is stable, but almost on the border.
You can find the roots of its characteristic’s equation. One root can be ignored, the remaining
two roots will be very close to the imaginary axis. (Roots of its characteristics equation will be -
2.9816, -0.0092±j1.39). Against step input, its time response
85 | P a g e
Response has oscillations, it is the response of the underdamped system
Question
86 | P a g e
CHAPTER 6
One of the most important tasks in the analysis and design of control systems is mathematical
modeling of the systems. The two most common methods of modeling linear systems are the
transfer function method and the state-variable method. The transfer function is valid only for
linear time-invariant systems, whereas the state equations can be applied to linear as well as
nonlinear systems. Although the analysis and design of linear control systems have been well
developed, their counterparts for nonlinear systems are usually quite complex.
Therefore, the control systems engineer often has the task of determining not only how to
accurately describe a system mathematically but, more importantly, how to make proper
assumptions and approximations, whenever necessary, so that the system may be realistically
characterized by a linear mathematical model. A control system may be composed of various
components including mechanical, thermal, fluid, pneumatic, and electrical; sensors and
actuators; and computers
Using the basic modeling principles such as Newton's second Law of motion or Kirchoff's law, the
models of these dynamic systems are represented by differential equations. It is not difficult to
understand that the analytical and computer simulation of any system is only as good as the
model used to describe it. It should also be emphasized that the modern control engineer should
place special emphasis on the mathematical modeling of systems so that analysis and design
problems can be conveniently solved by computers.
87 | P a g e
Modelling of mechanical systems
Mechanical systems may be modeled as systems of lumped masses (rigid bodies) or as distributed
mass (continuous) systems. The latter are modeled by partial differential equations, whereas the
former is represented by ordinary differential equations. Of course, in reality all systems are
continuous, but, in most cases, it is easier and therefore preferred to approximate them with
lumped mass models and ordinary differential equations.
Definition: Mass is considered a property of an element that stores the kinetic energy of
translational motion. Mass is analogous to the inductance of electric networks, as shown in
𝑊
Section 4-10. If W denotes the weight of a body, then M is given by 𝑀=
𝑔
where g is the acceleration of free fall of the body due to gravity (g = 32.174 ft/sec 2 in British
units, and g = 9.8066 m/sec2 in SI units).
The equations of a linear mechanical system are written by first constructing a model of the
system containing interconnected linear elements and then by applying Newton's law of motion
to the free-body diagram (FBD
Translational Motion
The motion of translation is defined as a motion that takes place along a straight or curved path.
The variables that are used to describe translational motion are acceleration, velocity, and
displacement. Newton's law of motion states that the algebraic sum of external forces acting on
a rigid body in a given direction is equal to the product of the mass of the body and its acceleration
in the same direction. The law can be expressed as
∑ 𝐹 = 𝑀𝑎
𝑒𝑥𝑡𝑒𝑟𝑛𝑎𝑙
88 | P a g e
Force-mass system
where M denotes the mass, and a is the acceleration in the direction considered. Fig. above
illustrates the situation where a force is acting on a body with mass M. The force equation is
written as
where a(t) is the acceleration, v(t) denotes linear velocity, and y(t) is the displacement of mass
M, respectively. For linear translational motion, in addition to the mass, the following system
elements are also involved.
• Linear spring. In practice, a lineal' spring may be a model of an actual spring or a compliance
ofa cable or a belt. In general, a spring is considered to be an element that stores potential energy
where K is the spring constant, or simply stiffness. Eq. (4-4) implies that the force acting on the
spring is directly proportional to the displacement (deformation) of the spring.
Friction for translation motion. Whenever there is motion or tendency of motion between two
physical elements, frictional forces exist. The frictional forces encountered in physical systems
are usually of a nonlinear nature.
The characteristics of the frictional forces between two contacting surfaces often depend on such
factors as the composition of the surfaces, the pressure between the surfaces, and their relative
velocity among others, so an exact mathematical description of the frictional force is difficult.
Three different types of friction are commonly used in practical systems: viscous friction, static
friction, and Coulomb friction. These are discussed separately in the following paragraphs.
• Viscous friction. Viscous friction represents a retarding force that is a linear relationship
between the applied force and velocity. The schematic diagram element for viscous friction is
89 | P a g e
often represented by a dashpot, such as that shown below. The mathematical expression of
viscous friction is
Static friction.
Static friction represents a retarding force that tends to prevent motion from beginning. The
static frictional force can be represented by the expression
90 | P a g e
which is defined as a frictional force that exists only when the body is stationary but has a
tendency of moving. The sign of the friction depends on the direction of motion or the initial
direction of velocity
Coulomb friction.
Coulomb friction is a retarding force that has constant amplitude with respect to the change of
velocity, but the sign of the frictional force changes with the reversal of the direction of velocity.
The mathematical relation for the Coulomb friction is given by
It should be pointed out that the three types of frictions cited here are merely practical models
that have been devised to portray frictional phenomena found in physical systems. They are by
no means exhaustive or guaranteed to be accurate. In many unusual situations, we have to use
other frictional models to represent the actual phenomenon accurately. One such example is
rolling dry friction, which is used to model friction in high-precision ball bearings used in
spacecraft systems. It turns out that rolling dry friction has nonlinear hysteresis properties that
make it impossible for use in linear system modeling.
91 | P a g e
92 | P a g e
93 | P a g e
94 | P a g e
95 | P a g e
96 | P a g e
97 | P a g e
98 | P a g e
99 | P a g e
100 | P a g
e
101 | P a g e
102 | P a g
e
103 | P a g
e
104 | P a g
e
105 | P a g
e
106 | P a g e
Modeling of active electrical elements: Operational amplifiers
Operational amplifiers, or simply op-amps, offer a convenient way to build and implement, or
realize continuous-data or s-domain transfer functions. In control systems, op-amps are often
used to implement the controllers or compensators that evolve from the control system design
process, so in this section we illustrate common op-amp configurations. An in-depth presentation
of op-amps is beyond the scope of this text. For those interested, many texts are available that
are devoted to all aspects of op-amp circuit design and applications
107 | P a g e
108 | P a g e
109 | P a g e
110 | P a g e
111 | P a g e
112 | P a g e
113 | P a g e
114 | P a g e
115 | P a g e
116 | P a g e
117 | P a g e
118 | P a g e
119 | P a g e
6.2 Complex Control Systems
6.2.1 Ratio control system
Ratio Control System Ratio control system is a technique where in variable is manipulated to keep
it as a ratio proportional to another ratio control system is a special type feed forward control
system widely used in the process industries. The objective of ratio control system is to maintain
the ratio of two variables at a specified value.
In this figure the ratio control system consists of the flow transmitter which senses the flow rate
of the first pipe and second flow control. The flow controller controls the flow of the second pipe
with respect to the flow in the first pipe. Example of ratio control system A common example is
when the ratio of two reactants must be controlled is shown in the figure. One of the flow rates
is measured but allowed to float, that is, not regulated.
120 | P a g e
The outer flow rate is both measured and adjusted. The outer flow rate is both measured and
adjusted to provide the specified control ratio. The flow rate of reactant A is measured and added
with appropriate scaling, to the measurement of flow rate B. the controller reacts to the resulting
input signal by adjustment of the control valve in the reactant B input line. Application of ratio
control system: Blending operations for holding the fuel-air ratio of reactants of the optimum.
Maintaining a stoichiometric ratio of reactance of a reactor. Keeping a specified reflux ratio for a
distillation column etc.
Cascade control involves the use of two controllers with the output of the first controller
providing the set point for the second controller, the feedback loop for one controller nestling
inside the other. Such a system can give an improved response to disturbances.
121 | P a g e
With the single loop control system, the level sensor provides the feedback which gives the error
signal to the controller and hence initiates the controlling action on the rate at which fluid enters
the container. We have a situation where changes in the level occur rather slowly, because of the
large cross-sectional area of the container. Changes in flow can, however, occur very rapidly.
Thus, if we have a disturbance which causes a change in the input flow rate, there can be
considerable delay before the level changes enough to initiate a correction. With the cascade
system, the level sensor provides the feedback to the outer loop controller which then gives an
output which provides the set point input to the second controller, this being used to control the
rate of flow of the liquid. The flow level loop responds quickly to flow disturbances and so
considerably reduces the level fluctuations that would have occurred with the single loop control
system.
Feed-forward is a term describing an element or pathway within a control system which passes
a controlling signal from a source in its external environment, often a command signal from an
external operator, to a load elsewhere in its external environment. A control system which has
only feed-forward behavior responds to its control signal in a pre-defined way without
122 | P a g e
responding to how the load reacts; it is in contrast with a system that also has feedback, which
adjusts the output to take account of how it affects the load, and how the load itself may vary
unpredictably; the load is considered to belong to the external environment of the system. In a
feed-forward system, the control variable adjustment is not error-based. Instead it is based on
knowledge about the process in the form of a mathematical model of the process and knowledge
about or measurements of the process disturbances
With appropriate design of the feedforward controller C(n)S the effect of the disturbance can be
significantly decreased or even totally compensated. The disturbance acts on the output through
two paths. The resulting transfer function between the output and the disturbance is
• Guided missiles
The concept of split-range control is easier to understand when illustrated using applications such
as a temperature control.
123 | P a g e
In such an application, the process needs to be heated or cooled depending of the product
temperature.
The below figure shows how the temperature transmitter, the controller, and the two control
valves are connected for split-range control in a typical temperature control application.
In the diagram above, the 0% to 100% range of the controller output is split in two between the
two valves. If the controller output is between 0% and 50%, it is the cooling valve that operates.
This valve is fully open when the controller output is 0% and fully closed when the controller
output is 50%. If the controller output is between 50% and 100%, it is the heating valve that is in
operation.
At 50%, the heating valve starts to open and it is fully open at 100% of the controller output.
In a split-range control installation, there are different ways to connect the valves so that they
operate on two different ranges.
In the example above, the current to pressure converters are used to split the controller output
in two ranges.The first converter responds to a current from 4 mA to 12 mA, while the other
operates in a range from 12 mA to 20 mA.
124 | P a g e
CHAPTER 7
In this chapter, let us discuss the time response of the first order system. Consider the following
block diagram of the closed loop control system. Here, an open loop transfer function given as
We know that the transfer function of the closed loop control system has unity negative
feedback as,
The power of s is one in the denominator term. Hence, the above transfer function is of the first
order and the system is said to be the first order system.
We can re-write the above equation as
125 | P a g e
Where,
C(s) is the Laplace transform of the output signal c(t),
R(s) is the Laplace transform of the input signal r(t), and
T is the time constant.
Follow these steps to get the response (output) of the first order system in the time domain.
In the previous chapter, we have seen the standard test signals like impulse, step, ramp and
parabolic. Let us now find out the responses of the first order system for each input, one by one.
The name of the response is given as per the name of the input signal. For example, the response
of the system for an impulse input is called as impulse response.
126 | P a g e
127 | P a g e
7.1.3 Step Response of First Order System
128 | P a g e
129 | P a g e
130 | P a g e
7.14 Ramp Response of First Order System
131 | P a g e
132 | P a g e
7.2 Response of second order systems
133 | P a g e
134 | P a g e
7.2.1 Step Response of Second Order System
135 | P a g e
136 | P a g e
137 | P a g e
138 | P a g e
139 | P a g e
140 | P a g e
7.2.2 Impulse Response of Second Order System
Research Question
a. A digital filter is observed to have the outputs shown here in response to a unit impulse,
მ(n).
FILTER
x(n) = მ(n) y(n) = {0, 1, 2, 3, 0, 0, 0…}
141 | P a g e
7.3 The Concept of Stability
If a system has the property that it will get back into the equilibrium state again after moving
away from its equilibrium state, then it is stable. If the system is non-linear, its stability depends
on the input signal and also on the operating point. In this case, stability is a characteristic of a
state of the system, and not of system as a whole. In case of a linear system, stability is
characteristic for the system. Stability depends on the system’s structure and parameters, but
does not depend on the input signal. As far as stability is concerned, a number of various
formulations exist
The root locus gives the location of the roots of the characteristic equation of the closed-loop
system in the complex plane as a parameter (generally the loop gain) changes between zero and
infinity. If the roots are in the left half-plane, the system is stable. At the critical gain the root
locus crosses the imaginary axis. At gains where the root locus has moved to the right half-plane,
the system becomes unstable. From the root locus, not only the stability of the closed-loop
system can be checked, but from the location of the roots, also the dynamic properties can be
determined approximately.
For drawing the root locus, the characteristic equation has to be solved for different parameter
values. Today’s computer techniques and CAD programs provide considerable help in drawing
the root locus branches. But often there is the need for a rapid qualitative analysis to assist the
designer in design considerations. Therefore, several rules have been elaborated to support the
quick sketching of the root locus. (It is also called the EVANS method, after the name of the
developer of the method.)
142 | P a g e
Rules for Drawing Root Locus
With the analytical ROUTH-HURWITZ stability criteria, the stability of a closed-loop control
system can be determined based on the coefficients of the characteristic equation, but in the
case of instability it is difficult to tell how to change the parameters of the system to ensure the
appropriate dynamical performance. The root locus gives an expressive picture of the change of
the location of the roots of the closed-loop characteristic equation in the complex plane versus a
143 | P a g e
parameter, thus a comprehensive view can be obtained of the stability and dynamical properties
of the system.
With the NYQUIST stability criterion, the stability of the closed-loop control system can be
determined based on the frequency diagram of the open-loop. The method is expressive, and in
the case of instability it can be easily determined how to modify expediently the structure and
the parameters of the system. By appropriately forming the frequency function—i.e., introducing
new zeros and poles— the prescribed properties of the closed-loop system, in addition to its
stability, as well as its required static and dynamical properties can be ensured.
144 | P a g e
145 | P a g e
Summary
Nyquist stability criterion states the number of encirclements about the critical point (1+j0) must
be equal to the poles of characteristic equation, which is nothing but the poles of the open loop
transfer function in the right half of the 's' plane
146 | P a g e
ii. Bode plots
A Bode plot is a standard format for plotting frequency response of LTI systems. Becoming
familiar with this format is useful because:
2. Many common system behaviors produce simple shapes (e.g. straight lines) on a Bode plot,
so it is easy to either look at a plot and recognize the system behavior, or to sketch a plot from
what you know about the system behavior. The format is a log frequency scale on the horizontal
axis and, on the vertical axis, phase in degrees and magnitude in decibels.
The root locus of a feedback system is the graphical representation in the complex s-plane of the
possible locations of its closed-loop poles for varying values of a certain system parameter. The
points that are part of the root locus satisfy the angle condition
147 | P a g e
CHAPTER 8
The main difference between operating system and application software is that an operating
system is a system software that works as the interface between the user and the hardware while
the application software is a program that performs a specific task.
148 | P a g e
The Need for PLCs
Hardwired panels were very time consuming to wire, debug and change.
panels.
The First Programmable Logic Controllers (PLCs) were Introduced in the late 1960’s
Developed to offer the same functionality as the existing relay logic systems
Programmable, reusable and reliable
Could withstand a harsh industrial environment
They had no hard drive, they had battery backup
Could start in seconds
Used Ladder Logic for programming
• It uses a programmable memory to store instructions and specific functions that include
On/Offcontrol, timing, counting, sequencing, arithmetic, and data handling
• Flexible
149 | P a g e
• Faster response time
• Less expensive
150 | P a g e
151 | P a g e
152 | P a g e
8.3 PLC Architecture and Block Diagram
153 | P a g e
PLC Architecture
• An open architecture design allows the system to be connected easily to devices and
programsmade by other manufacturers.
• A closed architecture or proprietary system, is one whose design makes it more difficult to
connect devices and programs made by other manufacturers.
NOTE: When working with PLC systems that are proprietary in nature you must be sure that any
generic hardware or software you use is compatible with your particular PLC.
Power Supply
• In large PLC systems, this power supply does not normally supply power
• In small and micro PLC systems, the power supply is also used to power field devices.
154 | P a g e
Processor (CPU)
• Designed so the desired circuit can be entered in relay ladder logic form.
• The processor accepts input data from various sensing devices, executes the stored user
program, and sends appropriate output commands to control devices
I/O Section
155 | P a g e
Consists of:
• Input modules
• Output modules.
I/O Section
Forms the interface by which input field devices are connected to the controller.
• The terms “field” and “real world” are used to distinguish actual external devices that exist
and must be physically wired into the system
156 | P a g e
Output Module
Forms the interface by which output field devices are connected to the controller.
• PLCs employ an optical isolator which uses light to electrically isolate the internal
componentsfrom the input and output terminals.
157 | P a g e
8.4 PLC Programming
• The software allows users to create, edit, document, store and troubleshoot programs
• The personal computer communicates with the PLC processor via a serial or parallel data
communications link
Hand held
• They are compact, inexpensive, and easy to use, but are not able to display as much
logic onscreen as a computer monitor
158 | P a g e
PLC Mixer Process Control Problem
Mixer motor to automatically stir the liquid in the vat when the temperature and pressure reach
preset values
The temperature and pressure sensor switches close their respective contacts when conditions
reach their preset values
159 | P a g e
Motor starter coil is energized when both the pressure and temperature switches are closed or
when the manual pushbutton is pressed
• These devices are wired to the input module according to the manufacturer’s labeling scheme
Same output field device is used and wired to the output module
160 | P a g e
Triac switches motor ON and OFF in accordance with the control signal from the processor
161 | P a g e
162 | P a g e
I/O address format will differ, depending on the PLC manufacturer. You give each input and
output device an address. This lets the PLC know where they are physically connected
During each operating cycle, the controller examines the status of input devices, executes the
user program, and changes outputs accordingly
163 | P a g e
The completion of one cycle of this sequence is called a scan. The scan time, the time required
for one full cycle, provides a measure of the speed of response of the PLC.
Almost all programmable logic controllers (PLCs) worldwide handle scanning in the same way.
First, the CPU reads the physical inputs into a memory table, usually called the "input table." This
table is then used as the program is evaluated.
There are different types of registers that are used in different platforms; these registers are
updated as the logic is processed left to right on each rung and top to bottom within each routine.
This includes updating an output table, which will later be used to drive the physical devices
connected to the PLC.
The program might call different subroutines for different purposes, and it can be important in
what order routines are called. Depending on where memory registers and output tables are
updated, the physical outputs could be delayed by up to two scans.
In either case, the program meanders through the different routines as they are called before
returning to wherever they were called from and eventually ends up at the end of the original
cyclic routine. Most programs use an initial cyclic routine that is used to call all of the other
routines. It should be noted that some programs, however, run on a periodic basis instead of a
continuous program. This is uncommon, though. Most programs use a continuous program
configuration that runs as fast as it can. After executing all of the code, evaluating the logic, and
updating all of the tables (except for the input tables, which were written at the beginning of the
scan), the resulting output table or register contents are written to the physical outputs
164 | P a g e
The scan time can take as long as 80 ms. If the scan time is longer than about 50 ms (for a machine
control project) then the user should be looking for a more powerful processor or ways to make
the code more efficient. Beyond 50 ms the effect on output reaction for a machine control project
starts to be noticeable; for a process control project this may not matter.
The can be considered to represent a coil that, when energized, will close a set of contacts.
Coil O/1 is energized when contacts I/1 and I/2 are closed or when contact I/3 is closed. Either of
these conditions provides a continuous path from left to right across the rung that includes the
coil.
165 | P a g e
Modifying A PLC Program
The change requires that the manual pushbutton control should be permitted to operate
at any pressure but not unless the specified temperature setting has been reached.
If a relay system were used, it would require some rewiring of the system, as shown, to
achieve the desired change.
If a PLC is used, no rewiring is necessary!
The inputs and outputs are still the same. All that is required is to change the PLC program
166 | P a g e
8.6 Factors considered when procuring PLCs.
1. System Requirements
The tasks that your system is required to carry out will determine the kind of PLC you need.
Another deciding factor is whether your system is to be built from scratch or if existing products
are already installed. These factors are important because you will want to match a PLC's
functionality with the task at hand and with any existing products that are installed.
2. Environmental Requirements
Although most PLCs are ruggedized for tough physical environments, issues such as dust,
vibration, temperature or specific facility codes may affect your application. Temperature
extremes, for example, may be problematic. The typical operating range for PLCs is 0-55 degrees
Celsius (32-130 degrees Fahrenheit), but if your facility's ambient temperature falls outside of
that range or has other atypical environmental requirements, you will need to research other
potential PLC candidates more thoroughly.
As we've seen so far, inputs and outputs are fundamental to the operation of a PLC. Two key
factors to consider in choosing the right PLC are the number of I/O s and their location.
Because a PLC controls a sizable part of a process, you will want to make sure that it can handle
multiple I/O s and I/O s of different types. The number of both analog and discrete devices that
your system has will impact this decision as well. Keep in mind that the number of I/O s will also
determine the size of your PLC's chassis.
The location of I/O s also makes a difference in your selection. Will your system require a local
I/O, or will you need both local and remote I/O s? The answer to this question depends on
whether your application will have subsystems that are a long distance from the CPU. You will
also need to investigate whether the speeds and distances of the remote I/O are sufficient for
your application.
4. Speed of CPU
167 | P a g e
The processing of the CPU must be quick enough to handle multiple I/O's and the types of data
collection required for your application. Having enough memory is essential too, and it will
depend on how many devices you have. Another consideration is the scan time, which is the
amount of time it takes for the CPU to perform one cycle of gathering inputs, running the PLC
program, and updating the outputs. Also, program memory for the CPU will be determined by
the type of program and instructions you plan to use.
The type of communication protocols your system will use is another factor in PLC selection.
What kind of networks or devices will the PLC be communicating with?
Sometimes PLCs are equipped with communication ports, but others require additional
communication modules. Other options are to communicate remotely via Ethernet or to build
upon multiple types of communications as your system requires.
6. Programming
Find out what your programming requirements are: will you need basic programming
instructions, or will you require special programming instructions?
Are you accustomed to using assembly language or would you prefer to use a higher-level
language such as C or BASIC?
Do you want to use tag name-based control, where you assign a specific amount of
memory for a certain data type?
Or, are you more comfortable using fixed memory addressing that does the assigning for
you? The programming characteristics of the PLC you decide on should give you the most
ease-of-use for development, troubleshooting, and maintenance.
Use the PLC in an environment that meets the general specification contained in this
manual or datasheet.
168 | P a g e
Using the PLC in an environment outside the range of the general specifications could
result in electric shock, fire, erroneous operation, and damage to or deterioration of the
product.
Completely turn off the power supply before loading or unloading the module.
When install the PLC in environment of much vibration, be sure to insulate the PLC from
direct vibration.
Not doing so could cause electric shock, fire, and erroneous operation.
Be sure to there are no foreign substances such as conductive debris inside the module.
DIGITAL CONTROL
Developments in digital electronics have led to many industrial processes being computer
controlled. The first system used was Direct Digital Control (DDC), in which a computer measured
each variable in the process, these signals being used to maintain the required set points in the
process.
As digital electronics developed, minicomputers become more competitive, and with the advent
of electronic Multiplexer (Mux) and Demultiplexer (Demux), it is possible to sample the state of
many analog and digital transducers at high speed and also to control many values or devices in
the plant.
169 | P a g e
A basic Direct Digital Control System is shown below. In this system a large number
of transducers are sited around the plant, each transducer being connected to one input of a
Mux. (A Mux can be considered as- the electronic equivalent of a switch with a contact or blade
which rotates very rapidly so that it moves from one transducer to another, the blade remaining
in contact with the transducer long enough for an ADC to sample and digitize or to quantize the
analog signal. The quantized data are then transmitted along the data bus of the system to the
CPU).
When the CPU has analysed the data from one or more transducers and has compared them with
the appropriate set points in the computer program, it sends signals along the data bus to the
values controlling the system as follows. The digital signal produced by the CPU is converted into
an analog signal by a DAC and the analog signal is transmitted to the appropriate control value
through a demux. As this is being performed, data are displayed on the operator’s visual display
unit and if necessary, he can remotely change the set points associated with various sections of
the process.
170 | P a g e
8.9 Distributed Control System
A distributed control system (DCS) is a specially designed automated control system that consists
of geographically distributed control elements over the plant or control area.
It differs from the centralized control system wherein a single controller at central location
handles the control function, but in DCS each process element or machine or group of machines
is controlled by a dedicated controller. DCS consists of a large number of local controllers in
various sections of plant control area and are connected via a high-speed communication
network.
In DCS control system, data acquisition and control functions are carried through a number of
DCS controllers which are microprocessor-based units distributed functionally and geographically
over the plant and are situated near area where control or data gathering functions being
performed as shown in the figure above. These controllers able to communicate among
themselves and also with other controllers like supervisory terminals, operator terminals,
historians, etc.
Distributed individual automatic controllers are connected to field devices such as sensors and
actuators. These controllers ensure the sharing of gathered data to other hierarchal controllers
via different field buses. Different field buses or standard communication protocols are used for
establishing the communication between the controllers. Some of these include Profibus, HART,
arc net, Modbus, etc.
DCS is most suited for large-scale processing or manufacturing plants wherein a large number of
continuous control loops are to be monitored and controlled. The main advantage of dividing
control tasks for distributed controllers is that if any part of DCS fails, the plant can continue to
operate irrespective of failed section.
171 | P a g e
1) DCS is the acronym for Distributed control systems; SCADA is the acronym for Supervisory
Control and Data Acquisition
4) A DCS is a process control system that uses a network to interconnect sensors, controllers,
operator terminals and actuators. A DCS typically contains one or more computers for control
and mostly use both proprietary interconnections and protocols for communications.
SCADA may be called Human-Machine Interface (HMI). SCADA systems are used to monitor or to
control chemical, physical or transport processes.
5) Distributed Control System (DCS) consists of one or more controllers used to implement
advanced process control techniques.
Supervisory Control and Data Acquisition (SCADA) systems cannot carry out advanced process
control techniques.
172 | P a g e
6) DCS is more integrated and can do more higher-end stuff, but SCADA systems are more
flexible.
8.10 SCADA
A SCADA (supervisory control and data acquisition) is an automation control system that is used
in industries such as energy, oil and gas, water, power, and many more. The system has a
centralized system that monitors and controls entire sites, ranging from an industrial plant to a
complex of plants across the country.
A SCADA system works by operating with signals that communicate via channels to provide the
user with remote controls of any equipment in a given system. It also implements a distributed
database, or tag database, that contains tags or points throughout the plant. These points
represent a single input or output value that is monitored or controlled by the SCADA system in
the centralized control room. The points are stored in the distributed database as value-
timestamp pairs. It's very common to set up the SCADA systems to also acquire metadata, such
as programmable logic controller (PLC) register paths and alarm statistics.
While these systems simplify a given infrastructure, their components are quite complex. There
are five essential composing parts of a SCADA system:
The HMI processes data from each tag and sends it to a human operator, where he or she then
can monitor or control the system. The supervisory system gathers the data sent from each tag
and sends commands or operations to the process.
The RTUs connect sensors and convert their signals to digital data and send it to the supervisory
system, where it can be stored in a distributed database. PLCs are used as field devices because
173 | P a g e
they are much more versatile and economical than process-specific RTUs. Finally, the
communication infrastructure delivers connectivity to the supervisory system and then to the
RTUs and PLCs for the user to command.
The communication infrastructure is necessary to relay data from remote RTU/PLCs, which run
along electric grids, water supplies, and pipelines. Communication is the absolute most essential
link for a SCADA system to operate properly; however, how well the system manages
communication from HMI to RTUs and PLCs fundamentally determines how successful a SCADA
system can be. Below is a figure of what a basic SCADA system might look like for a given
infrastructure.
SCADA systems
174 | P a g e
8.10.1 Applications of SCADA
SCADA is widely used in different areas from chemical, gas, water, communications and power
systems. The list of applications of SCADA can be listed as follows.
SCADA systems are used in electric power generation plants, transmission area and distribution
system.
SCADA based systems are used by the state or municipal corporation to monitor, control and
regulate water capacities in reservoir.
5. Traffic controls:
SCADA helps in regulation of traffic signals , controls the traffic flow in railway systems on road
systems and air traffic controls.
Facility managers use SCADA to control HVAC, refrigeration units, lighting and entry systems.
175 | P a g e
Transit authorities use SCADA to regulate electricity to subways, trams and trolley buses; to
automate traffic signals for rail systems; to track and locate trains and buses; and to control
railroad crossing gates.
Redundancy
Diagnostics
Maintainability
In engineering, maintainability is the ease with which a product can be maintained in order to:
correct defects or their cause, repair or replace faulty or worn-out components without having
to replace still working parts, prevent unexpected working conditions, maximize a product's
useful life, maximize efficiency, reliability, and safety, meet new requirements, make future
maintenance easier, or cope with a changed environment.
Expandability
176 | P a g e
Control System Flowchart (CSF)
"Ladder" diagrams Ladder diagrams are specialized schematics commonly used to document
industrial control logic systems. They are called "ladder" diagrams because they resemble a
ladder, with two vertical rails (supply power) and as many "rungs" (horizontal lines) as there are
control circuits to represent. If we wanted to draw a simple ladder diagram showing a lamp that
is controlled by a hand switch, it would look like this:
The "L1" and "L2" designations refer to the two poles of a 120 VAC supply, unless otherwise
noted. L1 is the "hot" conductor, and L2 is the grounded ("neutral") conductor. These
designations have nothing to do with inductors, just to make things confusing. The actual
transformer or generator supplying power to this circuit is omitted for simplicity. In reality, the
circuit looks something like this:
Typically, in industrial relay logic circuits, but not always, the operating voltage for the switch
contacts and relay coils will be 120 volts AC. Lower voltage AC and even DC systems are
sometimes built and documented according to "ladder" diagrams:
177 | P a g e
So long as the switch contacts and relay coils are all adequately rated, it really doesn't matter
what level of voltage is chosen for the system to operate with. Note the number "1" on the wire
between the switch and the lamp. In the real world, that wire would be labeled with that number,
using heat-shrink or adhesive tags, wherever it was convenient to identify. Wires leading to the
switch would be labeled "L1" and "1," respectively.
Wires leading to the lamp would be labeled "1" and "L2," respectively. These wire numbers make
assembly and maintenance very easy. Each conductor has its own unique wire number for the
control system that it's used in. Wire numbers do not change at any junction or node, even if wire
size, color, or length changes going into or out of a connection point. Of course, it is preferable
to maintain consistent wire colors, but this is not always practical.
What matters is that any one, electrically continuous point in a control circuit possesses the same
wire number. Take this circuit section, for example, with wire #25 as a single, electrically
continuous point threading to many different devices:
In ladder diagrams, the load device (lamp, relay coil, solenoid coil, etc.) is almost always drawn
at the right-hand side of the rung. While it doesn't matter electrically where the relay coil is
located within the rung, it does matter which end of the ladder's power supply is grounded, for
reliable operation. Take for instance this circuit:
178 | P a g e
Here, the lamp (load) is located on the right-hand side of the rung, and so is the ground
connection for the power source. This is no accident or coincidence; rather, it is a purposeful
element of good design practice. Suppose that wire #1 were to accidently come in contact with
ground, the insulation of that wire having been rubbed off so that the bare conductor came in
contact with grounded, metal conduit. Our circuit would now function like this:
With both sides of the lamp connected to ground, the lamp will be "shorted out" and unable to
receive power to light up. If the switch were to close, there would be a short circuit, immediately
blowing the fuse. However, consider what would happen to the circuit with the same fault (wire
#1 coming in contact with ground), except this time we'll swap the positions of switch and fuse
(L2 is still grounded):
179 | P a g e
This time the accidental grounding of wire #1 will force power to the lamp while the switch will
have no effect. It is much safer to have a system that blows a fuse in the event of a ground fault
than to have a system that uncontrollably energizes lamps, relays, or solenoids in the event of
the same fault. For this reason, the load(s) must always be located nearest the grounded power
conductor in the ladder diagram.
REVIEW:
• Ladder diagrams (sometimes called "ladder logic") are a type of electrical notation and
symbology frequently used to illustrate how electromechanical switches and relays are
interconnected.
• The two vertical lines are called "rails" and attach to opposite poles of a power supply,
usually120 volts AC. L1 designates the "hot" AC wire and L2 the "neutral" (grounded) conductor.
• Horizontal lines in a ladder diagram are called "rungs," each one representing a unique
parallelcircuit branch between the poles of the power supply.
• Typically, wires in control systems are marked with numbers and/or letters for
identification. The rule is, all permanently connected (electrically common) points must bear the
same label
180 | P a g e
8.12.2 Digital logic functions
We can construct simply logic functions for our hypothetical lamp circuit, using multiple contacts,
and document these circuits quite easily and understandably with additional rungs to our original
181 | P a g e
"ladder." If we use standard binary notation for the status of the switches and lamp (0 for un-
actuated or de-energized; 1 for actuated or energized), a truth table can be made to show how
the logic works:
Now, the lamp will come on if either contact A or contact B is actuated, because all it takes for
the lamp to be energized is to have at least one path for current from wire L1 to wire 1. What we
have is a simple OR logic function, implemented with nothing more than contacts and a lamp.
We can mimic the AND logic function by wiring the two contacts in series instead of Parallel
182 | P a g e
Now, the lamp energizes only if contact A and contact B are simultaneously actuated. A path
exists for current from wire L1 to the lamp (wire 2) if and only if both switch contacts are closed.
The logical inversion, or NOT, function can be performed on a contact input simply by using a
normally-closed contact instead of a normally-open contact:
Now, the lamp energizes if the contact is not actuated, and de-energizes when the contact
is actuated.
If we take our OR function and invert each "input" through the use of normally-closed contacts,
we will end up with a NAND function. In a special branch of mathematics known as Boolean
algebra, this effect of gate function identity changing with the inversion of input signals is
described by DeMorgan's Theorem, a subject to be explored in more detail in a later chapter.
183 | P a g e
The lamp will be energized if either contact is un-actuated. It will go out only if both contacts are
actuated simultaneously.
Likewise, if we take our AND function and invert each "input" through the use of normally-closed
contacts, we will end up with a NOR function:
A pattern quickly reveals itself when ladder circuits are compared with their logic gate
counterparts:
184 | P a g e
The top rung (NC contact A in series with NO contact B) is the equivalent of the top NOT/AND
gate combination. The bottom rung (NO contact A in series with NC contact B) is the equivalent
of the bottom NOT/AND gate combination.
The parallel connection between the two rungs at wire number 2 forms the equivalent of the OR
gate, in allowing either rung 1 or rung 2 to energize the lamp. To make the Exclusive-OR function,
we had to use two contacts per input: one for direct input and the other for "inverted" input.
The two "A" contacts are physically actuated by the same mechanism, as are the two "B"
contacts. The common association between contacts is denoted by the label of the contact. There
is no limit to how many contacts per switch can be represented in a ladder diagram, as each new
contact on any switch or relay (either normally-open or normally-closed) used in the diagram is
simply marked with the same label. Sometimes, multiple contacts on a single switch (or relay)
are designated by a compound labels, such as "A-1" and "A-2" instead of two "A" labels.
This may be especially useful if you want to specifically designate which set of contacts on each
switch or relay is being used for which part of a circuit. For simplicity's sake, I'll refrain from such
elaborate labeling in this lesson. If you see a common label for multiple contacts, you know those
contacts are all actuated by the same mechanism
185 | P a g e
If we wish to invert the output of any switch-generated logic function, we must use a relay with
a normally-closed contact. For instance, if we want to energize a load based on the inverse, or
NOT, of a normally-open contact, we could do this:
We will call the relay, "control relay 1," or CR1. When the coil of CR1 (symbolized with the pair of
parentheses on the first rung) is energized, the contact on the second rung opens, thus de-
energizing the lamp. From switch A to the coil of CR1, the logic function is non-inverted. The
normally-closed contact actuated by relay coil CR1 provides a logical inverter function to drive
the lamp opposite that of the switch's actuation status. Applying this inversion strategy to one of
our inverted-input functions created earlier, such as the OR-to-NAND, we can invert the output
with a relay to create a non-inverted function:
186 | P a g e
From the switches to the coil of CR1, the logical function is that of a NAND gate. CR1's normally-
closed contact provides one final inversion to turn the NAND function into an AND function.
REVIEW:
• A relay must be used to invert the output of a logic gate function, while simple normally-
closedswitch contacts are sufficient to represent inverted gate inputs.
187 | P a g e
Consider the following circuit and PLC program:
When the pushbutton switch is unactuated (unpressed), no power is sent to the X1 input of the
PLC. Following the program, which shows a normally-open X1 contact in series with a Y1 coil, no
"power" will be sent to the Y1 coil.
Thus, the PLC's Y1 output remains de-energized, and the indicator lamp connected to it remains
dark. If the pushbutton switch is pressed, however, power will be sent to the PLC's X1 input. Any
and all X1 contacts appearing in the program will assume the actuated (non-normal) state, as
though they were relay contacts actuated by the energizing of a relay coil named "X1". In this
case, energizing the X1 input will cause the normally-open X1 contact will "close," sending
"power" to the Y1 coil. When the Y1 coil of the program "energizes," the real Y1 output will
become energized, lighting up the lamp connected to it
188 | P a g e
It must be understood that the X1 contact, Y1 coil, connecting wires, and "power" appearing in
the personal computer's display are all virtual. They do not exist as real electrical components.
They exist as commands in a computer program -- a piece of software only -- that just happens
to resemble a real relay schematic diagram.
Equally important to understand is that the personal computer used to display and edit the PLC's
program is not necessary for the PLC's continued operation. Once a program has been loaded to
the PLC from the personal computer, the personal computer may be unplugged from the PLC,
and the PLC will continue to follow the programmed commands. I include the personal computer
display in these illustrations for your sake only, in aiding to understand the relationship between
real-life conditions (switch closure and lamp status) and the program's status ("power" through
virtual contacts and virtual coils).
189 | P a g e
The true power and versatility of a PLC is revealed when we want to alter the behavior of a control
system. Since the PLC is a programmable device, we can alter its behavior by changing the
commands we give it, without having to reconfigure the electrical components connected to it.
For example, suppose we wanted to make this switch-and lamp circuit function in an inverted
fashion: push the button to make the lamp turn off, and release it to make it turn on. The
"hardware" solution would require that a normally closed pushbutton switch be substituted for
the normally-open switch currently in place. The "software" solution is much easier: just alter the
program so that contact X1 is normally-closed rather than normally-open. In the following
illustration, we have the altered system shown in the state where the pushbutton is unactuated
(not being pressed):
190 | P a g e
One of the advantages of implementing logical control in software rather than in hardware is that
input signals can be re-used as many times in the program as is necessary. For example, take the
following circuit and program, designed to energize the lamp if at least two of the three
pushbutton switches are simultaneously actuated
191 | P a g e
To build an equivalent circuit using electromechanical relays, three relays with two normally-
open contacts each would have to be used, to provide two contacts per input switch. Using a PLC,
however, we can program as many contacts as we wish for each "X" input without adding
additional hardware, since each input and each output is nothing more than a single bit in the
PLC's digital memory (either 0 or 1), and can be recalled as many times as necessary.
Furthermore, since each output in the PLC is nothing more than a bit in its memory as well, we
can assign contacts in a PLC program "actuated" by an output (Y) status. Take for instance this
next system, a motor start-stop control circuit:
192 | P a g e
The pushbutton switch connected to input X1 serves as the "Start" switch, while the switch
connected to input X2 serves as the "Stop." Another contact in the program, named Y1, uses the
output coil status as a seal-in contact, directly, so that the motor contactor will continue to be
energized after the "Start" pushbutton switch is released.
You can see the normally-closed contact X2 appear in a colored block, showing that it is in a
closed ("electrically conducting") state. If we were to press the "Start" button, input X1 would
energize, thus "closing" the X1 contact in the program, sending "power" to the Y1 "coil,"
energizing the Y1 output and applying 120volt AC power to the real motor contactor coil. The
parallel Y1 contact will also "close," thus latching the "circuit" in an energized state:
193 | P a g e
Now, if we release the "Start" pushbutton, the normally-open X1 "contact" will return to its
"open" state, but the motor will continue to run because the Y1 seal-in "contact" continues to
provide "continuity" to "power" coil Y1, thus keeping the Y1 output energized:
194 | P a g e
To stop the motor, we must momentarily press the "Stop" pushbutton, which will energize the
X2 input and "open" the normally-closed "contact," breaking continuity to the Y1 "coil:"
195 | P a g e
When the "Stop" pushbutton is released, input X2 will de-energize, returning "contact" X2 to its
normal, "closed" state. The motor, however, will not start again until the "Start" pushbutton is
actuated, because the "seal-in" of Y1 has been lost:
196 | P a g e
An important point to make here is that fail-safe design is just as important in PLC controlled
systems as it is in electromechanical relay-controlled systems. One should always consider the
effects of failed (open) wiring on the device or devices being controlled. In this motor control
circuit example, we have a problem: if the input wiring for X2 (the "Stop" switch) were to fail
open, there would be no way to stop the motor! The solution to this problem is a reversal of logic
between the X2 "contact" inside the PLC program and the actual "Stop" pushbutton switch:
197 | P a g e
When the normally-closed "Stop" pushbutton switch is unactuated (not pressed), the PLC's X2
input will be energized, thus "closing" the X2 "contact" inside the program. This allows the motor
to be started when input X1 is energized, and allows it to continue to run when the "Start"
pushbutton is no longer pressed. When the "Stop" pushbutton is actuated, input X2 will de-
energize, thus "opening" the X2 "contact" inside the PLC program and shutting off the motor. So,
we see there is no operational difference between this new design and the previous design.
However, if the input wiring on input X2 were to fail open, X2 input would de-energize in the
same manner as when the "Stop" pushbutton is pressed.
The result, then, for a wiring failure on the X2 input is that the motor will immediately shut off.
This is a safer design than the one previously shown, where a "Stop" switch wiring failure would
have resulted in an inability to turn off the motor.
In addition to input (X) and output (Y) program elements, PLCs provide "internal" coils and
contacts with no intrinsic connection to the outside world. These are used much the same as
198 | P a g e
"control relays" (CR1, CR2, etc.) are used in standard relay circuits: to provide logic signal
inversion when necessary. To demonstrate how one of these "internal" relays might be used,
consider the following example circuit and program, designed to emulate the function of a three-
input NAND gate. Since PLC program elements are typically designed by single letters, I will call
the internal control relay "C1" rather than "CR1" as would be customary in a relay control circuit:
In this circuit, the lamp will remain lit so long as any of the pushbuttons remain unactuated (un -
pressed). To make the lamp turn off, we will have to actuate (press) all three switches, like this:
199 | P a g e
This section on programmable logic controllers illustrates just a small sample of their capabilities.
As computers, PLCs can perform timing functions (for the equivalent of time-delay relays), drum
sequencing, and other advanced functions with far greater accuracy and reliability than what is
possible using electromechanical logic devices. Most PLCs have the capacity for far more than six
inputs and six outputs
8.12.3
There are two ways in which PLC programs can be fed into the PLC system. They
are:
Online programming
200 | P a g e
Offline programming
Online programming:
Offline programming:
asante sana
201 | P a g e