Embedded smart box for legacy machines to approach to I 4.0 in smart manufacturing

This paper introduces the design of a Linux-based embedded controller which includes machine state detection application for legacy machines and manufacturing line. For Industrie 4.0 (I4.0), it is important to acquire, manipulate, and transmit machine operating states or physical data to form useful information. However, many existing legacy machines lack of controller or sensor(s) to response to their operating status. Some machine controllers cannot be connected to provide internal parameter(s) by means of communication. Gathering machine operating state should be the first priority to approach to I4.0. This paper adopts widely used Raspberry PI as the core platform to build Embedded Smart Box (ESB). It uses external sensors to detect the machine operating status to compute the machine’s availability (one of Overall Equipment Efficiency factors) and measures current to calculate the power consumption. In this research, the combination of embedded system and sensors can be a smart box for legacy machines. Such cost-effective design would help users to take the useful data from the machines and construct the base of I4.0 system even without the existence of the controller. This embedded-based design methodology has great potential implications that might fundamentally change the legacy factories into I4.0 smart one.


Introduction
Manufacturing process information sent to notify user anywhere and anytime in wired and wireless environment to enable the controlling and monitoring between machines and mobile device is the trend in industry [1].Gathering related machine data, processing, storing and sending or notifying user is the basis of I4.0.I4.0 is the mega-trend in manufacturing.Its key components includes Internet of Things (IoT), Machine to Machine (M2M), and integration of vertical and horizontal production device.Thoben et al. provided an overview of I4.0-related initiatives and some selected application examples [2].The basic design for upgrading machine into I4.0 is building the data acquisition (DAQ) system to collect and store machine-related information.Then creating the online monitoring systems to display and notify user when specific situation occurs in manufacturing process.High cost and newer machine could embrace Industrial Personal Computer (IPC), Database, and Web architecture to build such DAQ and pertinent Web user interface for machine.
Since complex monitoring design and relative high costs make those systems not practical for legacy processing machine.An open source and low-cost Embedded system, data acquisition, database and web system using Raspberry Pi (RPi), applied to target equipment could be a suitable and cost-effective solution [3].Many machines in manufacturing sites with average lifetimes exceeding twenty years and serviceable are called "legacy" equipment.They are incompatible with networks connection and are still being used.How to improve such legacy machines to make them approaching IoT and being compatible presents big problems.In these legacy machines, sensing operating status and sending information outside should be achieved to form IoT capability.The signal tower in legacy machines indicates operation status, however, it is hard to identify whether the machine is in actual operating or just in idle state.For many different legacy machines, various operation statuses detecting method by current signal is proposed to identify the actual operating condition [4].For no sensor-embedded machine, Cheng-Ju Kuo et al. [5] used add-on simple sensors to obtain various feature values from that machine, and designed procedures to predict status of machines to help factories with legacy machines to overcome barriers to build Industry 4.0 function.For match the main trend to build the high degree of automation, the economic efficiency of highly productive machine is determined by the manufacturing equipment availability.Many methods are investigated to increase the availability [6].For machine availability monitoring and process planning, [7] develop an Internet-and Web-based service-oriented system to enable real-time monitoring during working process.It introduced tiers of architecture to implement the connection between shop flow machines and web-based monitoring system.For building status sensing and web-connecting ability in legacy machine, this paper focus on building cost-effective Webbased monitoring embedded system to improve legacy machine digitalization and internet connection function.Also help legacy machine approach to IoT

Material and methods
Many small-and medium-sized factories have a large amount of legacy machines, these factories cannot afford advance communication device to implement DAQ and internetconnection in those machines.The ESB architecture this paper proposed is as Fig. 1.RPi with open source embedded Linux operating system (Raspbian) is used to connect legacy machine, gathers information about machine operating status (Digital Input, DI) and current/voltage (Analog Input, AI) value.ESB proceeds some calculation and comparison, then stores these data into on-board MySQL database server.ESB also installed Apache web-server on board, user(s) can connect to ESB web page to browse the current monitoring data or historical trend plot.For notifying user the machine status on time, ESB adopted the Websocket data exchange technology to build a message tunnel with Browser HTML.If any of emergency status occurs in monitoring process, ESB will send message to user's web page on time.In local Ethernet network environment users can connect to ESB and browse the data or interact with system directly.Considering the future system expansion, Cloud Data Centre (CDC) could be built to store ESBs data and achieve remote monitoring feature.Legacy machine's controller used to control machine action and display the machine status by light tower or 7-segment LED, many of them doesn't provide output connection pin for post-processing, also lack for sensor to sense physical state.For monitoring the machine power consumption and calculating the availability of machine, ESB measured current, voltage, and operating status.Fig. 2 depicts the design of signal connection to implement these requirements.

Software process and modules
For detecting the working state, voltage and current, the system software includes three executing parts: -Run main program to handle the DAQ process.Read setup content and check recording time is up or not.If the recording time is up, write the current data into embedded database server.
-Invoke the embedded server, including web-related and database for providing current data display and storing recorded data.Based-on embedded Linux system, MySQL server stores all the data manipulated by system.Apache web server brings the web pages to interact with user for system setting, data querying and displaying.Web-Socket server implements the direct and fast data exchange method between user and system through web pages.
-Lunch crontab for routine checking for hourly, daily, and monthly calculation of monitored data.Some advance data processing, including hourly/daily/monthly data summarizing, are separated from main program to reduce the flow complexity and increase the system flexibility.Data produced by these processes are also stored into embedded MySQL.The whole system software flow chart shown in Fig. 3.
Availability, one of the three OEE (Overall Equipment Effectiveness) factors shown in Fig. 4, is calculated as the ratio of Run Time to Available Time [8,9] Run Time = 450 -50 = 400 Availability = 400/450 = 0.889 = 88.9 % From detecting the working status signal, system can verify whether machine is working or not.If DI (depicted in Fig. 2) is high/low, then represents the machine is working/down.Calculate the summation of working and down time can obtain machine availability.

Web-based operation
Internet-and Web-based for remote monitoring system is the main trend in I4.0 for smart manufacturing to bring convenient and consistent user interface anytime and anywhere.Based on embedded Linux system and web server; ESB combines HTML5, CSS, Javascript and web socket technologies to build the web pages as interface for user to interact with.
No matter what device users run the Http Browser, users will get the same display content sent by ESB.

Experiment and results
To detect the machine working status, one can connect reciprocal part to Limit Switch component.Analog transducers can be used to measure machine's voltage and current.ESB acquires these three signals and calculates the power consumption and availability.For continuous monitoring situation, machine state will not change rapidly, and in general one can set the time interval in storing data to save system resources and storage space.Once time interval is up; then stores data to embedded MySQL database.Fig. 5 shows typical one day machine data which is under perfect working situation.The monitored values show working state, break time and lunch time.Machine starts at 08:00 and shutdown at 17:00, lunch time is 60 minutes and break time summation is 30 minutes.If unplanned down time appears, assumed it is x minutes, then availability will be  The actual machine availability shown in Fig. 6 varied from 70% to 93.5% in one month.Actually, no one machine is perfect and provides 100% availability.From the availability trend plot, one can understand the lower productivity timestamp or the trend, and make some plan to promote machine performance.For being suitable on multi-user's different device display screen and providing the consistent view, web-based development tools are adopted.A lot of clients connect to server might slow down the data exchange speed due to the complex connection process between client and server.ESB adopted web socket to create the message exchanging tunnel to omit the re-connecting process.Server sent current monitored data to all clients at the same time.The desktop and mobile web pages show the current status as Fig. 7. Current data shown in Fig. 7 include working state (LED on/off), monitored parameters gage and trend plot.No matter what or how many devices used to request the monitoring page, all of them will obtain the same data on time.If user's Browser window keeps alive, ESB will send data automatically via web socket tunnel when system produces new data.Users always receive the newest data.

Conclusions
This paper proposed and carried out a cost-effective design to retrofit a large amount of legacy machine to build DAQ function and intranet-or internet-based feature to approach smart manufacturing for I4.0.Simple but essential DAQ function applied to take the machine state provide user on time data to verify the machine situation, and derive other important manufacturing coefficients (e.g.availability and power consumption).Intranetor internet-based feature creates the world-wide and remote connection ability for legacy machine.Web pages user interface design lead users observe real-time data and trend plot to understand the current and tendency of monitored machine parameters.The proposed benefits include scalable design from single machine to cluster, cost-effective to improve the many of existence legacy machines, and Web-and internet-based to meet the I4.0 trend.To retrofit and promote the legacy machine toward I4.0 in mart manufacturing and extract the availability and power consumption for user reference and manufacturing planning, this paper introduces compact and effective approach to implement.

Fig. 3 .
Fig. 3. System software flow chart.As mentioned above, power consumption and availability are key parameters.Main program acquires machine's voltage and current to calculate the power consumption.The energy E in kilowatt-hours (kWh) per day is equal to the power P (V*I) in watts (W) multiply the number of usage hours per day t and divided by 1000 watts per kilowatt as following:  (ℎ/) = ( • ) () •  (ℎ/) /1000 (/)(1)
Assume the unplanned down time is 50 minutes, e.g.there is 20 minutes down time for tuning machine and 30 minutes for fixing problem, the availability will be

7 .
Desktop web page display (current value and trend plot) Mobile display (portrait and landscape) Fig.Desktop and mobile current status web page display.