The Anatomy of a Programmable Logic Controller: Understanding its Design and Architecture.
The advent of Programmable Logic Controllers (PLCs) has completely changed the world of automation and control systems. For most real-life applications like manufacturing and infrastructure, PLCs are mostly used compared to Arduino boards and other microcontrollers, this is because PLCs manage complex processes with a higher degree of precision and efficiency.
Despite its relevance in the automation world, the hireable expertise size could be much larger but the complexity of PLCs explains the reason for this gap. Furthermore, PLCs exist in a wide variety of types and specifications. Hence, it is advisable to specialize. Qualified experts might still need specific training to get accustomed to before getting hired.
Generally, the “documentation” (if existent) for most PLCs is either poorly written or not beginner friendly. This article intends to help beginners understand the fundamentals of PLCs and will be split into 3 parts:
- The Anatomy of a Programmable Logic Controller: Understanding its Design and Architecture.
- Programming a PLC: Working Principle and How to Write Ladder Diagrams With GX Developer.
- How to build an Automated Garage System Using an FX1N-20MR PLC.
By the end of this series, you should know most of the things you need to know about this remarkable microcontroller so get ready to delve into the world of PLCs and understand their functionality!
Overview of a PLC.
PLCs were invented by Dick Morley in 1964 and can be described as programmable computers that efficiently automate tasks that are repetitive and span for a long time. They are designed to be ruggedized computers while still maintaining the flexibility of their function unlike other ‘hard-wired’ control systems, this is why it is found mainly in industrial applications.
PLCs exist in 2 distinct types:
1. Compact PLCs and
2. Modular PLCs.
The difference is in their efficiency, compact PLCs cannot be upgraded or altered while modular PLCs can be swapped out because they are different parts coupled together, this flexible construction makes modular PLCs better because they can have far more memory and have the capability to store a higher volume of information. Unlike compact modules which have limited Input/Output (I/O) modules (a term used in computer architecture basically to describe an interface between the controller[input] and the controlled[output]), the modular PLC has the capacity to accomplish more complex processes making it more advantageous. Read more about their differences here.
These types can be subclassified based on various factors:
SIZE
The size of a PLC is determined by the number of I/O points, the higher the number of I/O points, the higher the number of devices that can be put on it. They include the following:
— Mini PLC: it has 128 to 512 I/O modules, these numbers are already too many for a control system, and it is only used in industries that are predicted to scale up.
— Micro PLC: this consists of 15 to 128 I/O modules and is applicable in small industries.
— Pico/Nano PLC: it has less than 15 I/O points and is mostly used as trainers and integrated into automation projects.
OUTPUT TYPE
The method of delivery of current to the output modules varies, most automation requires switching between ON and OFF(1 and 0) so it is only logical to have more digital output types. These digital types include:
— Relay output: makes use of relays to control output, relays basically work as a key in a circuit that is triggered by current flowing in its coils. This mechanical process may cause wear over extended use so relay output types are majorly used to switch on continuous motion like motors in a conveyor belt. Relay types are usually characterized by their “clicking” sound.
— Transistor output: does not use any mechanical parts, such devices are called solid state devices and they are more efficient because they are not prone to degradation by mechanical stress. This is why your computer technician would suggest that you get a solid-state drive (SSD) for your laptop.
Read about other types of output here.
PLCs can also be classified based on manufacturers, a couple of notable examples include Siemens, Rockwell Automation, ABB, Mitsubishi, Schneider, Hitachi, etc.
For the purpose of this article, I would be going over the general concepts with reference to a typical and beginner-friendly PLC which is the FX1N-20MR; it uses relay output and has 12 input and 8 output points, it has a DC supply voltage within 10–28V with an output voltage of 24V and 220V(DC and AC respectfully) and a memory capacity of 2000 steps. The Gx Works2 can be used to program this PLC but its lighter and handy version, the Gx Developer is widely adopted. In case you were wondering, this PLC is just about the size of a palm if not smaller.
Components of a PLC
Every common PLC has 4 major units but custom PLCs may include other units depending on their functions. These units include:
- Processing Unit
- Power Unit
- Input/Output Unit
- Programming Unit
Processing Unit
Like every other processing unit, this serves as the “brain” of a PLC because it takes entry from input devices and gives instructions to the output devices based on the commands in the programming unit. The processor can be seen as a box with one-to-many connections, every other unit is linked to it. It consists of microelectronic components so only ±5V is supplied to its terminals by the power unit. The RS232 port is what receives commands from the Programming Unit.
Power Unit
This unit can be likened to the “workhorse” of a PLC. The FX1N-20MR PLC requires about 24V to run efficiently, so a regulator is required to step down your line voltage of 220V. For modular PLCs, the power supply is usually isolated while a few compact PLCs have inbuilt regulators. The regulator in the diagram below is called a rail power supply because it can be mounted using the rail behind it, the PLC below also comes with a rail housing if you do not wish to use the 4pcs M3 screws.
WARNING!: Ensure that you check the ratings/specifications of electronic components before connecting them to power, I cannot count how many components I have “fried” due to negligence. In the next part, we would go over the safe practices you should adopt when using a PLC.
If you take a 100-question multiple-choice quiz by purely guessing on every single question, then there’s only a 1 in 750 trillion chance of you getting all the questions correct. The odds of finding the perfect how-to guide on setting up a PLC are closer to 0 than that.
Below is a snapshot of Drake narrating an experience. He connected his PLC to the wrong power supply, too bad he has/had to order another power source, again! Another win for online marketplaces.
Input/Output Unit
This unit consists of several points/ends, the number of these points depends on what?
If your answer was “size”, you are ready to start applying to Siemens!
If you read the line above before you could even answer, you might have just unlocked another level of skimming, congratulations!
There are input and output points, input points take the pins of input devices(controllers) while output points take the pins of the output devices(controlled).
On our reference PLC, input points are marked from X0 to X13 while the output points are marked from Y0 to Y7, you would notice that each Y point has a corresponding C point(apart from Y7). I like to think of the C points as “NC contact”.
X and Y points are all signal points, all input devices receive voltage from the 0V DC output while all output devices return current back to the loop through the 24V DC input (from the image above) regardless of their pin configuration. All these concepts would be extensively explained in subsequent parts of this series.
Programming Unit
Remember how I likened the Processing Unit to the “brain” of the PLC? The Programming Unit provides the data that the brain uses to carry out the tasks, think of it as the “neuron” of the brain. The whole PLC would be useless if you don’t tell it what to do.
Even for humans, the brain does not think for itself, we subconsciously give it commands based on the tasks that we want to carry out. Even for humans, the brain does not think for itself, we subconsciously give it commands based on the tasks that we want to carry out, you are also not in a loop, I just told my brain to repeat a command.
The Programming Unit usually consists of a computer that houses the software for writing the set of commands and a medium of communication between the Processing and Programming units. For our reference PLC, it uses a wired medium called the USB — RS232 Cable, there is also an option for female-to-female connection, which is mostly used for connection with other microcontrollers like Raspberry Pi.
A PLC program consists of a set of instructions either in textual or graphical form, representing the logic governing the process the PLC controls. There are two main classifications of PLC programming languages, which are further divided into many sub-classified types.
- Textual Language
— Instruction list
— Structured text - Graphical Form
— Ladder Diagrams (LD) (i.e. Ladder Logic)
— Function Block Diagram (FBD)
— Sequential Function Chart (SFC)
The most common instruction type adopted is the Ladder Logic. Fortunately, the Gx Developer is for writing ladder diagrams!
Another important feature of the PLC is the switch.
Note: The “switch” does not turn on/off the power supply to the PLC, rather it starts/ stops the execution of the existing command on the PLC’s memory. It is similar to the press button on an Arduino board but the button on an Arduino resets the microcontroller’s memory.
Conclusion
Now that all the “boring” stuff is finally out of the way, it’s time to learn how PLCs actually work! The next part would also include a beginner guide on how to use the Gx Works/Developer.
It took me a month to write this, I hope to finish the next part in lesser time, fingers crossed. Stay tuned!