Wireless communication based on Raspberry pi and Codesys for mobile robots using IoT technology

. The industrial environment is going through exponential changes, due to the diversity of technological solutions that appear more and more frequently and the increase of productivity at increasing capacities. Due to this fact in the industrial area the number of devices, processing systems, collaborative robots, mobile robots and industrial equipment is increasing more and more. Consequently, there is a need for communication and connectivity of entities, common physical or virtual functioning and decision making, all of which are fundamental to the transition to the new concept of Industry 4.0. This study presents how wireless communication can be achieved in a mobile robotic platform that serves an industrial sector with other equipment in the production area, such as industrial equipment, collaborative industrial robots or other mobile robots. Also in this paper is presented how to create an HMI interface for the mobile platform that can be accessed from a touchscreen display mounted on the robot or from any mobile device connected to the internet.


Introduction
Nowadays, intelligent systems are developing extremely fast. This development comes with a set of major improvements of different communication systems both in everyday life and in the industrial environment [1][2]. The development of communication systems has developed major in recent years with the advent of microprocessors containing an increasing number large number of transistors and are becoming more efficient. For these reasons we can today discuss wireless, internet, or Bluetooth communications, which can provide a large exchange of data between devices and at very fast speeds. In the industrial environment there are several types of standardized communications that are used in industrial equipment and are usually communications between a PLC and other devices connected to it. With the increasing degree of automation in the industry, and with the emergence of the new concept of Industry 4.0, there is a need for equipment to communicate with each other, to exchange data and store them all in one place. As a result, the boundary between the physical and digital worlds becomes smaller, thus generating new trends, including the Internet of Things (IoT) [2]. The Internet of Things (IoT) is an extensive system based on the Internet, and its ultimate goal is to achieve real-time interactions between things, machines and people through various advanced technological means. The oldest literature on IoT was published in 2002 and discusses an application that can access video cameras in stores via the Internet. After almost 20 years of development, a growing number of officials and researchers tend to believe that IoT is an important technology for improving our living environment and quality of life [3]. Practical applications of IoT technology can be found in many industries, such as agriculture, chemical, pharmaceutical, energy and transportation. The industrial Internet of Things (IIoT), which is the application for industry, opens up huge opportunities for a large number of new applications that bring major opportunities to improve productivity in factories and ensure a better allocation of resources. This revolutionary technology is attracting the attention of many researchers and practitioners around the world. The Internet of Things is a language common to all connected systems, regardless of the brand, operating system, or software tools used [4][5].
This paper aims to achieve a wireless communication between a modular mobile platform, and equipment in the industrial production area using specific communication protocols such as: EtherNet / IP, CANbus, EtherCAT, Modbus, Profibus, Profinet, Sercos. This is possible with the integration of a Raspberry Pi minicomputer in the command and control system of the mobile modular platform, which has been transformed into an industrial PLC using a software package developed by Codesys, also having the possibility to create an interface HMI graphics that can be accessed from any device connected to the Internet and through which it can track and send commands to the mobile platform.

Integration of Raspberry Pi in the control system of the modular mobile platform
The modular mobile platform is a robot that can be easily configured by changing the locomotion system which is a plug and play system so that the motherboard of the robot and the electronic part remain the same. In this way the robot can have a high flexibility performing multiple functions and running on several types of surfaces. In order to further increase the flexibility but also the versatility of the mobile platform, it was found that the robot must be able to communicate with the equipment in the environment in which it operates and to exchange data in real time with them. This is possible with the integration of a Raspberry Pi minicomputer in the commandand-control system of the mobile modular platform shown in Fig.1, which was transformed into an industrial PLC using a software package developed by Codesys, also having the possibility to create a graphical HMI interface that can be accessed from any device connected to the internet and through which it can track and send commands to the mobile platform. As can be seen in Fig.1, the control of the modular mobile platform is based on 3 Arduino Mega development boards that communicate through a serial communication so that its mobile platform can have several configurations. The motor control is performed by two VNH5019 drivers, one for each of the two motors. These drivers operate at a voltage between 5.5-24 V, and the maximum current they can withstand is 12 A continuous (30 A peak) on the motor or 24 A continuous (60 A peak) on a single motor connected to both channels. These drivers provide feedback on the direction of current and support a PWM command with a frequency of up to 20 kHz. Through the microcontroller, the real-time power consumption of the motors can be monitored, and the LEDs with which they are provided provide the necessary feedback to help visually diagnose any problems or breakdowns [5].
According to the block diagram shown in Fig.1, the modular mobile platform can have 3 possible configurations presented: • Mobile platform with mobile wheels; • Four-wheel drive mobile platform; • Mobile platform with four omnidirectional wheels; Depending on the industrial sector where the platform is used and the tasks it has to perform, the platform has a modular locomotion system that can be easily changed mechanically, and an HMI interface of the robot selects the desired configuration and the program that the robot can perform.  Figure 2 shows the concept of interconnectivity and the achievement of a wireless communication between a modular mobile platform and equipment in the production area of several types of industrial sectors. The concept is based on a wireless industrial router that creates a local LAN network, to which all equipment and the robotic platform are connected. The router will provide each device with a unique IP that remains fixed and is protected by various IT solutions so that it cannot be accessed by other equipment. Equipment in the production area has various control systems and are based on PLCs or microprocessors that use various communication protocols. The realization of a wireless communication between the mobile platform and the control systems of the equipment can be achieved with the help of a Raspberry Pi minicomputer that was integrated in its control system according to Fig.1 and on which a software package provided by Codesys was configured. CODESYS Control for Raspberry Pi is an application developed by CODESYS compatible with the Raspbian operating system, practically transforming the Raspberry Pi minicomputer into a PLC that has digital inputs and outputs via GPIO pins, access to the I2C interface where SenseHat, SRF02, Adafruit can connect PWM, MPU6050 Gyro, MPU9150 Gyro, AK8975 Compass, SPI interface with MCP3008, MCP23S17, PiFace Digital, PiFace Control Display, and access to the Raspberry Pi Camera. Runtime Package the following fieldbuses are supported: CANopen, EtherCAT, EtherNet / IP, Modbus TCP, Modbus Serial, PROFINET. Due to this flexibility, communications through various protocols can be achieved at a chosen time. The Codesys software package is also used to develop control programs that will run on the mobile platform [6]. In order to do this, the Raspberry Pi has a USB serial connection to an Arduino Mega development board from the platform's control block diagram. mobile, illustrated in Fig.1 and the interpretation of the signals received by Raspberry Pi from various equipment through wireless communication is done through a ModBus communication between Arduino and Raspberry through the serial port and with the help of Node-red software. Figure 3 shows how ModBus communication can be achieved between Arduino and Codesys using the Node-red application. Using this type of communication the number of inputs and outputs can be significantly increased with the help of Arduino Mega boards. In Fig.3 it can be seen that on the address of a WORD type register we can have a number of 16 digital outputs or inputs using a simple function presented in Fig.4

Fig. 4. Output function configuration in Node Red with 16 outputs
Using this method in Codesys we have two channels for registers each of which has a number of 10 WORD registers. In conclusion, several Arduino boards can be connected with a number of 20 analog inputs or outputs or a number of 320 digital outputs or inputs. The developed software project must have different functions, such as: -graphical user interfaces, for configuring the mobile platform, for monitoring all production stages and all areas of the factory, for manual control of the mobile platform --implementation of constraints and interconditioning between different equipment -sorting and mediating analog signalsnetwork communication with computers and other devices [6,9].   This HMI interface can be accessed via the internet from any type of device directly from the navigation browser by accessing the IP of the Raspberry Pi minicomputer. If a LAN is used as shown in Fig.2, a VPN connection and a special configuration of the router are required for its interface to be accessed via the Internet, but it is necessary to implement a security severe on the router. Through this method we can have access via the Internet not only to the robotic platform but also to all the equipment that a communication with the robot control system made in Codesys, therefore opens a major opportunity for the use of IoT technology.

Conclusions
This paper presents a control block diagram for a robotic mobile platform that can have several hardware configurations and a series of predefined programs. A Raspberry Pi minicomputer has been integrated into the control system, which with the help of a software package developed and provided by Codesys, Raspberry Pi is transformed into an industrial PLC that can support industrial programming languages such as Ladder and can also communicate through various protocols with the equipment in the production area of several industrial sectors. It presents a concept of wireless communication between the mobile platform and various equipment and is also made in Codesys an HMI interface for the mobile platform that can be accessed via the Internet from almost any device.