The research of multi-dimensional flow mapping for proportional flow control valve based on long short-term memory network

The multidimensional flow mapping illustrates the numerical correlation between the flow rate and three pertinent factors, namely spool displacement, valve port pressure difference, and oil temperature. This representation signifies a mapping of three-dimensional inputs to a one-dimensional output. Accurate mapping relationship lays solid foundation for the feasible flow control of the flow control proportional valve. Since the proportional flow control valve is a complex system with high nonlinearity, it is challenging to treat the flow mapping relationship as a simple parameter estimation problem. In this regard, this paper combines the relevant theories of signal processing and deep learning (DL) to propose a novel four-dimensional input-output mapping relationship learning method. This method adopts the long short-term memory (LSTM) network to model the multi-dimensional flow mapping relationship. And for better quality of the data, the initial measurement datasets, contaminated by environmental factors, are processed using a finite impulse response (FIR) filter to reduce noise before training the data. Moreover, the trained model is validated on test datasets. The experimental results shows that the mentioned method can accurately estimate the multidimensional mapping relationship of the proportional flow control valve.


Introduction
Due to the characteristics of high-power density and output, hydraulic systems are widely used in various heavy industries, automobiles, agricultural machinery, and other fields.As the core component of the hydraulic system, the proportional control valve controls the flow and pressure of the system by regulating the opening of the spool, the capability of which determines the working performance of the whole system.In most applications, proportional control valves are used in conjunction with external sensors for actuators.For instance, in a valve-controlled cylinder system, the displacement signal of the hydraulic cylinder is collected by a displacement sensor and fed back to the controller for closed-loop control operation, which in turn outputs an analog signal to adjust the proportional control valve opening.However, due to the harsh working environment of construction machinery, sensors that measure the position information of hydraulic actuators (hydraulic cylinders, hydraulic motors, etc.), such as displacement sensors and rotary encoders, are easily damaged, which can lead to high markup and repair costs, and even serious safety accidents.Accordingly, proportional flow control valves that directly regulate system flow (i.e., actuator speed) are becoming a major research topic.
Proportional flow control valves use the flow rate required for system operation as the control target, and the actual flow rate as the feedback to form a closed-loop control.Due to the high cost of flow sensors and the problem of delayed flow signal acquisition, the use of flow sensors to collect the flow feedback signal is not desirable.Therefore, many scholars nowadays investigate the numerical relationship between the flow rate and various factors (such as the main spool opening, the pressure drop of the valve port, the oil temperature, etc.) to determine the actual flow rate of the system.From the previous literature, it can be summarized that the research on this multidimensional flow mapping relationship can be categorized into two schools of thought.Firstly, the flow rate Q is expressed by the flow equation (1), where the pressure drop p  at the valve port can be measured by the pressure sensors, the flow-through area A is derived from the structural parameters of the spool, and the discharge coefficient d C is related to several factors such as the valve port shape, pressure drop, and oil temperature, etc.
Whether the discharge coefficient d C can be accurately attained determines whether the flow characterization is accurate [1][2][3][4][5].However, this method is subject to highly nonlinear relationships between the influential parameters, which significantly diminishes the accuracy of representation.
Other scholars have made nonparametric models the focus of their research to cope with the nonlinearity.Among these studies, the methods can be categorized as follows: a) grid maps, b) polynomial approximations, and c) artificial neural networks.Due to the simplicity and practicality, nonlinear static mapping based on grid maps are widespread in industrial applications [6].However, the qualities of the grid maps depend heavily not only on the number and layout of the nodes, but also the degree of nonlinearity and the reliability of interpolation methods.This approach consumes a high amount of experimental and computational resources when the objects are more than two-dimensional or the nonlinear relationships between parameters are sophisticated.The method of polynomial approximations takes advantages in its capability to handle mapping problems with small data volumes and simple parameter relationships [7].Åman et al. [8] utilized a cubic polynomial equation with the pressure difference as the independent variable to calculate the flow rate, which acquired a trade-off between accuracy and calculation speed.Nevertheless, it is hard to determine the maximum degree and the product form of the parameters in the case of a high volume of data and the presence of outliers.
With the rapid development of the major of machine learning and its excellent performance in relationship mapping, more and more researchers pay their attention to its application in the engineering hydraulic machinery field.Zhang et al. [9] introduced an AdaBoost neural network to learn the mapping relationship between the flow rate and other factors, such as spool displacement, pressure drop, and temperature.The authors adopted the AdaBoost method to avoid possible overfitting caused by BP neural network learning and thus improved the fitting accuracy.Sitte et al. [10] applied the above three methods to the flow mapping of seat valves and made comparisons, concluding that the best fitting results about accuracy can be obtained with the utilization of ANN.The datasets, which the researches based on ANN above focused on, were sampled when the hydraulic system status had been in a stable state rather than in a transient state.Consequently, on the one hand, data acquisition took a lot of time; on the other hand, a lot of process status information was forced to be lost.In order to address this problem effectively, this paper treats the measured transient signals (including pressure drop, temperature, spool displacement, and flow rate) as time series and introduces long short-term memory network to sufficiently learn the flow mapping relationship.
The main contents of this paper are listed as follows.An elaborated introduction of the proportional flow control valve is illustrated in section 2. In section 3, a method, which combines the FIR algorithm and the LSTM network, is applied to learning the flow mapping for the proportional flow control valve with multi-degrees of freedom.In section 4, a brief introduction to the test bench for data acquisition is performed and the FIR-LSTM method is applied to train the acquired datasets.Finally, conclusions are drawn in Section 5.

System background
The proportional flow control valve is an important valve to achieve proportional control of the hydraulic system flow by the combination of two-stage hydraulic spool valve, its structure is shown in figure 1.The main stage of the flow control valve is a three-position three-way spool structure, which is used to directly control the load inlet and outlet.The pilot stage is a three-position four-way spool structure, the two ends of the proportional solenoid directly drive the pilot spool, adjusting the pilot valve opening.Changes in the opening of the pilot valve will cause changes in the pressure of the pressure control chamber at both ends of the main valve, so that the main spool movement to achieve stepless control of flow.The main spool is fed back by the installation of a displacement sensor, providing a closed loop control of the spool displacement.In addition, the two working ports (A and B) are fitted with pressure sensors to feedback the pressure status of the load working oil chamber.Traditional flow proportional control valves must rely on the real-time flow of the hydraulic system, collected by an external flow meter, to achieve closed-loop control.However, in practical engineering applications, the method of collecting flow signals by flow sensors to achieve flow control is very costly and limited by the response and measurement accuracy of the flow sensors, which cannot meet the requirements of high-precision flow control.Therefore, this paper establishes the mapping relationship between the flow rate at the valve port and the differential pressure, spool travel and temperature by adopting a suitable method to realize the high-precision characterization of the actual flow rate.

FIR filter
As sensors in the hydraulic system are subject to environmental factors such as electromagnetic interference from motors and high frequency vibration, the acquired signals are often interspersed with high frequency noise signals.The presence of these noise signals has a great impact on the accuracy of the model learning, which can seriously cause the model to fail to converge.Therefore, it is crucial to use an appropriate method to filter the noise signals for obtaining clean data signals.
In engineering practice, digital filters are widely used because they have many outstanding advantages such as high stability, high accuracy, flexible design, easy implementation, etc., while avoiding the problems of voltage drift, temperature drift and noise, which cannot be overcome by analogue filters.Among them, the FIR filter is one of the most effective digital filters as it can guarantee strict linear phase characteristics while designing arbitrary amplitude-frequency characteristics.
The output of a FIR filter y of length N corresponding to the input time series ( )  x n is given by a finite convolution sum (convolution sum of the filter coefficients h and the sequence x ), and the expression is listed as in equation ( 2).(2) In this paper, we use FIR filters the coefficients of which are constants.

LSTM
The LSTM network, a modification of the recurrent neural network (RNN), was proposed in 1997 [11].
Compared with traditional the RNN network, the LSTM network can effectively diminish gradient vanishing and explosion.By introducing cell module, it works well in enhancing the long-term memory capability of the model.The temporal logic structure is shown in figure 2. The detailed structure of the LSTM cell module is shown in figure 3. The gradient of the LSTM model is calculated through the back propagation through time (BPTT) algorithm.According to the gradient, the model weight and bias parameters can be adjusted until convergence.As shown in figure 3, the memory cell (c (t-1) ) transmits information, containing memory information until the moment t-1, to the external state of the hidden layer (h (t) ).The path of information transmission is determined by three gates, namely input gate (i), forgetting gate (f) and output gate (o).The input gate controls the input of the current information ( c ); the forgetting gate control whether the history information (c (t-1) ) needs to reset; the output gate controls the output of the current memory information (c (t) ).The basic formula is shown as follows: (8) In equation (3) -equation ( 8) above: W and b are weight matrices and bias vectors to be learned during training;  represents the vector inner product;  is the sigmoid activation function, and its function value is in the range of (0,1), which plays the role of gating and represents the weight that allows the corresponding information to pass.tanh is used to scale the values to the range -1 to 1, which is used to update cell memory and cell output.The expressions of function  and tanh are listed as follows.

Data acquisition and pre-processing
To obtain an accurate flow mapping model, a large amount of data needs to be collected for model training and validation.To this end, the hydraulic circuit schematic diagram (figure 4) is designed, and the test bench shown in figure 5 is constructed, which consists of 1) the hydraulic oil source; 2) the hydraulic valve to be tested; 3) a flow meter and a pressure control valve; and 4) the data acquisition system.Among them, the inlet and outlet of the hydraulic valve to be tested are installed with pressure sensors and temperature sensors for differential pressure signal and oil temperature signal acquisition.In this paper, analogue signals are acquired by means of Beckhoff PLC components with a 5millisecond acquisition period.The signals include proportional valve spool displacement, inlet and outlet pressure, oil temperature and flow rate.Changes in inlet and outlet pressure are realized by means of a pressure control valve, and changes in spool displacement are realized by changing the current input to the proportional solenoid.In addition, as the hydraulic system working hours continue to increase, the temperature is also increasing, and the speed of change is related to the throttle state of the valve port.In this paper, by changing the spool displacement and the differential pressure of the valve port to produce changes in the flow rate under different operating conditions, a total of 500,000 data points are collected, which can fully meet the training requirements of the deep learning model.
After the data acquisition, the original signal is filtered by FIR filter, the length of the FIR time series is 50, the filter coefficient is a constant 0.02, and the filtering effect is shown in figure 6 (17s is taken for demonstration).From the figure, it can be seen that the FIR filter has a very good filtering effect, and there is no time hysteresis in the filtered signal.

Model learning and results
The filtered data can be used for training of LSTM network.In this paper, one layer of LSTM network is used, the number of hidden layer units is 512, and the length of the time series for training is 100, i.e., 500 ms.out of the 500000 data collected in the previous section, 400000 data are used for training, and the remaining 100000 data are the test set.the input to the LSTM layer consists of three features, which are the spool displacement signal, the differential pressure signal, and the temperature signal, and the input data dimension is (399900, 100, 3).Since the output has only one variable, flow, a fully connected layer is utilized to achieve a univariate output.The optimal structural parameters of the whole network, including weights, biases, etc., are obtained recursively by the adaptive moment estimation (Adam) algorithm, with the number of training epochs set to 200, the bath-size set to 100, and the learning rate to 0.005.In addition, an early termination is introduced during the training process to prevent overfitting.
This training is based on Python and developed on PyCharm idle using Tensorflow-gpu environment.After 200 epochs and 9700s of training, the training loss converges to 3.9026e-06.The trained model is tested on the test set and judged by three indicators, namely maximum error (ME), mean absolute error (MAE) and mean square error (MSE), and the results are shown in the table below.In the table, the maximum model error is 3.968 L/min out of 100,000 test data points, which is 2.48% of the maximum flow value (160 L/min), and the maximum error occurs in the step condition.The average error of the whole test set is 0.685, and the percentage error is 4.28‰.It can be seen that the model accuracy is very high, and also proves the effectiveness of the multidimensional flow mapping method proposed in this paper.And also, the testing results of two different working conditions (a. continuous condition; b. stepped condition) with a time length of 45s are taken and plotted as follows, as is shown in figure 7. It can be seen that, for continuous conditions, the model error is very small, the maximum flow rate error is less than 1L/min, about 6‰ of the maximum flow rate value; for step conditions, the error will increase with the flow rate value, but the error is less than 2%, which means that the precision is very high.

Conclusion
In this paper, a model that can characterize the multidimensional flow mapping relationship is proposed by incorporating the FIR filtering method and LSTM network.The model establishes the mapping relationship between the proportional flow control valve orifice flow and the spool displacement, orifice differential pressure and oil temperature.The LSTM network is used to learn the temporal and mapping relationships of the input and output signals, and the data collected by the sensors, interspersed with noise signals included, are filtered by FIR filter.The trained models are validated on a test set, and the model error for continuous signals was less than 1 L/min, which is only 6% of the maximum flow value.For step signals, the errors increase slightly, but are less than 2 per cent.Therefore, the model can characterize the mapping relationship between the flow rate and the other factors very accurately.
In practical engineering, real-time hydraulic system flow values can be derived from the real-time data of the spool displacement sensor, the port pressure sensor and the temperature sensor based on this model, avoiding the expensive economic and space costs associated with the use of high-precision, highresponse flowmeters in engineering.In addition, obtaining accurate real-time flow values provides a solid foundation for high-precision flow control of proportional valves.

Figure 1 .
Figure 1. the structure of the proportional flow control valve.

Figure 2 .
Figure 2. The temporal logic structure of the LSTM network.

Figure 3 .
Figure 3.The detailed structure of the LSTM cell module.

Figure 4 .
Figure 4. Schematic diagram of test hydraulic circuit.

Figure 7 .
Figure 7. the testing results of two different working conditions.