The protocol in this work allows building a flexible data communication structure for a Polymer processing machine by employing a publisher subscriber based protocol code MQTT. Even when using a classical equipment processing data can be observed and recorded by various devices anywhere in the internet. The protocol facilitates data communication between multiple publishers and multiple subscribers.
We have implemented a system that publishes processing data from a existing extrusion line to the subscribing devices through a broker device. The data from a legacy extrusion controller has been interpreted in an device and sent up to the broker. Addition devices for ambient temperatures at two different locations and of during processing also publish the data to the broker.
Then the broker relays the data to subscriber devices which are interested in those data. To display and record the data. The subscriber system has been designed and built.
Since all the code for the participating devices have been written in Python. The code can be reused on the devices with different operating systems. Finally, the system is deployed and tested for line to demonstrate the validity First broker installation.
To begin configure the MQTT broker system so that it may monitor and record processing data over the internet. In order for a broker device to relay such data it must be accessible by both publishers and subscribers. Connect a computer system to the internet with a public IP address so that the broker can be accessed by both publishers and subscribers.
Then on the computer install, open broker software such as Eclipse Mosquito use a test tool like MQTT lens to examine the MQTT brokers operability. Second, main publisher preparation. Now let us prepare the main publisher device.
As previously mentioned this computer publishes the machine data via MQTT to the broker. Legacy data should be interpreted and repackaged to be sent out. This can be usually done by RS-485 or ethernet.
The connection in the hardware level should be verified depending on the bus type. The considered extrusion machine sends out data via Modbus through an ethernet port, to acquire data from the extrusion machine and publish them. Place a computer as the main publisher in the machine site.
On that computer install Python three as the software environment. Then install Pi Modbus to enable Modbus connectivity and communication. Examine the Modbus function codes of the extrusion controller and connect it to the main publisher.
Fully identify the data and the associated address and the Modbus codes from the machine using a Modbus tool such as Modbus poll or Q mod master on the main publisher. Then write a Python code on the publisher that retrieves the data from the extrusion controller. In addition, combine data stream via PCIE USB RS-232 and RS-485 from other devices.
Import paho dot MQTT dot client and implement the code to connect and publish data to the broker. Third, additional publisher preparation. In addition to the main publisher let us employ additional IOT devices to acquire and publish ambient temperatures and film illuminance.
To do so. Two Raspberry Pi devices have been employed. Each device publishes the measured data to the broker as the main publisher does.
Place the devices near the sensor locations. Then install Python three on the devices and implement the code to acquire the sensor data. The sensor data are transmitted by I2C for the illuminance sensor and by GPIO for the temperatures.
Reuse the previous Python code to publish the data. Thanks to the device independence of Python. The code for windows can be reused for the Raspberry Pis.
Fourth, subscribers set up. Now let us explain how to subscribe to the processing data. As previously stated, any devices on the internet may receive the data via the broker.
Again, the data can be processed and visualized by a Python code. On an internet connected device install a suitable Python environment depending on the device and the operating system. For example, on an Android device Pydroid 3 should be installed instead of Python 3, then import both paho dot MQTT dot client and paho dot MQTT dot subscribe to connect to and receive data from the broker.
Then build a user interface as required based on Pi QT5. Since implementation of this part is quite lengthy and can be laborious. The details are not further described here with this code display the incoming data on the GUI.
Also know that existing applications such as MQT tool in app store can receive the data. Fifth, data logging. To record the data during monitoring the Python should be able to access a database.
In this work the data is written to a Microsoft access file. Considering the data scale and software availability. Select a subscriber device to record the data.
Then import pyodbc in the Python code to access the database. For recording the processing data, send a query to the database by the Python code. To retrieve the recorded data send another query to the database.
Once the data is retrieved, the data can be analyzed by restructuring the data as needed. A table readable in a spreadsheet can be instantly built. Sixth, deployment.
After all the items are developed the Python codes should be deployed onto each device. The mode of connection wired or wireless is not important but it has to be secured that each device should be able to access the broker. This means the broker plays as a gateway on the border between the internet and internet for the security purpose.
Here to maintain better security connect the extrusion controller the main publisher and the additional publishers to the internet. Then connect one ethernet port of the broker to the internet and the other to the internet to monitor and record the processing data. Connect subscribers to the internet as required.
Seventh, execution. To test the whole system, start the extrusion line. Next turn on all the computer devices.
Then start the broker software Mosquito, and run all the Python codes. Representative results. As a result of executing the designed and implemented system, processing data are monitored and visualized.
The data can be shown in a variety of ways including graphs and tables, even on a mobile device the data can be monitored and recorded. Moreover, the data is recorded and retrieved in order to be analyzed. Conclusion It has been found that the data shown in the HMI and measured by the Raspberry PIs are monitored and recorded in the subscribers.
By following the protocol presented the processing data can be monitored and recorded without expensive IT solutions such as the MES.