本研究提出了一种基于消息队列遥测传输(Message Queuing Telemetry Transport,MQTT)协议的薄膜挤出系统与监控设备之间数据通信的灵活方法。
方法文章
本研究提出了一种基于消息队列遥测传输(Message Queuing Telemetry Transport,MQTT)协议的薄膜挤出系统与监控设备之间数据通信的灵活方法。
本研究旨在通过采用基于发布-订阅模式的消息队列遥测传输(Message Queuing Telemetry Transport, MQTT)协议,在TCP/IP之上构建一种适用于聚合物加工设备的灵活数据通信结构。即使使用传统设备,加工数据也可通过互联网通信由任意位置的多种设备进行测量和记录。基于消息的协议实现了灵活的通信方式,克服了现有客户端-服务器协议的局限性。多个设备可订阅由源设备发布的加工数据。该方法支持多个发布者与订阅者之间的数据通信。本研究实现了一个系统,可将来自设备及附加传感器的数据发布至消息代理(message broker)。订阅者可对代理转发的工艺数据进行监控和存储。该系统已部署并应用于一条薄膜挤出生产线,以验证其有效性。
在第四次工业革命浪潮中,获取和监控各种加工数据已成为重要任务1。特别是利用工艺数据改进制造过程,并建立高效的运行计划,将成为所有制造设施的重要目标2,3。如果能够及时从工厂发出警报或实施预测性维护,则可大幅减少停机时间4。近年来,针对聚合物加工过程的数据分析已开展了大量研究工作5,6。然而,由于从现有系统中获取此类数据存在困难,开展这些工作并不容易7。控制系统与仪表的层级结构使得数据采集与通信变得复杂。
首先,无法从不同生产日期的设备上获取数据。由于需要在专有格式的不同现场总线之间实现互操作性,因此实现不同设备间的通信十分困难。这种方式使得通信方法和数据格式保持私密。虽然这有助于轻松维护数据安全,但使用户在服务和未来发展方面依赖于设备制造商。目前,连接到聚合物加工设备的现代控制计算机大多采用基于 Windows 的系统,但其运行的软件通常是在专有的开发环境中创建的。尽管可以使用不同厂商的可编程逻辑控制器(PLC)与传感器或执行器进行通信,但在许多情况下,上层的监控与数据采集(SCADA)系统仍依赖于控制计算机8。这种做法导致了大量协议、现场总线和控制系统在市场上相互竞争。尽管这种复杂性随着时间的推移已逐步缓解,但目前仍有多种现场总线和协议在广泛使用。
另一方面,控制设备与SCADA之间的通信已由开放平台通信统一架构(OPCUA)实现标准化9。此外,SCADA与制造执行系统(MES)之间的通信也主要通过OPCUA实现。在这种紧密的层级结构中,难以自由提取数据用于过程监控与分析。通常,必须从SCADA或MES中提取数据10。如前所述,这些系统具有供应商专属性,且数据格式很少开放。因此,数据提取需要原始信息技术/运营技术(IT/OT)解决方案供应商的大量支持,这可能阻碍监控与分析所需的数据获取。
在薄膜挤出生产线中,控制用PC由SCADA系统进行监控11。SCADA系统由计算机程序操作,而该程序通常难以修改。尽管该程序可能具备可编辑性,但修改过程成本高昂且耗时。为了便于远程监测和分析加工数据,这些数据应能够从任意位置访问。若需在远离现场的位置监控加工数据,计算机程序必须具备将加工数据流式传输至互联网的功能12。此外,采用开放且免费的方法可降低数据采集的成本13。该方法使得即使资金有限、无法投资商业IT解决方案的小型工厂也能够进行数据分析14。
本研究采用基于发布-订阅模型的消息协议。消息队列遥测传输(MQTT)是一种开放的标准协议,可实现多个数据提供者与消费者之间的消息传递15在此,我们提出一种利用MQTT协议对现有制造设施进行数据采集、传输与监控的系统。该系统在薄膜挤出生产线上进行了测试,以验证其性能。来自原始控制器的数据被传输至边缘设备 通过 Modbus 协议。随后,数据被发布至代理服务器。与此同时,两台 Raspberry Pi 将测得的温度和照度发布至同一代理服务器。此后,互联网上的任何设备均可订阅该数据,并对其进行监控与记录,如图所示。 图1本研究中的方案展示了整个操作流程的具体实施方法。
访问受限。请登录或开始试用以查看此内容。
1. Broker installation
NOTE: To monitor and record processing data via the Internet, a computer system that relays the data should be prepared. The system should be accessible from both the publishers and the subscribers as shown in Figure 2. Thus, it needs to have a public IP address that is known prior to any communication. An open MQTT broker called Eclipse Mosquitto is installed on the system13.
2. Main publisher preparation
NOTE: This computer publishes the machine data via MQTT over TCP to the broker. Legacy data should be interpreted and repackaged to be sent out.This can be usually done by RS485 or Ethernet. The connection at the hardware level should be verified depending on the bus type. The extrusion machine sends out the data via Modbus through an Ethernet port.
3. Additional publisher preparation
NOTE: This computer also publishes the machine data via MQTT over TCP to the broker. Sometimes, additional measurement that cannot be done on the main publisher is required. Internet of Things (IoT) devices such as Raspberry Pi and Arduino can take the role. In this work, Raspberry Pi was employed for temperature data and illuminance data. The procedure is similar to protocol section 2.
4. Subscriber's setup
NOTE: Any devices on Internet may receive the processing data via the broker. The data is processed and visualized also by a Python code. In case the development is difficult, available applications such as MQTT Client in Google Play and MQT Tool in the App Store can be employed. Since the implementation of the user interface is quite lengthy, the details are not described here. Also note that existing applications such as MQT Tool in App Store can receive the data.
5. Data logging
NOTE: The processing data can be written in a database while monitoring. In this work, a lab-scale database was chosen. The data are connected onto a Microsoft Access file to easily write and retrieve from a user computer. In addition, a table can be instantly built by a query to analyze data in a spreadsheet such as Microsoft Excel.
6. Deployment
NOTE: If all the devices can be connected to the Internet, the setup is simple. However, to secure the machine side data, the publishers can be in the intranet only. In this case, the broker can be a gateway to the Internet. To be so, the broker should be equipped with two ethernet adaptors, one of which must have a public IP address. After all the items are developed, the codes should be deployed onto each device as shown in Figure 4. The mode of connection, wired or wireless, is not important, but it has to be secured so that each device should be able to access the broker. This means the broker can act as a gateway on the border between the intranet and the Internet for security purposes. Of course, even if all the devices are exposed to the Internet, there is no problem from a communication point of view.
7. Execution
NOTE: To test the whole system, we started the extrusion line and ran all the Python codes and Mosquitto.
访问受限。请登录或开始试用以查看此内容。
研究发现,HMI 上显示的数据以及由树莓派测量的数据已在订阅者端被监控和记录,如图5所示。如视频中所示,处理后的数据已记录到数据库中。

图1:使用MQTT协议进行数据传输的示意图。 代理负责将消息从发布者转发给订阅者。本图中的发布者包括主发布者和附加发布者(树莓派)。主发布者直接连接至挤出机以接收数据。只要网络容量允许,订阅者的数量不受限制。订阅者可将数据重新发布给其他订阅者,以便将其记录到数据库中,例如 Microsoft ...
访问受限。请登录或开始试用以查看此内容。
通过遵循本方案,无需使用制造执行系统(MES)等昂贵的IT解决方案,即可对加工数据进行监控和记录。物联网(IoT)技术可更便捷地从传统设备中获取并传输数据。研究表明,基于消息的协议MQTT可成功作为聚合物加工生产线数据通信的平台。此外,其他附加数据也可灵活地同步测量和传输。本研究中使用的附加发布者为树莓派(Raspberry Pi)。值得注意的是,可通过将树莓派安装在工业级防护外壳中,进一步增强其在恶劣环境下的稳定运行能力。订阅者可以是任何位置、任何操作系统的任意设备。订阅设备可通过选择订阅主题,仅接收所需的数据。本研究证明,MQTT协议结合物联网设备能够简便地实现聚合物加工生产线的数据监控。现代工业通信架构正逐渐偏离普渡模型(Purdue model)等金字塔式结构,而本研究也表明这一发展趋势是合理的。
通过使用 Python 实现软件,该代码可被复用于多种平台19。因此,不同平台的设备均能够参与处理数据的发布与订阅。此外,通过导入多个预构建的代码库(如 PyModbus、pyodbc、paho.mqtt 和 PyQT5),可大幅减...
访问受限。请登录或开始试用以查看此内容。
作者声明无利益冲突。
本研究由首尔科技大(首尔科学技术大学)资助的研究项目支持。
访问受限。请登录或开始试用以查看此内容。
| 姓名 | 公司 | 目录编号 | 评论 |
|---|---|---|---|
| 边缘设备 | Adavantech | UNO 420 | Intel Atom E3815 无风扇 |
| 薄膜挤出机 | EM Korea | 不可用 | 用于生产 450 mm 薄膜 |
| Pydroid | IIEC | 不可用 | 安卓设备 |
| Python3 | Python 软件基金会 | 不可用 | Windows, Linux |
| Raspberry Pi 4 | CanaKit | 不可用 | 标准套件 |
访问受限。请登录或开始试用以查看此内容。
申请许可以重复使用本 JoVE 文章的文本或图表
申请许可