What is PLC? What is the difference between MCU and PLC?

Abby Brown's picture

Offline

Joined: Mar 19, 2021

Replies: 3
What is PLC? What is the difference between MCU and PLC?
May 26, 2021 - 9:10am

Since the United States introduced PLC to replace traditional relay control devices in the 1960s, PLC has developed rapidly and has been widely used all over the world. At the same time, the function of PLC is constantly improving. With the continuous development of computer technology, signal processing technology, control technology network technology and the continuous improvement of user needs, PLC has added analog quantity processing and motion control functions on the basis of switching quantity processing. Today's PLC is no longer limited to logic control, but also plays a very important role in motion control, process control and other fields.
PLC
PLC (Programmable Logic Controller) is a programmable logic controller, a digital operation electronic device designed for industrial production. It uses a type of programmable memory for internal storage of programs, execution of logic operations, and sequence control. , Timing, counting and arithmetic operations and other user-oriented instructions, and control various types of machinery or production processes through digital or analog input/output. It is the core part of industrial control.
Single chip microcomputer
Microcontrollers are a kind of integrated circuit chip, which uses VLSI technology to integrate the central processing unit CPU, random access memory RAM, read-only memory ROM, various I/O ports, interrupt systems, and timers with data processing capabilities. /Counter and other functions (may also include display drive circuit, pulse width modulation circuit, analog multiplexer, A/D converter and other circuits) integrated into a silicon chip to form a small and complete microcomputer system, in each Widely used in the field. Such as mobile phones, automotive electronics, industrial stepping motors, robot control, etc., you can see the figure of the single-chip microcomputer. The characteristics of the single-chip microcomputer are that the programming and maintenance are relatively complicated, the programming method is commonly used in C language or assembly language, the cost is relatively low, and the I/O interface is relatively limited.
The difference between PLC and SCM·
PLC is a relatively mature control system composed of single-chip microcomputers. It is a product of a mature and stable single-chip application system that has been debugged and has strong versatility.
· Single-chip microcomputer can form a variety of application systems with a wider range of applications, but as far as "single-chip microcomputer" is concerned, it is only an integrated circuit, and it must be used in a system with other components and software. · From the perspective of engineering use, it is quick and convenient to use PLC for a single project or a project with very few repetitions, with a high success rate and good reliability, but the cost is high.
· For large-volume supporting projects, the use of a single-chip microcomputer system has the advantages of low cost and high efficiency, but it requires considerable research and development strength and industry experience to make the system stable.
In essence, PLC is actually a set of ready-made single-chip microcomputer (single-chip microcomputer range is very wide) system.
Features of PLC
PLC widely uses ladder diagram instead of computer language, which has certain advantages for programming. You can understand the ladder diagram as a programming language, just like a calculator language such as assembly, but with a different range of use. And the usual practice is to convert your ladder diagram into C or assembly language by PLC software (determined by the CPU used by the PLC), and then use assembly or C compilation system to compile it into machine code. What the PLC runs is only the machine code, and the ladder diagram just makes it easier for users to use.
As mentioned, MCS-51 single-chip microcomputer can also be used for PLC production, but 8-bit CPU is used in some advanced applications such as: a large number of operations (including floating point operations), embedded systems (now UCOS can also be transplanted to MCS-51), etc. It's just a little overwhelming. However, the addition of DSP can already meet the general requirements, and the ladder diagram programming is also used, we can convert the ladder diagram into C51 and then use KEIL's C51 to compile. It is not difficult to find that different types of PLC will use different CPUs. In fact, it also shows that PLC is a set of ready-made SCM systems. In this way, PLC is not mysterious. Many PLCs are very simple. In addition to the high speed of their internal CPU, other functions are not as good as ordinary single-chip microcomputers. Usually PLC uses 16-bit or 32-bit CPU, with 1 or 2 serial channels to communicate with the outside world, and there is a timer inside. If you want to improve the reliability, add a watchdog timer to solve the problem. In addition, the key technology of the PLC is that a program that can explain the ladder diagram language and an auxiliary communication program are solidified inside. The efficiency of the ladder diagram language interpreter determines the performance of the PLC, and the communication program determines the difficulty of the PLC to exchange information with the outside world. . For simple applications, it usually operates as an independent controller, and does not need to exchange information with the outside world, just a program that can explain the ladder diagram language is solidified inside.
In fact, the main job of designing a PLC is to develop and explain the ladder diagram language program. The current single-chip microcomputer can completely replace the PLC. Because the stability and anti-electromagnetic interference ability of the previous single-chip microcomputer is relatively weak, there is no way to compare it with PLC. Now the single-chip microcomputer has achieved high stability and strong anti-interference ability and has been replaced in some fields.
Can a single-chip microcomputer replace a PLC?
Some people say that this is a pseudo problem. Single-chip microcomputers are components, and PLC is a system composed of components and huge software. The two are not comparable in this respect-most PLC control chips are actually single-chip microcomputers, which means they can Think of PLC as the secondary development of single-chip microcomputer. In terms of industrial protection level alone, the stability and reliability of single-chip microcomputers are simply not comparable to those of IP67 products such as PLC (IP is the marking letter, the first marking number indicates the level of contact protection and foreign object protection, and the second marking number indicates the waterproof protection level. ). Moreover, a redundant system has been developed for products such as PLC that can cope with the harsh industrial environment.
I/O function The I/O points of the single-chip microcomputer are really limited, but what about PLC? For different field signals, there are corresponding I/O points that can be directly connected to industrial field devices (such as buttons, switches, sensor current transmitters, motor starters or control valves, etc.), and are connected to the CPU main board through the bus connection. Almost any production line in the industry has hundreds or even thousands of I/O points, which is completely unmatched by single-chip microcomputers.
Development cycle
There are more than 200 PLC brands, and almost every brand has different programming software, and they are constantly improving their own programming software, making it easier and simpler to serve electrical engineers, and various program blocks are also increasing. The more convenient and humanized it is to call arbitrarily, such as PID module, motion control module, etc., which greatly reduces the development pressure of engineers and shortens the development cycle. How to realize the microcontroller? If there is no ready-made module to use, then it can only be developed. Then engineers who have done non-standard automation equipment will encounter the problem of insufficient time limit. PLC, a highly integrated and modular product, has reached the development cycle required to meet the equipment requirements, and it is also stretched in front of the construction period, not to mention a single-chip microcomputer like a blank sheet of paper.
Communication distance
At present, most of the pipelines are to be integrated and monitored across regions. The communication methods used are mostly Ethernet plus repeaters, or direct civilian broadband optical fibers. In the end, the things used are likely to be Microsoft's IE browser. Obviously the PLC has an RJ-45 interface. Even if the main body does not have an RJ-45, it can be equipped with an Ethernet module. Can the PCB board mounted on the microcontroller add this interface and then develop Ethernet communication? How long does it take to develop?
Programming language
This is an advantage for the microcontroller, but also a disadvantage. As mentioned above, there are more than two hundred PLC brands and more programming software. Although the programming languages ​​of most PLCs are similar, every time they come into contact with a different brand of PLC, the electrical engineer must start from the PLC hardware parameters, software components, It's handy to understand all aspects of programming software and so on from the beginning to use. The programming language of the single-chip microcomputer is C language or assembly language, which is common to any single-chip microcomputer. In other words, if you learn C language or assembly language, you can use any single-chip microcomputer to develop the desired function (provided that you have the relevant electrical engineering and electronics foundation).
But then again, electrical engineers are not electronic engineers. Their job is not to just consider how the single-chip microcomputer drives the relay to control the machine tool. Even some electrical engineers do not know MCU development languages ​​such as C language and assembly language. In recent years, with the promotion of the IEC-61131-3 standard, more and more PLCs support multiple programming languages, such as ST language similar to C language, and CFC language similar to circuit diagrams. This convenient function is really impossible to realize in the traditional MCU development environment.
In the field of industrial control, PLC occupies an absolute advantage. From the current situation (function, stability, ease of use, programming and maintenance, etc.) of the single-chip microcomputer, it will be impossible to complete the replacement of the PLC by the single-chip microcomputer, or the deadline tends to be Infinite and difficult tasks.

Sourav Gupta's picture

Offline

Joined: Feb 12, 2018

Replies: 696

Great Information.