lOMoARcPSD|37791314
Automation OF Electrical Machines
Electrical and electronics engineering (Kisumu National Polytechnic)
Scan to open on Studocu
Studocu is not sponsored or endorsed by any college or university
Downloaded by Levis mj (
[email protected])
lOMoARcPSD|37791314
ELECTRICAL ENGINEERING (POWER OPTION) LEVEL 6
Unit of Competency: AUTOMATION OF ELECTRICAL MACHINES
Trainer: Julius Mukoma
Course Outline
1. Design automation system 3. Program automation system
Meaning of automation Meaning of programming in
system automation
Factors to consider in Programming languages
designing of automation Coding of programming
system languages
Components of automation Testing and debugging of the
system: program
Sensors, actuators, limit Uploading of program
switches, push buttons, 4. Simulate automation system
logic gates, Meaning of terms
microcontrollers, PLCs, Automation system modelling
SCADA systems System modeling components
2. Mount electrical components Test running of system
Meaning of terms models
Examples of automation 5. Test run automation system
components: Automation system testing
Relays, contactors, timers, Testing parameters in an
microcontrollers, PLCs automation system:
Configuration of components Efficiency, accuracy,
Fixing of automation reproducibility, stability,
components resolution
Page 1 of 71
lOMoARcPSD|37791314
1. DESIGN AUTOMATION SYSTEM
Definition of terms used in automation system
(i). Automation system:- is an integration of sensors, controllers and actuators
designed to perform a function with minimal or no human intervention.
(ii). Sensors:- are devices that convert physical quantities to electrical signal. Eg.
Temperature sensor converts temperature into an electrical signal (voltage or
current) equivalent to the level of temperature.
(iii). Actuators:- are devices that convert electrical signal into physical action. Eg.
Motors converts electrical energy into motion
(iv). Transducers:- are devices that convert one form of energy to another. NB:
Sensors and actuators are examples of transducers.
(v). Limit switches:- are electromechanical devices used to detect the position of an
object.
(vi). Push buttons:- are simple mechanical switches used to manually start, stop or
control a process/machine.
(vii). Logic gates:- are basic digital circuits that perform logic operations on binary
data.
(viii). Microcontroller:- is a small computer on a single chip (IC) that control
operations of machines based on written programs/instructions.
(ix). Programmable Logic Controller (PLC):- is a specialized digital computer
system used for industrial automation of machines and processes.
(x). Supervisory Control and Data Acquisition (SCADA):- is a computer-based
system used to gather and analyze data to help in remote monitoring and
controlling of industrial processes.
(xi). Human Machine Interface (HMI):- is a visual user interface that allows the
operator to interact with the automation system.
(xii). Relay:- is an electromechanical switch used to control high-power circuits with a
low-power signal.
Need/Importance of Automation System
(i). To improve efficiency
(ii). To reduce human errors
(iii).To improve productivity
(iv). To ensure consistency in quality production
(v). To reduce costs of production
(vi). To reduce risks when working in high hazardous environments
(vii). To enhance scalability (scale operations up or down based on demand)
(viii).To improve customer service satisfaction by ensuring quality and accurate
services/products are offered/produced to the customers.
(ix). To improve flexibility and adaptability since modern automation systems can be
reprogrammed to perform different tasks.
Page 2 of 71
lOMoARcPSD|37791314
Factors to consider when designing an automation system
(i). Cost of materials :- evaluate the cost of materials based on the budget of the
client
(ii). Maintenance requirements:- choose automation components that are easily
accessible/available when repair and maintenance is needed
(iii). Integration with existing system:- ensure the new automation system can
communicate and work with the existing system/machines
(iv). Cybersecurity:- measures should be put in place to prevent data breaches and
privacy
(v). Power and energy requirements:- ensure the power supply meets the system
requirements
(vi). Safety and compliance with the relevant regulations:- design a system that
meets industrial safety standards and regulations
(vii). Environmental and operating conditions of the system:- should match the
environmental conditions where the system will be installed
(viii). Flexibility and scalability:- the system should allow for future expansion and
changes in production requirements
(ix). Functionality:- the system should be designed based on the tasks to be
performed
Steps/phases followed when creating an automation system
(i). Phase 1: Designing:- This step involved site visit and documenting all the
system components required (quotation), their connections (drawings) and costs
calculations
(ii). Phase 2: Selection and supply:- involves selecting appropriate supplier,
ordering the materials and having them delivered/supplied.
(iii). Phase 3: Programming:- involves writing programs/instructions to the
PLC/microcontroller to check for its correct operation.
(iv). Phase 4: Installation:- involves connecting all the components of the system
according to the wiring diagrams and installing appropriate software.
(v). Phase 5: Commissioning:- involves checking for proper operation and
connection of the system before handing over to the client.
Essential checks before commissioning an automation system
(i). Ensure that all components are correctly installed, secure and not damaged
(ii). Ensure that all electrical connections are secure and correctly wired
(iii). Ensure that the power supply meets the system requirements
(iv). Ensure that the PLC and other controllers are correctly programmed and
configured
(v). Ensure that the HMI is correctly configured
(vi). Confirm that all communication between the components is functioning correctly
(vii). Ensure that all emergency stop buttons are working properly
Page 3 of 71
lOMoARcPSD|37791314
(viii). Check that the system is protected against overloads
(ix). Ensure that all alarms and notification devices are working properly
(x). Test run the system without load for correct operation
(xi). Test run the system with load for correct operation
(xii). Ensure that the operators are fully trained on the system operation and safety
procedures
(xiii). Ensure that all configuration and test procedures are documented
Components of an automation system
(i). Sensors
(ii). Actuators
(iii). Limit switches
(iv). Push buttons
(v). Logic gates
(vi). Microcontrollers
(vii). PLC
(viii). SCADA
(ix). Human Machine Interface (HMI)
Sensors
They are devices that convert physical quantities to electrical signal.
Types of sensors
1) Proximity sensors:- detect presence or absence of an object
Eg. Ultrasonic, optical, and photoelectric sensors
2) Temperature sensors:- measure the temperature in a given environment
Eg. Thermocouples, thermistors, and infrared sensors
3) Light/Optical sensors:- measures light levels in the environment
Eg. Photodiodes, phototransistors, LDR (Photoresistors), and IR sensors
4) Pressure sensors:- measures the pressure of gases or liquids
Eg. Piezoelectric and strain gauge sensors
5) Level sensors:- measures the level of a substance in a container or space
Eg. Float switch, radar, ultrasonic, and capacitive sensors
6) Flow rate sensors:- used to measure the flow rate of liquids and gases
Eg. Turbine flow meter, magnetic flow meter and ultrasonic flow meter
7) Position sensors:- used to measure the position of an object
Eg. Potentiometer, encoders, and linear variable differential transformer (LVDT)
8) Humidity sensors:- measures the moisture level of the air
Eg. Resistive humidity sensor, capacitive humidity sensor, and thermal humidity
sensors
9) Gas sensors:- measures the presence and concentration of gases in the
environment. Eg. IR gas sensors and MOS gas sensors
10) Vibration sensors:- measures vibrations/oscillations in machines and structures
Page 4 of 71
lOMoARcPSD|37791314
Eg. Piezoelectric vibration sensors and accelerometers
11) Strain gauges :- used to measure force/weight
Terms used to define performance of sensors
(i). Accuracy:- is the extent to which the value obtained by the measuring system
might be wrong. E,g A temperature sensor with an accuracy of ±0.1℃.
(ii). Error/Offset:- is the difference between the value measured and the set point.
(iii). Range:- is the limits between which the input can vary. E.g A thermometer
having a quoted range of −200℃ 𝑡𝑜 + 800℃
(iv). Sensitivity:- is the ratio of output to input of the sensor.
(v). Stability:- is the ability of the sensor to give the same value when the input does
not change
(vi). Repeatability:- is the ability of the sensor to give the same value when repeated
measurements are made.
(vii). Reliability:- is the probability that the sensor will operate to the agreed level of
performance.
(viii). Response time:- is the time taken for a sensor to respond to a change in input
(ix). Rise time:- is the time taken for the measured value to rise to a specified steady
state.
(x). Settling time:- is the time taken for the output to settle to a steady state value.
(xi). Peak time:- is the time taken for the output to reach peak/maximum value
(xii). Set point :- is the desired value of the sensor output
Page 5 of 71
lOMoARcPSD|37791314
Actuators
They are devices that convert electrical signal into physical action/quantity.
Types of actuators
1) Electric actuators:- convert electrical energy into mechanical energy (motion)
Eg. Electric motors, solenoids, stepper motors, servo motors
2) Hydraulic actuators:- convert hydraulic energy (fluid pressure) into mechanical
energy. Eg. Hydraulic cylinders, hydraulic motors
3) Pneumatic actuators:- Convert compressed air into mechanical motion
Eg. Pneumatic motors, pneumatic cylinders, and pneumatic grippers
4) Magnetic actuators:- use magnetic fields to produce motion. Eg. Speaker
Limit switches
They are electromechanical devices used to detect the position of an object.
- They can be operated in the normally open (NO), normally closed (NC), or
momentary modes
Push buttons
They are simple mechanical switches used to manually start, stop or control a
process/machine.
Types of push buttons
(i). Normally open (NO) start button
(ii). Normally closed (NC) stop button
(iii). Momentary push button
(iv). Maintained Push Button
Page 6 of 71
lOMoARcPSD|37791314
(v). Emergency stop button
Switch Circuitry for Limit switches and push buttons
When the switch is opened, the sensor input is pulled to the +5V supply by the pull up
resistor.
When the switch is closed, the input is tied to ground, generating a zero voltage signal
Logic Gates
A logic gate is an electronic circuit which makes logic decisions.
It has one output and one or more inputs
Types of logic gates
There are 7 basic logic gates:
(i). AND gate
(ii). OR gate
(iii). NOT gate (Inverter)
(iv). NAND gate
(v). NOR gate
Page 7 of 71
lOMoARcPSD|37791314
(vi). XOR gate
(vii). XNOR gate
Note: Logic gates use binary data to make logic decisions. Binary data take only two
values; “0” and “1” whereby “0” means OPEN, FALSE, or LOW while “1” means
CLOSED, TRUE, or HIGH
AND gate
Is a logic gate which gives an output of “1” only when all its inputs are “1”
Is a logic gate whose output is logic HIGH only when all its inputs are logic
HIGH
Symbol and Boolean equation of AND gate
The symbol, equivalent circuit and Boolean equation for an AND gate is as shown
below.
Truth Table for AND gate
OR gate
Is a logic gate which gives an output of “1” only when at least one of its inputs is
a “1”
Is a logic gate whose output is logic HIGH when any of the inputs is logic HIGH
Symbol and Boolean equation of OR gate
The symbol, equivalent circuit and Boolean equation for an OR gate is as shown below.
Page 8 of 71
lOMoARcPSD|37791314
Truth Table for OR gate
NOT gate (Inverter gate)
Is a logic gate that inverts the status of the input. i.e. The output is “1” when the input is
“0” and the output is “0” when the input is “1”.
Symbol, Boolean equation, and Truth Table of NOT gate
The following figure shows the symbol, truth table and Boolean equation of an inverter
gate
NAND gate
Is a combination of NOT and AND gates.
It gives an output of “0” only when all the inputs are “1”, otherwise the output will be “1”
Symbol and Boolean equation of NAND gate
The figure below shows the symbol and Boolean equation of the NAND gate
Page 9 of 71
lOMoARcPSD|37791314
Truth Table
NOR gate
Is a combination of NOT and OR gates.
It gives an output of “1” only when all the inputs are “0”, otherwise the output will be “0”
Symbol, Boolean equation and Truth Table of NOR gate
The figure below shows the symbol, Boolean equation, and truth table of the NOR gate
Exclusive-OR (XOR) gate
It is a type of logic gate that gives an output of “1” when all the inputs are not similar. i.e.
All inputs are not “0” or all inputs are not “1”.
Symbol, Boolean equation and Truth Table of X-OR gate
The figure below shows the symbol, Boolean equation, and truth table of the X-OR gate.
Exclusive-NOR (XNOR) gate
It is a type of logic gate that gives an output of “1” when all the inputs are similar. i.e. All
inputs are “0” or all inputs are “1”.
Page 10 of 71
lOMoARcPSD|37791314
Symbol, Boolean equation and Truth Table of X-NOR gate
The figure below shows the symbol, Boolean equation, and truth table of the X-NOR
gate.
Summary
AND Gate – If both the inputs are HIGH then the output is also HIGH
OR Gate – If a minimum of one input is HIGH then the output is HIGH
XOR Gate – If the minimum one input is HIGH then only the output is HIGH
NAND Gate – If the minimum one input is LOW then the output is HIGH
NOR Gate – If both the inputs are LOW then the output is HIGH.
De Morgan’s Theorems
These two theorems (or rules) are a great help in simplifying complicated logical
expressions and can be stated as follows:
(i). The complement of a sum equals the product of complements
i.e.
(ii). The complement of a product equals the sum of the complements
i.e.
For example, simplify the following Boolean expressions using De Morgan’s Theorems:
(i)
Solution
(ii)
Page 11 of 71
lOMoARcPSD|37791314
Solution
Page 12 of 71
lOMoARcPSD|37791314
Tutorial Problems
Page 13 of 71
lOMoARcPSD|37791314
Microcontrollers
A microcontroller is a small computer designed into a single chip (IC) that performs
specific operation based on written program.
Basic components of a microcontroller
(i). CPU (Central Processing Unit):- It is the brain of the microcontroller that
controls all the operations.
(ii). Memory (RAM and ROM):- used for storing data and program used by the
microcontroller.
(iii). Input and output ports:- are pins used by the microcontroller to interact with
external devices such as sensors and actuators.
(iv). Timers and counters:- Timers are used to create delays and measure time
intervals while counters are used to count events such as the number of pulses.
(v). Analogue to digital converters (ADC):- used to convert analogue signals to
digital
(vi). Digital to analogue converters (DAC):- used to convert digital signals to
analogue
(vii). Communication interface:- used by the microcontroller to communicate with
other devices in the network
Examples of microcontrollers are such as:- Arduino microcontrollers, 8051
microcontrollers and PIC (Peripheral Interface Controller).
Programmable Logic Controllers (PLC)
A PLC is a specialized digital computer system that uses stored program to automate
industrial machines and processes.
Page 14 of 71
lOMoARcPSD|37791314
It uses written program/instructions to check status of inputs and update outputs
Basic Components of a PLC
A PLC is made up of the following basic elements:
(i). CPU:- is the brain of the PLC that controls all its operations
(ii). Power supply:- provides electrical power to the PLC components
(iii). Memory unit:- used to store data and program used by the PLC
(iv). Input module:- receives signal from the input devices and send it to the CPU
(v). Output module:- sends control signals from the CPU to the actuators
(vi). Communication interface:- helps the PLC communicate with other PLCs,
computers, and other devices in the same network.
(vii). Programming device:- used to write or edit program/instructions into the PLC
Note: PLC power supplies typically operate within specific voltage ranges, such as 24V
DC, 120V AC, or 240V AC, depending on the system's design and application. When
the PLC uses 24V DC, you need a 24V DC power converter to operate the PLC.
Page 15 of 71
lOMoARcPSD|37791314
Physical appearance of a PLC
Page 16 of 71
lOMoARcPSD|37791314
Examples of input devices used in PLCs
Input devices are those that provide data/ electrical signal to the PLC.
(i). Push button (Start button, Stop button)
(ii). Limit switch
(iii). Emergency stop buttons
(iv). Sensors (List the various types of sensors)
(v). Joystick
(vi). Scanners (eg. Barcode Scanners)
(vii). Weighing scales
(viii). Tachometers (Measures rotational speed)
(ix). Encoders (Give feedback on position, speed or direction of motion)
Examples of output devices used in PLCs
Output devices are those that execute/perform actions based in a signal send by the
PLC.
(i). Electric motor
(ii). Solenoid valve
(iii). Relay
(iv). Indicator lamps/lights
(v). Buzzer/Alarms
(vi). Heater
(vii). Pump
(viii). Variable Speed/Frequency Drives (VFDs)
NB: The input/output devices can process digital or analogue signals depending
on their designs. Digital I/O devices process binary (discrete) signals represented
Page 17 of 71
lOMoARcPSD|37791314
as 0(OFF) or 1(ON) while analogue I/O devices process continuous signals that
can take any value.
Examples of digital I/O devices are such as push buttons, solenoid valves, relays,
limit switches, etc. while examples of analogue I/O devices are such as
temperature sensors, level sensors, variable speed/frequency drives, electric
motors, etc.
Types of PLC Outputs
(i). Relay outputs:- in this type, the signal from the PLC is used to operate the relay
and enable it to switch high load current from low current from the PLC.
Suitable for both a.c and d.c switching and can withstand high surge
currents/voltage spikes.
They are slow to operate/switch.
Operation
When the coil is energized/powered by current from the PLC, it creates an
electromagnet field which attracts the contact. This breaks the contact from the NC
terminal and makes contact with the NO terminal thus completing the output circuit to
light the lamp/output.
(ii). Transistor outputs:- uses transistors to switch current through the load circuit
using small current from the PLC.
Suitable for only d.c switching and cannot withstand high surge
currents/voltage spikes. Therefore, it is used together with a fuse and
opto-coupler.
They are faster to operate/switch.
Page 18 of 71
lOMoARcPSD|37791314
Operation
The signal from the PLC turns ON the opto-coupler which in turn turns ON the
transistor. When the transistor is turned ON, load current will start flowing though it and
the load gets energized.
(iii). Triac Outputs:- uses TRIACs to switch current through the load circuit using
small current from the PLC.
Suitable for only a.c switching and cannot withstand high surge
currents/voltage spikes. Therefore, it is used together with a fuse and
opto-coupler.
They are faster to operate/switch.
Operation
The signal from the PLC turns ON the opto-coupler which in turn turns ON the triac.
When the triac is turned ON, load current will start flowing though it and the load gets
energized.
Sourcing and Sinking in PLCs
Sourcing occurs when the input/output device receives current from the input/output
modules of the PLC. That is, the input/output module is the source of the current.
Sinking occurs when the input/output device supplies current to the input/output
modules of the PLC. That is, the input/output module is the sink of the current.
Page 19 of 71
lOMoARcPSD|37791314
Types of PLC Designs
(i). Compact/Fixed PLC
This is an all-in-one design whereby the processor (CPU), power supply
and I/O modules are integrated into a single housing/unit.
This design saves space, is easy to setup, and relatively cheap compared
to the other models.
(ii). Modular PLC
In this design, the PLC is made up separate modules for the processor
(CPU), I/O modules, and power supply.
This design is flexible (easy to expand by adding more modules),
scalability, easy maintenance without affecting the entire system, and
allows for customization depending on client’s needs.
(iii). Rack-mounted PLC
In this design, the PLC uses rack-based architecture whereby individual
modules are mounted into slots on a rack.
This design allows for ease of maintenance, flexibility, scalability, and
ease of integration into existing systems.
PLC Architecture
Central Processing Unit (CPU):- controls all the operations of the PLC
Registers:- are temporary memory used for holding data and instructions when the
system is in operation
Memory:- used for storage of data and instructions used by the PLC
User program RAM:- used to store programs being worked on by the user
Page 20 of 71
lOMoARcPSD|37791314
System ROM:- used to store information written by the manufacturer for controlling the
operation of the system
Data RAM:- used to store data from input and output modules or from the CPU
Bus:- are conductive pathways used by computers to carry communication signals
Types of buses
(i). Data bus:- used to carry data signal to and from the memory, input and output
modules
(ii). Address bus:- used to carry the address signal of memory locations
(iii). Control bus:- used to carry control signals for coordinating the operations of the
PLC
(iv). System bus:- used for communication between input and output modules and
the PLC components
Types of Memory Elements in PLCs
(i). ROM:- used for permanent storage of data and instructions that are used to
control the operation of the PLC.
(ii). RAM:- used to store user program and data from input devices
(iii). EPROM/EEPROM (Erasable and Programmable Read Only Memory /
Electrically Erasable and Programmable Read Only Memory):- used to store
critical data and programs that must be retained even when the power goes off.
NB: Volatile memory loses data when power goes off while non-volatile memory
does not lose data even after the power goes off.
Types of PLC programming devices
(i). Personal computers (PCs) (Desktop or laptop computers with specialized
software)
(ii). Handheld programming devices
(iii). Field programmable panels
(iv). PLC human machine interface (HMI)
(v). Embeded smartphones/Tablets
Types of PLC programming software
Most PLC manufactures provide their own software which support specific programming
languages, tools and features. Some of the most common software are:-
(i). Siemens TIA portal (Seiemens Totally Integrated Automation Portal) – For
Siemens PLCs
(ii). Mitsubishi GX Developer(GX works) – For Mitsubishi PLCs
(iii). Omron CX programmer – For Omron PLCs
(iv). Schneider Electric Unity Pro – For Schmeider Electric PLCs
(v). ABB automation builder – For ABB PLCs
Page 21 of 71
lOMoARcPSD|37791314
(vi). Studio 5000 – For Allen-Bradley PLCs
(vii). CODESYS (Controller Development System) – Universal PLC software
Basic Operation of a PLC
A PLC performs the following four steps before repeating the loop over and over again.
(i). Input scan:- the PLC reads the status of the inputs and stores the data in the
memory
(ii). Progra scan/execution:- the PLC processes input signal based in the stored
program
(iii). Output scan:- the PLC updates the status of the output devices based on the
results of the program execution
(iv). Housekeeping:- the PLC communicates with programming devices and
performs internal diagnostic checks before starting the next cycle
PLC features that make them suitable for Industrial application
(i). They are rugged and designed to withstand harsh industrial environmental
conditons such as extreme temperatures, vibrations and noise.
(ii). It has modular plug in design that allows for easy connection and replacement
(iii). Uses easy to understand programming language
(iv). They are easy to program and re-program while in operation
(v). They occupy small space and are less expensive compared to relay logic
(vi). They are flexible in design which allows for use in different operations
(vii). They can communicate with other PLCs and computers in the industrial network
(viii). They are reliable and stable in their operations making them to last long without
maintenance
Advantages of using PLCs over relay logic controllers
(i). Reliability:- can operate for long periods without failure
(ii). Flexibility:- can be reprogrammed to perform diffenernt tasks
(iii). Scalability/Easy to expand:- allow for easy expansion by adding more input and
output modules
Page 22 of 71
lOMoARcPSD|37791314
(iv). Easy to program and reprogram:- uses easy to understand programming
language
(v). Occupies small space thus making them economical in industrial space
(vi). They can be integrated with other automation systems such as HMI and
SCADA
(vii). They are easy to troubleshoot and debug
(viii). It doesn’t use complex wiring system making it easy to install
Diasdavtages of using relay logic controllers
(Convert the advantages of PLCs to negative points to make the disadvantages of
relays e.g They are not flexible, troubleshooting is not easy, occupy large space, cannot
be programmed, e.t.c)
Need for PLCs (Why PLCs are important in industrial controls)
(i). They ensure safety of the operations
(ii). They increase efficiency of production
(iii). They reduce variability in production
(iv). They ensure quality products are produced
(v). They help reduce operational costs by automating most of the operations
Applications of PLCS
(i). Used in automating manufacturing processes e.g in controling robotic arms and
conveyor systems
(ii). Used in process control processing industries e.g in water treatment plant
(iii). Used in building/home automation e.g. in controlling lighting, seurity, and
ventilation systems
(iv). Used in material handling I warehouses and elevator systems
(v). Used in transportation system to control traffic signals, railway systems and
airport baggage handling systems
(vi). Used in power generation and distribution system
(vii). Used in car park control systems
(viii). Used in augriculture to control crop management system such as irrigation and
pests control
Primary functions of PLCs
(i). Logic control and sequencing
(ii). Monitoring and controlling input/output devices
(iii). Timing and counting
(iv). Data processing
(v). Communication with other components of the system such as other PLCs
(vi). Fault detection and diagnosis
Page 23 of 71
lOMoARcPSD|37791314
Essential checks before commissiong a PLC system
(i). Check that all cable connections are complete, safe and meet required
specifications and standards
(ii). Check that the power supply matches the voltage/power rating of the PLC
(iii). Check that all protective devices are set to the appropriate trip settings
(iv). Check that the emergency stop buttons are working properly
(v). Check that all the input/output devices are connected to the correct I/O points of
thee PLC
(vi). Load and test the software
Fault Detection Techniques in PLCs
(i). Timing checks:- involves using watchdog timers to check if a particular
function/operation is carried out within a specified time. If not, then the PLC is
assumed to be faulty.
(ii). Last output set:- it involves use of status lamps to indicate the last ouptut that
were set before the process came to stop. This way, you can tell which outputs
are occuring and which ones are not occuring.
(iii). Reploiation:- in this case, the PLC is made to run/perform each operation twice
and check whether it produces the same results. If not, then it is assumed to be
faulty.
(iv). Expected value checks:- this method involves checking whether the PLC
outputs/produces the expected value/output. If not, it is assumed to be faulty.
Items contained in an automation (PLC) system documentation
(i). Description of the plant
(ii). Specifications of the control requirements
(iii). Details of the PLC
(iv). Electrical installation diagrams
(v). List of all input and output connections
(vi). Program with commentary on what it is achieving
(vii). Software back-ups
(viii). Operation manual
Supervisory Control and Data Acquisition (SCADA)
A SCADA is a computer-based system used to gather and analyze data to help in
remote monitoring and controlling of industrial processes.
They are used in industrial automation to monitor and control processes at a large
scale.
Components of a SCADA system
(i). Remote Terminal Units (RTUs):- they collect data from field devices such as
sensors and execute control commands from the MTU
Page 24 of 71
lOMoARcPSD|37791314
(ii). Master Terminal Unit (MTU) (Also known as Central Host Computer):- it
processes data from the RTUs and sends it to the HMI.
(iii). Human Machine Interface (HMI):- it allows the operators to interact with the
SCADA system by displaying the operation of the system or allow him/her to
send commands to control the operation of the system.
(iv). Communication system:- helps connect the RTUs, MTU and HMI
SCADA system architecture (Generations)
(i). Centralized (monolithic) architecture:- all the data processing and control
decisions are made at a central location. Suitable for smaller systems with less
complex operations.
(ii). Distributed architecture:- data processing and control decisions are distributed
across multiple locations. Suitable for large scale operations with different sites
that operate independently while being overseen by a central control room.
(iii). Networked architecture:- different SCADA systems connected via LAN or WAN
to allow remote access and control.
(iv). Internet of Things (IoT) architecture:- this is a future generation of SCADA
system which would involve cloud computing and big data analysis for remote
monitoring and predictive maintenance to improve efficiency and reliability.
Applications of PLCS
(i). Used in power generation and distribution
(ii). Used in water and wastewater treament and management
(iii). Used in oil and gas industry to monitor pipelines, refineries, and storage facilities
(iv). Used in manufacturing industry to ensure quality and efficient production
(v). Used in telecommunication industry to manage networks
(vi). Used in transport industry to manage highway, railway, sea, and air transport
systems
Page 25 of 71
lOMoARcPSD|37791314
(vii). Used in weather and climate monitoring systems
(viii). Used in food processing industries to optimize production and storage conditions
Primary functions of SCADA system
(i). Logic control and sequencing
(ii). Monitoring and controlling input/output devices
(iii). Timing and counting
(iv). Data processing
(v). Communication with other components of the system such as other PLCs
(vi). Fault detection and diagnosis
(vii). Real-time data acquisition
(viii). Visualization/display of the system operations
(ix). Enable remote control of system operations
(x). Data logging and reporting (record historical data for analysis)
(xi). Data processing
2. MOUNT ELECTRICAL COMPONENTS
Definition of terms used in mounting of automation components
Mounting:- is the process of physically attaching automation components to their
appropriate surface or control panel.
Relay:- is an electromechanical switch used to control high power circuits with low
power signal.
Contactor:- is a type of relay designed to switch high power loads such as motors
DIN rail:- is a standardized metal rail used for mounting industrial control equipment
such as relays, contactors, circuit breakers and PLCs
Panel Mounting:- is the process of attaching components directly onto the surface of a
control panel using screws, brackets etc.
Enclosure:- is a protective casing or housing used to house and protect electrical
components from environmental factors like dust, moisture, and mechanical damage
Busbar:- is a metallic strip or bar that distributes electrical power to multiple circuits
within a control panel
Grounding/Earthing:- is the process of connecting electrical components to the earth
to prevent electric shock and protect equipment from surges.
Schematic (Wiring) Diagram:- is a graphical representation of an electrical circuit,
showing the connections and components
Page 26 of 71
lOMoARcPSD|37791314
Vibration Dampeners:- are devices used to reduce the transmission of vibrations from
machines to mounted components
Configuration of automation components
Configuring components for industrial automation involves setting up and integrating
various devices to work together efficiently and reliably within an automated system
This process includes careful planning, wiring, programming, and testing to ensure that
the system operates as intended
Configuration procedure for automation system
(i). System design and planning:- identify system objectives and components
required to achieve the objective
(ii). Perform electrical wiring and installation:- connect reliable power supply and
all inputs and output devices
(iii). Program the PLC or microcontroller and configure the HMI:- write program to
the PLC/microcontroller and set up the HMI for user monitoring and control of the
system
(iv). Integrate all the devices to effectively communicate with each other
(v). Test the system to ensure that it is wiring and control logic works correctly
(vi). Document all the system configuration
(vii). Commission and handover the system to the client/operator
Essential checks before commissioning an automation system
(xiv). Ensure that all components are correctly installed, secure and not damaged
(xv). Ensure that all electrical connections are secure and correctly wired
(xvi). Ensure that the power supply meets the system requirements
(xvii). Ensure that the PLC and other controllers are correctly programmed and
configured
(xviii). Ensure that the HMI is correctly configured
(xix). Confirm that all communication between the components is functioning correctly
(xx). Ensure that all emergency stop buttons are working properly
(xxi). Check that the system is protected against overloads
(xxii). Ensure that all alarms and notification devices are working properly
(xxiii). Test run the system without load for correct operation
(xxiv). Test run the system with load for correct operation
(xxv). Ensure that the operators are fully trained on the system operation and safety
procedures
(xxvi). Ensure that all configuration and test procedures are documented
Fixing of automation components
It refers to the physical installation and secure placement of various devices within an
automation system.
Page 27 of 71
lOMoARcPSD|37791314
Proper fixing ensures the components operate reliably, are easy to maintain, and
comply with safety standards.
Key aspects to consider when fixing automation components
(i). Planning and layout design:- conduct site survey and design a layout for
placement of components according to the set standards
(ii). Select components to be mounted and the mounting techniques to be used
(iii). Ensure proper cable management to prevent interference and damage
(iv). Ensure that all components are properly grounded to prevent electrical hazards
(v). Protect the components from environmental factors like dust, moisture and
extreme temperatures
(vi). Ensure all components are properly fixed and secured
IEE regulations when mounting automation components
(i). All the automation components must be properly earthed to prevent electric
shock hazards.
(ii). Provide appropriate means of isolation and switching to safely disconnect the
system for maintenance or in emergency situations.
(iii). Install suitable circuit breakers or fuses to protect the system against overcurrent
conditions.
(iv). Select appropriate cable sizes based on current rating, voltage rating and
environmental conditions.
(v). Use proper terminations of cables to ensure reliable contact.
(vi). The control panel should be designed with sufficient space for all components
and adequate ventilation.
(vii). Select control panels with appropriate IP (Ingress Protection) ratings to
safeguard against environmental factors.
(viii). Establish routine inspection and maintenance schedule to ensure that the system
operates within the standards.
(ix). Provide detailed documentation of the system for future reference and
maintenance.
Motor Starting Methods/Techniques
(i). Direct On-Line (DOL) Starter
(ii). Star-Delta Starter
(iii). Auto Transformer Starter
(iv). Soft Starter
(v). Variable Frequency Drive (VFD)
(vi). Capacitor Start and Capacitor Run
(vii). Rotor Impedance Starter
(viii). Power Electronics Starter
Page 28 of 71
lOMoARcPSD|37791314
Direct On-Line (DOL) Starter
The motor is directly connected to the full supply voltage, resulting in maximum starting
current and torque. It's simple but causes a high inrush current.
Suitable for small motors where the high starting current does not pose a problem.
Star-Delta Starter
The motor starts in a star (Y) configuration, which reduces the voltage and current, then
switches to a delta (Δ) configuration to run at full voltage. This reduces the starting
current to approximately one-third of the DOL method.
Commonly used in large motors to reduce mechanical and electrical stress.
Auto-Transformer Starter
This method uses an auto-transformer to reduce the voltage during startup. The motor
initially receives a reduced voltage, which limits the starting current. After reaching a
certain speed, full voltage is applied.
Suitable for large motors requiring reduced starting current and torque.
Soft Starter
A soft starter gradually increases the voltage applied to the motor, thereby gradually
increasing the motor speed. This smooth acceleration reduces mechanical stress and
inrush current.
Used in applications where smooth starting is critical, such as in pumps, fans, and
compressors.
Variable Frequency Drive (VFD)
A VFD controls the motor speed and torque by varying the frequency and voltage
supplied to the motor. It provides precise control over the motor's acceleration,
deceleration, and operating speed.
Used in applications requiring variable speed control, such as conveyors, HVAC
systems, and industrial machinery.
Resistor Starter
This method inserts resistors in series with the motor windings during startup, reducing
the voltage and, consequently, the starting current. The resistors are bypassed as the
motor accelerates.
Used in wound rotor motors, typically in heavy-duty applications like cranes and
elevators.
Page 29 of 71
lOMoARcPSD|37791314
Capacitor Start and Capacitor Run
The capacitor start method uses a starting capacitor to increase torque at startup, while
the capacitor run method keeps the capacitor in the circuit to improve running
performance.
Common in small, single-phase motors used in household appliances and light-duty
machinery.
Stator Resistance Starter
Similar to the resistor starter but applied to the stator windings. The resistance is
inserted in the stator circuit to reduce the starting voltage, and hence the starting
current.
Typically used in large wound rotor motors or where lower starting currents are
essential.
Slip Ring or Rotor Resistance Starter
Used in slip ring motors (a type of wound rotor motor), this method inserts resistors into
the rotor circuit to control the starting current and torque. The resistors are gradually
shorted out as the motor reaches operating speed.
Ideal for applications requiring high starting torque and controlled acceleration, such as
in mills, crushers, and heavy-duty conveyors.
Reduced Voltage Starter (RVS)
This is a general term for any method that reduces the voltage applied to the motor
during startup, including auto-transformers, resistors, and soft starters.
Used across various industries where reducing the initial inrush current is critical to
preventing damage to the electrical network.
NB: The most commonly used motor start methods are Direct On-Line (DOL) Starter,
Start-Delta Starter, Soft Starter, and Variable Frequency Drive (VFD) because of their
ability to balance cost, complexity, and performance.
Direct On-Line Starter (DOL)
The starting torque is likely to be 0.75 to 2 times the full load torque. In order to avoid
excessive voltage drops in the supply line due to high starting currents, the DOL starter
is used only for motors with a rating of less than 5KW.
It consists of main contactor, protective devices, and overload relay.
Page 30 of 71
lOMoARcPSD|37791314
Wiring Diagram
Page 31 of 71
lOMoARcPSD|37791314
Power Circuit
Control Circuit
Page 32 of 71
lOMoARcPSD|37791314
Physical Connection
Page 33 of 71
lOMoARcPSD|37791314
Operation of DOL Starter
The DOL starter consists of a coil operated contactor, K1M, controlled by start and stop
push buttons. On pressing the start push button S1, the contactor coil K1M is energized
from line L1. The three mains contacts (1-2), (3-4), and (5-6) in fig. (1) are closed. The
motor is thus connected to the supply. When the stop push button S2 is pressed, the
supply through the contactor K1M is disconnected. Since the K1M is de-energized, the
main contacts (1-2), (3-4), and (5-6) are opened. The supply to motor is disconnected
and the motor stops.
Star-Delta Starter
Although DOL starter method is a common method of starting induction motors, it
requires high starting current which may not be safe if large induction motors are to be
used. For this reason, the star-delta starter method is used to reduce the voltage and
current when the motor is starting.
The motor starts with a star connection and when it reaches up to 75% to 85% of its full
load speed, the motor runs in delta connection.
Operation
When the start button is pressed, the star contactor closes, and the motor windings are
connected in star configuration. The motor starts running at a reduced voltage
1 1
( 𝑜𝑓 𝑓𝑢𝑙𝑙 𝑙𝑖𝑛𝑒 𝑣𝑜𝑙𝑡𝑎𝑔𝑒) and current ( 𝑜𝑓 𝑓𝑢𝑙𝑙 𝑙𝑜𝑎𝑑 𝑐𝑢𝑟𝑟𝑒𝑛𝑡). After the motor has
√3 3
accelerated to 75% to 85% of full load speed, a timer or a control circuit disconnects the
star contactor and immediately closes the delta contactor. There is a brief open
transition period during which the motor is not connected to any supply voltage (this
prevents the star and delta contactors from working at the same time). Once the delta
Page 34 of 71
lOMoARcPSD|37791314
contactor is engaged, the motor windings are now connected in delta configuration, and
the motor runs at full line voltage.
Power Circuit
Control Circuit
Page 35 of 71
lOMoARcPSD|37791314
Physical Connection
Page 36 of 71
lOMoARcPSD|37791314
Page 37 of 71
lOMoARcPSD|37791314
Page 38 of 71
lOMoARcPSD|37791314
With Timer
Variable Frequency Drive (VFD) Starter
A VFD is a sophisticated power electronic device used to control the speed, torque, and
direction of an electric motor by varying the frequency and voltage supplied to the
motor. VFDs are widely used in industrial applications where precise control of motor
speed and torque is required.
Operation
The VFD first converts the incoming AC power to DC power using a rectifier diodes or
thyristors. The rectified DC power is then smoothed using capacitors to create a stable
DC voltage. The smooth DC voltage is then converted back into AC voltage using an
inverter with variable frequency and amplitude using an inverter.
By adjusting the frequency and voltage of the AC power supplied to the motor, the VFD
controls the speed of the motor. Lowering the frequency reduces the speed, while
increasing the frequency increases the speed.
Page 39 of 71
lOMoARcPSD|37791314
Soft Starter
A soft starter is an electronic device used to control the acceleration and deceleration of
an electric motor. It does this by gradually increasing the voltage supplied to the motor
during startup, which limits the inrush current and reduces mechanical stress on the
motor and the driven equipment.
Soft starters are widely used in applications where smooth motor starting is required,
but variable speed control is not necessary.
Operation
When the motor is started, the soft starter gradually increases the voltage from a low
value to the full line voltage over a predefined period. This is achieved using power
electronic devices such as thyristors. As the voltage increases, the motor gradually
accelerates to its full operating speed. The rate of acceleration can be controlled by
adjusting the time over which the voltage ramps up. Once the motor reaches its full
speed, the soft starter applies the full line voltage to the motor. At this point, the
thyristors or SCRs are fully conducting, and the motor runs at its rated voltage and
speed.
Page 40 of 71
lOMoARcPSD|37791314
Sequential Motor Control using PLC
Page 41 of 71
lOMoARcPSD|37791314
Page 42 of 71
lOMoARcPSD|37791314
3. PROGRAMMING OF AUTOMATION SYSTEM
Programming is the process of writing codes (set of instructions) that the
computer/controller follows to perform specific tasks.
A program is a code (set of instructions) that that the computer/controller follows to
perform specific tasks.
A bug is an error or flaw in the PLC program that causes it to malfunction or produce
unexpected results.
Debugging is the process of identifying, analyzing, and fixing errors or bugs in the PLC
program.
The primary goal of programming in automation is to control industrial processes,
machinery, and equipment to increase efficiency, accuracy, and safety.
PLC programming languages
(i). Ladder Logic Diagram (LLD)/Ladder Diagram (LD)
(ii). Instruction Listing (IL)
(iii). Functional Block diagram (FBD)
(iv). Sequential Function Chart (SFC)
(v). Structured Text (ST)
Note: The choice of programming language depends on the complexity of the task, the
familiarity of the programmer with the language, and the specific requirements of the
automation system.
Ladder Logic Diagram (LLD)/Ladder Diagram (LD)
It is a graphical/pictorial PLC programming language which resembles ordinary ladder
and uses rungs to connect inputs and outputs between power rails.
A ladder diagram consists of:- two vertical lines representing power rails, and rungs
which are the horizontal lines representing circuits between the two vertical lines.
Power flows from the positive power rail, through the rung to the negative power rail.
A PLC scans the rungs from the left hand side to the right hand side from the top most
rung to the last rung of the program before repeating the process over and over again.
Each rung on the ladder diagram defines one operation in the control process and it
must start with at least one input and end with at least one output.
Page 43 of 71
lOMoARcPSD|37791314
Ladder Logic symbols and their functions
Symbol Function
Normally Open (NO) contact. It only closes when operated
Normally Closed (NC) contact. It opens when operated
De-energized Output coil. Only energizes (closes) when the input
conditions are TRUE
Energized Output coil. Only de-energizes (opens) when the input
conditions are TRUE
Set Output Coil. Only sets (turns ON) when the input conditions are
TRUE
Reset Output Coil. Only resets (turns OFF) when the input
conditions are TRUE
Counter. Used to count items.
Note: Cxx is the counter name while Kyy is the number of items to
be counted.
Timer. Used to time delay.
Note: Txx is the Timer name while Kyy is the number of seconds to
be delayed/timed.
Ladder logic diagrams for basic logic operations
1. AND operation
The input contacts are connected in series
Page 44 of 71
lOMoARcPSD|37791314
2. OR operation
The input contacts are connected in parallel
3. NOT operation
Uses the normally closed (NC) contact for the input
4. NAND operation
Uses normally closed (NC) contact connected in parallel
5. NOR operation
Uses normally closed (NC) contact connected in series
6. XOR operation
Uses a combination of alternating normally closed (NC) and normally open (NO) contact
connected in both series and parallel
Page 45 of 71
lOMoARcPSD|37791314
7. Latching operation
This is used when we want to hold the output in the energized/ON state even after the
input that turned it ON ceases. E.g A motor starts when a start button is pressed and
continues to run even when the start button is released.
Ladder diagram programming solved examples
1. Draw a PLC ladder diagram that represents the following operations:
Two switches S1 and S2 are both to be closed for a motor M to operate;
Either of two normally open switches S3 and S4 have to be closed for a
coil C to be energized;
A lamp L1 is to be switched ON if there is an input from sensor A or B;
A light L2 is to come ON if there is no input from sensor C.
Solution
Page 46 of 71
lOMoARcPSD|37791314
2. A motor (M) is to be controlled by a start button (S1), stop button (S2), an
emergency button (S3), and a thermal overload switch (S4). The motor should
run when the start button is pressed and remain ON until the either the stop
button or the emergency button is pressed or there is thermal overload. Draw a
PLC ladder diagram to perform this operation.
Solution
3. A digital control system has three inputs A, B, and C and three outputs X, Y, and
Z. the relationship between the outputs and inputs is as follows:
Output X indicates the absence of all the three inputs A, B, and C;
Output Y indicates the presence of both inputs A and B;
Output Z indicates the presence of all inputs A, B and C.
(i). Draw a truth table to represent these functions;
Solution
A B C X Y Z
0 0 0 1 0 0
0 0 1 0 0 0
0 1 0 0 0 0
0 1 1 0 0 0
1 0 0 0 0 0
1 0 1 0 0 0
1 1 0 0 1 0
1 1 1 0 0 1
(ii). Write down the logic expressions for the functions in (i) above;
Solution
𝑋 = 𝐴̅𝐵̅ 𝐶̅
𝑌 = 𝐴𝐵𝐶̅
𝑍 = 𝐴𝐵𝐶
(iii). Draw a ladder diagram for the functions.
Page 47 of 71
lOMoARcPSD|37791314
Solution
4. Draw a PLC ladder diagram for the following logic functions:
(i). 𝑌 = 𝑊𝑋 + ̅̅̅̅̅̅
𝑊. 𝑋
̅ ̅
(ii). 𝐹 = 𝑈𝑉 + 𝑈𝑉 + 𝑈𝑊
(iii). 𝑄 = 𝑈𝑉̅ 𝑊
̅ + 𝑈𝑉𝑊
(iv). 𝑍 = ̅̅̅̅̅̅̅̅̅̅̅̅̅̅
𝑈 + 𝑉 + 𝑊 + 𝑈𝑊
Solution
5. A motor, M is controlled to run in forward and reverse directions by two buttons F
and R respectively. The motor should not run when both buttons are pressed.
Page 48 of 71
lOMoARcPSD|37791314
(i). Draw a truth table for this control;
Solution
F R M
0 0 0
0 1 1
1 0 1
1 1 0
(ii). Draw the ladder diagram for this control;
Solution
(iii). Write the equivalent Boolean expression for this control.
Solution
𝑀 = 𝐹̅ 𝑅 + 𝐹𝑅̅
6. A staircase light is controlled by two switches S1 and S2. One switch is located
at the top of the staircase and the other at the bottom. The light can be switched
on at the bottom and switched off at the top of the staircase and vice versa.
(i). Draw the truth table for this system;
Solution
S1 S2 L
0 0 0
0 1 1
1 0 1
1 1 0
(ii). Write the Boolean equation for the system control;
Solution
𝐿 = 𝑆̅1 𝑆2 + 𝑆1 𝑆̅2
(iii). Draw a PLC ladder diagram to control the light.
Page 49 of 71
lOMoARcPSD|37791314
Solution
7. Draw a ladder diagram for a system that makes lamp L to be ON when push
button A is ON, and when either push button B or C are ON.
Solution
8. Consider a valve which is to be operated to lift a load when a pump is running
and either the lift switch is operated or a switch operated indicating that the load
has not already been lifted and is at the bottom of its lift channel. Draw the ladder
diagram for this control system.
Solution
9. A signal lamp is required to be switched on if a pump is running and the pressure
is satisfactory, or if the lamp test switch is closed. Draw the ladder diagram to
represent this operation.
Solution
Page 50 of 71
lOMoARcPSD|37791314
10. Consider a system where there has to be no output when any one of four
sensors gives an output, otherwise there is to be an output.
Solution
Instruction Listing (IL)
It is a PLC programming language which used mnemonic codes to represent PLC
operations.
Instruction List Mnemonic Codes
IEC Mitsubishi Omron Siemens Operation
1131-3
LD LD LD A Start a rung with a NO contact
LDN LDI LDNOT AN Start a rung with a NC contact
ST OUT OUT = End a rung with a de-energized coil
STN OUTI OUTNOT ≠ End a rung with an energized coil
OR OR OR O Parallel NO contacts
ORN ORI ORNOT ON Parallel NC contacts
AND AND AND A Series NO contacts
ANDN ANDI (or ANI) ANDNOT AN Series NC contacts
ORB ORB ORB OB A block of parallel contacts
ANDB ANDB (or ANB) ANDB AB A block of series contacts
Instruction List Programming Solved Examples
1. Develop the instruction list program for the following ladder diagram
Solution
LD A
OR B
OUT Y
LD C
AND D
OUT Z
END
Page 51 of 71
lOMoARcPSD|37791314
2. Develop the instruction list program for the following ladder diagram
Solution
LD S1
ANI S2
ANI S3
AND S4
OUT M1
LD S1
OR S2
ORI S3
OUT M2
LD M1
OUT T1
LD M1
LD S1
AND M2
LD T1
ANDB
OUT M3
OUT M4
END
3. Develop the instruction list program for the following ladder diagram
Solution
LD X400
OR Y430
LD X401
LDI X404
ORI X405
ANB
OUT Y430
LD Y430
OUT Y 431
lOMoARcPSD|37791314
LD X402 OUT Y432
OR M100 END
LD X406
ANB
OUT M100
4. Write the equivalent instruction list program for the following ladder diagram
Solution
LD X400
OR C461 LD X400
RESET C460 OR C461
LD X401 RESET C461
OUT C460 LD X401
K6 AND C460
OUT C461
LD C460 K12
OUT Y430
5. Write the equivalent instruction list program for the following ladder diagram
Page 53 of 71
lOMoARcPSD|37791314
Solution
LD X400 LD T450 LD T451
OUT T450 OUT T451 OUT Y430
K999
6. The table below shows a program listing for PLC. Draw its equivalent ladder
diagram program
Steps Instructions
1 LD X400
2 OR X402
3 LD X401
4 ORI X403
5 ANB
6 OUT Y430
Solution
7. The table below shows a program listing for PLC. Draw its equivalent ladder
diagram program
Steps Instructions Solution
1 LD A
2 ANI B
3 LD C
4 AND D
5 ARB
6 OUT Y
8. Convert the following ladder diagrams into instruction list.
Page 54 of 71
lOMoARcPSD|37791314
Functional Block Diagram (FBD)
It is a graphical/pictorial PLC programming method that uses block symbols of logic
gates to represent PLC operations.
The following blocks may be used for the operations represented by the ladder
diagrams:
1. AND operation
2. OR operation
Page 55 of 71
lOMoARcPSD|37791314
3. NOT operation
4. NAND operation
5. NOR operation
6. XOR operation
7. XNOR operation
Functional Block Diagram (FBD) programming solved examples
1. Draw the equivalent functional block diagram for the following PLC ladder
diagrams
Page 56 of 71
lOMoARcPSD|37791314
(a)
Solution
(b)
Solution
(c)
Solution
2. Convert the following functional block diagram (FBD) to ladder diagram and write
its Boolean equation.
Page 57 of 71
lOMoARcPSD|37791314
Solution
Sequential Funtional Chart (SFC) programming method
It is a graphical/pictorial PLC programming language which represents system
operations in a sequence of events represented by steps, transitions and actions.
The following elements are used for SFC programming:
(i). Steps or States (stages)
(ii). Transitions (conditions)
(iii). Actions (outputs)
Steps/States (stages)
Indicate the state of the process
Can be represented by the following blocks
Transition (Condition)
It is represented by an horizontal line across a vertical line as shown below
NB: Two steps must be connected through a transition
Actions (Outputs)
It is the output of an operation. Usually represented by a rectangular block connected to
the right hand side of a step by an horizontal line as shown below.
Page 58 of 71
lOMoARcPSD|37791314
The figure below shows a general skeleton of how a SFC can looks like
Sequential Function Chart (SFC) Programming solved examples
1. Draw the sequential functional chart for a PLC whose ladder diagram is shown
below.
2. Draw the equivalent signal flow graph for the following PLC ladder diagram
Solution
Page 59 of 71
lOMoARcPSD|37791314
3. Draw the equivalent signal flow graph for the following PLC ladder diagram
Solution
4. Draw the equivalent signal flow graph for the following PLC ladder diagram
Solution
Page 60 of 71
lOMoARcPSD|37791314
5. A domestic washing machine requires that its drum is to be filled with water and
then when full, a heater has to be switched on and remain on until the
temperature searches the required level. The drum is then to be rotated for a
specific time before the operation stops. Draw a sequential function chart to
represent this operation.
Solution
Structured Text (ST) Programming Method
It is a text-based PLC programming language which is similar to traditional computer
programming languages such as Pascal, C or C++.
Statements used in structured text programming:
1. IF … THEN … ELSE is used when selected statements are to be executed when
certain conditions occur.
For example
2. FOR … DO allows a set of statements to be repeated depending on the value of
the iteration integer variable.
lOMoARcPSD|37791314
For example
Here, the output is decrease by 1 each time the input, dropping from 10 to 0,
decreases by 1.
3. WHILE … DO allows one or more statements to be executed while a particular
Boolean expression remains true.
For example
4. REPEAT … UNTIL allows one or more statements to be executed and repeated
whilst a particular Boolean expression remains true.
For example
Structured Text (ST) Programming solved examples
1. Consider a situation whereby two gates 1 and 2 are controlled a limit switch and
the presence of a work piece. If the limit switch is ON and a work piece is
present, then gate 1 opens while gate 2 closes. If the above condition is not true,
then gate 1 should close and gate 2 open. Write the structured text program for a
PLC to perform this operation.
Solution
VAR //Start the variable block
LimitSwitch: BOOL; //Boolean variable representing the state of the limit switch
WorkPiece: BOOL; //Boolean variable representing presence of work piece
Gate1: BOOL; //Boolean variable representing state of gate 1
Gate2: BOOL; //Boolean variable representing state of gate 2
END_VAR //End the variable block
IF (LimitSwitch AND WorkPiece) THEN
Gate1:= TRUE; //Open gate 1
Gate2:= FALSE; //Close gate 2
ELSE
Gate1:= FALSE; //Close gate 1
Gate2:= TRUE; //Open gate 2
END_IF; //Close the conditional IF block
Page 62 of 71
lOMoARcPSD|37791314
2. Write a PLC structured text program that will be used to light lamp L1 when either
of two switches 1 and 2 are closed but remain off when either of the switches is
not closed or when both switches are closed at the same time
Solution
VAR
Switch1 : BOOL; // Boolean variable representing the state of switch 1 (TRUE =
Closed, FALSE = Open)
Switch2 : BOOL; // Boolean variable representing the state of switch 2 (TRUE =
Closed, FALSE = Open)
LampL1 : BOOL; // Boolean variable representing the state of lamp L1 (TRUE =
On, FALSE = Off)
END_VAR
// Control logic for lighting lamp L1
IF (Switch1 XOR Switch2) THEN
LampL1 := TRUE; // Light lamp L1 when only one of the switches is closed
ELSE
LampL1 := FALSE; // Turn off lamp L1 when either both switches are closed or both
are open
END_IF;
Alternatively;
VAR
Switch1 : BOOL; // Boolean variable representing the state of switch 1 (TRUE =
Closed, FALSE = Open)
Switch2 : BOOL; // Boolean variable representing the state of switch 2 (TRUE =
Closed, FALSE = Open)
LampL1 : BOOL; // Boolean variable representing the state of lamp L1 (TRUE =
On, FALSE = Off)
END_VAR
// Control logic for lighting lamp L1
IF (Switch1 = TRUE) AND (Switch2 = FALSE) THEN
LampL1 := TRUE; // Light lamp L1 when switch 1 is closed and switch 2 is open
ELSIF (Switch1 = FALSE) AND (Switch2 = TRUE) THEN
LampL1 := TRUE; // Light lamp L1 when switch 1 is open and switch 2 is closed
ELSE
LampL1 := FALSE; // Turn off lamp L1 when either both switches are closed or both
are open
END_IF;
3. Write a PLC structured text program using that counts 12 items detected by
sensor A and opens a gate B when the 12 items are reached.
Page 63 of 71
lOMoARcPSD|37791314
Solution
Using “for loop” statement
VAR
ItemCount : INT := 0; // Counter for items
SensorA : BOOL := FALSE; // State of sensor A (TRUE = Item detected, FALSE = No
item)
Gate : BOOL := FALSE; // State of the gate (TRUE = Open, FALSE = Closed)
i : INT; // Loop variable
END_VAR
// Main Program Logic
FOR i := 1 TO 12 DO
// Wait for sensor A to detect an item
WHILE NOT SensorA DO
// Loop until an item is detected
END_WHILE;
// Increment the item count when sensor A detects an item
ItemCount := ItemCount + 1;
// Reset the sensor state (In a real scenario, this would depend on the actual sensor
logic)
SensorA := FALSE;
END_FOR;
// Open the gate after counting 12 items
Gate := TRUE;
Alternatively; “Using IF…THEN…ELSE” statement
VAR
ItemCount : INT := 0; // Counter for items
SensorA : BOOL := FALSE; // State of sensor A (TRUE = Item detected, FALSE =
No item)
Gate : BOOL := FALSE; // State of the gate (TRUE = Open, FALSE = Closed)
END_VAR
// Main Program Logic
IF SensorA THEN
// Increment the item count when sensor A detects an item
ItemCount := ItemCount + 1;
// Reset the sensor state (depending on the actual sensor logic, this might be
automatic)
SensorA := FALSE;
END_IF;
Page 64 of 71
lOMoARcPSD|37791314
IF ItemCount >= 12 THEN
// Open the gate after counting 12 items
Gate := TRUE;
END_IF;
Timers and Counters
Timers and counters are provided as built-in elements in PLCs.
Timers
A timer is used to cause a delay or take the time of an operation in a PLC. It is set to
some preset value and when this value after the input signals/pulses has been received,
it operates its contacts. Thus, normally open contacts would be closed while normally
closed contacts will be opened.
Types of timers
(i). ON-delay timers (TON):- their contacts come ON after a particular time delay
(ii). OFF-delay timers (TOFF):- their contacts come OFF after a particular time delay
(iii). Pulse timers (TP):- their contacts witch ON/OFF for a fixed period of time
PLC symbol of a timer
The number T200 represents the timer name while K10 is the time in seconds that the
delay should occur. Therefore, timer T200 delays an operation for 10 seconds; can be
ON, OFF. If it is a Pulse timer, then it will cause alternate switching the contacts ON and
OFF for 10 seconds.
Example in a program
1. Consider a system that produces an output Y430 in 5 seconds after an input
X400 was operated. Draw its ladder diagram and write its instruction list program.
Use a timer T450.
Page 65 of 71
lOMoARcPSD|37791314
2. Describe the operation of a system represented by the following ladder diagram
An output IR1 is set when start
button is pressed and remains
ON until a stop button is pressed.
Timers T1 and T2 starts delay
time when IR1 is energized.
Timers T2 starts delay time when
IR1 is energized.
Motor 1 starts running when IR1
is energized.
Motor 2 starts running after timer
T1 delay time is over.
Motor 3 starts running after timer
T2 delay time is over.
Counters
A counter counts the number of occurrences of an input signal. It is set to some preset
number value and when this value of input signals/pulses has been received, it operates
its contacts. Thus, normally open contacts would be closed while normally closed
contacts will be opened.
Types of counters
(i). Down-counter (CTD):- counts down from a preset value to zero.
When the counter value reaches zeros, it contacts are operated as explained
above.
(ii). Up-counter (CTU):- counts up from zero to a preset value
When the counter value reaches the preset value, it contacts are operated as
explained above.
PLC symbol of a counter
The number C460 represents the counter name while K10 is the number of items to be
counted. Therefore, counter C460 counts 10 items; can be Up or Down counter.
Page 66 of 71
lOMoARcPSD|37791314
Example in a program
Testing and Debugging of the Program
Testing is a systematic evaluation of the PLC program to ensure it meets specified
requirements and functions as intended.
Debugging is the process of identifying, analyzing, and fixing errors or bugs in the PLC
program.
Page 67 of 71
lOMoARcPSD|37791314
Testing and debugging are crucial processes in PLC programming to ensure that the
control system operates correctly and efficiently.
Importance of testing and debugging PLC program
Ensure the PLC program performs as expected
Identify and fix errors/bugs in the program
Ensure that the automation system operates safely
Ensures that high efficiency and accuracy of the automation process
To ensure that the system meets the regulatory and operational standards
Testing methods
(i). Simulation:- uses software tools to simulate the PLC program’s behavior without
the physical hardware
(ii). Hardware-in-the-loop (HIL) testing:- involves the use of actual hardware to
verify the program’s performance.
(iii). Live testing:- involve connecting the PLC to the actual machine or system when
testing the program
Types of testing
(i). Unit testing:- involves testing individual components or blocks of the PLC
program
(ii). Integration testing:- involves testing the interaction between of the different
components/blocks of the PLC program
(iii). System testing:- involves testing the whole PLC program with the whole
automated system
(iv). Acceptance testing:- is a test done to confirm that the PLC program meets the
client’s specifications.
Debugging process
(i).Identify the issue by looking for signs of malfunction or incorrect behavior
(ii).Analyze the program to locate/identify errors
(iii).
Correct the errors in the program by making the necessary changes
(iv).Verify and validate the corrected program by testing it in the operational
environment
(v). Document the changes for future reference
Best Practices/Techniques for Testing and Debugging
(i). Structured approach:- involves following a systematic process for testing and
debugging to ensure that all the errors are identified
(ii). Divide and conquer:- isolate and test different parts of the program individually
(iii). Incremental testing:- involve writing and testing the program in bits to address
issues as they arise
Page 68 of 71
lOMoARcPSD|37791314
(iv). Collaboration/Peer review:- working with colleagues or experts to identify and
correct errors
(v). Continuous learning:- involves staying updated with the latest testing and
debugging tools and techniques
Uploading of Program
Uploading program is the process of transferring/retrieving a program that is running in
a PLC to a programming device (computer).
Downloading program is the process of transferring/sending a program to a PLC from
a programming device (computer).
After testing and debugging the program to satisfaction, the program can be
downloaded to the controller (PLC or microcontroller) using an appropriate
communication interface such as USB cable, Ethernet cables, Bluetooth, WiFi, etc.
Uploading of a program is done to retrieve the program for editing, analysis, creating
a backup, troubleshooting, and documenting.
Downloading a program is done when we want to:- send new program, update the
existing program, delete existing program, and implement new control logic.
4. SIMULATE AUTOMATION SYSTEM
Definition of terms
Automation system is a system designed to control processes and machines with
minimal human intervention.
Simulation is the process of creating a virtual model of an automation system to test,
analyze, and optimize its operation without the physical/actual components.
System modeling involves creating a mathematical or logical representation of the
components of an automation system for behavior analysis.
Most PLC programming software include build-in simulation tools that programmers can
use to test system code before downloading it to the actual PLC.
Importance of System Modeling
(i). Helps in designing and developing the system before its actual implementation
(ii). Helps in predicting the performance of the system under different operating
conditions
(iii). Enables optimization of the system parameters to achieve desired outcomes
(iv). Helps in identifying potential issues early in design process for correction
(v). Helps determine the practicality of the system before its actual implementation
Page 69 of 71
lOMoARcPSD|37791314
Importance of simulating automation system
(i). Helps reduce risks by early design problem detection
(ii). Increases cost efficiency by optimizing the use of resources
(iii). It enables fine tuning of the system for performance optimization
(iv). It accelerates the design and development process
(v). It helps enhance system reliability and quality
(vi). It helps designer understand the behavior of the system for different conditions
(vii). It allows experimental testing of different designs thus making the right decision
on the choice of system
5. TEST RUN AUTOMATION SYSTEM
Definition of Terms
Efficiency:- is the ratio of output of the system to the input i.e the measure of how the
system converts input resources into the desired output.
Accuracy:- is the degree to which the output of the system matches the desired value.
Reproducibility:- is the ability of a system to consistently produce the same results
when the process is repeated under the same conditions.
Stability:- is the ability of the system to maintain its performance over time and under
varying conditions.
Resolution:- is the smallest measurable change that the system can detect or produce.
Automation System Testing
Automation system testing is a critical phase in the development of an industrial
automation system.
This process verifies that the system meets its design specifications, functions correctly
in different scenarios, and operates reliably over time.
Key Objectives of Automation System Testing
(i). Confirming that the system performs according to its design and requirements.
(ii). Ensuring that each component of the system works correctly and integrates well
with other components.
(iii). Assessing the system’s efficiency, accuracy, and other performance metrics.
(iv). Checking that the system operates consistently over time without failures.
(v). Ensuring that the system meets safety standards and does not pose risks to
personnel or equipment.
Page 70 of 71
lOMoARcPSD|37791314
Testing Parameters in an Automation System
When testing an automation system, several critical parameters must be evaluated to
ensure the system meets the desired performance standards. Such parameters include:
(i). Efficiency:- Measures the system's output relative to its input under various
operating conditions.
(ii). Accuracy:- Compares the system’s actual output to the expected output under
controlled conditions.
(iii). Reproducibility:- Measures the ability of the system to produce the same results
under the same conditions.
(iv). Stability:- It evaluates how the system responds to environmental changes and
changes in the input.
(v). Resolution:- Assesses the system’s ability to produce fine (small) changes in
inputs or outputs.
Page 71 of 71