1 Introduction

With the acceleration of structural adjustment and upgrading of China's textile industry, loom enterprises are develo** in the direction of informatization, less labor, and intelligence. At present, the loom equipment in our country has realized automated production initially, with many controlled objects and complex mechanical structures. However, its monitoring method still adopts the traditional mechanical button and touch screen method, and the touch screen can realize the use of a single function, and the interface design is simple. The original monitoring system lacks effective and convenient unified management of equipment, and the factory manager cannot timely inquire about the working status of the loom. In the case of loom failure, it is impossible to find out the reason for loom failure quickly, and only manual inspection can be carried out, which seriously affects production efficiency due to the tedious process [1]. Moreover, the traditional monitoring method is limited by the geographical space, which is only suitable for operation in the industrial field and lacks an effective network management method. Given the above shortcomings, a monitoring system that can be used in both industrial fields and remote networks is designed.

2 The overall structure of the loom system

From the function point of view, the whole system can be divided into two parts: loom monitoring system and control system. The control objects of the loom control system are select the weft and selvage, let-off and take-up, main motor, brake clutch, and so on. Because of its complex mechanical structure and decentralized process, a distributed modular design method with one main control center and several sub-controls is adopted. This design can not only meet the control requirements but also avoid the whole system damage caused by the failure of a single system. In this paper, the loom monitoring system is independent as a subsystem and performs data interaction with the main control board of the control system through the industrial bus. The management and operation of each module are concentrated in the loom monitoring system, and the control work is completed by other corresponding functional modules. The overall structure of the loom system is shown in Fig. 1.

Fig. 1
figure 1

The overall structure of the loom system

This paper mainly studies the loom monitoring system. The control system will not be introduced in this article. The loom monitoring system is divided into the industrial field and remote network, mainly including embedded control system, wireless communication module, industrial bus module, industrial field man–machine interaction functional interface, cloud platform server, WEB client, etc. The overall structure is shown in Fig. 2.

  1. (1)

    The chip of the main control module in the control system is STM32F407ZET6. The touch screen and the RS485 communication module of the main control system realize data interaction through Modbus RTU communication protocol.

  2. (2)

    The design of the main control window, equipment window, user window, real-time database, and strategy script is completed in MCGS Pro configuration software, so that the industrial field system can realize the functions of real-time monitoring, parameter setting, color editing, fault diagnosis and alarm, machine repair and debugging, etc. Fault diagnosis is a fault tree diagnosis method based on the theory of the expert system.

  3. (3)

    The main control module transmits the collected data to the wireless module through the serial port and then uses the TCP/IP communication protocol based on the Socket interface for data transmission to the cloud platform server. TCP has two working modes: Client and Server. In this system, the WIFI module is set as TCP Client, and the Socket Server is set as TCP Server.

  4. (4)

    The cloud platform is the core organization of the remote system, which mainly includes a Socket server, a data processing module, a database, and a Web server [2]. The data processing module saves the processed data files into the database as historical parameters and sends them to the Web server. The Web server mounts HTML pages and sends data files to the WEB client through Ajax. In this way, the client can quickly refresh device data [3].

Fig. 2
figure 2

The overall structure of the loom monitoring system

3 The design of field monitoring system

The carrier of the field system adopts Kunlun touch screens, and the RS485 bus is adopted to communicate with the hardware of the main control system. The remote system can simultaneously satisfy enterprise users to monitor multiple looms and select WIFI as the wireless communication mode of the remote system. The wireless module ESP8266 is adopted to realize communication and interaction between on-site devices and the Internet. Figure 3 shows the PCB board of the main control module.

Fig. 3
figure 3

Main control module PCB board

3.1 The design of the RS485 bus

With the rapid development of industrial buses, more and more industrial sensors, instruments, and equipment adopt industrial buses. RS485 industrial bus is one of them, which often combines with Modbus and other communication protocols for communication detection and control [4]. In this system, STM32F407ZET6 is used as the main control module MCU. Because the main control chip of this system uses the RS485 communication mode to transmit data with the touch screen, only the RS485 module circuit is introduced here, and other hardware circuits of the main control module are not involved. Figure 4 shows the schematic diagram of the circuit designed according to the RS485 chip manual.

Fig. 4
figure 4

RS485 module circuit schematic

3.2 The design of Touch screens in the industrial field

Before designing and develo** the touch screen in the industrial field, it is necessary to clarify the detailed functional requirements and actual operation steps and then plan and design the entire interface structure of the industrial field system. This monitoring system uses MCGS Pro embedded configuration software to design all functional interfaces of the industrial field system. It needs to meet the requirements for real-time monitoring of the working status, parameters, and production data of the loom. This system adopts MCGS Pro embedded configuration software to design all functional interfaces of the industrial field system. It needs to meet the requirements of real-time monitoring of the working status, parameters, and production data of the loom and the recording of loom failure and tension fluctuation information. The staff can modify the operating parameters of the loom through the touch screen interface to realize the control of the loom equipment. The industrial field system should implement the following specific functional tasks:

  1. (1)

    Multi-level authority management.

  2. (2)

    Fault detection and log recording.

  3. (3)

    Machine repair and test.

  4. (4)

    Display and statistics of production data.

  5. (5)

    Tension adjustment and weft detection.

  6. (6)

    Real-time tension fluctuation curve.

  7. (7)

    Other data monitoring and parameter setting.

  8. (8)

    Fault diagnosis.

This monitoring system mainly designs the device window, user interface, real-time database, script strategy, etc. Each part corresponds to different characteristics; especially in the interface design process, the rationality and friendliness of the user operation engineering should be fully considered [5]. The specific implementation steps are as follows:

  1. (1)

    Device window

    The main control module and the touch screen communicate with each other using a serial port. Therefore, in the device window, the "general serial port parent device" is added, and the touch screen communicates with the external device using the "Modbus RTU" communication method.

  2. (2)

    User window

    The interface designed by the user window is the direct touch of the user to the industrial field system. Good interfaces need to meet the requirements of having clear operation logic. So that users can better operate the loom [6]. According to the design and planning of the industrial field system in the previous article, a total of 42 pages of human–computer interaction interfaces were designed and created.

  3. (3)

    Real-time database

    The real-time database is the core hub of the monitoring system for data conversion. The data sent or retrieved between each part of the monitoring system through the real-time database finally realizes the monitoring of the loom. The device window connects the main control module to the system and reads or writes data from the main control module to the real-time database. After that, the data in the real-time database and the data objects designed by the personal computer interaction interface are correlated with each other, and the data is processed by the operation strategy.

  4. (4)

    Strategy script

    The MCGS Pro configuration software supports a large number of script functions, which can achieve certain functions just like the built-in functions of a computer language. It mainly includes environment operation functions, data object operation functions, rights management operation functions, system operation functions [7]. These functions are the key methods to realize the mode selection, fault diagnosis, user login, color editing, and other functional tasks in the man–computer interaction interface.

3.3 Fault diagnosis of expert system based on fault tree diagnosis

The MCGS Pro configuration software has good logic scripting capabilities, but the hardware computing capabilities cannot support some fault diagnosis methods. Therefore, the fault tree diagnosis method with strong logic and a simple structure is adopted to realize the fault diagnosis function. The expert system fault diagnosis method based on fault tree diagnosis is combined with a real-time database to establish related fault logic and knowledge base. And this monitoring system uses MCGS Pro configuration software to design a logic script program to complete knowledge acquisition and fault interpretation expression and finally realize the fault diagnosis function of the industrial field system.

The expert system usually consists of six parts: knowledge base, inference engine, interpreter, database, knowledge acquisition, and human–computer interaction interface [8]. Figure 5 shows the expert system model.

Fig. 5
figure 5

Expert system model

Expert system has been widely used. However, to better establish a clear and concise logical relationship between the various detection parameters of the loom and the related fault phenomena, the fault tree diagnosis method is also referred to [9]. The basic idea of the fault tree diagnosis method is shown in Fig. 6: Three failure events occurred, namely event 1, event 2, and event 4. According to the logical relationship, it is inferred that the final cause of the failure is event 6.

Fig. 6
figure 6

Logic diagram of fault tree diagnosis method

The fault diagnosis of the loom field system must have multiple fault trees, and the sub-events in these fault trees will overlap each other, which leads to repeated operations on multiple fault trees and makes the fault knowledge base redundant. Because the phenomenon of concurrent faults in the loom system rarely occurs, the fault tree can be simplified. Sub-events involving intersections are set as reference relationships, and different fault trees can refer to the same sub-event. As shown in Fig. 7, the complex fault tree is simplified according to the logical relationship between events.

Fig. 7
figure 7

a Fault tree logic diagram before simplification; b fault tree logic diagram after simplification

Regarding the establishment of fault logic and knowledge base, we must first plan the events corresponding to all signals and divide the initial event set that caused the fault appearance and the bottom event set of the root cause of the fault. And determine the intermediate events contained therein, finally clarify the logical relationship between the events, and establish a fault tree about the fault. The knowledge storage method of the knowledge base in the fault diagnosis function of the monitoring system adopts the knowledge production rule representation of IF < condition > THEN < conclusion > . This method is a non-structured storage method, which has the characteristics of saving memory space and fast query speed and is particularly suitable for the hardware conditions of the Industrial field system.

4 The design of remote monitoring system

The design of the remote system mainly includes the design of the wireless transmission module, the selection and deployment of the cloud platform, the design of the cloud database, the development and design of the Web server and the WEB client. This system uses a three-tier B/S architecture, with WEB browser as the presentation layer, Web server as the application layer, and database server as the data layer. The B/S architecture uses a wide area network. The browser only handles a very small part of the business logic, and users can browse the Internet through the browser, without the need to install a client. The B/S architecture model is shown in Fig. 8.

Fig. 8
figure 8

Schematic diagram of B/S architecture model

In the development of the remote system data transmission channel, the driver program design of the wireless communication module needs to be completed first, and the wireless communication module is operated through the corresponding AT command. Subsequently, the Socket interface is used as the endpoint of data transmission. The Socket interface completes the network communication between computers through the combination of IP address and port. The Socket interface can be regarded as the endpoint on both sides of the data transmission bridge [10.

Fig. 10
figure 10

Wireless communication module software driver flowchart

System initialization includes initialization of related pins and timer clock. The user configuration mainly includes the setting of the wireless transmission module working mode, the user name and password for connecting to the router, and the IP address and port number of the TCP server. The initialization of related pins mainly includes serial port pin configuration, wireless module chip selection CH_PD pin configuration, and reset RST (GPIO16) pin configuration. The timer setting is to ensure a stable connection with the cloud platform server. After establishing contact with the cloud platform server, check whether the connection with the cloud platform server and router is normal at regular intervals; if there is an abnormality, immediately re-establish the connection with the cloud platform server or router to ensure that data transmission continues. To realize real-time data transmission, the connection between the ESP8266 wireless communication module and the cloud platform server must always be maintained. If the ESP8266 wireless communication module loses contact with the cloud platform server, the wireless module repeatedly sends requests to the cloud platform server to reconnect.

4.2 The selection and configuration of cloud platform

The current mainstream cloud platforms are mainly Alibaba Cloud and Tencent Cloud. This system chooses Alibaba Cloud platform with higher security and reliability, and installs Linux system as the operating system of Alibaba Cloud platforms. Configure the server parameters according to the needs of the remote system, as shown in Table 2. Alibaba Cloud Server must implement the following functions in the loom remote monitoring and fault diagnosis system:

  1. (1)

    Accept and save all operating parameter information of the loom equipment;

  2. (2)

    View the historical parameter information of the loom in the database;

  3. (3)

    Diagnose the fault of the loom, send the fault information to the remote client, and save the fault and each sensor information in the fault library.

Table 2 Server configuration

4.3 The design of cloud database

In this system, the database should not only store the data sent from the loom control module but also record the operational data generated by the WEB client. Redis database can not only persist the data but also store the data in the cache. The cache reads quickly, which can greatly improve the operation efficiency. So Redis is chosen as the cloud database.

After the Redis database is identified as a cloud database, the Redis database needs to be installed in the cloud server platform and build its operating environment. In the Linux system, the task of downloading and decompressing the installation package is completed through the wget command and the tar command, and then, the make command is used to complete the compilation and installation.

Redis database stores key-value data in the form of dict (dictionary), so the operations of adding, subtraction, updating, and value of data in the database are all based on the operation of the dictionary [

5 Monitoring system test and experiment

The above has completed the analysis and system design of the loom monitoring system, as well as the development and construction of related software and hardware. This section will test and experiment on the monitoring system.

5.1 Wireless module communication test

To test whether the ESP8266 wireless module can complete the normal networking work, the main control module is connected to the wireless module to test the network connection. This module is used as a TCP client in the entire remote system.

The wireless module is first connected to the field router and then connected to the cloud platform TCP server through the Internet to complete the wireless transmission from the industrial field to the cloud platform. Therefore, you can check whether the wireless module is connected successfully through the management system of the field router. The STA (station) connection list is shown in Fig. 16. The unique MAC address of the wireless module in the list proves that the wireless module has completed the connection with the router.

Fig. 16
figure 16

STA connection list

The experiment above proves that the hardware circuit and software driver of the wireless module can communicate with the Internet. Due to the interference of many factors, the actual effective transmission distance of the wireless module can only be determined through actual experiments. In the factory, the effective transmission distance is determined by adjusting the position of the router. In the end, the actual effective transmission distance of the router is found to be about 185 m through the test. If the transmission distance of the wireless module exceeds 150 m, data packet loss will occur. Therefore, the actual effective transmission distance is about 150 m. This distance can fully meet the actual needs of textile factories.

5.2 Field touch screen test

To avoid the damage caused by the uncertainty of the experiment to the operation of the loom, it is necessary to establish a simple interface to test the read and write data of the control system. Add 4 test data in the driver: 1201, 1002, 2303, 8204, and point the holding registers 1–4 to the test data to complete the assignment of the relevant registers. As shown in Fig. 17, the holding registers 1–4 of the touch screen successfully read the test data. Enter a random number in the input box and click the set button. The number in the holding register 5 is successfully written. The test proves that the field system can realize data interaction with the control system.

Fig. 17
figure 17

Holding register read data and holding register write data

After ensuring the safe storage of data and being able to be queried by users, system testing of the touch screen can be carried out. The login interface displayed by default when the system is powered on is shown in Fig. 18. The user clicks "Please log in here" to automatically pop up the user login interface. The MCGS Pro configuration software divides the user authority into two groups: loom enterprise and operator. Loom enterprises have the highest authority to access all functional areas for operation.

Fig. 18
figure 18

Login interface

When the user successfully logs in and enters the system, it will enter the condition monitoring interface by default as shown in Fig. 19. The condition monitoring interface design is divided into three parts. The upper part mainly displays the seven function buttons of set parameter, design color, signal, alarm, repair, statistical, and assist center. The middle part shows speed, weft density, angle position, loom condition, set tension, effective tension, driving time, current team. In addition, click the tension curve button to understand the amplitude of tension fluctuation and the law of change. It can be seen from Fig. 20 that the red curve represents the set tension, the black represents the real-time tension, and the blue represents the effective tension; the tension value set by this system is 110 kg, and the real-time tension value and effective tension value fluctuate around the set tension value, which can be used to monitor tension changes. The bottom part is the alarm scroll bar for fault alarm.

Fig. 19
figure 19

Condition monitoring interface

Fig. 20
figure 20

Tension curve interface

This subject divides the parameter setting into six parts according to different processes, which are the color selection dobby setting, the let-off and take-up setting, the start-stop setting, adjust tension parameter setting, and the weft seeking setting. Take the adjust tension parameter setting interface as an example to introduce the design of the parameter setting interface, as shown in Fig. 21. During the operation of the loom, the cloth surface tension fluctuates due to the movement of the mechanical structure of the equipment. Therefore, it is necessary to adjust the cloth surface tension through the two servo motors of let-off and take-up to maintain the stability of the cloth surface tension. Use the PID algorithm to realize the real-time adjustment of tension to keep the cloth surface tension stable. The adjust tension parameter setting interface is mainly for setting various parameters in the tension adjustment process. These parameters mainly include set tension, actual tension, effective tension, maximum tension, minimum tension, sampling advance angle, sampling lag angle, the related parameters of the PID algorithm. The effective tension value refers to the average value of the tension value sampled multiple times in the range of the tension sampling angle. In addition, to facilitate debugging, control buttons such as unwinding, tightening, loosening, and tightening have been added to the page.

Fig. 21
figure 21

Adjust tension parameter setting interface

Click the design color button to enter the design color interface as shown in Fig. 22. Usually, the design color is designed on the PC side with special design editing software. After the design is completed, the design color program is written into the control system through the U disk. However, in the actual operation of the industrial field, it is necessary to set the pattern with a shorter number of lines through the field interface. In the design color interface, you can set 20 dobby arms, 8 color selections, weft density, and stop war**. Each line in the interface represents the 32-bit data of one weft suit. Each square represents a character. The background color of the square represents 0 or 1, white represents a bit of data is 0, and the opposite is 1. After finishing the color setting, use the equipment command function provided by the configuration software and other system functions to design the corresponding strategy script, and finally realize the writing of color data.

Fig. 22
figure 22

a The first part of the design color interface; b the second part of the design color interface

In the loom control system, it is necessary to monitor multiple controlled objects and multiple sensor signals. Figure 23 shows the signal monitoring interface. This interface covers 20 heald frames, 8 color selections, 4 signal indicators, and other signal information. Because each sensor of the loom needs to be verified during system debugging and maintenance, the corresponding sensor signal needs to be shielded during this process. Therefore, a signal shielding interface is also designed, as shown in Fig. 24.

Fig. 23
figure 23

Signal monitoring interface

Fig. 24
figure 24

Signal shielding interface

Other interfaces are some system function interfaces, such as logout, alarm log, and production statistics. The logout function is realized by writing the script function of the MCGS Pro configuration software. After clicking the logout button, the system will automatically log out and restore to the login interface. Whenever the equipment fails, the filed system not only provides a fault alarm but also records the fault information in an alarm log. The fault information is recorded through the alarm browsing component of the MCGS Pro configuration software. The production statistics interface mainly includes the team switching, the production output statistics of each shift, the working hour statistics.

5.3 Remote server test

The cloud platform plays the role of storing, converting, and calculating the operating data transmitted by the on-site wireless module through the Internet. The debugging assistant sends a set of random data to the cloud platform, and the server can print this set of data, as shown in Fig. 25. This indicates that the data can be transferred and compiled into key-value keys, which are stored in the Redis database. Therefore, it is ensured that the data is stored safely and can be queried by the user.

Fig. 25
figure 25

Server print data

5.4 Remote client test

The client of the remote monitoring system has similar functions with the filed MCGS configuration screen interface. Take the multi-machine management interface as an example to show the use effect. In this management interface, you can browse the important operating parameters of each loom, such as the current status of the loom, production information, and fault information. Figure 26 shows the operation of three looms in the workshop to help users understand the real-time operation status of each loom equipment.

Fig. 26
figure 26

Remote system multi-machine management interface

In addition to the above function interface, there are user information interface, system introduction interface, multi-machine management interface, and single-machine management interface. When the user forgets the password or changes personal information, the user information interface can be used to view the personal information of the logged-in user, change the password, log out, and other functions. If the user does not use some functions of the system, the system introduction interface can view the system introduction to help users quickly understand the use of the system. When the user wants to set the process parameters of a loom, he can enter the single-machine operation interface. These interfaces are functionally similar to those of field systems and will not be described in detail here.

6 Conclusion

In order to solve the problems of the traditional system, such as lack of remote interaction mode, single function and limited access location, the loom monitoring system is improved in this paper. The traditional touch screen operation is transformed into a full-featured touch screen interface in the industrial field, and the remote interaction mode with cloud platform as the server is added. This not only simplifies the complexity of the operation but also meets the needs of staff in different positions.