A software and hardware design scheme of intelligent valve positioner

. Valve positioner is the core component of the pneumatic control valve. A new software and hardware design scheme of intelligent valve positioner is presented in this paper. The circuit composition of each part of the intelligent valve positioner is introduced in hardware part. Based on it, a hardware solution to realize HART ‘multi-point’ communication is proposed in this research. In the software design, a novel combined PID control algorithm is proposed to solve the nonlinear problem caused by the friction between the valve stem and the packing during the control process. Simulation results show that the method proposed in this paper is better than traditional PID method and fuzzy PID method. The software and hardware design scheme of the valve positioner proposed in this paper has certain guiding significance for the development of related products.


Introduction
Pneumatic control valves are widely used in the process industry for its simple structure, stable performance and low price [1]. Intelligent valve positioner is a key component of pneumatic control valve, which is responsible for position control and signal transmission. In order to improve the accuracy and stability of the control valve and meet the needs of intelligent and networked control valve equipment, it is necessary to research on the intelligent valve positioner.
The research of valve positioner mainly involves communication and control. For communication in intelligent valve positioner, hardware circuits need to be designed to ensure signal integrity. Meanwhile, the control algorithm is the core of intelligent valve positioner. The friction between the packing and the valve stem cause non-linear characteristics such as dead zone, viscosity, and backlash during the control. It is reported that nearly one third of the low performance control loop is caused by the non-linear characteristics of the control valve.
Many researches have been conducted on the nonlinear control of pneumatic control valves. Zabir used the MIQP control algorithm to overcome the nonlinear problem in the control valve. Experiments show that this method is difficult to apply in practice due to the large amount of calculation [2]. Fang proposed a novel pneumatic control valve physical model, which does not ignore the backlash characteristics during the control process, but this article does not propose the solution to the valve backlash problem [3]. By designing and adjusting fuzzy rules, Zhang realized the self-tuning of controller parameters, which effectively improved the response speed of the regulating valve, overcome the delay effect, and improved the performance of the control system [4].
In order to solve the nonlinear control problems existed in the pneumatic control valve, a combined PID method is proposed in this paper to achieve real-time optimization of PID parameters, to overcome the shortcomings of traditional PID parameters that cannot be adjusted in real time, and to achieve nonlinear control. Besides, a hardware and software design scheme of intelligent valve positioner based on HART protocol to realize the multi-point communication network of intelligent valve positioner is also be introduced in this paper.

System structure
The intelligent valve positioner is a key component of pneumatic control valve, which is composed of main control board, electrical (I/P) converter, power supply module, I/P drive circuit module and valve position feedback module.
The nozzle baffle type I/P converter is used in this research, which is composed of a nozzle-baffle mechanism and a pneumatic amplifier. The I/P converter receives 4-20mA analog current to change the gap between nozzle and baffle, and controls the output air pressure to drive the pneumatic actuator valve. The pneumatic amplifier is similar to the power amplifier in the circuit, which is used to increase the gas output flow to speed up the movement of the actuator. The pneumatic diaphragm actuator is used in this research, which uses an elastic diaphragm to convert the input air pressure into the push rod thrust, and the valve core connected with the push rod produces corresponding displacement to change the valve opening degree. The schematic diagram of the valve control system is shown in Fig.1.

Main control board circuit
The main control board circuit is mainly composed of a microcontroller and its peripheral circuits, a HART modulation and demodulation circuit and a current loop circuit. The diagram of the main control board circuit is shown in Fig.2. The chip STM32F103C8T6 is used as the microcontroller in this paper, which meets the functional design requirements The main function of the HART modulation and demodulation circuit is to complete the mutual conversion between the digital signal and the HART signal, and realize the remote operation and status monitoring of the valve positioner. The dedicated chip AD5700 for HART signal modulation and demodulation is selected in this research. The chip integrates the filtering, detection, modulation, and demodulation functions required by the physical layer of the HART protocol, and performs digital communication with the microcontroller through the USART.
The main function of the current loop circuit is to couple the HART modulation signal to the 4-20mA analog signal to realize the remote transmission of the digital signal. Digital-to-analog conversion chip AD421 is selected in this research. This chip is fully compatible with the standard HART circuit, and is connected to the microcontroller via SPI communication, and converts the digital input into a 4-20mA analog signal. In the actual circuit design, the HART modulation signal is coupled into the AD421 through a 6.2nF capacitor, and then superimposed on the loop for transmission to realize HART signal transmission.

I/P drive circuit module
The main function of the I/P drive circuit module is to convert the duty ratio of the PWM signal into a 4-20mA current signal to change the gap between nozzle and baffle inside the I/P converter. The pneumatic actuator converts back pressure of the I/P converter into the movement of the valve stem to change the position of the valve stem and realize the control of the medium in the pipeline

Valve position feedback module
The contact-type valve position feedback method is adopted in the traditional valve positioner. The contact-type valve position feedback method requires a mechanical transmission mechanism, which is easily affected by factors such as vibration, wear, and transmission delay. To overcome this problem, this paper uses the hall sensor and constructs a uniform magnetic field to make the voltage output value of the hall sensor and the displacement value in the stroke of the valve stem have a linear relationship, so as to realize the non-contact valve position feedback.

HART multipoint communication design scheme
HART communication is mainly divided into two communication modes: "point-to-point" and "multipoint". In point-to-point mode, 4-20mA current is not only the carrier of HART digital signal, but also the main variable in the control process. However, in order to reduce electromagnetic interference, the current value is generally fixed at 4mA in multipoint mode. In this mode, HART communication becomes an all-digital communication method and the current is only used as the carrier of HART sine wave signal.
In order to realize the HART multi-point communication networking and reduce the current interference between the slaves, a relay (KV) module is added to the slave module, and the on-off of the relay is used to control whether each slave is connected to the bus. When the bus is idle, the relay is in the open state, and the slave waits for the master signal.
When a signal appears on the bus, each slave parses the HART message and determines whether it needs to respond according to the address segment. If a response is required, the microcontroller of slave controls the relay closure, and the target slave connects to the bus and sends a response message. The design scheme of multi-point communication is shown in Fig.3.

System software design
The software part of the intelligent valve positioner is mainly composed of the main system control program, the HART communication subprogram, and the valve position acquisition program.

Software function introduction
The system HART communication subroutine mainly generates the communication data that meets the requirements according to the requirements of the data link layer and the application layer in the HART communication protocol and modulates and demodulates the HART signal, so that the valve positioner and the host computer can realize two-way communication. The HART communication subroutine designed this time adopts the master-slave mode, that is, the slave will respond only when the master visits. When the HART master sends a signal, the slaves on the same network parse the HART message and send the digital signal to the microcontroller through the serial port. According to the address and data segments in the signal, the target valve positioner generates a corresponding response Frame, the CPU sends the response frame through the serial port in the interrupt mode, and sends it to the HART bus through HART host modulation and current loop module coupling, and the HART host receives and reads it to complete the master-slave data interaction.
The valve position acquisition program uses the 12-bit ADC inside the STM32F103 chip to perform analog-to-digital conversion, realizes direct data transfer between ADC and system memory in DMA mode, which improves the execution efficiency of the program. The main task of the system control main program is to read the valve position setting value sent by the host computer and the actual valve position value sampled by the valve position feedback module, and output the control signal according to the control algorithm after data processing.

Control method
The friction between the valve stem and the packing will cause nonlinear characteristics in the control system, and the valve stem is prone to vibration during the control process. In order to solve the nonlinear problem, the combined control method of fuzzy PID and traditional PID is proposed in this paper to improve controller performance.
Fuzzy PID is an intelligent control method based on conventional PID method, fuzzy set theory, fuzzy language variables and fuzzy logic inference. The input of the fuzzy controller is the difference E between valve position setting value and feedback value and its derivative value EC , and the output is the correction value of the PID parameter. In order to facilitate calculation and programming, the membership function is generally selected as a triangle, and NB and PB are adjusted to be Z-type function and S-type function respectively. The fuzzy control rule is shown in Table.1. A combined PID control algorithm is proposed in this paper, which combines the advantages of traditional PID method and fuzzy PID control method. The specific implementation process is as follows: (1) The pure proportional(P) control in traditional PID is conducted until the output reaches 80% of the setting value, and the time point is recorded as Tp. In this step, pure proportional control is used to improve the control response speed, so that the error is reduced as soon as possible; (2) In order to suppress the overshoot caused by pure proportional control, the system switches to pure differential(D) control, and the control curve has a peak value within 0~0.5Tp. The differential control in this step plays the role of "advance adjustment", which can reduce the amount of overshoot.
(3) After the peak value, the control mode is switched to fuzzy PID control. This step introduces fuzzy PID control to achieve real-time tuning of PID parameters to optimize the control process.

Control effect comparison
In order to prove the effectiveness of the combined PID algorithm in solving the problem of nonlinear control of pneumatic control valves, traditional PID algorithm, fuzzy PID algorithm and combined PID algorithm are respectively applied to the simulation experiment. . In order to describe the nonlinear characteristics of the system accurately, the backlash module is introduced in the simulation, and the gap value is 1.2. The simulation diagram of pneumatic control valve is shown in Figure.4. According to the simulation results, the combined PID algorithm can effectively solve the backlash problem in the control valve control process.

Conclusion
1) In terms of overshoot and adjustment time, the combined PID method proposed in this paper is better than other algorithms, which can be used in the control of pneumatic control valve.
2) The design scheme and control method described in the article have certain reference significance for the further development and design of intelligent valve positioner.
3) The simulation experiment of the control algorithm is carried out in this paper. The future work is to improve the combined PID method and apply it in actual industrial production.