PLC’s are not the only solution to automation. They go up against devices called Micro Controllers, which are often far cheaper, but yet essentially the same. Let’s get under the hood with what exactly a micro controller is.
A Barebones Device
Microcontrollers are designed almost like computers from the 80s. They’re barebones devices, sometimes with processors running at megahertz and less speeds and just kilobytes to a few megabytes of ram. These are numbers more comparable to an old Gameboy than a computer or even your cell phone. This sounds really useless, doesn’t it? How do you use something so ‘primitive’?
Simplicity is the key here. On a desktop computer, there’s millions of lines of code running. It can take multiple chunks of a millisecond to process and so something. It takes hundreds of watts in a day, just to sit there idling. A regular computer is incredibly powerful, but it gets in its own way when it comes to processing interactions. The complexity and speed ironically slow it down. In order for you desktop to respond to a keypress, the keyboard input has to be sent, decoded by hardware, passed to a driver, interpreted in the kernel, handed off to a program in the user end of the operating system, calculations performed, and then work sent back to the kernel, to the hardware, to encode instructions, to actually do something. For a microcontroller, an input comes in, is processed, and acted on immediately. There’s no middle man to slow things down.
This barebones nature does impose challenges. Microcontrollers are often programmed in a language called Assembly. Programmers will manage every aspect of the machine. Instead of simply writing “Int A = 1 + 1;” they write out each step the machine must take, storing memory, incrementing numbers, and so on. It’s incredibly complex, but it removes any interference of other programs. The machine can respond near instantly.
This efficiency means that some micro controllers can run on mere AA sized batteries for years. They can respond in milliseconds to inputs. They are incredibly cheap because they’re using lower cost hardware with less complexity. That said, this isn’t a cut-and-dry that Microcontrollers are awesome. They can be a serious pain to work with.
The complexity of the programming makes it a nightmare to debug a microcontroller. When it’s acting up, there can be thousands of lines of code to read over. Every change has to be written back to the device, it has to be rebooted, it’s a time consuming and troublesome process. In order to actually fix an automation system with a microcontroller, multiple specialists may be involved. An electrician may shutdown parts of the facility and gain access to the micro controller, an engineer will do the programming, and other engineers will have to help debug and validate that it’s safe.
Further, it’s not fully standardized in the way that a PLC might be. There are numerous companies designing microcontrollers and their development systems. There’s multiple languages and commands involved. The code isn’t necessarily portable between devices. They are a blank slate which you need to configure to do everything, from communicating with other machines to handling inputs.
This in part explains the cost difference between PLC and Microcontroller. Microcontrollers don’t have the massive ease of use considerations taken by their PLC counterparts. And that’s just the tip of the iceberg. We’ll cover more of the differences on Wednesday.