PLC Versus Microcontroller – What’s In Your Plant?

The PLC versus Microcontroller debate has certainly gained more traction in recent years. With the plethora of commercial off the shelf (COTS) single-board computers (SBC’s) growing in popularity, functionality and raw power, which one could you, or should you choose for your next automation project?

In this article we will investigate if a low-cost COTS single-board computer should be considered in your next automation project. We will take a look at the benefits and drawbacks and consider when a traditional PLC still may be the right choice. Of course, every project is different so there is certainly no one size fits all solution. What we aim to do in this article, is look at the pros and cons of why you may consider one option over another.

Due to the shear number of open- source COTS single-board computers on the market today, for the purpose of this discussion I am going to make some generalizations. Microcontrollers, field programmable gate array (FPGA) boards and single-board computers have varying capabilities and limits, and I know I’m going to tick some enthusiast off a little, however, I am going to lump them all together under the broad term “Microcontroller”.

Similarly, the capabilities, functionality, features and limitations of PLC’s will vary across different manufacturers. In this article we are going to generalize the standard capabilities that most industrial automation controllers possess.

Why I Love COTS Single-Board Computers

Believe me, it is not my intent to bash these credit-card sized computers and tell you that your should never even consider them in your next automation project. To the contrary, I absolutely love these devices and own several of them. They have become incredibly powerful in recent years and at their low price point, it is very tempting and getting increasingly more difficult for modern controls engineers to resist.

If you perform a quick online search, you will be confronted with a plethora of choices on both Google and Amazon. So much so, that if you are just getting started into this “world” of control it can be a little daunting to choose which one you should buy. For this reason, I will highlight three of the more popular ones, ones that I personally own, have experience programming and have actually utilized and deployed to the field.

  1. Beagleboard (BeagleBone Rev C)
  2. Raspberry Pi 3 Model B Motherboard
  3. Elegoo EL-CB-003 MEGA 2560 R3 Board ATmega2560 ATMEGA16U2 + USB Cable for Arduino

All of these devices offer great computing power at a very low price point and like I said I own all three of them. I will focus my discussion on my number one choice here, the Beaglebone Black because of its outstanding performance and in my opinion the most suitable choice of the three for our discussion of PLC versus Microcontroller.

To give you a sense of the size of these little powerhouses, check out the image below, it is literally the size of a credit-card.

PLC versus Microcontroller

Why You Should Consider Learning Single-Board Computers?

To be quite honest, probably the more appropriate question is why haven’t you been getting up to speed on one of these COTS single-board computers? The applications for these little devices are limitless!

Especially when you consider all the buzz words of the past few years, “Smart Manufacturing”, “Internet of Things”, “Big Data”, “Plant-wide Convergence”, the list goes on and on. Where I have found very good uses for these devices is in projects that involve the Internet of Things (IOT) and building automation/management systems.

My most recent project leveraged a Beaglebone Black to control a series of heaters throughout a large manufacturing facility. Could I have opted to use a PLC and then field distributed a bunch of remote I/O racks to the various heaters? Of course! However, the cost to do so would have meant I never would have been awarded the project in the first place. That was the biggest selling point I could offer my customer!

The combination of cost and the high degree of flexibility made an SBC a logical choice and provided additional functionality not readily available in a standard low cost programmable logic controller.

Leveraging the built-in Linux web-server, I was able to quickly develop a custom graphical user interface (GUI) to remotely control the heaters via a custom C# application, leveraging the onboard discrete and analog I/O.

What Makes The Beaglebone Black An Exceptional Microcontroller?

While the Beaglebone Black is the most expensive of the three SBC’s listed, the one area in which it blows the Raspberry Pi and Arduino out of the water is in GPIO (general purpose Input/Output) connectivity. The Pi only has a single 26-pin header that can be used as 8 GPIO pins, or as a serial bus and depending on the Arduino board you purchase, similar GPIO counts.

The Beagle, on the other hand, has two 48-socket headers that can be used for virtually limitless I/O hardware and includes a number of analog I/O pins that allow it to connect to a variety of sensor hardware that can’t be used with an out-of-the-box Raspberry Pi or Arduino.

The Beaglebone Black has a 1GHz ARM-based CPU, 512MB of RAM and 2GB of onboard storage, expandable with a MicroSD slot. In practical terms, this is enough to run a Linux OS, along with a web browser and other desktop applications. It can be leveraged to be a powerful tool for sophisticated projects, and a good way to learn about Linux-based operating systems.

Like most SBC’s, the Beagle is designed for use in embedded systems—a computer installed inside a larger electronics project. The shear number of  GPIO  pins allows the Beaglebone Black to communicate with a wide range of sensors, servos, outputs and other hardware, letting it act as the brain of a whole host of projects, ranging in size and complexity.

If you are considering purchasing one of these devices to start playing with (I highly recommend you do), I would like to recommend a book that is available on Amazon and it is hands down the best book you will find on this device.

PLC versus Microcontroller

It is authored by Derek Molloy and titled Exploring BeagleBone: Tools and Techniques for Building with Embedded Linux. It is by far the best and most thorough book I have purchase on COTS single-board computers in general with specific emphasis on the Beaglebone Black.

When To Consider a COTS Single-Board Computer

Single-board computers like the Beagle are ideally suited for the integration of high-level software and low-level electronics type projects. These include projects that involve, building automation and management systems, smart displays, sensor networks, IOT, vending machines, just to name a few.

The major advantage the Beaglebone Black has over more traditional embedded systems such as the Arduino, PIC and AVR microcontrollers becomes very apparent when you unleash the power of a Linux OS in your projects.

Linux provides device driver support for a plethora of USB peripherals and adapters making it possible to connect cameras, WIFI adapters, and other low-cost consumer devices without having to write custom low-level drivers to support them.

When You Should NOT Use A Single-Board Computer

As mentioned above the Beaglebone Black, as with most other COTS single-board computers on the market, were not designed for real-time or predictable processing. Their kernels are not preemptive, meaning that once the processor begins executing kernel code it can not be interrupted.

This poses a significant problem when dealing with safety critical applications, or applications that have mission-critical sensing requirements. For example, this would be problematic if you needed to sample a high-speed input device precisely every one-millionth of a second. If at the instant you need to sample the kernel is executing a different task, it will not be interrupted to service the sensor sampling.

Due to the fact that many industrial processes demand such stringent processing and safety-critical requirements, SBC’s have a severe disadvantage when compared to traditional PLC’s.

That said, there are options to extend the capabilities of some single-board computers on the market. I know that you can interconnect real-time microcontrollers to the Beagle via electrical buses (i.e., I2C, UART, CANbus and Ethernet) and have the Beagle act as the central processor for a distributed control system. Molloy explains real-time applications in depth in his book Exploring BeagleBone: Tools and Techniques for Building with Embedded Linux in Chapter 9 and 10.

PLC Versus Microcontroller – Which One Wins?

Okay so which one wins in the battle of PLC versus Microcontroller?

I’ve spent quite a bit of time making a case for COTS SBCs, specifically the  Beaglebone Black, as I am quite confident that most of my readers are quite comfortable in the world of programmable logic control, their uses, and applications.

It should be clear that I am of the mindset that both of these systems can find a place in modern industrial manufacturing facilities today, however, careful consideration needs to be taken when contemplating which one you should use (PLC versus Microcontroller).

PLC’s are designed to withstand the demands of  harsh industrial environments. The hardware is robust, and it’s made and tested to withstand shock, vibration, electrical noise, corrosion at a wide range of temperatures. This is simply not the case with Microcontrollers.

In general, the basic difference between the PLC versus Microcontroller, is summarized below:

  1. The I/O capacity and flexibility of a PLC is far more comprehensive than that of a Microcontroller.
  2. Modern PLC’s have more than one CPU that allows it to run dedicated safety-critical or scan critical tasks. Microcontrollers currently do not.
  3. PLC’s have pre-built, well-tried and tested hardware and software watchdogs and system routines.
  4. PLC’s generally have redundancies built-in, giving them the ability to be single fault tolerant. Microcontrollers do not have this ability.
  5. PLC distributed I/O (Remote I/O) can be placed and operated in hazardous areas. This can be difficult with COTS Microcontrollers.
  6. PLC’s have the ability to bridge many open and industrial communication protocols. Microcontrollers simply can not.
  7. PLC’s are more reliable and robust to use  in industrial applications so mean-time to failure is much longer than that of a microcontroller.

Therefore, if your application involves real-time, safety and scan-critical tasks then a PLC is the clear winner. However, if your application has tight budget constraints, is not critical or protecting human life, then a Microcontroller can be a good alternative.

Final Words…

I hope you enjoyed this short article, and I do encourage you to become a member of our growing community of professional engineers, technicians and technologists, Register Here!

Also, check out our YouTube Channel to see some great videos…and don’t forget to like and subscribe to our channel!

If you enjoyed this article be sure to check out some of these good reads too:

Lastly, if you run  into any problems in your day-to-day engineering activities please be sure to check out our Live and Interactive PLC Forum!

And if you so desire, assist other community members by replying or offering helpful information to the questions or challenges they may be facing right now!

 

Fred Graham

Author: Fred Graham

Hi, Fred here, I am the founding member and site moderator here at PLCGurus.NET. I’d like to be the first to welcome you to the site. I have over 20 years in the Industrial Automation and Control Systems field. Be sure to Register Today!

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