Differences Between Microcontrollers and PLCs

Since the introduction of PLCs in the 1960s in the United States to replace traditional relay control devices, PLCs have rapidly developed and been widely applied around the world. At the same time, the functions of PLCs have continuously improved. With the ongoing advancements in computer technology, signal processing technology, control technology, and network technology, as well as the increasing demands of users, PLCs have added functions such as analog processing and motion control on the basis of handling discrete signals. Today’s PLCs are no longer limited to logical control; they also play a crucial role in motion control and process control.

PLC

PLC (Programmable Logic Controller) is an electronic device designed for industrial production, which performs digital operation tasks. It uses a type of programmable memory to internally store programs, execute logical operations, sequential control, timing, counting, and arithmetic operations directed at the user, and controls various types of machinery or production processes through digital or analog input/output. It is a core part of industrial control.

Microcontroller

A microcontroller (Microcontrollers) is an integrated circuit chip that uses ultra-large-scale integration technology to integrate a central processing unit (CPU) with data processing capabilities, random access memory (RAM), read-only memory (ROM), various I/O ports, interrupt systems, timers/counters, and other functions (which may also include display driver circuits, pulse width modulation circuits, analog multiplexers, A/D converters, etc.) into a small, complete microcomputer system on a single silicon chip, widely used in various fields.
Microcontrollers can be found in devices such as mobile phones, automotive electronics, stepper motors in industrial applications, and robotic arms.The characteristics of microcontrollers include relatively complex programming and maintenance, commonly using C language or assembly language for programming, lower costs, and relatively limited I/O interfaces.

Differences Between PLCs and Microcontrollers

  • PLCs are more mature control systems built from microcontrollers, products that are stable and have been debugged, offering strong generality.
  • Microcontrollers can form various application systems and have a wider range of applications, but when referring to ‘microcontroller’ alone, it is merely an integrated circuit that must work with other components and software to form a system for application.
  • From an engineering perspective, for single projects or projects with very few repetitions, PLCs are quick and convenient, with a high success rate and good reliability, but at a higher cost.
  • For large-scale supporting projects, using microcontroller systems has the advantages of lower costs and higher efficiency, but this requires considerable research and development strength and industry experience to stabilize the system.
  
Essentially, PLCs are just a set of pre-made microcontroller (which has a wide range) systems.  

Characteristics of PLCs

PLCs widely use ladder diagrams instead of computer languages, giving them certain advantages in programming. You can understand ladder diagrams as a programming language similar to assembly language; they just have different ranges of use. Typically, the PLC software converts your ladder diagram into C or assembly language (depending on the CPU used by the PLC), and then uses an assembler or C compiler to compile it into machine code. PLCs only run machine code; ladder diagrams simply make it easier for users to utilize.
As mentioned, the MCS-51 microcontroller can also be used to create PLCs, but the 8-bit CPU struggles with some advanced applications, such as large-scale calculations (including floating-point operations) and embedded systems (now UCOS can also be ported to MCS-51). However, adding a DSP can already meet general requirements, and it is also programmed using ladder diagrams; we can convert ladder diagrams into C51 and then use KEIL’s C51 for compilation. It is not difficult to see that different models of PLCs use different CPUs, which also indicates that PLCs are essentially a set of pre-made microcontroller systems.
  
Looking at it this way, PLCs are not mysterious; many PLCs are quite simple, and their internal CPUs, aside from being fast, do not have other functions that surpass ordinary microcontrollers. Typically, PLCs use 16-bit or 32-bit CPUs, equipped with 1 or 2 serial channels for external communication, and have an internal timer. If reliability needs to be improved, an additional watchdog timer can solve the problem.
  
Additionally, the key technology of PLCs lies in the internal firmware that interprets ladder diagram language and auxiliary communication programs. The efficiency of the ladder diagram interpreter determines the performance of the PLC, while the communication program determines the ease of information exchange between the PLC and the outside world. For simple applications, PLCs often operate as standalone controllers without needing to exchange information with the outside world, as long as they have a program capable of interpreting ladder diagram language internally.
In fact, the main work in designing PLCs is developing programs that interpret ladder diagram language. Today’s microcontrollers can completely replace PLCs. In the past, microcontrollers could not compare with PLCs in terms of stability and electromagnetic interference resistance, but modern microcontrollers have achieved high stability and strong anti-interference capabilities, making replacements in certain fields possible.

Can Microcontrollers Replace PLCs?

Some say this is a pseudo-question; microcontrollers are components, while PLCs are systems composed of components and extensive software, making them incomparable in this respect—most PLC control chips are essentially microcontrollers, meaning PLCs can be seen as a secondary development of microcontrollers. In terms of industrial protection levels, the stability and reliability of microcontrollers cannot compare to PLCs, such as those rated IP67 (IP denotes protection against contact and foreign objects, while the second digit indicates waterproof protection). Moreover, PLCs developed to withstand harsh industrial environments also have a redundancy system.

I/O Functions

Microcontrollers have very limited I/O points, while PLCs have corresponding I/O points for various field signals that can connect directly with industrial devices (such as buttons, switches, current sensors, motor starters, or control valves) and connect to the CPU motherboard via a bus. Almost any production line in industry has hundreds or even thousands of I/O points, which microcontrollers cannot compare with.

Development Cycle

There are over 200 brands of PLCs, each with different programming software that is continuously improved to make it simpler for electrical engineers to use, and various program blocks are becoming increasingly convenient and user-friendly to call, such as PID modules, motion control modules, etc., greatly reducing the development pressure on engineers and shortening the development cycle.
How can microcontrollers achieve this? Without ready-made modules to use, they can only be developed. Engineers who have worked on non-standard automation equipment often encounter issues with insufficient project timelines. PLCs, being highly integrated and modular products, face similar challenges in meeting development cycles needed for equipment, especially when compared to microcontrollers that are like blank slates.

Communication Distance

Most production lines now require cross-regional integration and monitoring, using communication methods such as Ethernet with repeaters or direct civilian broadband fiber optics. The final product may end up using Microsoft’s Internet Explorer. Clearly, PLCs have RJ-45 interfaces, and even if the main unit does not have RJ-45, Ethernet modules can be equipped. Can a PCB board mounted on a microcontroller be equipped with this interface and developed for Ethernet communication? How long would development take?

Programming Languages

This aspect is an advantage for microcontrollers but also a disadvantage. As mentioned, there are over 200 brands of PLCs, and even more programming software. Although most PLC programming languages are quite similar, every time an electrical engineer encounters a different brand of PLC, they must learn the hardware parameters, soft components, programming software, and other aspects from scratch to use it proficiently. In contrast, the programming languages for microcontrollers are C or assembly language, which are universal for any microcontroller. In other words, learning C or assembly language allows one to develop any desired functionality with any microcontroller (provided they have the relevant electrical and electronic knowledge).
However, it should be noted that electrical engineers are not electronic engineers; their work does not solely involve how microcontrollers drive relays to control machine tools. Some electrical engineers may not even know C language, assembly language, or similar MCU development languages. In recent years, with the promotion of the IEC-61131-3 standard, more and more PLCs support various programming languages, such as structured text (ST) language similar to C and continuous function chart (CFC) language similar to circuit diagrams. This convenient functionality is something traditional microcontroller development environments cannot achieve.
In the field of industrial control, PLCs hold an absolute advantage. Given the current situation (in terms of microcontroller functionality, stability, ease of use, programming, and maintenance), it seems impossible for microcontrollers to replace PLCs, or rather, it is an extremely challenging task with an indefinite timeline.

Disclaimer: This article is a network repost or adaptation, and the copyright belongs to the original author. If there are copyright issues, please contact us for removal!

Leave a Comment