Professional Documents
Culture Documents
Developing Open Source Cyber-Physical Systems For Service-Oriented Architectures Using OPC UA
Developing Open Source Cyber-Physical Systems For Service-Oriented Architectures Using OPC UA
Abstract—Cyber-physical systems (CPS) are key enabling ferred to as cyber-physical production systems (CPPS) [3]. The
technologies for the fourth industrial revolution, referred to idea of such systems is not new and in the past, many protocols
as Industrie 4.0 or Industry 4.0. The Reference Architecture have been developed for application, e.g., Devices Profile
Model Industrie 4.0 (RAMI4.0) has recently been standardized
and OPC Unified Architecture (OPC UA) is listed as the sole for Web Services (DPWS), Constrained Application Protocol
recommendation for implementation of a communication layer. (CoAP), Message Queue Telemetry Transport (MQTT), OPC
Many automation and control systems offer already implemen- Unified Architecture (OPC UA) etc., [4] but no uniform and
tations of OPC UA but no satisfying implementation of OPC consistent reference standards were available. The Reference
UA was found for Arduino, a popular platform for engineering Architecture Model Industrie 4.0 (RAMI4.0) has recently been
physical computing systems. This paper presents open source
integration and application of a customizable OPC UA server standardized [5] and OPC UA is listed as the one and only
on an Arduino Yun board using open62541, an open source and recommendation for implementation of a communication layer
free implementation of OPC UA. The Arduino board discussed [6]. Therefore, the focus of this paper is on OPC UA.
in this paper offers hot-end closed-loop temperature control According to RAMI4.0 [6], extensive, complex things such
for a 3D printer but the temperature set value and control as machines, as well as less extensive things such as intelligent
parameters can be manipulated and requested via OPC UA using
OPC UA clients. The application is verified using Prosys OPC sensors, can be integrated using Industry 4.0 compliant com-
UA Client and UaExpert. The results of our research can be munication. Many automation and control systems, e.g., Beck-
used for developing open source cyber-physical systems without hoff TwinCAT, Siemens SIMATIC, B&R Automation Studio
specialized knowledge in microcontroller programming, bringing etc., offer already OPC UA communication interfaces which
Industry 4.0 applications into classrooms without effort. make I4.0 compliant communication, e.g., of programmable
logic controllers (PLC) with MES and ERP, possible [7]–[10].
I. I NTRODUCTION
Considering the idea of intelligent sensors and decentralized
Cyber-physical systems (CPS) are key enabling technolo- services, small CPS, e.g., temperature sensors or controllers
gies for the fourth industrial revolution, referred to as Industrie with their own OPC UA interfaces, are also useful. Therefore,
4.0 or Industry 4.0 [1]. CPS are embedded systems which we are focused on compact physical computing systems.
combine the physical world with the virtual world via net- In recent years, Arduino became a popular platform for
works. Sensors are used by CPS to bring information from the engineering physical computing systems. Its concept makes a
physical world to the virtual world, while actuators are used wide range of sensors, actuators and interfaces easily accessi-
to influence the physical world from the virtual world [2], [3]. ble to those without specialized knowledge in microcontroller
Local Area Networks (LAN) and Wireless Local Area Net- programming. Arduino is suitable for engineering low-cost
works (WLAN) can be used for communication. Considering physical computing systems because hardware and software
the concept of the Internet of Things (IoT), the network used are published under open source licenses and pre-assembled
is not restricted to a local company network, which makes boards are available for less than $20 [11]. In addition, Ar-
global access to information and services possible, and offers duino become usable for industrial applications: e.g., Industru-
entirely new perspectives for automation technologies. For ino, an Arduino compatible industrial controller with industrial
example, sensor data are no longer limited to the shop floor level I/O capability, is available and the German institution
field bus; they can be offered in a cloud and can be directly “Industrie- und Handelskammer (IHK)” defines Arduino as a
accessed, e.g., by manufacturing execution systems (MES) demonstrator for examinations [12], [13]. Therefore, the aim
and/or enterprise resource planning systems (ERP). As a result, of this paper is to make Arduino-based CPS with Industry 4.0
the conventional architecture of the automation pyramid will compliant interfaces possible. After the Introduction in Section
gradually be transformed into a CPS-based architecture with I, Section II shows the start of the art. Section III describes
decentralized services [2], [3]. The interoperability of systems our approach and Section IV describes the application. The
makes intelligent production systems possible, offering cost- evaluation of the application is presented in Section V. The
efficient and energy-efficient production. This vision is also re- paper ends with a conclusion in Section VI.
l-)))
II. S TATE OF THE A RT C. Implementation of OPC UA for Arduino
Arduino Yun Board
OPC UA Interfaces
A0 D10
Prog. OPC UA
NTC MOSFET
PC Client
Fig. 1. Architecture of Arduino Yun with temperature control and OPC UA application
nodes, such as BrowseName and DisplayName, can also be attributes such as BrowseName and DisplayName. Table I lists
assigned. The OPC UA server waits for configuration from the Arduino data types currently supported by our library with
the Arduino side when it has started. Therefore, it is listen on their reference to OPC UA data types.
serial port /dev/ttyATH0. The Arduino side sends information The library contains a class called OPCUA. The constructor
to the server regarding the nodes desired. Depending on the configures the serial port (Serial1) for serial communication
configuration information, the server creates the nodes desired when an instance of the class is created. The library offers
and is listen on port 4840. two functions for creating methods and referencing them to
Currently, the number of our pre-implemented Arduino variables: addMethodIn and addMethodOut. Both
MethodNodes is limited to four data types and five variables functions expect two parameters: the first parameter is the
per data type. When the number of pre-implemented nodes address of a variable which will be referenced to the OPC UA
and data types is sufficient, the OPC UA server implemented method; the second parameter is the text used as an attribute
can be used for Arduino projects without re-compilation on for BrowseName and DisplayName. In the Arduino sketch’s
the Linux side. This makes it possible to bring information setup function the functions addMethodIn and addMethodOut
from Arduino to OPC UA without specialized knowledge in have been called. Both functions send configuration informa-
microcontroller programming or programming on embedded tion to the OPC UA server. Another function offered by the
Linux. When the number of implemented variables or data library is called handle. It has been called in the Arduino
types is not sufficient for a project, further nodes can be sketch’s loop function and handles data exchange. It assigns
added, but this requires modifications in the source code of input arguments from methods called to Arduino variables and
the OPC UA server. Source code compilation on the Linux assigns Arduino variables to output arguments. Source code
side is initiated by terminal emulation via WiFi and directly compilation on the Arduino side is initiated by Arduino IDE;
performed on AR9331 by the GNU Compiler Collection WiFi and USB communication are feasible.
(GCC). The C99 version of the C programming language
standard is used. IV. A PPLICATION
The approach described above is applied to make a CPS
C. Arduino side: Design of Arduino sketch for temperature control possible. The application follows
An Arduino library was developed which abstracts data the concept of hot-end closed-loop temperature control and
access, handles data transfer and reduces effort needed to temperature measurement for a 3D printer as described in
create OPC UA nodes such as MethodNodes, with specific [27]. With a focus on [27], the CPS replaces the part of the
TABLE I Actually, the application supports the following features via
R EFERENCE OF DATA TYPES ON A RDUINO SIDE (AT MEGA 32 U 4) AND OPC UA by method calls:
L INUX SIDE (AR9331) CONSIDERING IEC 62541-3 AND OPEN 62541
• Temperature control can be enabled/disabled.
Arduino IEC 62541-3 open62541 • Temperature set value can be set/modified temporarily.
Boolean Boolean UA Boolean • PID parameters can be set/modified temporarily.
Integer Int16 UA Int16
Float and Double Float UA Float • Status of temperature control can be requested.
String String UA String • Temperature set value can be requested.
• Actual temperature can be requested.
• PID parameters can be requested.
temperature control with its sensor and actuator described in • PID output value can be requested.
its extended CNC architecture for fused layer modeling. • PID parameters and the temperature set value can be
Fig. 1 shows the architecture of our application. An NTC modified permanently. For this purpose, values are trans-
thermistor EPCOS 100k [28] is used for temperature mea- ferred from SRAM to EEPROM.
surement, and is connected to Arduino Yun’s analog input pin These features are sufficient for the application of temperature
A0. A MOSFET IRF3708 [29] is used to amplify the pulse- control, but there is no reason to limit the application to
width modulated (PWM) control signal from 5V to 12V. It these values. The application described is limited to a specific
is connected to Arduino Yun’s PWM pin 10. The amplified NTC sensor because constant NTC parameters from data
signal powers a thermal resistor which represents the heating sheets are deposed in the Arduino sketch. When the NTC
unit. sensor is replaced by an NTC from another vendor or batch,
The Arduino sketch implemented makes closed-loop tem- constant parameters can change and modifications in the
perature control possible using a PID control algorithm. For Arduino sketch are required. Therefore, we will make more
this purpose, the Arduino PID library is used. The AT- parameters modifiable to make maintenance more flexible
mega32u4 has 1 kB of EEPROM. The EEPROM is used via OPC UA. Our application is only focused on hot-end
to permanently store initial values such as PID parameters closed-loop temperature control, but it is also possible to
and the temperature set value. The temperature set value and make chamber/workspace or heating bed temperature control
PID parameters can be manipulated temporarily in SRAM and possible.
permanently in EEPROM via OPC UA. The actual tempera-
ture, the temperature set value and PID parameters can be V. E VALUATION
requested via OPC UA. Fig. 2 shows the procedure for data A private wireless network is established for prototyping
exchange. The procedure is described using an example: an using a private WiFi router (TP-Link TL-WR841ND). Special
OPC UA client requests the value of the PID Parameter P. router configuration is not necessary. The Arduino Yun’s WiFi
Communication steps are represented by numbered arrows. interface is configured for DHCP and to look for the SSID of
1) An OPC UA client calls the method called “Get PID our router. The router assigns it the IP address 192.168.0.100;
Parameter P”. therefore, the Yun’s OPC UA server can be reached at:
2) The OPC UA server receives the method call and opc.tcp://192.168.0.100:4840. When the router is not avail-
handles it. It requests the value from the Arduino side able, the Arduino establishes its own network and the OPC
(32u4) via serial communication. UA server can be reached at: opc.tcp://192.168.240.1:4840.
3) The Arduino side receives the request and answers with Two separate OPC UA clients are used at the same time
the value of the variable referenced. to demonstrate vendor-independent and platform-independent
4) The OPC UA server receives the value from the Arduino communication. First, the Microsoft Windows version of the
side and sends it as an output argument of the method OPC UA client UaExpert is used to set the PID parameter P
call to the OPC UA client. value to 9.5, which is shown in Fig. 3. The Android version of
Prosys OPC UA Client is used to verify the modification. Fig.
1 2 4a shows that the value is 9.5. Following this, the Prosys OPC
UA Client is used to set the value to 12.5. This is shown in Fig.
OPC UA Client OPC UA Server ATmega32u4 4b. Finally, UaExpert is used again to verify the modification.
Fig. 5 shows that the value is now 12.5.
4 3 Finally, the Arduino Yun’s Ethernet interface is used to bring
it into the universities network. The evaluation procedure and
Fig. 2. Procedure for data request from OPC UA client and response from the results are equal. The open62541 client was deliberately
OPC UA server
not used for evaluation to demonstrate vendor-independent
communication.
Fig. 3. Method called by UaExpert to set PID parameter P value to 9.5 Fig. 5. Method called by UaExpert to get PID parameter P value: 12.5
[6] D. Dirzus, Ed., Status Report: Reference Architec- of Engineering Applied Sciences and Technology, vol.
ture Model Industrie 4.0 (RAMI4.0), 2015. [Online]. 1, pp. 145–151, 6 2016, ISSN: 2455-2143.
Available: www . zvei . org / Downloads / Automation / [19] A. Nayyar and V. Puri, “A review of Arduino board’s,
5305%20Publikation%20GMA%20Status%20Report% Lilypad’s Arduino shields,” in 2016 3rd International
20ZVEI%20Reference%20Architecture%20Model.pdf Conference on Computing for Sustainable Global De-
(visited on 01/05/2017). velopment (INDIACom), 2016, pp. 1485–1492.
[7] Beckhoff, Ed., TF6100 — TC3 OPC UA, 2016. [On- [20] OPC Foundation, Ed., OPC Unified Architecture: Inter-
line]. Available: http://www.beckhoff.de/default.asp? operability for Industrie 4.0 and the Internet of Things,
twincat/tf6100.htm (visited on 12/30/2016). n.d. [Online]. Available: https://opcfoundation.org/wp-
[8] Siemens, Ed., OPC UA - TIA Portal - Siemens: content / uploads / 2016 / 05 / OPC - UA - Interoperability -
SIMATIC OPC UA - Support for standardized con- For - Industrie4 - and - IoT - EN - v5 . pdf (visited on
nections - regardless of the platform, 2016. [Online]. 01/03/2017).
Available: http : / / www. industry. siemens . com / topics / [21] OPC Foundation, Ed., Cooperation of OPC Founda-
global/en/tia-portal/software/details/Pages/opc-ua.aspx tion and PLCopen Interoperability of the new gener-
(visited on 12/30/2016). ation, n.d. [Online]. Available: https://opcfoundation.
[9] B&R Bernecker + Rainer Industrie Elektronik GmbH, org / wp - content / uploads / 2014 / 05 / OPC - UA
Ed., Open communication for Industry 4.0, 2014. [On- CollaborationPLCopen EN.pdf (visited on 01/03/2017).
line]. Available: https : / / www . br - automation . com / [22] M. V. Garcia, E. Irisarri, F. Perez, E. Estevez, and M.
en / company / press - room / open - communication - for - Marcos, “OPC-UA communications integration using a
industry-40/ (visited on 12/30/2016). CPPS architecture,” in 2016 IEEE Ecuador Technical
[10] OPC Foundation, Ed., Find Certified Products, 2016. Chapters Meeting (ETCM), 2016, pp. 1–6. DOI: 10 .
[Online]. Available: https://opcfoundation.org/certified- 1109/ETCM.2016.7750838.
products (visited on 12/30/2016). [23] V. Vimos, E. Sacoto, and D. X. Morales, “Conceptual
[11] Arduino, Ed., Boards & Modules : Arduino Store - architecture definition: Implementation of a network
community and electronics, n.d. [Online]. Available: sensor using Arduino devices and multiplatform appli-
https : / / store . arduino . cc / category / 106 (visited on cations through OPC UA,” in 2016 IEEE International
01/03/2017). Conference on Automatica (ICA-ACCA), 2016, pp. 1–5.
[12] Industruino, Ed., Industruino is an Arduino compat- DOI : 10.1109/ICA-ACCA.2016.7778476.
ible industrial controller, 2016. [Online]. Available: [24] F. Palm, S. Gruner, J. Pfrommer, M. Graube, and L.
https : / / industruino . com / page / boaseboard (visited on Urbas, “Open source as enabler for OPC UA in in-
12/31/2016). dustrial automation,” in 2015 IEEE 20th Conference on
[13] PAL Prüfungsaufgaben- und Lehrmittelentwick- Emerging Technologies & Factory Automation (ETFA),
lungsstelle, Ed., Elektroniker/ - in für Geräte und 2015, pp. 1–6. DOI: 10.1109/ETFA.2015.7301562.
Systeme Änderung der Prüfungsmaterialien ab AP [25] open62541, Ed., open62541: an open source implemen-
Teil 1 - Frühjahr 2016, 2015. [Online]. Available: tation of OPC UA, 2017. [Online]. Available: http : / /
http : / / www. hannover. ihk . de / fileadmin / user upload / open62541.org/ (visited on 01/03/2017).
150728 EGS Juli 2015.pdf (visited on 12/31/2016). [26] The open62541 authors, open62541 Documentation,
[14] Arduino, Ed., Arduino - Introduction, n.d. [Online]. 2017. (visited on 01/03/2017).
Available: https : / / www . arduino . cc / en / Guide / [27] M. Müller and E. Wings, “An Architecture for Hy-
Introduction (visited on 12/30/2016). brid Manufacturing Combining 3D Printing and CNC
[15] RepRap.org, Ed., Arduino Mega Pololu Shield - Machining,” International Journal of Manufacturing
RepRapWiki, 2016. [Online]. Available: http://reprap. Engineering, vol. 2016, pp. 1–12, 2016, ISSN: 2356-
org / wiki / Arduino Mega Pololu Shield (visited on 7023. DOI: 10.1155/2016/8609108.
12/31/2016). [28] EPCOS AG, Ed., NTC thermistors for temperature
[16] R. K. d Hilal Al Habsi and G. R. Rameshkumar, measurement: Glass-encapsulated sensors, standard
“Design and Fabrication of 3-Axis Computer Numerical type Series/Type: B57560G, B57560G1, 2015. [Online].
Control (CNC) Laser Cutter,” International Journal Available: http : / / www . epcos . com / inf / 50 / db /
of Multidisciplinary Sciences and Engineering, vol. 7, ntc 09 / Glass enc Sensors B57560 G560 G1560 .
pp. 7–16, 5 2016, ISSN: 2045-7057. pdf (visited on 01/11/2017).
[17] B. Jayachandraiah, O. V. Krishna, P. A. Khan, and R. A. [29] International Rectifier, Ed., SMPS MOSFET: IRF3708
Reddy, “Fabrication of Low Cost 3-Axis Cnc Router,” IRF3708S IRF3708L HEXFET Power MOSFET, n.d.
International Journal of Engineering Science Invention, [Online]. Available: http://www.irf.com/product- info/
vol. 3, pp. 1–10, 6 2014, ISSN: 2319-6734. datasheets/data/irf3708.pdf (visited on 01/11/2017).
[18] M. Papoutsidakis, D. Piromalis, and P. Papageorgas,
“Manual and Automated Operation Control on User
Demand of a Milling Machine,” International Journal