Chap. 3 Working of PLC
Chap. 3 Working of PLC
A Programmable Logic Controller (PLC) is an industrial digital computer designed for the
control and automation of manufacturing or other processes, such as assembly lines, robotic
devices, or any activity requiring high reliability and process control. It is robust, adaptable, and
capable of handling complex control tasks in real-time. The term logic refers to the set of
instructions, user defines conditions/ contained applied on input data to execute the expected
output data i.e., end results.
• Input/Output (I/O) Interface: Monitors field devices like sensors and actuators. It converts
signals from sensors into data that the CPU can process and sends control signals to
actuators.
• Central Processing Unit (CPU): The brain of the PLC. It executes control instructions
based on the programmed logic and manages communication with other devices. The CPU
handles functions like logic operations, arithmetic calculations, data handling, and
communication with external devices.
• Memory: Stores the control program, input/output data, and intermediate results. PLC
memory can be divided into:
• Power Supply: Provides the necessary voltage and current for the PLC and its components,
ensuring stable operation. It typically converts AC mains power to low-voltage DC power
required by the PLC.
• Programming Device: Allows users to write, test, and debug the control logic. Examples
include personal computers with dedicated PLC programming software like RSLogix, TIA
Portal, or CX-Programmer.
• Communication Interfaces: Enable connectivity with other devices and networks, such as
Ethernet, Modbus, or Profibus, for remote monitoring and control.
One of the fundamental concepts in the operation of a PLC is the scan cycle, which is essential
for understanding how a PLC processes inputs, executes logic, and controls outputs. The PLC
operates in a continuous loop called the scan cycle, which is essential for real-time control and
decision-making. These stages include input scanning, program execution, output updating, and
housekeeping tasks. The scan cycle operates in a loop, allowing the PLC to monitor the status of
inputs and adjust outputs accordingly in real-time.
o The PLC reads the status of all input devices (e.g., sensors, switches, and buttons).
o The data from the input devices is stored in the Input Image Table, which acts as a
temporary memory buffer. This input data remains constant throughout the scan cycle,
ensuring consistent logic execution.
o This allows the CPU to access the input data without directly communicating with the
physical input devices, improving response time.
2. Program Execution:
o The CPU executes the user-defined control program (typically written in Ladder Logic,
Function Block Diagram, or Structured Text).
o The logic is processed based on the data stored in the Input Image Table and determines
the appropriate control actions.
o The results of the logic execution are stored in the output image table, which temporarily
holds the output status before the physical output devices are updated. During this step,
the PLC updates internal variables, counters, timers, and other control functions.
3. Output Scan:
o After program execution, the PLC updates the status of all output devices, such as
actuators, relays, and indicators, based on the information in the output image table. The
CPU updates the Output Image Table with the results of the program execution.
o This ensures that the physical outputs reflect the decisions made during the program
execution phase i.e., the data from the Output Image Table is sent to the output devices
(e.g., motors, valves, relays) through the output modules.
4. Housekeeping:
o This stage involves internal maintenance tasks, such as diagnostics, communication with
other devices, updating timers and counters, and managing memory. The PLC performs
internal diagnostics to detect faults or errors.
o It handles communication tasks with other devices or supervisory systems. The system
updates status flags and performs necessary maintenance tasks to ensure smooth
operation. So housekeeping tasks ensure the PLC operates efficiently and reliably.
• A faster scan cycle improves response time and ensures accurate real-time control.
• Proper management of the scan cycle is critical for applications requiring precise timing
and synchronization, such as robotics and process control systems.
Scan Time:
The scan time refers to the time taken to complete one full cycle, from input scanning to
housekeeping. Factors influencing scan time include:
A shorter scan time allows for faster response to changes in input conditions, which is critical
in high-speed automation applications. However, excessive scan times can lead to delays and
affect the overall performance of the control system.
E.g., In a conveyor belt system, the input scan reads data from proximity sensors, the program
execution determines whether the motor should start or stop, the output scan activates the motor,
and the housekeeping step checks for errors or communication updates.
The memory structure of a PLC is critical for managing data, executing programs, and
maintaining system reliability. Efficient memory management is essential for optimizing PLC
performance. Key strategies for the same include:
PLC memory is organized into distinct sections that serve different functions, including storing
the control program, managing input and output data, and handling internal variables.
✓ Input/ Output Image Table: Reflect (Temporarily stores) the current state of input and
output devices. It temporarily holds the status of output devices before sending signals. Input
image table captures the status of sensors and switches, while the output image table holds
the status of actuators and indicators.
✓ Data Memory: Stores intermediate variables, counters, timers, and other data needed during
program execution. Divided into temporary and permanent data areas. Temporary data is lost
when the PLC powers off, while permanent data is retained.
✓ Program Memory: Holds the user-defined control logic, typically written in ladder logic,
structured text, or function block diagrams. The program is stored in non-volatile memory to
retain data during power loss.
✓ System Memory: Maintains internal diagnostics, status flags, and configuration settings.
Stores the operating system, firmware, and configuration settings necessary for the PLC to
function. Manages communication protocols and handles diagnostics and error handling.
➢ Memory Addressing: PLC memory is typically organized in addressable units, such as bits,
bytes, or words. Common addressing schemes include:
• Bit Addressing: Individual binary states, such as a relay contact or sensor status.
• Word Addressing: Multi-bit data, such as analog input values or numerical counters.
• Indexed Addressing: Allows access to data arrays and tables for advanced control
functions.
The Input/Output (I/O) structure is a critical component of the PLC system that allows
interaction with external devices. It serves as the bridge between the PLC’s CPU and the physical
world.
• Input Modules:
o Detect and transmit (Collect data) signals from field devices (e.g., sensors, switches,
switches, and encoders) to the PLC. It also converts analog or digital signals into a format
the PLC can process.
o Additionally, it includes signal conditioning and isolation circuits to protect the PLC from
voltage spikes or noise. Types include discrete input modules (for binary signals) and
analog input modules (for continuous signals like temperature and pressure).
• Output Modules:
o Send control signals from the PLC to external devices (e.g., Control devices such as
motors, relays, and solenoids). It also converts the PLC’s logic signals into appropriate
voltage or current levels to drive actuators.
o Types include discrete output modules (for ON/OFF control) and analog output modules
(for variable control, such as motor speed). It may also include solid-state relays or
mechanical relays for different load types.
o If required, it provides feedback loops to confirm output activation and detect faults.
• I/O Addressing:
o Each input and output point are assigned a unique address. These addresses are used in the
control program to reference specific devices.
o Addressing schemes vary based on the PLC manufacturer (e.g., Allen-Bradley, Siemens).
o It filters out noise and protect against surge and convert signals to appropriate voltage or
current levels.
Communication Protocols:
Example:
In a temperature control system, the analog input module reads the temperature sensor’s signal,
and the output module adjusts the heater’s power accordingly. Similarly, in a conveyor belt
system, discrete input modules detect object presence via sensors, and output modules control
the motor.
The power supply unit converts AC voltage from the mains into the DC voltage required by the
PLC components. It ensures stable operation and protects against voltage fluctuations and power
surges.
Example:
A 24V DC power supply is standard for industrial PLCs and can power sensors, actuators, and
communication devices.
A programming terminal is essential for developing and maintaining PLC programs. The
programming terminal of a PLC is a crucial component, allowing engineers and technicians to
create, edit, and monitor control programs. The programming terminal of PLCs, its features,
functionalities etc. are listed below,
✓ Graphical Programming Interface: Supports ladder logic, function block diagrams, and
structured text programming.
✓ Data Logging and Trend Analysis: For performance evaluation and fault detection.
Example:
Ladder Logic is the most commonly used programming language for PLCs. It resembles
electrical relay logic diagrams and uses rungs to represent control logic.
Basic Ladder Logic Example including PB1: Push Button (input) and L1: Lamp (output)
|----[ ]----( )----|
| PB1 L1 |
Here, when PB1 is pressed, the circuit closes, and the lamp L1 is turned on. The programming
terminal allows the user to create, edit, and simulate this logic before downloading it to the PLC.
Example 2: Timer Function including PB2: Push Button, T1: Timer On Delay and M1: Motor
Here, when PB2 is pressed, the timer T1 starts counting. After a preset time, the motor M1 turns
on. This is used in applications like conveyor belt systems and automated filling stations.
• The AND gate outputs HIGH (1) only when all inputs are HIGH (1).
• It is commonly used in safety systems and quality control processes where multiple
conditions must be met simultaneously.
• The function of an AND GATE is simulated as shown in the figure below. Notice that
the lamp is on ONLY when the switches are closed. In the truth table you can see that
there is only one set of inputs that produces a high logic output.
• AND Gate ensures all safety conditions are met before operation.
Example:
The machine will only start when all three conditions are met.
• The OR gate outputs HIGH (1) when at least one input is HIGH (1).
• Notice that the lamp will be ON when one or both of the switches are closed. The truth
table shows a logic high output for all combinations of inputs except where both A and
B are low. When either input A,B ,or both are ON ,output is ON.
Example:
Machine Fault Detection System:
• A NOR gate is the inverse of an OR gate. It outputs HIGH (1) only when all inputs are
LOW (0).
• Used in fault monitoring and standby systems, ensuring that a machine runs only when no
faults occur.
• Notice that the lamp will be ON when both switches are open. The NOR gate takes its
name from NOT and OR gate. It can be built by connecting an OR gate and NOT gate.
• NOR Gate is ideal for fault monitoring, ensuring the machine runs only when no faults are
present.
• Fault Conditions:
o Overheating (A = 1)
o Low Pressure (B = 1)
Overheating (A) Low Pressure (B) NOR Output (Machine Running)
0 0 1 (Machine runs)
0 1 0 (Machine stops)
1 0 0 (Machine stops)
1 1 0 (Machine stops)
• The machine runs only when no faults occur (both inputs LOW).
6) X-OR Gate in Manufacturing Industry:
• The X-OR gate outputs HIGH (1) when only one input is active, which is ideal for
detecting mismatches or anomalies in manufacturing processes.
• The XOR gate stands for the Exclusive-OR gate. This gate is not basic gates in their own
and is constructed by combining with other logic gates. The XOR gate is the hybrid gate.
• X-OR Gate helps in error detection and identifying misalignment issues.
Example in Manufacturing:
• X-NOR Gate is effective for process verification and position monitoring in automated
systems.
Example in Manufacturing:
• Two sensors, A and B, monitor the position of a robotic arm during welding.
• If both sensors detect the arm in the correct position (both HIGH) or both detect it in the
incorrect position (both LOW), the process continues.
• If the positions do not match, the X-NOR gate triggers an error signal to halt the operation.
When choosing a PLC for an industrial process, consider the application's complexity, I/O
requirements, environmental conditions, communication protocols, scalability, programming
software, and budget, ensuring the PLC meets the specific needs of the process while being
reliable and durable.
• Scale of Automation: Will the PLC control a single machine or an entire factory?
• Process Complexity: Determine whether you need a simple control process, or something
more complex involving data handling, motion control, or safety measures
• Number of I/O Points: Determine the number of digital and analog inputs and outputs
required for the application.
• Type of I/O: Consider the types of signals (digital, analog, special) that the PLC needs to
handle.
• Remote I/O: If the application requires remote I/O, ensure the PLC supports the necessary
interfaces.
• Cycle Time: Evaluate the required cycle time for the PLC to respond to changes in the
process.
• Complexity of Logic: Consider the complexity of the control logic and ensure the PLC has
sufficient processing power.
4. Communication Protocols:
5. Environmental Considerations:
• Operating Conditions: Ensure the PLC can withstand the environmental conditions of the
application (temperature, vibration, humidity, dust).
• Future Growth: Consider the ability to expand the PLC system in the future.
• Modular Design: Look for a PLC with a modular design that allows for easy addition of
modules.
• Documentation: Ensure the PLC has comprehensive documentation for programming and
maintenance.
• Vendor Reputation: Consider the reputation of the PLC manufacturer and the reliability of
their products.
9. Cost:
• Budget: Determine the budget for the PLC and ensure it aligns with the application
requirements.
• Life Cycle Cost: Consider the total cost of ownership, including initial cost, maintenance,
and potential downtime.
Voltage Levels:
Key Consideration: Select a PLC with suitable power input and redundancy options for
reliability.
Redundancy in PLC refers to the use of backup components or systems to ensure continuous
operation in case of failure. This is essential in critical industrial applications where downtime
can lead to significant losses in production, safety risks, or equipment damage.
• Software Redundancy: This involves having backup software or programs that can take
over in case of a failure.
1. CPU Redundancy
o Two CPUs (main and standby) are used.
o If the primary CPU fails, the standby CPU takes over automatically.
o Ensures continuous process control without interruption.
2. Power Supply Redundancy
o Two power supplies (primary and backup) provide power to the PLC.
o If one fails, the other takes over to prevent system shutdown.
3. I/O Redundancy
o Duplicate Input/Output (I/O) modules are used.
o If one I/O module fails, the system switches to the backup module.
4. Network Redundancy
o Uses dual communication paths (e.g., two Ethernet networks).
o Ensures reliable data transmission even if one network fails.
5. Chassis/Module Redundancy
o Redundant PLC chassis with identical configurations.
o If one chassis fails, the other takes over.
The points highlighting the importance of redundancy in PLC are listed below,
• Increased Reliability: By having backup systems in place, PLC systems can maintain their
functionality even in the face of hardware or software malfunctions, thereby ensuring high
availability and reliability.
Implementation of Redundancy
o Redundant PLCs: Using multiple PLCs to control the same process or equipment, with one
acting as the primary and the others as backups.
o Redundant Power Supplies: Having multiple power supplies to ensure that if one fails, the
others can continue to power the system.
o Redundant Network Interfaces: Having multiple network interfaces to ensure that if one
fails, the others can continue to provide communication.
o Redundant I/O Modules: Having multiple I/O modules to ensure that if one fails, the others
can continue to provide input and output signals.
✓ Cost: Redundant systems can be more expensive than non-redundant systems, so it's
important to weigh the costs and benefits.
✓ Complexity: Redundant systems can be more complex to design, implement, and maintain.
✓ Synchronization: In warm and hot redundancy, it's important to ensure that the backup PLC
is synchronized with the primary PLC.
✓ Switchover Time: The time it takes for the backup PLC to take over in case of a failure
should be as short as possible.
✓ Testing and Validation: Redundant systems should be thoroughly tested and validated to
ensure that they can operate reliably in the event of a failure.