PLC Basics: Introduction to PLC

Like what you're seeing? Share this to your friends!

In this post, you will learn about PLC Basics: its origins, components, and how it is used in control systems.

The design of control systems has become more and more complex over time. Before automatic machines were a thing, everything was manually operated by humans. Humans dictated whether a device would start or stop.

Now, almost everything related to machine control is computer operated especially in the industrial side, where the Programmable Logic Controller is used.

What is a PLC?

PLC or Programmable Logic Controller is a ruggedized type of computer designed for industrial control processes. It scans and evaluates each input that it receives from input devices such as buttons and sensors such that it would generate outputs to control output devices in relation to the stored program.

An Overview of Control Systems

Control systems are designed to manage the behavior of a set of devices and/or other control systems. They can be looked at as a system that converts a multitude of inputs to a multitude of outputs by undergoing a process.

This sequence is commonly familiar to us because of computers: you press key “A”, the computer processes that signal that came from the keyboard. Then, the computer outputs “A” through the monitor.

By the same token, we can also say that there are input and output devices as well in a control system.

Control systems can be categorized in two types: the open loop and the closed loop. Open loop systems are the simplest form of systems wherein the output is not even monitored. You put in the input, perhaps a command, and the system performs the process to produce an output. Obviously, this type of system does not consider any disturbances or irregularities that enter in the intermediate stages.

Another one is the Closed loop system. Closed loop systems are much more “intelligent” than the open loop because the output parameters will affect the processing of the input. Hence, the closed loop systems consider ANY change in output that may be caused by any irregularities in the intermediate steps. Considering that change in the output is called Feedback.

plc basics closed loop system for automation
PLC Basics: Closed Loop Systems

To give a concrete, real-world example of the two systems, let me give you an example: Toasting bread.

In an open loop system, you put the bread in the toaster (input), heat the bread (process) by turning the toaster on, and get the toasted bread (output) after the toaster is done. Simple.

On the other hand, in a closed loop system, you put the bread in the toaster. But wait, the bread that you are putting in is already toasted (feedback). You pick an untoasted bread (input) and put it in the toaster.

The toaster is kind of cheap, so the temperature is inconsistent…but it toasts the bread anyways (process). When the toaster is done, you get the supposedly toasted bread (output)…but you saw that the bread was just not at the right shade of brown (feedback).

Because you were so picky, you had to put the bread in the toaster again until the output satisfies you.

In history, humans already have these control systems way before the computers were even thought of.

In 1681, Denis Papin invented the safety valve. When the force inside a boiler exceeded the safety valve’s weight due to an increase in pressure, the valve opens and the steam inside the boiler is released—effectively causing a drop in pressure level. You can call it “automatic pressure regulation”, except not a single electronic component was used.

Otherwise, manually controlled machines were the only thing that people could ever imagine back in the day.

Manual Control

Manual control of machines requires the presence of human operators because the inputs and decisions are also made by the operator. The machines are still the ones performing the processes, but it is up to the human operator to judge the output elements.

The obvious problem in that arouse from manually operated control systems is the long-term costs.

Companies would have to pay even more people to control every process just because the same people are the ones performing the quality checks, trouble detection, and every critical task that required thinking.

In fact, just training these people would take another chunk of time, and likely an opportunity cost for them. Moreover, productivity of this type of system is sub-optimal because of human limitations.

Hence, the manual control, although low-cost in a small scale industrial system, may not be economical long-term in a large scale perspective.

Rise of Automated Systems

Automated systems became the obvious solution to the problems that came with a large-scale manual control setup.

Automated systems eliminate tasks that operators are usually asked to do: Trouble Detection and System Control. The automatic system uses a closed-loop feedback system to make this possible.

The controller element, in our case, is the PLC, and the “Process or Plant” is the Output devices which the PLC controls to perform the processes. PLC automation also uses this model in order to perform a series of tasks repeatedly.

Contact Relays

Before the PLC was invented, the machines were controlled using electromechanical switches called Relays.

Relays work using the principle of electromagnetic fields. Its design consists of a coil, where voltage can be applied and a contact metal which provides continuity to two terminals, usually a source and the controlled device/machine.

Because of the invention of relays, the switching of high-powered devices such as motors can now be controlled using smaller electrical circuits. The usual scenario is a small power source controlling the switching for a larger circuit.

A three-phase induction motor, for example, may now be controlled using a 24V DC supply instead of switching it directly from the source using a purely mechanical switch. This setup eliminates electrical hazards that the operators face during operation.

Relays can either be normally open or normally closed. A normally open relay, when connected to a circuit, is like an OFF-state switch.

Energizing the relay closes the connection between the connected terminals, hence providing electrical continuity and turning it ON. Normally open relays are usually used on circuits where it is OFF majority of the time.

A normally closed relay, on the other hand, acts the opposite way as the normally open relay (as common sense tells us). Connecting the normally closed relay provides electrical continuity.

Energizing the normally closed relay effectively cuts the connection between the two connected terminals, turning the circuit OFF because the current flow stops.

Relay control systems already consisted of logical operations back then. Because of this, the relay system design required knowledge on the fundamentals of logic.

The designs of control systems using relays was laid out with highest simplicity using Relay Logic Diagrams.

PLC basics: PLC Programming came from Relay Logic Diagrams
PLC basics: Relay Logic

Based on the figure, placing them in series resembled the AND condition—which meant that both Relay1 AND Relay2 must provide electrical continuity, otherwise there is no continuity.

Placing them in parallel resembled the OR condition—which meant that EITHER ONE of Relay1 and Relay2 may be turned ON to provide power to the circuit.

All of these conditions assume a Normally Open Relay because the Normally Closed Relays are in fact, an equivalent of the NOT logic.

The Problem with Relays

Relays, even though it became a more flexible solution in control systems, also became problematic as the industrial scales grow larger in size.

First of all, Relay control systems are hardwired. Being hardwired, as it may suggest, meant that every relay or input device must be connected using wires. The control panels back then were such a huge mess!

PLC Basics relay panels
PLC Basics: Relay Panels (Photo from Wikimedia Commons: Courtesy of Signalhead)

Take note that in industrial processes, several conditions for operation are present. Processes may sometimes adapt to system changes because companies just strive to improve productivity and efficiency. For hardwired systems, this requires the whole system to be rewired.

“It’s an easy task if you are a good electrical engineer.” Not really. Again, the Relays are electromechanical devices. During the setup phase, they test the system every now and then. However, testing also meant that the switching of the relays was involved. This would not become a problem until ONE out of a HUNDRED or THOUSAND relays failed due to wear.

What would then be the problem? Troubleshooting. It would take A LOT of wasted time—a higher opportunity cost.

Companies had to think—there must be some way we can get around that recurring issue.

Invention of the PLC

Hydra-Matic was the first one to issue a request for proposals to solve this issue by giving an objective “create an electronic alternative for these types of relay systems”. It became clear to everyone that these conventional relay systems became problematic as the industry expanded.

That time, it was Richard E. Morley who proved to be the most instrumental person in the invention of the PLC. He was named as “Father of PLC”.

The first PLC was not even named PLC? It was called Modicon (Modular digital controller).

The Modicon was then acquired by companies, Schneider Electric being the current owner.

The PLCs were programmed using a derivative or the Relay Logic Diagrams(called Ladder Logic Diagrams) mainly because of its simplicity and the ability to utilize the previously learned Relay Logic Design skills. No one was required to study a new programming language in order to use the ladder logic for PLC.

PLC Basics: Ladder Logic Diagram Example
PLC Basics: Ladder Logic Diagram Example

With the evolution of the PLC, different PLC programming languages are now available which are also adopted from principles in computer programming and block diagrams. This made the process highly versatile in terms of how PLCs are programmed and troubleshot.

I found one helpful video that describes PLC in detail, it is also present in a related post (link).

Advantages of PLC

  • Economic advantage to Relays

As previously mentioned, the PLC solved the economical and technical problems that large-scale Relay Control systems have. Programmable Logic Controllers have Internal Relays, this means you can use the PLC to act as a Relay if you wanted to.

Further applications of the Internal Relays also allowed designers to reduce costs of buying separate components to create Timer Relays or Counter Relays.

  • Flexibility

Compared to the Relay Control Systems, PLC control systems have a much, much wider array of control possibilities. Let me prove to you using an example: Pressure Control and Temperature Control.

Using Relay systems, you would have to use another Relay Design for the two types of control systems.

Using PLC systems, however, you only need to have 1 program because the same ladder logic diagram may be used except that the output and input devices are altered.

  • Processing

Because PLCs are computers, they can switch almost instantly at a rate unreachable by the electromechanical Relays.

Even though relay logic systems use the fundamentals of logic, the PLC can still perform switching at a much higher speed than the relay system especially if the number of relays comes to a hundred or a thousand. This comes from the processing speed of the PLC’s central processing unit.

  • Simulation

This is the best advantage in the design of PLC systems. Now, there are software available for designing Ladder Logic Diagrams for the PLC which include the Simulation of the design.

This allows you to test the whole system without having to waste power on the output devices.

PLC Basic Simulation of Ladder Logic
PLC Basics Simulation of Ladder Logic

Heck, you can even do this without a PLC as long as you have the software in your computer, but some PLCs can be programmed “as is”.

Those kinds of PLCs may be programmed in its LCD display, but it does need to have the input devices connected to it in order to show an equivalent output on the screen.

  • Durability

The PLC is a ruggedized computer, which means it is designed for harsh conditions that may be encountered in ANY industrial processes. Even the components that the PLC uses last for a very long time before failure.

Also, the PLC uses a circuit protection principle called Optoisolation.

PLC Basics: Optoisolation
PLC Basics: Optoisolation

Basically, this principle uses light to turn on an input or output terminal of the PLC, thus not having direct contact with the circuitry of both sides.

This allows the PLC to avoid the electrical current that passes through BOTH the input side and the output side.

Parts of PLC

The main parts of the PLC can be categorized into three: I/O section, Central Processing Unit, and Programmer. We know for a fact that a certain brand of PLC may have specific components that may or may not be present in others, because it is proprietary. The parts that you will see below are the ESSENTIAL ones.

  • I/O Section

I/O stands for Input/Output.  For every PLC, the input and output section are where all of the devices are connected. However, you have to make sure that the devices that you are going to use is compatible with the PLC that you are using.

To begin with, there are two different ways that these I/O sections are incorporated:

  1. Fixed I/O

Fixed I/O refers to PLCs with no removable units. It is indeed “fixed”. This type of I/O limits you of the number of I/O units. On the bright side, you get it at a lower cost.

  1. Modular I/O

On the contrary, Modular I/O refers to PLCs with removable units called “Modules”—hence the term “Modular”. This type of PLC offers greater flexibility, obviously.

  • Central Processing Unit

Back in basic elementary computer class, the CPU was referred to as the “brain” of the computer. This is also the case in PLCs.

Because the Programmable Logic Controller performs logical operations, it needs a processing unit and a memory unit.

The processing unit makes the decisions based on the current conditions of the inputs which it will get from the memory unit.

The memory unit stores all the program data as well as the current input states.

  • Programmer/Programming Device

The PLC needs a set of instructions called programs in order to perform the control operations. This is where the Programming Device or Programmer is responsible.

You would not go to battle if you did not know how to fight, would you?

PLC Programming can be done in different ways because there are multiple programming languages available, and only some may be appropriate for a specific PLC.

Programming languages are sets of rules for combining the instructions that you want the PLC to follow. As an analogy, if someone speaks a language you’re not familiar with, you wouldn’t expect yourself to follow what he is saying, correct?

Usually, programs are entered using PLC ladder logic diagrams.

The logic diagram, as previously shown, is easier to interpret than words and hence the reason why it is more widely used by PLC programmers especially the beginners.

Regardless of the programming technique, the programming device compiles the ladder logic into a form that is readable by the PLC itself. You can program PLCs using a computer and then using serial devices and interfaces to communicate.

This is usually the easiest way of PLC programming because simulation is also available in PLC software.

The program or the set of instructions that the user has developed will now dictate the output of the PLC.

  • Power Supply

The Programmable Logic Controller is a DC powered device, hence, because AC is the distributed power, the power supply of the PLC must be able to convert the AC electrical power to DC.

The power supply powers not only the processor of the PLC, but also the Input and Output devices connected to it. The I/O requires a separate connection to the processor’s supply (even if they use the same source) because the two are opto-isolated, as you may recall.

If you want to see how these PLC parts look like, I suggest you check an article made by PLCdev (link).

How the PLC works

The PLC works by first reading the set of inputs connected to it, executing the program to perform logical decisions, and then representing the decisions as output voltages at the output side of the PLC.

The input may come from switches and/or sensors. The output may be indicator/alarm devices or actuators.

Program

To start with, the PLC must have a program first in order for it to work.

“What program??” Well, let me take that back. As the designer, you must have a control problem to solve first!

Let me use a basic control problem as an example:

“When the start button is pushed, the lamp turns and stays on, and when the stop button is pressed, the lamp turns off.”

As an illustration, I programmed a ladder logic diagram in PicoSoft 6 as shown below. Each number represents a step in the PLC program, called “rung”. Each rung connects the left and right vertical lines, which are respectively, the 24V and the 0V.

PLC Basics: Programming Example
PLC Basics: Programming Example

There is a Simulation button on the left side, let’s click on it and simulate the entire system by pressing the “play” button above.

Upon simulation, you’ll notice that there are components in red. This means that there is electrical continuity.

PLC Basics: Programming Example 1
PLC Basics: Programming Example

When I press the start button, you’ll notice that the output becomes red—hence turned ON.

PLC Basics: Programming Example 3
PLC Basics: Programming Example

When I press the stop button, the output becomes black again. This is because for a moment, I cut the connection between the +24V and the 0V.

The example showed us that a single line, more appropriately called “rung”, must have continuity from the +24V and the 0V in order to turn an output ON. Easy enough?

Now, let’s assume that this program is the one stored in the PLC memory, and that the two switches and the lamp are connected to the input and output, respectively. Because I finished programming the PLC, the same set of conditions will now be followed by the device.

An activated input, by default, will connect a +24Vdc signal to the PLC. Then, the PLC scans all of the input devices before it makes its decision. Finally, the PLC performs the output based on the program stored into it.

It’s a basic Input-Process-Output sequence!

Input Devices

PLCs use input devices that can either be Analog or Discrete.

Analog devices are those that give an electrical value proportional to the physical quantity being measured. Discrete input devices are usually switching devices—photoelectric switches, push buttons, limit switches, etc.

Output Devices

Output Devices in PLC control systems can either:

  • Notify the operator about the status of the system and/or part of it
  • Perform a mechanical operation

The devices that you will commonly see in PLC control systems are pilot lights, DC motors, and Solenoid Valves.

Conclusion

The Programmable Logic Controller has indeed revolutionized how the industry controls the different electrical devices in an organized fashion. As a recap, the PLC concept started because of the expansion problems brought by an increasing network of conventional Relays.

Relays were once a spectacular invention—but as it turned out, use too plenty of them and it boggles everyone’s minds! PLCs became the solution to the messy problems that came from hardwiring. Programmable Logic Controllers are used in industrial processes, especially in the automotive industry (PLCs are most widely used in this field).

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

shares