**4. Control strategies**

Controller PI actuating in the oil output valve in the oil industry is the traditional method used to control the liquid level in production separators. If the controller is tuned to maintain a constant liquid level, the inflow variations will be transmitted to the separator output, in this case, causing instability in the downstream equipments. An ideal liquid level controller will let the level to vary in a permitted range (i.e., band) in order to make the outlet flow more smooth; this response specification cannot be reached by PI controller conventional for slug flow regime. Nunes [9] defined a denominated level control methodology by bands, which promotes level oscillations within certain limits, i.e, the level can vary between the maximum and the minimum of a band, as Figure 9, so that the output flowrate is close to the average value of the input flowrate. This strategy does not use flow measurements and can be applied to any production separator.

In the band control when the level is within the band, it is used the moving average of the control action of a slow PI controller, because reducing the capacity of performance of the controller gives a greater fluctuation in the liquid level within the separator. The moving average is calculated in a time interval, this interval should be greater than the period T of

**Figure 9.** Band control diagram of *Nunes*.

10 Will-be-set-by-IN-TECH

5 10 15 mLSout [kg/s]

> 0.3 0.4 0.5 0.6

49 49.5 50 50.5 51 51.5 52 52.5

pressure [bar]

mGSout [kg/s]

**Figure 7.** Input liquid (up-left) and gas (down-left) mass flowrate in the separator and output liquid

(up-right) and gas (below-right) mass flowrate in the separator with *z* = 50% (slug flow).

**Figure 8.** Liquid level (left) and gas pressure (right) in the separator with *z* = 50% (slug flow).

Controller PI actuating in the oil output valve in the oil industry is the traditional method used to control the liquid level in production separators. If the controller is tuned to maintain a constant liquid level, the inflow variations will be transmitted to the separator output, in this case, causing instability in the downstream equipments. An ideal liquid level controller will let the level to vary in a permitted range (i.e., band) in order to make the outlet flow more smooth; this response specification cannot be reached by PI controller conventional for slug flow regime. Nunes [9] defined a denominated level control methodology by bands, which promotes level oscillations within certain limits, i.e, the level can vary between the maximum and the minimum of a band, as Figure 9, so that the output flowrate is close to the average value of the input flowrate. This strategy does not use flow measurements and can be applied

In the band control when the level is within the band, it is used the moving average of the control action of a slow PI controller, because reducing the capacity of performance of the controller gives a greater fluctuation in the liquid level within the separator. The moving average is calculated in a time interval, this interval should be greater than the period T of

<sup>0</sup> <sup>50</sup> <sup>100</sup> <sup>150</sup> <sup>200</sup> <sup>250</sup> <sup>300</sup> <sup>350</sup> <sup>0</sup>

<sup>0</sup> <sup>50</sup> <sup>100</sup> <sup>150</sup> <sup>200</sup> <sup>250</sup> <sup>300</sup> <sup>350</sup> 0.2

<sup>0</sup> <sup>50</sup> <sup>100</sup> <sup>150</sup> <sup>200</sup> <sup>250</sup> <sup>300</sup> <sup>350</sup> 48.5

time [min]

time [min]

<sup>0</sup> <sup>50</sup> <sup>100</sup> <sup>150</sup> <sup>200</sup> <sup>250</sup> <sup>300</sup> <sup>350</sup> <sup>0</sup>

<sup>0</sup> <sup>50</sup> <sup>100</sup> <sup>150</sup> <sup>200</sup> <sup>250</sup> <sup>300</sup> <sup>350</sup> <sup>0</sup>

<sup>0</sup> <sup>50</sup> <sup>100</sup> <sup>150</sup> <sup>200</sup> <sup>250</sup> <sup>300</sup> <sup>350</sup> 0.55

time [min]

time [min]

5 10 15 mLout [kg/s]

> 0.5 1 1.5 2 2.5

> 0.6

**4. Control strategies**

to any production separator.

0.65

level [m]

0.7

0.75

0.8

mGout [kg/s]

the slug flow. When the band limits are exceeded, the control action in moving average of the slow PI controller is switched to the PI controller of the fast action for a time, whose objective is return to the liquid level for within the band, if so, the action of the control again will be the moving average. To avoid abrupt changes in action control for switching between modes of operation within the band and outside the band, it is suggested to use the average between the actions of PI controller of the fast action and in moving average.

Therefore, this paper performs the application in the Sausen's model of the level control strategy PI considering 3 (three) methodologies: (1) level control strategy PI conventional, the level shall remain fixed at setpoint; (2) level control strategy PI in the methodology by bands; (3) error-squared level control strategy PI in the methodology by bands.

The error-squared controller [14] is a continuous nonlinear function whose gain increases with the error. Its gain is computed as

$$k\_c(t) = k\_1 + k\_{2NL} |e(t)|$$

where *k*<sup>1</sup> is a linear part, *k*2*NL* is a nonlinear one and *e*(*t*) is the tracking error. If *k*2*NL* = 0 the controller is linear, but with *k*2*NL >* 0 the function becomes squared-law.

In literature the error-squared controller is suggested to be used in liquid level control in production separators under load inflow variations. From the application of the error-squared controller, in liquid level control process in vessels, it is observed that small deviations from the setpoint resulted in very little change to the valve leaving the output flow almost unchanged. On the other hand large deviations are opposed by much stronger control action due to the larger error and the law of the error-squared, thereby preventing the level from rising too high in the vessel. The error-squared controller has the benefit of resulting in more steady downstream flow rate under normal operation with improved response when compared to the level control strategy conventional [12].

For implementation of the controllers it is used the algorithm control PI [1] in speed form, whose equation is given by

$$
\Delta\mu(t) = k\_c \Delta\varepsilon(t) + k\_c \frac{1}{T\_i} T\_a \varepsilon(t) \tag{13}
$$

where Δ*u*(*t*)is the variation of the control action; *kc* is the gain controller; Δ*e*(*t*) is the variation of the tracking error; *Ta* is the sampling period of the controller; *e*(*t*) is the tracking error. It is considered that the valve dynamics, i.e., the time for its opening reach the value of the control action is short, so this implies that the valve opening is the control action itself.

#### **5. Simulation and analysis results of the control strategies**

This section presents the simulation results of the control strategies using the computational tool Matlab. To implement the control by bands it is used a separator with length 4.5 m and diameter 1.5*m* following the standards used by [9]. The setpoint for the controller is 0.75*m*n(i.e., separator half), the band is 0.2*m*, where the liquid level maximum permitted is 0.95*m* and the minimum is 0.55*m*. The bands were defined to follow the works of [3, 9]

Initially, for the first simulation, it is considered the *Z* valve opening at the top of the riser in *z* = 20% (slug flow). To simulate the level control strategy PI conventional the values used for the controller gain *kc* and the integral time *Ti* are 10 and 1380*s* respectively, according to the heuristic method to tune level controllers proposed by Campus et al. (2006). In level control strategy PI in the methodology by bands the level can float freely within the band limits in separator. In this case, the controller PI with slow acting (i.e., within the band) uses controller gain *kc* = 0.001 and integral time *Ti* = 100000*s*, and the PI controller with fast acting (i.e., out the band) uses *kc* = 0.15 and *Ti* = 1000*s*. In error-squared control strategy PI in the methodology by bands, the gain linear and nonlinear of the controller are computed to following the methodology present in [11] based on Lyapunov stability theory. In this case, the error-squared level PI controller with slow acting (i.e., within the band) uses *kc* = 0.001, *k*2*NL* = 0.000004 and *Ti* = 100000*s*, and the PI controller with fast acting (i.e., out the band) uses *kc* = 0.15, *k*2*NL* = 0.03 and *Ti* = 1000*s*. The period for calculating the moving average of the PI controllers by band was *Ti* = 1000*s*.

Figure 10 (a) presents the liquid level variations *N*(*t*) considering level controller strategy PI conventional (dashed line) and level control strategy PI in the methodology by bands (solid line) in the separator, and the Figure 10 (b) presents liquid level variations *N*(*t*) considering level control strategy PI conventional (dashed line) and error-squared level control strategy PI in methodology by bands (solid line). Figures 11 (a) and (b) shown the liquid output flow rate variations *mLS*,*out*(*t*) of the separator that corresponding to controls of the presented in Figures 10 (a) and (b).

**Figure 10.** Liquid level variations *N*(*t*), (a) level control strategy PI conventional (dashed line) and level control strategy PI by band (solid line), (b) level control strategy PI conventional (dashed line) and error-squared level control strategy PI by band (solid line), *z* = 20%.

12 Will-be-set-by-IN-TECH

This section presents the simulation results of the control strategies using the computational tool Matlab. To implement the control by bands it is used a separator with length 4.5 m and diameter 1.5*m* following the standards used by [9]. The setpoint for the controller is 0.75*m*n(i.e., separator half), the band is 0.2*m*, where the liquid level maximum permitted is 0.95*m* and the minimum is 0.55*m*. The bands were defined to follow the works of [3, 9]

Initially, for the first simulation, it is considered the *Z* valve opening at the top of the riser in *z* = 20% (slug flow). To simulate the level control strategy PI conventional the values used for the controller gain *kc* and the integral time *Ti* are 10 and 1380*s* respectively, according to the heuristic method to tune level controllers proposed by Campus et al. (2006). In level control strategy PI in the methodology by bands the level can float freely within the band limits in separator. In this case, the controller PI with slow acting (i.e., within the band) uses controller gain *kc* = 0.001 and integral time *Ti* = 100000*s*, and the PI controller with fast acting (i.e., out the band) uses *kc* = 0.15 and *Ti* = 1000*s*. In error-squared control strategy PI in the methodology by bands, the gain linear and nonlinear of the controller are computed to following the methodology present in [11] based on Lyapunov stability theory. In this case, the error-squared level PI controller with slow acting (i.e., within the band) uses *kc* = 0.001, *k*2*NL* = 0.000004 and *Ti* = 100000*s*, and the PI controller with fast acting (i.e., out the band) uses *kc* = 0.15, *k*2*NL* = 0.03 and *Ti* = 1000*s*. The period for calculating the moving average of

Figure 10 (a) presents the liquid level variations *N*(*t*) considering level controller strategy PI conventional (dashed line) and level control strategy PI in the methodology by bands (solid line) in the separator, and the Figure 10 (b) presents liquid level variations *N*(*t*) considering level control strategy PI conventional (dashed line) and error-squared level control strategy PI in methodology by bands (solid line). Figures 11 (a) and (b) shown the liquid output flow rate variations *mLS*,*out*(*t*) of the separator that corresponding to controls of the presented in

> 0.6 0.7 0.8 0.9 1 1.1 1.2

**Figure 10.** Liquid level variations *N*(*t*), (a) level control strategy PI conventional (dashed line) and level control strategy PI by band (solid line), (b) level control strategy PI conventional (dashed line) and

level [m]

<sup>0</sup> <sup>50</sup> <sup>100</sup> <sup>150</sup> <sup>200</sup> <sup>250</sup> <sup>300</sup> <sup>350</sup> <sup>400</sup> 0.5

Setpoint.

time [min] − (b)

PI conventional level controller. Error−squared PI level controller by band.

**5. Simulation and analysis results of the control strategies**

the PI controllers by band was *Ti* = 1000*s*.

<sup>0</sup> <sup>50</sup> <sup>100</sup> <sup>150</sup> <sup>200</sup> <sup>250</sup> <sup>300</sup> <sup>350</sup> <sup>400</sup> 0.4

Setpoint.

PI conventional level controller. PI level controller by bands.

time [min] − (a)

error-squared level control strategy PI by band (solid line), *z* = 20%.

Figures 10 (a) and (b).

0.5 0.6 0.7 0.8 0.9 1 1.1 1.2

level [m]

**Figure 11.** Liquid output flow rate variations *mLS*,*out*(*t*), (a) level control strategy PI conventional (dashed line) and level control strategy PI by band (solid line), (b) level control strategy PI conventional (dashed line) and error-squared level control strategy PI by band (solid line), *z* = 20%.

The following are presented simulation results for valve opening at the top of the riser, i.e., *z* = 20%, *z* = 25%, *z* = 30% and *z* = 35% (slug flow). Figure 12 (a) presents the liquid level variations *N*(*t*) considering level control strategy PI conventional (dashed line) and level control strategy PI in the methodology by bands (solid line) in separator, and the Figure 9 (b) presents liquid level variations *N*(*t*) considering level control strategy PI conventional (dashed line) and error-squared level control strategy PI in the methodology by bands (solid line). Figures 10 (a) and (b) shown the liquid output flow rate variations of the separator that corresponding to controls of the level presented in Figure 9 (a) and (b).

**Figure 12.** Liquid level variations *N*(*t*), (a) level control strategy PI conventional (dashed line) and level control strategy PI by band (solid line), (b) level control strategy PI conventional (dashed line) and error-squared level control strategy PI by band (solid line), *z* = 20%.

Comparing the simulation results between the level control strategy PI and error-squared level control strategy PI both in the methodology by bands, it is observed that the second controller (Figures 10 and 12 (b)) has respected strongly the defined bands, i.e., in 0.95*m* (higher band) and in 0.55*m* (lower band), because it has the more hard control action than the first controller (Figure 10 and 12 (a)). However, when the liquid level reached the band limits for the error-squared level control strategy PI, at this time, the liquid output flow rate has a little more oscillatory flows than the ones found for the level controller PI by bands, but

**Figure 13.** Liquid output flow rate variations *mLS*,*out*(*t*), (a) level control strategy PI conventional (dashed line) and level control strategy PI by band (solid line), (b) level control strategy PI conventional (dashed line) and error-squared level control strategy PI by band (solid line), *z* = 20%.

this difference is minimal, according to Figures 11 (a) and (b), Figures 13 (a) and (b). For both controllers simulation results of the liquid output flow rate are better than the results obtained with the level control strategy PI conventional. Considering the liquid output flow rate when the level is within the band, both processes (i.e., level control strategy PI and error-squared level control strategy PI both in the methodology by band) have similar trends.
