Open Source Hardware and Software Alternative to Industrial PLC
Abstract
The revolution of Internet of Things (IoT), Industrial Internet of Things (IIoT) and Industry 4.0 is approaching with new market opportunities for all kinds of smart devices. This thesis was about building such a device, an open source hardware and software alternative to industrial Programmable Logic Controller (PLC). The idea was to prove the concepts by building a prototype with a solid foundation that includes the best suiting communication protocol available (OPC-UA) and a modular functionality for ease of repair and customisation. The challenges were appropriate choices of open source hardware and software along with making sure that interactions between different parts of hardware were possible. That includes the communication protocols between modules and extensive programming needed in various programming languages. Several tests were then needed to validate the required communication speed and reliability requirements.
The prototype was developed with Open Platform Communications - Unified Architecture (OPCUA) server module and four input/output (I/O) modules which include digital in, digital out, analog in and analog out. Raspberry Pi 2 was chosen as the System on Chip (SoC) hardware capable of running on Linux and hosting the OPC-UA server while Arduino Leonardo microcontrollers were chosen for the I/O modules. The OPC-UA server on the SoC hardware was programmed in Node.js on Linux while all I/O microcontrollers were programmed in a subset of C/C++. OPC-UA client in LabVIEW was developed for the majority of experiments while Matlab was used for data analysis.
The concept of building an open source PLC prototype was proven and its capabilities tested. The prototype proved to be stable in long time runs with no software/hardware crash on record. The communication speed from sensor to client (read) and client to actuator (write) was measured in LabVIEW with an average of under 10 ms. Only open source hardware and software was used, except for Raspberry Pi SoC OPC-UA server module which is not defined as an open source hardware by strictest definition. Modular I/O functionality was successfully implemented on a I2C communication bus.