# The Cascade Control of Natural Gas Pipeline Systems
## 3 Case Studies of the Cascade Control of Natural Gas Pipelines  
A natural gas pipeline with a total length of 169 km has only the initial station and the terminal station. The initial station has a speed regulating compressor that is adjusted by the outlet pressure. The terminal station has a regulating valve that is adjusted by the outlet pressure. To acquire the exact behavior of the pipeline, the Stoner Pipeline Simulator (SPS) software is used to simulate the pipeline. SPS is a powerful commercial software package and capable of analyzing and predicting the hydraulic performance of both liquid and gas pipeline systems accurately. SPS has the ability to simulate the operating characteristics of almost all configurations of pipelines and equipments as they are subjected to various control strategies and operating scenarios. The simulation model in SPS is shown in Figure 3. The PID parameters of the local controllers are listed in Table 1. The initial working condition is a steady state that the pressure and flow rate along the pipeline are shown in Figure 4. Two step downs of the flow rate means that there are two distribution points along the pipeline. When there is a disturbance of the flow rate at the distribution station, the compressor in the initial station is able to adjust itself accordingly. In systems with only local PID controllers, the pressure and flow rate at each station are set and adjusted manually by the dispatchers. It means that the systems is not fully automatically controlled but scheduled by human beings. The dispatchers have to watch the working conditions of the pipelines and perform the regulating operations all the time in reality. The pressure along the pipeline is chosen as the main variable to be controlled. The pressure at the compressor outlet is taken as the secondary variable. The terminal control valve keeps the outlet pressure of the control valve at a constant value 5 MPa. In design of the cascade control system, \(Q\) is a diagonal matrix and its larger elements means the importance of the corresponding state variables. \(R\) is also a diagonal matrix and its larger elements means the importance of the corresponding control variables. \(Q\) and \(R\) could be set as different values under different transient process requirement. In this case, matrices \(Q\) and \(R\) are set as the identity matrix, where the performance index \(J\) is to balance the transient time and control energy cost. The optimal control model is solved by steps given in Section 2 and the feedback matrix \(\mathbf{K}\) is obtained as follows:  
\[\mathbf{K}=[0.0691\quad-0.0563\quad 0.6656\quad 0.0559\quad-0.5525\quad 0.9497 \quad-0.6233]. \tag{13}\] \begin{table}
\begin{tabular}{c c c c c} \hline \hline
**Station** & **Controller Type** & **Proportional Gain K\({}_{\mathbf{c}}\)** & **Integral Time \(T_{l}/min\)** & **Differential Time \(T_{D}/min\)** \\ \hline First station & Pressure Controller & 1.12 & 0.2 & 0 \\ terminal station & Pressure Controller & 0.5 & 0.2 & 0 \\ \hline \hline \end{tabular}
\end{table} 
Table 1: Parameters of PID controller. Figure 4: Steady state diagram. Figure 3: Stoner Pipeline Simulator (SPS) model of the pipeline. The set points of the compressor PID controller are not given by dispatchers manually, but calculated by Equation (14) via the SCADA system. \[u=-\mathbf{K}y. \tag{14}\]  
To verify the effectiveness of the algorithm and to eliminate the contingency, six initial states were simulated. The outlet pressure of the compressors and the terminal flow rate were considered as the disturbance of the system. With the cascade control, the outlet pressure of the control valve was stabilized. The relative error of the final outlet pressure of the compressor was less than 5%. The results are given in Table 2. These results show that the cascade control could keep end users with stable pressure whenever there was a disturbance at different points of the system.