Lecture 1: Chapter 1 - Programmable Logic Controllers
Objective: To introduce the fundamental concept of a PLC, its main components, internal architecture,
and system types.
Introduction to Control Systems
o Define a control system's tasks, such as controlling a sequence of events or maintaining a
variable.
Examples:
An automatic drilling machine that sequences through lowering, drilling, and
retracting operations based on switch inputs.
A conveyor system that uses sensors to direct items for packing.
o The "traditional" hardwired control method, where control rules are determined by
physical wiring, and changing the rules requires rewiring. In contrast, modern
microprocessor-based systems, such as those in a washing machine, use a program to
control outputs based on inputs.
The PLC: A Specialized Controller
o Lecture:
o Definition of a Programmable Logic Controller (PLC) as a specialized microprocessor-
based controller that uses programmable memory for functions like logic, sequencing,
timing, and counting to control machines.
o Advantages of PLCs: flexibility (a new program changes the control system without
rewiring), cost-effectiveness, and suitability for a wide range of control systems.
o The differences between PLCs and general-purpose computers:
PLCs are ruggedized for industrial environments (vibration, temperature,
humidity, noise).
They have built-in interfacing for inputs and outputs.
They use an easily understood programming language focused on logic and
switching operations.
PLC Hardware and Internal Architecture
o The main hardware components of a PLC system using a block diagram:
Processor Unit (CPU): The microprocessor that interprets inputs and executes
the control program.
Power Supply Unit: Converts mains AC voltage to low DC voltage (e.g., 5V) for
the processor.
Programming Device: Used to enter the program (e.g., hand-held device,
computer).
Memory Unit: Stores the user's program (RAM), the operating system (ROM),
and data from I/O.
Input/Output (I/O) Sections: Interface between the PLC and external devices
like sensors and motors.
Communications Interface: Transmits data to other PLCs or supervisory systems.
o Internal architecture:
CPU: Contains an Arithmetic and Logic Unit (ALU), registers, and a control unit.
Buses: Data bus, address bus, control bus, and system bus for internal
communication.
I/O Unit and Isolation: Explain that I/O channels provide electrical isolation
(usually with optoisolators) and signal conditioning. Discuss the different output
types: relay, transistor, and triac, and their characteristics for switching AC/DC
loads.
Sourcing and Sinking: Define sourcing (module provides current) and sinking
(module receives current) for DC I/O connections.
PLC System Types and Discussion
o Difference between the two common mechanical designs for PLCs:
Single Box (Brick) Type: An integral package with all components, common for
small controllers, sometimes expandable. Example: Mitsubishi MELSEC FX3U.
Modular/Rack Type: Separate modules for power, processor, I/O, etc., that plug
into a rack. This allows for easy expansion and customization. Example: Allen-
Bradley PLC-5.
o Discussion:
1. Why would an engineer choose a modular PLC system over a compact "brick"
type for a large, complex factory automation project?.
2. What are the safety and performance trade-offs when choosing between relay,
transistor, and triac output modules for controlling a high-speed DC motor
versus a large AC heater?.
Summary and Next Steps
o Definition of a PLC, its core components, and the basic system types.
Lecture 2: Chapter 2 - Input-Output Devices
Objective: To identify and describe the characteristics of common input sensors and output actuators
used with PLCs.
Introduction to Sensors and Actuators
o Define sensor (a device providing a usable output for a physical input) and transducer (a
device converting a signal from one form to another).
o Terms for sensors:
Accuracy and Error (non-linearity, hysteresis).
Range, Response Time, Sensitivity, Stability, and Repeatability.
Common PLC Input Devices (Sensors)
o Types of input devices, explaining their operating principles.
Mechanical Switches: Generate on-off signals from mechanical input. Discuss
normally open (NO) and normally closed (NC) contacts. Examples include limit
switches actuated by levers, rollers, or cams.
Proximity Switches: Detect presence without contact. Cover the capacitive type
(for metallic and non-metallic objects) and eddy current type (for metallic
objects only).
Photoelectric Sensors: Use a beam of light (often infrared) to detect objects.
Differentiate between transmissive (object breaks the beam) and reflective
(object reflects the beam) types.
Encoders: Provide a digital output based on displacement. Distinguish between
an incremental encoder (detects change from a datum) and an absolute
encoder (gives actual position).
Temperature Sensors: Include bimetallic strips for on-off control and resistive
temperature detectors (RTDs), which provide an analog signal.
Displacement and Position Sensors: Discuss resistive potentiometers and the
Linear Variable Differential Transformer (LVDT).
Strain Gauges: Explain how resistance changes with strain (∆R/R = G × strain)
and their use in force and pressure sensors.
Other Sensors: Briefly mention liquid level detectors and fluid flow meters.
Common PLC Output Devices (Actuators)
o PLC outputs control actuators, which transform the electrical signal into a powerful
action.
Relays and Contactors: A solenoid creates a magnetic field to close switch
contacts, allowing a small PLC output to control a much larger current for a
device like a motor.
Directional Control Valves: Use a solenoid to control the flow of pressurized air
or oil, which can then operate devices like cylinders. Explain how to describe
valves (e.g., 4/2 valve) and their symbols.
Cylinders: Differentiate between single-acting (powered in one direction,
returned by a spring) and double-acting (powered in both directions) cylinders.
Motors: Cover basic on-off and directional control of a DC motor.
Stepper Motors: Explain that a stepper motor produces rotation in discrete,
equal angles (steps) for each digital pulse it receives, allowing for precise
positioning. Describe the basic principles of permanent magnet and variable
reluctance types.
Application Examples and Discussion
o Application examples: conveyor belt control, a simple goods lift, robot control with
valves, and liquid level monitoring.
o Discussion:
1. For the robot arm application, what would happen if a single-acting cylinder
were used for the "Open/close gripper" function instead of a double-acting one?
What are the limitations?
2. To accurately position a component on a machine tool, would you choose a
standard DC motor or a stepper motor? Justify your answer based on the
source's descriptions.
Summary and Next Steps
o What are the major categories of sensors and actuators?
Lecture 3: Chapter 3 - Number Systems
Objective: To explain the different number systems used by PLCs, how to convert between them, and
how PLCs handle signed numbers and data types.
Introduction to Number Systems
o While humans use the decimal (base-10) system, computers and PLCs are based on the
binary (base-2) system because its two digits (0 and 1) easily represent on/off electrical
states.
o A bit as a binary digit. Explain the concept of weights based on powers of 2, and identify
the Least Significant Bit (LSB) and Most Significant Bit (MSB).
o Convert a binary number (e.g., 1010) to decimal (10) and a decimal number (e.g., 31) to
binary using successive division.
Octal, Hexadecimal, and BCD
o Octal (base-8) and hexadecimal (base-16) as compact ways to represent long binary
numbers.
o The conversion process:
Binary to Octal: Group binary digits in threes.
Binary to Hexadecimal: Group binary digits in fours.
o Binary Coded Decimal (BCD), where each denary digit is coded separately into a 4-bit
binary number. Explain its convenience for interfacing with devices like thumbwheel
switches.
Binary Arithmetic and Signed Numbers
o The rules for basic binary addition and subtraction.
o Introduce signed numbers, where the MSB is used as a sign bit (0 for positive, 1 for
negative).
o The two's complement method for representing negative numbers:
1. Start with the positive binary number.
2. Find the one's complement by inverting all bits (0s to 1s, 1s to 0s).
3. Add 1 to the one's complement to get the two's complement.
o Demonstrate that this method allows for subtraction to be performed via addition (e.g.,
(+4) + (-6)).
PLC Data Types and Discussion
o The concept of a word as a group of bits (typically 16 bits for most PLCs).
o The standard data types used in PLCs:
BOOL: A single bit for on/off values.
INT (Integer): A 16-bit signed number (-32,768 to +32,767).
SINT, DINT, LINT: Short, double, and long integers using 8, 32, and 64 bits,
respectively.
REAL (Floating Point): For decimal fractions, represented with a mantissa and an
exponent.
o Discussion/Activity:
1. Convert the decimal number 181 to its 8-bit binary equivalent. Now, convert it
to BCD, which form is more intuitive for a human to read, and why BCD is useful
for a digital display.
2. Using an 8-bit system, represent the number -6 in signed two's complement
form.
Summary and Next Steps
o Recap of the four main number systems (binary, octal, hex, BCD) and the concept of
two's complement.
Lecture 4: Chapter 4 - I/O Processing
Objective: To explain how a PLC's I/O unit processes different types of signals, communicates with
remote devices, and scans its program.
I/O Units and Signal Types
o The three types of I/O signals: analogue, discrete (on-off), and digital (pulse sequence).
o The CPU requires digital signals (typically 0-5V), so the I/O units must perform signal
conditioning.
o What are sourcing and sinking for DC input/output units?
Input and Output Modules
o Describe the function of input and output modules.
Input Units: Explain how DC and AC input units use optoisolators for protection
and signal conversion.
Analogue Inputs: Explain the role of an Analogue-to-Digital Converter (ADC),
which converts an analogue voltage into a multi-bit digital word. Define
resolution as the smallest change in analogue voltage that results in a one-bit
change in the digital output. Example: For a 10-bit ADC over a 0-10V range, the
resolution is about 0.01V.
Output Units: Review the three main types: relay, transistor, and triac.
Analogue Outputs: Describe the function of a Digital-to-Analogue Converter
(DAC), which converts a digital word from the PLC into a stepped analogue
output voltage or current.
Remote Connections and Communication
o Why remote I/O modules are used: to reduce long, multi-core cable runs by placing
modules near sensors/actuators and using a single communication cable.
o Distinguish between serial communication (data transmitted one bit at a time, for long
distances) and parallel communication (all bits transmitted simultaneously, for high
speed over short distances).
o Introduction to common communication standards:
RS232: A common serial standard, but limited to short distances (approx. 15m).
Explain concepts like baud rate and the use of start, stop, and parity bits.
IEEE-488: A standard parallel interface with lines for data, control, and
handshaking.
o Protocol is the set of rules governing data flow, including handshaking (RTS/CTS) and
error checking (parity check).
o Briefly describe network topologies: star, bus, and ring. Mention access methods like
CSMA/CD (used in Ethernet) and token passing.
PLC Scan Cycle and I/O Addressing
o The PLC's operational cycle or scan. Describe the mass I/O copying method:
1. Scan Inputs: The PLC reads the status of all inputs and copies them into RAM.
2. Execute Program: The CPU executes the user program instruction by instruction,
using the copied input data and writing results to a RAM output area.
3. Update Outputs: The PLC transfers the output data from RAM to the physical
output channels.
4. Repeat: The cycle repeats.
o The cycle time (typically 10-50 ms) is the time to complete one scan and means that
very brief input signals might be missed.
o PLCs use addresses to identify each specific input, output, rack, and module, examples:
Mitsubishi (X400, Y430), Allen-Bradley (I:012/03), and Siemens (I0.1, Q2.0).
Discussion
o What are the consequences of a PLC having a long scan time (e.g., 100 ms) in a high-
speed bottling application? What kind of signals might be missed?.
o Why is electrical isolation using optocouplers so important in an industrial I/O module?.
Summary and Next Steps
o Recap the I/O processing steps, communication methods, and the scan cycle.
Lecture 5: Chapter 5 - Ladder and Functional Block Programming
Objective: To introduce the fundamentals of ladder diagram programming, including logic functions
(AND, OR, NOT), latching, and the equivalent representation in Function Block Diagrams (FBD).
Introduction to Ladder Diagrams
o PLC programming languages are designed to be intuitive for engineers, with ladder
programming being the most common.
o Introduction to the core conventions of a ladder diagram:
Two vertical lines are the power rails.
Horizontal lines are rungs, each defining one operation.
Power flows from left to right.
The PLC scans rungs from top to bottom, left to right, in a continuous cycle.
Each rung starts with input(s) and ends with at least one output.
o Introduce the basic IEC 1131-3 symbols: normally open contact | |, normally closed
contact |/|, and output coil ( ).
Implementing Logic Functions
o Building the fundamental logic gates using ladder diagrams.
AND Logic: Show how contacts in series (a horizontal line) represent an AND
function. Both must be closed for the output to energize. Use the truth table for
clarification.
OR Logic: Show how contacts in parallel (alternative paths) represent an OR
function. Either contact closing will energize the output. Use the truth table.
NOT Logic: Explain that a normally closed contact |/| represents a NOT gate.
The output is on when the input is off, and vice versa.
NAND, NOR, XOR: Briefly build these more complex gates using combinations of
the basic three to demonstrate the flexibility of ladder logic.
Latching and Multiple Outputs
o The concept of latching or a self-maintaining circuit is used to keep an output energized
even after the initial input (like a pushbutton) is released.
o The standard latch circuit: an output's own contact is placed in parallel (OR) with the
start button's contact. A normally closed stop button is placed in series to break the
latch.
o How can multiple outputs be controlled from a single rung or in sequence across
multiple rungs?
Function Block Diagrams (FBD) and Discussion
o Function Block Diagram (FBD) as another graphical PLC language defined in the IEC
1131-3 standard.
o The FBD representation: a rectangular block with inputs on the left and outputs on the
right.
o The standard FBD blocks for the logic gates (AND, OR, etc.) and how they correspond
directly to their ladder diagram counterparts.
o Briefly mention Boolean algebra as the mathematical system underlying this logic (e.g.,
AND is A·B, OR is A+B).
o Discussion/Activity:
1. Have you seen a real-world scenario for a latching circuit? (e.g., A motor started
by a button should keep running until a stop button is hit).
2. On the board, students should translate the following requirement into both a
ladder rung and an FBD: "A warning light should turn on if a pump is running
AND the pressure is too high, OR if a manual 'test' button is pressed." [This
combines AND and OR logic, see Fig 5.37 for reference].
Summary and Next Steps
o Recap the core concepts: series for AND, parallel for OR, NC for NOT, and the structure of
a latch.
Lecture 6: Chapter 6 - IL, SFC, and ST Programming Methods
Objective: To introduce the other IEC 1131-3 programming languages: Instruction List (IL), Sequential
Function Charts (SFC), and Structured Text (ST).
Instruction List (IL) Programming
o Instruction List (IL) as a text-based language equivalent to ladder diagrams, consisting of
a series of mnemonic instructions.
o The basic structure: an operator followed by an operand (e.g., LD X400).
o The common operators and their ladder equivalents from the source's table:
LD (Load): Start a rung with an open contact.
LDN/LDI (Load Not): Start a rung with a closed contact.
AND/A: A series contact.
OR/O: A parallel contact.
OUT/=: An output coil.
o Translate simple AND and OR ladder rungs into IL for both Mitsubishi and Siemens
formats to show the slight variations.
Sequential Function Charts (SFC)
o Sequential Function Charts (SFC) are a graphical language ideal for representing the
sequential operation of a system.
o The core elements of an SFC:
Steps (or States): Rectangular boxes representing a particular state of the
system (e.g., "Filling Tank").
Transitions: Horizontal bars between steps that represent the condition that
must be met to move from one state to the next (e.g., "Tank Full Sensor On").
Actions: Boxes attached to a step that describe the output(s) that occur while
that step is active (e.g., "Open Fill Valve").
o The traffic light or washing machine is an example that illustrates a simple sequence.
o Selective branching (an OR condition, where one of several paths is taken) and parallel
branching (an AND condition, where multiple sequences run simultaneously).
Structured Text (ST) Programming
o Structured Text (ST) as a high-level, text-based language resembling PASCAL, used for
complex procedures.
o The basic format of assignment statements (e.g., Light := SwitchA;) where the value of
an expression is assigned to a variable.
o Introduce key statement types:
Conditional Statements: IF...THEN...ELSE for executing statements based on a
condition being true or false. CASE for selecting statements based on an integer
value.
Iteration (Looping) Statements: FOR...DO to repeat a set number of times,
WHILE...DO to repeat while a condition is true, and REPEAT...UNTIL to execute at
least once and repeat until a condition is true.
Discussion
o For what type of control problem would SFC be a better choice than a ladder diagram?
(Hint: think about processes with clear, distinct stages).
o When might an engineer choose to use Structured Text instead of a graphical language
like Ladder or FBD? (Hint: think about complex math or data manipulation).
Summary and Next Steps
o Recap the three programming languages and their primary use cases: IL for low-level
text entry, SFC for sequences, and ST for complex algorithms.
Lecture 7: Chapter 7 - Internal Relays
Objective: To explain the concept and application of internal relays, including battery-backed relays, one-
shot operations, SET/RESET functions, and master control relays.
What are Internal Relays?
o Internal relays (also called markers, flags, or auxiliary relays) as bits in the PLC's memory
that behave like physical relays but do not exist as hardware.
o Fundamental use: they are activated on one rung, and their "contacts" can then be used
as inputs on other rungs, linking different parts of a program.
o How are they addressed differently from physical outputs (e.g., Mitsubishi 'M', Siemens
'F', Allen-Bradley 'B3')?
Applications of Internal Relays
o how internal relays simplify programming.
Complex Logic: An internal relay is used to represent the outcome of a complex
input condition (e.g., (In1 OR In3) AND In2), which can then be used as a single,
simple input in a later rung.
Latching: An internal relay can be used to reset a latch circuit, providing a
cleaner separation of the SET and RESET logic.
Controlling Multiple Outputs: How a single internal relay can act as a "master"
latch to enable or disable a group of outputs simultaneously.
Special Relay Functions
o Specialized functions based on internal relays.
Battery-Backed (Retentive) Relays: These relays retain their state (on or off)
even if the PLC loses power, ensuring a safe shutdown and proper restart. Show
the 'M' symbol for a retentive coil.
One-Shot Operation (Pulse): The one-shot function, which activates a relay for
only one program scan cycle, creating a fixed-duration pulse when an input is
triggered. Show the IEC symbols for positive and negative transition-sensing
coils.
SET and RESET Coils (Flip-Flops): The SET (S) coil, which latches an output on,
and the RESET (R) coil, which latches it off. Show how this provides a direct way
to implement latching without the parallel contact structure. Give examples for
different manufacturers (Mitsubishi, Allen-Bradley "latch/unlatch", Siemens
SR/RS blocks).
Master Control Relays (MCR)
o The purpose of a Master Control Relay (MCR): to enable or disable entire sections of a
ladder program.
o The operation: when the MCR rung is activated, the block of rungs between the MCR
instruction and the corresponding MCR reset instruction becomes "live." If the MCR is
off, those rungs are disabled, regardless of their individual input conditions. Show
examples from Mitsubishi and Allen-Bradley.
Discussion
o When would a battery-backed relay be critical in a control system? (e.g., to remember
the stage of a process after a power cut to prevent dangerous restarts).
o What is the advantage of using SET/RESET instructions over a standard latching circuit
with a parallel contact? (Hint: Clarity, especially when the set and reset conditions are
many rungs apart).
Summary and Next Steps
o Recap the key roles of internal relays as programming tools for logic simplification,
latching, and special functions.