In order to describe the parts that make up a PLC, it is imperative to define that every automatic control system has three stages that are inherent and essential, these are:
Signal conditioning stage - This is integrated by the whole series of sensors that convert a determined physical variable to an electrical signal, interpreting this as the information of the control system.
Control Stage - This is where you have the information to be able to carry out a sequence of steps, in other words, it is the governing element.
Power stage - It serves to carry out a work that is always manifested through the transformation of a type of energy to another type.
The union of the three stages results in a complete automatic control system, but it must be considered that interfaces are required between the connections of each stage, so that the flow of information circulates safely between them.
Control systems can be conceived under two configuration options:
Open loop control system - When the control system has implemented the corresponding algorithms so that, depending on the input signals, a response is generated considering the error margins that can be represented towards the output signals.
Closed Loop Control System - When you have a control system that responds to the input signals, and to a proportion of the output signal in order to correct the possible error that could be induced, in this control system feedback is a very important parameter since the physical variable that is being controlled will always remain within the established ranges.
Ideally all control systems should be designed under the concept of closed loop, because the physical variable that is intervening at all times is controlled, this activity is done by comparing the output value against the input value, but in many cases according to the nature of the production process is impossible to have a closed loop control system. For example, in an automatic washing machine, the task of cleaning a garment that has the designer's logo engraved on one of its bags would be a bad decision to implement a closed loop in the cleaning process, because the washing machine would be comparing the fabric already washed (exit signal) against the dirty fabric (entry signal), and while the logo is present the washing machine would consider it as a stain that does not want to fall.
Reviewing the parts that constitute an open-loop or closed-loop control system, there is practically a similarity with respect to the parts that integrate a PLC, so that either of the two control methods can be implemented by means of a PLC.
To begin to use the terms that are proper to a PLC, it will be observed that the elements that conform to the control systems of open loop and/or closed loop, are included in the parts that conform to a Programmable Logical Control and that are the following ones:
- Central processing unit.
- Data input and output modules.
- Programming or terminal device.
CENTRAL PROCESSING UNIT
This part of the PLC is considered to be the most important, since inside it there is a microcontroller that reads and executes the user program that is located in a memory (normally of the EEPROM type), besides carrying out the management of ordering and organizing the communication between the different parts that make up the PLC. The user program consists of a series of instructions that represent the logical control process that must be executed, in order to do this work, the central processing unit must store in temporary memory locations the conditions of the most recent data input and output variables.
The central processing unit essentially has the capacity to perform the same tasks as a personal computer, because as mentioned earlier, inside is installed a microcontroller that is responsible for governing the entire control process.
When a PLC is energized, the microcontroller points towards the ROM memory block where the information is found indicating how it must be predisposed to start its control operations (PLC BIOS). It is in the execution of this small program (developed by the PLC manufacturer) that a diagnostic process is carried out through which, it is known which peripheral elements to the central processing unit are counted (input / output modules for example), once concluded this phase the PLC "knows" if it has a user program housed in the corresponding memory block, if so, by means of an indicator it warns that it is waiting for the command to start executing it, otherwise, it also notifies that the user memory block is empty.
Once the user program has been loaded into the corresponding memory block of the PLC, and it has been indicated to start executing it, the microcontroller will be located in the first memory location of the user program and will proceed to read, interpret and execute the first instruction. Depending on the instruction, it will be the action carried out by the microcontroller, although in general the actions carried out are the following: reading the input data generated by the sensors, storing this information in a temporary memory block, carrying out an operation with the temporary data, sending the information resulting from the operations to another temporary memory block, and finally sending the processed information to the output terminals to manipulate some actuator(s).
As for the data that enters and leaves the central processing unit, they are organized in groups of 8 values, which correspond to each sensor that is present if it is input data, or actuators if it is output data. Groupings of 8 values are chosen because that is the number of bits that have the ports of input and output of data of the microcontroller, each grouping is known by the name of byte or word. In each cycle of reading data generated in the sensors, or writing data to the actuators, 8 different sensors or actuators are governed, so that each input / output element has its image in a bit of the byte that is sent to the microcontroller.
In the process of reading data from the sensors, temporary memory locations are reserved that correspond to the bit and the word that in turn is a set of 8 bits (byte), this is to have identified at all times the state in which the sensor is 5 for example.
With the temporary memory spaces reserved for input data, information packets are generated that correspond to the reflection of what the sensors are measuring. These data packets, when the microcontroller gives the indication, are stored in the corresponding memory location, being that information the one that represents the last conditions of the input signals. If during the execution of the control program the microcontroller needs to know the most recent input conditions, it immediately accesses the memory location that corresponds to the state of a given sensor.
The product of the execution of the user program depends on the conditions of the input signals, in other words, the result of the execution of an instruction may have a certain answer if a particular input manifests a logical one, and another different result if that input is at logical zero. The answer brought about by the execution of an instruction is stored in a section of the temporary memory, so that these data are later retrieved, either to be displayed or used for another part of the process.
This concludes another installment that I leave for you with much affection hoping that I can be of use to you and sincerely thanking you for the time you have taken to read my article.
All images used in this article are my own, photographs taken during my professional work. I allow the use of these images as long as they are mentioned to me in the article and the source is cited.
Steemit is expanding to other blog ecosystems, will soon be official with Smart Media Tokens and is already possible for WordPress thanks to the steempress plugin, a revolutionary initiative. If you wish to support the project I invite you to vote for @steempress as a witness by clicking here
Posted from my blog with SteemPress : https://automation80.000webhostapp.com/2018/09/architecture-of-a-plc