Advanced Flowrate Control of Petroleum Products in Transportation: An Optimized Modified Model Reference PID Approach

— Efficient flowrate control is paramount for the seamless operation and reliability of petroleum transportation systems, where precise control of fluid movement ensures not only operational efficiency but also safety and cost-effectiveness. The main aim of this paper is to develop a highly effective modified model reference PID controller, tailored to ensure optimal flowrate control of petroleum products throughout their transportation. Initially, the petrol transportation process is analyzed to establish a suitable mathematical model based on vital factors like pipeline diameter, length, and pump attributes. However, using a basic first-order time delay model for petrol transportation systems is limiting due to inaccuracies, variable delay issues, safety oversights, and real-time control complexities. To improve this, the delay portion is approximated as a third-order transfer function to better reflect complex physical conditions. Subsequently, the PID controller is synthesized by modifying its structure to address flowrate control issues. These modifications primarily focus on the controller ’ s derivative component, involving the addition of a first-order filter and alterations to its structure. To optimize the proposed controller, the genetic, black hole, and zebra optimization techniques are employed, aiming to minimize an integral time absolute error cost function and ensure that the outlet flow of the controlled system closely follows the response of an appropriate reference model. They are chosen for their proficiency in complex optimization to enhance the controller's effectiveness by optimizing parameters within constraints, adapting to system dynamics, and ensuring optimal conditions. Through simulations, it is demonstrated that the proposed controller significantly enhances the stability and efficiency of the control system, while maintaining practical control signals. Moreover, the proposed modifications and intelligent tuning of the PID controller yield remarkable improvements compared to previous related work, resulting in a 𝟑𝟔% reduction in rise time, a 𝟔𝟑% reduction in settling time, an 𝟖𝟎% reduction in overshoot, and a 𝟗𝟖% reduction in cost value.


I. INTRODUCTION
Accurate and efficient control of flowrates is crucial in the transportation of petroleum products to ensure safe and smooth operations.PID controllers have been extensively utilized in this industry for regulating flowrate and other physical variables.However, the design of an optimal PID controller for a transportation lag system characterized by a first-order plus time delay can pose challenges [1]- [4].When designing a PID controller for a transportation lag system with a first order plus time delay, it is important to consider the specific characteristics and requirements of the system [5]- [7].The objective is to achieve accurate and stable control of the flowrate while minimizing overshoot, settling time, and steady-state error.Consequently, in pursuit of this objective, model reference control emerges as a favorable solution.This approach entails the creation of a welldesigned reference model with desired response characteristics and asymptotic stability.Simultaneously, a meticulously engineered PID controller is designed to facilitate the asymptotic tracking between the output of the closed-loop system and the reference model's output.This is accomplished by achieving optimal tuning for the controller gains, thereby ensuring effective tracking [8]- [12].The Ziegler-Nichols method is a frequently employed approach for adjusting the parameters of a PID controller by providing initial parameter values based on open-loop response data [13]- [15].However, the Ziegler-Nichols method may not result in optimal parameters for a transportation lag system due to its linear and time-invariant nature [15]- [19].To overcome these limitations, several studies have explored PID controller design methods for transportation lag systems with first order plus time delay [20] [21], such as the PID controller based on Ziegler-Nichols tuning, Internal Model Control tuning, and Shams Internal Model Control tuning [22], PID controller design based on the minimum error tunning rules [23] [24], enhanced fractional filter PID controller design [25], PID controller design based on fractional order tuning [26], directly synthesized parallel PID controller [27], active disturbance rejection PID controller [28], optimized PID controller based on linear programming [29], PI-PD controller design by considering both the maximum sensitivity principles and the Routh-Hurwitz stability criteria [30], particle swarm optimization-based PID controller [31], PID controller design based on disturbance observer [32], and filter-based PID with low-gain internal model control [33].However, these methods come with many limitations and challenges, such as suboptimal tuning, lack of robustness, and inadequate handling of system complexities.
The motivation from the previous studies has sparked significant interest and yielded a multitude of methodologies.However, despite these advancements, there remains a need for further investigation and comparison of alternative optimization algorithms to enhance the performance of PID controllers in the context of petroleum product transportation systems.By exploring genetic, black hole, and zebra algorithms, this study aims to bridge the existing gaps in the literature and provide a comprehensive comparative analysis, shedding light on the effectiveness and efficiency of these algorithms in achieving an optimized modified PID flowrate control.Such research is essential for refining control techniques and addressing the specific challenges faced by these systems, ultimately leading to improved operational stability, reliability, and cost-effectiveness.
The key contribution of this paper lies in synthesizing a powerful modified model reference PID flowrate control for petroleum product transportation system and using three distinct optimization algorithms, namely genetic, black hole, and zebra algorithms, for the purpose of optimizing the control algorithm design.In addition, the paper provides insights into the efficiency of the optimization techniques in achieving an optimized control strategy by mitigating suboptimal tuning issues, enhancing robustness, and improving the handling of intricate system complexities.Additionally, this paper addresses the specific challenges faced by such systems, which require precise and reliable flowrate control for viable stability and better performance.
The paper proceeds as follows: Section 2 introduces the mathematical modeling of the petrol transportation system, elucidating its intricacies.Section 3 delves into the proposed modified model reference PID controller design methodology, providing a comprehensive explanation of its intricacies.In Section 4, the simulation results and subsequent discussions regarding the practical application of the proposed controller to the petrol transportation system are presented, showcasing its performance.Finally, Section 5 concludes the paper by summarizing the pivotal findings and underscoring the real-world implications of the proposed controller.

II. MATERIALS AND METHODS
This section presents the methods and setups employed in this study.It begins by providing a detailed exposition of the mathematical modeling of the petrol transportation system.Subsequently, the comprehensive procedure for designing the controller to ensure efficient flowrate control tailored to the system's characteristics is elaborated.Moreover, the section offers an insightful overview of the optimization techniques utilized to refine the control algorithm's performance.

A. Petrol Transportation System Modeling
Transportation of petrol commonly occurs through pipelines due to its efficient and cost-effective nature.However, in some cases, directly assigning a flowrate sensor at the output of the petrol source can be challenging.This difficulty arises from several factors.Firstly, the flow of petrol within the pipeline is subject to various external influences, such as pressure variations, temperature changes, and frictional losses, which can lead to fluctuations in the flowrate.Secondly, the initial section of the pipeline may contain turbulent flow conditions, causing inconsistencies in the flow profile.These factors can affect the accuracy and reliability of the flowrate measurements.To mitigate these challenges, it is often preferred to install the flowrate sensor at a certain distance along the pipeline [34][35], as shown in Fig. 1.This allows for the establishment of a more stabilized flow profile, minimizing the impact of turbulent conditions and disturbances.By positioning the flowrate sensor further downstream, the measurements can provide a more representative and reliable indication of the actual flowrate, enhancing the overall monitoring and control of the petrol transportation process.The analysis of Fig. 1 reveals that the dynamics of the petrol flowrate control process can be accurately modeled using a transfer function known as First Order Plus Time Delay (FOPTD), this formula as shown in equation ( 1) [36]- [38].which is a mathematical representation commonly used to describe dynamic processes.It is characterized by three key parameters:  represents the system DC gain, which determines the amplification factor of the system's response to input;   denotes the process time constant, representing the rate at which the system approaches its steady-state value; and   represents the time delay due to transportation, accounting for the lag between input application and system response initiation.The presence of delays in the measurement process of the controlled system invariably diminishes its stability and the time it takes to achieve desired outcomes.The subsequent lemma aptly defines the system response when subjected to delayed measurements: Theorem 1: Assume that   () and   () stand for the system dynamical responses under the actual and delayed initial conditions, respectively.Then,   () is equivalent to   () with a backward time shift of   , i.e., as shown in equation ( 2) [39].
Yaseen Kh.Yaseen, Advanced Flowrate Control of Petroleum Products in Transportation: An Optimized Modified Model Reference PID Approach which proofs clearly the result of Theorem 1.
To define the process parameters, the model identification is conducted in [22] based on the worst-case scenario, where the model is defined with the highest process gain and the shortest time constant.The values extracted from experimental data are  = 0.8520,   = 6.153  and   = 1.347 .These parameters represent the simplified industrial setup of the process [22].The process model becomes shown in (5).
The transportation delay often poses challenges in control system design and implementation, as it can significantly affect system performance and stability.Padé approximation offers an effective approach to approximate the transportation delay using a rational function based on the following definition [41]- [44]: The irrational transfer function of the transportation delay  −   can be equivalently approximated as a rational function factorized into poles and zeros using Padé approximation based on the Taylor series expansion as (6) [45]- [47].
As a result, the definition above enables the equation ( 7) description of the process model.

B. Controller Design
This subsection introduces the controller design proposed in the study.Initially, the dynamical model of the system is simulated to evaluate its response and identify the key issues or challenges it exhibits.The open-loop unit step response of the system is illustrated in Fig. 2, revealing that the system is stable but falls short in terms of response properties and exhibits an existing error.Consequently, there is a need for controller design to enhance and reinforce the stability properties of the system while achieving improved response characteristics.The design methodology commences with the introduction of a suitable reference model, which serves to incorporate the desired performance measures into the closed-loop control system.The specific structure of the reference model can vary based on the distinct characteristics of the control problem and the system itself.In many cases, the step response of the regular second-order system is employed to be a reference model.The reference model possesses significant properties, including stability, and unity steady-state gain.It is important to note that the reference model is independent of the feedback design.The transfer function of the reference model can be expressed as (8) [48] [49].
Here,   represents the natural frequency of the reference model, and  denotes the damping factor.These parameters play a crucial role in managing and defining the desired response specifications.For this particular case, the values of the reference model are selected as   = 1 / and  = 0.9.Subsequently, the proposed control algorithm aims to adjust the system's inputs or parameters to minimize the error and guide the system's behavior towards convergence with the desired reference.A PID Controller is typically used to control systems on the basis of three variables (  ,   , and   ) according to the equation ( 9) [50] [51].
where () stands for the control signal, which is the current applied to the motor of the control valve.Besides, () is the error between the reference model and system outputs, i.e., () =   () −   ().However, the PID controller design outlined above often encounters limitations when applied to flowrate control in practical scenarios due to its disregard for noise and nonlinearity in flowrate sensors.Specifically, there are two issues associated with implementing the derivative term   ̇ in a PID controller for flowrate control.Firstly, the output of the reference model may exhibit sharp corners, especially when it takes the form of a square wave.Consequently, the value of   ( ̇ −  ̇ ) becomes large due to the amplified reference model output  ̇ , leading to the generation of excessively large control inputs to the plant.This can result in impractical or unwanted control actions.Secondly, flowrate sensors produce noise in the measurement of the output flowrate   .
Typically, this noise is characterized by high-frequency components, which in turn implies high derivatives of the noise.As a result, incorporating the derivative term in the PID controller can cause it to become large when  ̇ is large due to the presence of sensor noise.Therefore, the plant input may be excessively large, leading to undesirable control performance [50].To address the first issue, a suitable solution involves applying the derivative term as −   ̇ instead of   .This modification is beneficial in many applications where the reference model output   remains constant for extended periods, leading to  ̇ = 0.A practical approach to address the aforementioned second issue Yaseen Kh.Yaseen, Advanced Flowrate Control of Petroleum Products in Transportation: An Optimized Modified Model Reference PID Approach involves implementing a first-order filter on the derivative term and adjusting its pole position to effectively reduce noise by smoothing out rapid fluctuations over time, leading to a more stable response and improved control performance.By doing so, the occurrence of chattering caused by noise can be mitigated.This filter effectively attenuates high-frequency noise, resulting in its smoothing or reduction.Hence, the derivative term does not amplify the high-frequency noise, contributing to improved control performance and stability.As a result, the resultant modified PID controller, can be described as (10) [50].
Here,  represents the pole position of the filter of the derivative term within the PID controller.Now, the main challenge in controller design lies in the selection of suitable values for the controller parameters   ,   ,   , and , with the objective of accomplishing asymptotic tracking of the output flowrate with the reference flowrate.To tackle this, optimization techniques are employed as effective methods.These techniques utilize powerful search algorithms to identify the optimal values for the controller parameters while minimizing or maximizing a performance index or optimality criterion.This approach leads to the development of an optimal PID controller.In this study, the genetic, black hole, and zebra optimization techniques are utilized to address this controller design problem because these techniques collectively align with the intricacies of petroleum product transportation systems, making them suitable for optimizing PID control, where the genetic algorithm handles nonlinearities effectively, black hole algorithm explores local and global solutions, and zebra algorithm coordinates parameter adjustments in interconnected systems.

C. Optimization Algorithms
The genetic optimization technique, inspired by the principles of natural selection, utilizes a population-based search algorithm to iteratively improve the controller performance [52]- [54].Similarly, the black hole algorithm takes inspiration from the gravitational forces of black holes to explore the solution space and converge towards optimal parameter values [55]- [57].Additionally, the zebra optimization technique, inspired by the herd behavior of zebras, incorporates social interactions and competition among individuals to find the best controller parameter set [58] [59].By exploring the effectiveness of these techniques, it is aimed to identify the most suitable optimization approach for achieving enhanced control system performance.
The optimization setups of the genetic, black hole, and zebra algorithms are given in Table I, Table II and Table III, respectively.Through extensive testing, it has been demonstrated that the Integral Time Absolute Error (ITAE) is superior and reliable in attaining the desired control objectives consistently.It is chosen over other performance indices for its emphasis on fast and accurate responses while minimizing overshoot.This aligns with control objectives, ensuring rapid settling times and reduced oscillations [60] [61].In this cost function, the integral is computed over the interval from   to   which is represented in the equation (11).
(  ,   ,   , ) = ∫  |()|    =  (11) where   denotes the initial time and   represents the final time.Furthermore, the number of iterations in each technique is determined relying on whether a satisfactory solution is achieved or the maximum iteration threshold is conducted.As the optimization progresses, the best costs tend to converge and become identical, indicating the absence of further optimal solutions [48].The results of the optimization methods and the corresponding values of the controller optimized parameters are listed in Table IV.The table illustrates that the controller values are compelling and widely acknowledged for accurately predicting the outcomes of minor control current adjustments applied to the control valve motor.The genetic algorithm was applied for a total of 85 iterations, while the black hole optimization was applied for 100 iterations, and the zebra optimization techniques was applied for 50 iterations.It should be noted that the sensitivity of the chosen optimization techniques (genetic algorithms, black hole algorithms, and zebra algorithms) to variations in initial parameter values and convergence criteria could vary.Genetic algorithms are less sensitive due to their populationbased nature, while black hole algorithms might show some sensitivity related to initial configurations.Zebra algorithms, being cooperative, could be moderately sensitive to initial conditions affecting parameter coordination [52]- [59].This sensitivity depends on parameters, system characteristics, and implementation details.Furthermore, the convergence rates of the Yaseen Kh.Yaseen, Advanced Flowrate Control of Petroleum Products in Transportation: An Optimized Modified Model Reference PID Approach optimization cost function for the three methods are depicted in Fig. 3.This convergence rate indicates how swiftly an optimization algorithm reaches an optimal solution.Its importance lies in efficient resource utilization and reduced computation time.Also, Fig. 4 shows the complete block diagram of the proposed control scheme.In this section, the implementation of the proposed controller, defined in equation (10), to the petrol transportation model given in equation ( 5), is presented.The simulations are conducted using the MATLAB-SIMULINK, wherein a sequence of command step changes is applied.The command input is initiated at 500  and transitioned to 400  at  = 200 .Then,   = 330 , the command is returned to 500 , followed by a drop to 400  at  = 350 , and finally, a rise to 600  at  = 550 .Using this command input scheme, a simulation environment resembling real-world control systems is achieved, enabling a comprehensive rating of the proposed controller's performance.
In Fig. 5, the step responses of the control system are shown using the proposed PID controller, which was tuned using genetic, black hole, and zebra optimization methods.The responses, represented by the outlet flow trajectories, demonstrate the system's ability to track the command signal and reference model response.It is important to observe that the effects of the three methods on stability and performance are quite comparable, displaying only minor variations when dealing with significant command inputs.Step responses of the control system flowrate using genetic, black hole, and zebra optimization techniques However, when analyzing the responses, the gains derived from zebra optimization exhibit the swiftest reaction, characterized by a rapid rise time of 2.343  and a settling Yaseen Kh.Yaseen, Advanced Flowrate Control of Petroleum Products in Transportation: An Optimized Modified Model Reference PID Approach time of 4.173 .Following this, the control system's response stemming from black hole optimization gains emerges with a rise time of 2.371  and a settling time of 4.214 .In contrast, the response generated by genetic algorithm gains showcases rise and settling times of 2.389  and 4.24 , respectively.Shifting focus to overshoot, the most favorable outcome is attributed to the response achieved through genetic algorithm gains, exhibiting a minimal value of 3.72%.This is succeeded by the overshoot resulting from black hole optimization gains at 3.96%.Conversely, the greatest overshoot is observed in the response prompted by the gains attained from the zebra optimization method with a value of 4.48%.
Additionally, Fig. 6 and Fig. 7 display the performance of the system and the tracking error signals, respectively.It is worth highlighting that the actual system error signal and the tracking error signal resulting from the three methods exhibit a nearly uniform pattern, showing minor deviations when subjected to the same input.Furthermore, Fig. 8 exhibits the control signal (current) applied by the controller to the motor of the electric control valve for each of the three tuning algorithms, which have performed closely identical action.Lastly, the ramp response trajectories resulting from a unit ramp command are clearly illustrated in Fig. 9. (c) However, the optimization techniques could encounter difficulties such as demanding computation, responsiveness to parameter adjustments and initial conditions, the potential for converging to local optima, and reliance on stochastic behavior.Mitigating these challenges via meticulous parameter selection and sensitivity assessment can bolster the dependability of the optimized controller parameters.
(d) The applied control current remained within an acceptable and practical range, not exceeding 1.7 .The control current directly impacts system components, affecting their responses to achieve desired outcomes.Exceeding the acceptable range could lead to instability, component damage, and compromised performance, underscoring the significance of keeping it within bounds [39].
(e) The controlled system, with the proposed controller tuned using the three optimization methods, exhibited desirable (i) Ultimately, the limitations of the proposed work are twofold.Firstly, it centered on specific techniques and identifications.Besides, the investigation was short in fully assessing the robustness criterion.

IV. CONCLUSION
Effective control of flow rates plays a vital role in the smooth functioning and dependability of petroleum conveyance networks.Accurate control of fluid motion is essential, as it not only optimizes operational efficiency but also enhances safety measures and cost-efficiency in these systems.In this study, a modified model reference PID controller was developed for effective control of the petrol transportation system, with a focus on regulating the petrol flowrate.The paper addressed the challenges associated with using a PID controller for flowrate control by introducing modifications to the controller model structure.The controller parameters were then determined using three robust optimization algorithms: Genetic, Black Hole, and Zebra optimizations.The simulation results demonstrated the efficacy of the proposed controller in achieving desirable stability, performance, and control signal for monitoring and controlling the flowrate during transportation, utilizing the three optimization methods.The suggested alterations and intelligent fine-tuning of the PID controller led to impressive enhancements when juxtaposed with prior similar efforts.This translates to a noteworthy 36% decrease in rise time, a remarkable 63% decrease in settling time, a substantial 80% decrease in overshoot, and an extraordinary 98% reduction in the cost or fitness value.These findings highlight the practical utility of intelligent control in tuning controllers compared to traditional theoretical approaches.As a future direction, the optimization methods explored in this study can be extended to tune various controllers and filters in different applications.For example, in renewable energy, these methods could enhance solar tracking, wind turbine pitch, and energy storage control.They also have potential in industrial automation for optimizing robotic systems, manufacturing, and supply chains.The study limitations might be the focusing on specific techniques and metrics.In addition, robustness was not fully tested across conditions.Overall, the impact of this paper enhances efficiency across diverse applications.

Fig. 2 .
Fig. 2. Open-loop unit step response of the transportation system

Fig. 5 .
Fig. 5.Step responses of the control system flowrate using genetic, black hole, and zebra optimization techniques

TABLE I .
OPTIMIZATION SETUPS OF THE GENETIC OPTIMIZATION ALGORITHM

TABLE IV .
VALUES OF THE CONTROLLER PARAMETERS