Abstract
This study presents a comprehensive investigation into the optimization of PID control parameters for marine dual-fuel engines using an improved particle swarm algorithm. Through the development of a Matlab/Simulink simulation model, the thermodynamic behavior of the engine and the functionality of its control system are analyzed. The PID control parameters for air–fuel ratio control and mode switching control systems are fine-tuned utilizing the improved particle swarm algorithm (PSO). Simulation results demonstrate that the proposed improved PID-PSO approach outperforms traditional PID and traditional PSO-PID control methods in terms of reduced overshoot, minimized steady-state error, faster response times, and improved stability across various operating conditions and response modes. In comparison to traditional PID and PSO-PID controllers, the improved PSO-PID controller reduces the response time by 0.47 s and 0.21 s, the maximum overshoot by 98.43% and 96.05%, and decreases the absolute errors by 87.42% and 90.55%, respectively, in air–fuel ratio control using the step response method. The study's findings offer valuable insights into enhancing the performance and efficiency of marine dual-fuel engines through advanced control strategies.
Similar content being viewed by others
Introduction
With the increasing global concern for environmental protection and energy sustainability, the maritime industry is actively seeking more environmentally friendly and economical power solutions1, using clean energy to achieve decarbonization is also the theme of the times2,3,4 In this context, dual-fuel marine engines have attracted considerable attention due to their advantages in reducing emissions and improving fuel efficiency5. Dual-fuel engines can simultaneously utilize traditional liquid fuels and clean alternative fuels such as liquefied natural gas (LNG) to achieve more environmentally friendly and economical vessel operations6.
However, the control of marine dual-fuel engines faces a series of challenges, notably in air–fuel ratio control and mode switching7. Precise control of air–fuel ratio control is crucial to ensure stable combustion efficiency and emission performance across varying operating conditions8. Mode switching control involves seamless transitioning between liquid and gas fuels to meet diverse operating demands9. Although dual-fuel engines use both liquid fuel and clean energy sources like LNG, the significant differences in their characteristics, including ignition properties, energy density, and supply system requirements, necessitate intricate adjustment in the air–fuel ratio to ensure optimal combustion efficiency and performance stability across different fuel modes10. Furthermore, the dynamic nature of sea conditions and load variations during navigation introduces dynamic fluctuations in engine operating conditions, posing challenges in maintaining air–fuel ratio stability. Addressing these challenges requires real-time adjustments in fuel supply and ignition control to accommodate varying conditions effectively11. Transitioning between liquid fuel and LNG modes may occur complications such as unstable fuel supply or ignition delays, culminating in performance degradation and heightened emissions12.
Air–fuel ratio control and mode switching of dual-fuel engines involve multiple subsystems, including fuel supply systems, ignition systems, and control logic, necessitating sophisticated control algorithms and reliable hardware to ensure the coordinated operation and reliability of these subsystems13. To enhance engine performance, numerous studies have delved into engine control methodologies. PID controller is widely used because of its simple structure and good robustness14. Toriki et al.15 proposed an air–fuel ratio control system for dual-fuel engines employing PID control. Given that the parameters of the traditional PID controller are fixed, it is unable to make real-time adjustments for nonlinear factors, making it difficult to further improve the control performance. Nonlinear modification of control parameters in traditional PID controllers can reduce or even overcome the influence of these nonlinear factors16. Nonetheless, nonlinear PID controllers require tuning of more parameters, complicating the process. Furthermore, these methods are not globally convergent, making it difficult to ensure optimal control effects.
On this basis, more and more research has begun to turn towards the development of advanced control methods. These advanced methods aim to address the limitations of traditional PID controllers by enhancing their ability to handle nonlinear factors and improve overall control performance. Techniques such as adaptive control, fuzzy logic control, and machine learning-based optimization are being explored to provide more dynamic and precise adjustments in real-time. For instance, Najm et al.17 utilized a genetic algorithm (GA) to tune the parameters of a nonlinear PID controller in unmanned aerial vehicle systems. This approach leverages the GA’s ability to efficiently search for optimal solutions across complex, multi-dimensional spaces, thereby enhancing the performance of the PID controller in handling nonlinearities and dynamic changes in the system. However, the genetic algorithm requires a large number of samples for solution, incurs a high time cost, and may fall into local optimal solutions. Pathak et al.18,19 used an artificial gorilla force optimizer (GTO) to obtain controller parameters. The results show that the method has the advantages of small frequency deviation, short stability time and small integration error. Wang et al.20 explored the optimization of air–fuel ratio control in fuel engines through adaptive fuzzy PID. Despite these efforts, fuzzy PID control exhibits drawbacks such as low precision, diminished stability, susceptibility to disturbances, and protracted adjustment times. Shu et al.21 integrated PID control with the cuckoo search algorithm to manage mode switching in dual-fuel engines. Although the cuckoo search algorithm offers simplicity and ease of implementation with fewer parameters, it suffers from slow search speeds and relatively low precision. Particle swarm optimization (PSO) methods have emerged as a solution to address challenges associated with expert knowledge and control evaluation in describing PID controllers22. Researchers have applied PSO mathematical theory to optimize PID control parameters23, leading to stable control of engine air–fuel ratio and speed in simulation studies. However, traditional PSO algorithms are plagued by issues such as premature convergence and slow convergence speeds, hindering the achievement of high-precision control effects24. In addition, most existing improvements primarily focus on overshoot and response speed. However, dual-fuel engine systems demand high control accuracy and faster real-time control speeds. Therefore, a more efficient control strategy for controller optimization is essential to accelerate system response speed, suppress overshoot, and achieve high steady-state accuracy.
In addressing the nonlinearity and time-varying nature of large-scale marine dual-fuel engine systems with complex models, as well as the limitations of traditional PSO algorithms, cuckoo algorithm and GTO in tuning PID parameters, this paper proposes a PID controller optimization based on improved particle swarm optimization algorithm to optimize the control of air–fuel ratio and mode switching. The proposed method not only addresses the issues of premature convergence and local optimal search commonly encountered in traditional PSO algorithms but also mitigates the challenges of slow search speed and low accuracy associated with methods like the cuckoo algorithm and fuzzy algorithm. By dynamically adjusting the inertia weight based on similarity, the improved PSO algorithm can achieve a better balance between exploration and exploitation. To evaluate its effectiveness, the method is applied to a simulation of a dual-fuel engine model developed in the Matlab/Simulink environment. Comparative analysis is conducted with traditional PID control and standard PSO-PID control to assess the performance of the controllers in air–fuel ratio control and mode switching scenarios.
The main contributions of this paper is presented briefly as:
-
1.
Proposal and modeling of a sophisticated large-scale dual-fuel engine model based on the Matlab/Simulink environment.
-
2.
Introduction of an improved PSO algorithm to optimize the parameters of the traditional PID controller.
-
3.
Designing an effective similarity inertia weight function to ensure fast system response speed, low overshoot, and small steady-state errors.
-
4.
Air–fuel ratio and mode switching of the dual-fuel engine, solving issues of low optimization control precision, slow speed, and local optimal solutions.
-
5.
Insights for controling the dual-fuel engine for actual response modes in marine application.
Model of dual-fuel engine
Natural gas engines can be classified into two basic types based on the combustion method: single-fuel engines using spark plug ignition and dual-fuel engines that primarily use natural gas as the main fuel with high-reactivity fuels such as diesel as pilot fuel. The inclusion of pilot fuel in the latter addresses the challenge of ignition difficulty, especially under high fuel replacement rates, ensuring smoother and more reliable engine operation. In dual-fuel engines for vehicles, two main natural gas injection technologies are employed: intake manifold pre-mixed injection and in-cylinder direct injection. There are three popular types of dual-fuel engines for marine applications: two-stroke high-pressure injection, two-stroke low-pressure injection, and four-stroke intake manifold injection25. Figure 1 illustrates the main structure of the marine dual fuel engine. The model comprises key components such as the intake and exhaust modules, fuel supply module, cylinder module, supercharger module, and air cooler module for dual-fuel engines. Table 1 presents the main technical specifications of the MAN 8L51/60DF dual-fuel engine26.
Basic equation for thermodynamics
The operation of dual fuel engine involves a series of complex chemical combustion, physical transmission, gas/liquid flow and heat transfer processes, which can be simplified by the following equations.
Energy conservation equation:
where hj⋅dmj is the energy entering or exiting the system, kJ; Qi is the heat exchanged through the system, kJ; W is the work exerted on the piston by the expansion of the gas, kJ; hj is the enthalpy, kJ/kg; U is the internal energy of the system, kJ.
Conservation of mass equation:
where me is the outflow cylinder mass, kg; mB is the instantaneous fuel mass in the cylinder, kg; ms is the inflow cylinder mass, kg.
Ideal gas equation of state:
where p is the pressure, MPa; V is the volume, T is the temperature, K; R is the gas constant, kJ/(kg.K).
Cylinder mathematical model
The cylinder module stands out as the most intricate and pivotal component within the entire engine modeling framework. The modeling of cylinder module comprises three aspects: the cylinder working volume, combustion, and cylinder perimeter wall heat transfer. This module plays a crucial role in capturing and simulating the complex dynamics occurring within the engine cylinder27. The cylinder working volume and volume change rate can be presented as follows:
where Vs is cylinder working volume, L; λ is connecting rod to crank ratio; φ is crankshaft angle; S is fuel injection penetration; D is the diameter of the jet hole; ε is compression ratio.
In the context of non-predictive combustion models, the combustion rate is solely influenced by the crankshaft rotation angle, irrespective of whether the cylinder's operating conditions meet the combustion demand. Given the substantial impact of air–fuel ratio and fuel substitution rate on the combustion rate, coupled with the direct influence of injection parameter settings on the combustion process within the cylinder, the MAN 8L51/60DF dual-fuel engine employed in this study integrates the predictive combustion model DI-Pluse from Matlab/Simulink. This choice facilitates an exploration of the effects of these variables on power output, fuel consumption, and exhaust emissions in a dual-fuel engine. Distinct thermodynamic state parameters, compositions, and concentrations characterize the discrete thermodynamic partitions, and their independence from one another is a notable feature. The primary unburned zone, or first partition, comprises gases remaining in the cylinder after closure. The second and third partitions consist of the injected unburned zone-composed of inhaled fuel and gases-and the injected burned zone, representing combustion products. The mathematical model used to simulate this process is as follows.
Divided length:
where L is the length of the jet hole; vi is the jet velocity; ρl is the density of the injected fuel; and ρg is the density of the surrounding gas.
Angle of the spray cone:
Fuel injection penetration:
where tb is the oil beam splitting time; \(\Delta\)p is the jet pressure difference; D0 is initial diameter of spray hole.
Fire delay duration:
where a is the ignition delay factor; b is the pressure delay exponent; c is the empirical constant; d is the delayed activation temperature; Z is the ignition delay period; φ is the equivalence ratio.
Rates of combustion and volumetric absorption can be defined as:
where xj is the coordinate of the jth cell along the spray axis; Rj is the radius of the jth cell; vj is the velocity of the local jet; va, j is the velocity of the air; Cx is the empirical constant; SL is the laminar flame velocity.
Diffusion combustion models for computing volumetric absorption and burning rates:
where lI is the integrated length scale, Cu is 0.09, and Ce is the pre-combustion coefficient before the ignition point of each partition, k is insulation index.
Heat exchange occurs throughout the entire operation of the engine, such as between the external environment and the cylinder body, as well as between the cylinder body and the cylinder mixture. Heat losses are calculated through a heat transfer model, which transforms the complex heat transfer processes into a heat transfer coefficient model. The Woschni, Eichelberg, Annand, and Sitkei formulas can all be used to calculate the instantaneous heat transfer coefficient. In this paper, the Woschni heat transfer model is employed to calculate the heat transfer coefficient. This model is widely used in the field of internal combustion engine simulation modeling due to its simplicity and accuracy. The calculation formula is as follows28:
where Pz is the instantaneous cylinder pressure, MPa; Tz is the instantaneous cylinder temperature, K; P1, T1, V1 is the pressure, temperature, and volume at the starting point of compression; cm is the average piston velocity, m/s; c1 is the gas velocity coefficient; c2 is combustion chamber shape coefficient.
Intake and exhaust mathematical model
Due to the influence of exhaust gas pressure fluctuations on the efficiency of the turbocharger and the residual gas quantity in the cylinder, and the direct impact of intake manifold pressure fluctuations on the intake volume within the cylinder, it is necessary to perform detailed calculations of the gas flow in the dual fuel engine’s intake and exhaust pipes.
In the simulation and modeling calculations, it is common to simplify the three-dimensional non-isotropic flow simulation of the dual fuel engine's intake and exhaust processes into an unsteady one-dimensional flow. During the engine's operation, the relevant parameters of the intake and exhaust systems are constantly changing. The pipe diameter is much smaller than the pipe length, resulting in radial flow dominating the entire flow process. Therefore, the intake and exhaust processes are treated as one-dimensional, and the simulation calculation method adopts the one-dimensional finite volume method.
Firstly, it is necessary to establish the differential equations relating the state parameters such as velocity, temperature, and pressure of the pipe segment to the corresponding crankshaft rotation angle and axial direction. The solution of the continuity equation, energy equation, and momentum equation are crucial for the mathematical model of the intake and exhaust systems.
The continuous equation is presented as:
where min is the inlet mass flow rate, kg/s; m is the mass of the work fluid in the boundary, kg; ρ is the density of the fluid in the pipe, kg/m3. A is the corresponding cross-sectional area of the pipe, m2; u is the velocity of the control body boundary, m/s.
The energy equation is expressed:
where As is the heat transfer surface area of the inner wall of the tube, m2; p is the pressure, MPa; H is the total enthalpy corresponding to the fluid, J/kg; h is the heat transfer coefficient, W/(m2.K); Tfluid is the fluid temperature, K; Twall is the wall temperature of the tube wall, K.
Turbocharger mathematical model
In a waste gas turbocharged engine, the waste gas turbine converts the energy from the engine's exhaust gases into mechanical work through a turbine. This mechanical work is then transferred to the compressor, which compresses the air to increase the volume of air entering the engine and raise the intake pressure. Throughout this process, the turbine and compressor must achieve power balance, speed balance, and flow balance29.
The power balance is expressed as:
where WK is the work consumed by the compressor, kW; WT is the turbine work, kW; and ηTKm is the supercharger efficiency.
The rotational speeds of the compressor, turbine and supercharger are the same:
where nK is the speed of the compressor; nT is the speed of the turbine; and nTK the shaft speed of the supercharger.
The exhaust gas flow rate is the sum of the air and fuel flow rate:
where \(\dot{m}_{T}\) is the exhaust gas flow rate; \(\dot{m}_{K}\) is the air flow rate; and \(\dot{m}_{f}\) is the fuel mass flow rate.
The exhaust gas turbine plays a crucial role in powering the supercharger, and its model should encompass key features such as air flow, boost ratio, speed, and efficiency. The supercharger model, in turn, is characterized by two input parameters: air flow rate and supercharger speed, while the output parameters include temperature (To) and outlet pressure (Po).
The pressurization ratio and the turbine's rotor speed can be calculated using the principles of thermodynamics and Newton's laws. Specific flow rate and efficiency data for the compressor can be acquired by referring to relevant tables. Subsequently, the compressor's efficiency can be determined using the one-dimensional isentropic adiabatic flow theory. Finally, the outlet temperature (To) and outlet pressure (Po) can be calculated using the one-dimensional isentropic adiabatic compression process, with the arithmetic formula provided as follows.
where Pi is the atmospheric pressure, Pa; Te is the environmental temperature, K.
The pressurization ratio and isentropic efficiency of the compressor are contingent upon both the air flow rate and the rotational speed of the compressor. These functional dependencies can be expressed through a mathematical relationship:
The above functional relationships are typically determined based on characteristic curves of a specific model of a turbocharged gas engine. Due to the absence of characteristic curves for the turbocharger, a modeling approach is adopted using the characteristic curves of a diesel engine. Specifically, the pressurization ratio and efficiency of the turbocharger are formulated as a one-dimensional table that varies with the load of the dual-fuel engine, represented using the one-dimensional lookup table module in Simulink. The modeling process of the turbocharger involves the utilization of additional structural or performance parameters, with specific numerical values as detailed in Table 2.
Intercooler model
The intercooler serves to cool the fresh air entering the cylinder, thereby improving the turbocharging efficiency of the engine. The input parameters for the intercooler model include the air temperature, air pressure, and air mass flow rate at the outlet of the turbocharger. As air flows through the intercooler, there is a pressure loss and temperature decrease. By introducing the intercooler effectiveness coefficient (i.e., the temperature at the outlet of the intercooler), the outlet temperature of the intercooler is calculated using a simplified method. By introducing the intercooler effectiveness coefficient (β) and combining it with experimental data, the outlet temperature of the intercooler is calculated using a simplified method, with β set to 0.88, resulting in the intercooler outlet temperature.
where Tw is cooling water inlet temperature, K; β is cooling coefficient is generally taken as 0.7–0.9.
Intercooler pressure loss Ps is defined as:
where qm is actual flow rate of the intercooler, kg/s; Ps0 is pressure loss of the intercooler at design operating conditions, Pa; qm0 is intercooler design flow rate, kg/s.
Then the air pressure at the outlet is:
The values of the intercooler parameters are shown in Table 3.
Cylinder intake model
The cylinder charging coefficient is a parameter that quantifies the amount of fresh air remaining in the cylinder at the end of the intake stroke relative to the volume of the intake manifold. Research results indicate that there is a functional relationship between the cylinder charging coefficient and the engine speed. Therefore, this article uses the least squares method to fit the engine speed and boost coefficient data to obtain the boost coefficient curve:
where a0, a1, a2 are the fitted constants.
Since the model established is an average model for studying air–fuel ratio control methods, it overlooks the residual exhaust gases in the cylinder after each engine cycle. According to the ideal gas equation, the intake air flow can be calculated as:
Fuel sub-model
For the MAN 8L51/60DF LNG/diesel dual-fuel engine, a fuel sub-model is established based on the propulsion characteristics. Under propulsion characteristics, the relationship between power and speed is given by:
where P is engine power, kW; F is scale factor.
The corresponding values of propulsion characteristic speed and load are shown in Table 4.
To accurately establish the fuel supply sub-model for marine liquefied natural gas/diesel dual-fuel engines, it is necessary to explore the fuel injection quantity under propulsion characteristics30. In dual-fuel engines, both diesel and natural gas are introduced into the engine cylinder for combustion. The calculation necessitates the incorporation of the substitution ratio, which denotes the reduction in the amount of diesel consumed by the engine in dual-fuel operating mode compared to the consumption in pure diesel operating mode31. This ratio is expressed as a percentage of the diesel consumption in pure diesel operating mode32.
where Tm is diesel replacement rate, %; B is diesel consumption in diesel-only mode, kg/h; Bo is diesel consumption in dual-fuel mode, kg/h.
The natural gas entering the cylinder precisely substitutes the reduced diesel fuel in the combustion process, and the substitution rate equals the doping rate. The calculation of the substitution rate is as follows33. Under specific operating conditions and at a specific substitution rate, the cylinder injection volume per cycle and the natural gas injection volume are determined based on theoretical considerations.
where Bl is natural gas consumption in dual fuel mode, g/cycle; Hul is low calorific value of natural gas, MJ/kg; Huo is low calorific value of diesel, MJ/kg.
Based on the propulsion characteristics, the circulating injection volume and natural gas injection volume are calculated under various working conditions and different fuel substitution rates, following the aforementioned calculation process. Some of the calculation results are presented in Table 5.
Emissions calculation
The calculation of NOX and HC emissions is as follows:
where NOXW represents the wet volume concentration of nitrogen oxides in parts per million (ppm), HCW denotes the wet volume concentration of hydrocarbons in parts per million (ppm), MNOX signifies the mass flow rate of nitrogen oxides in grams per kilowatt-hour (g/kWh), and MHC denotes the mass flow rate of hydrocarbons in grams per kilowatt-hour (g/kWh). The detailed calculation and derivation of these parameters can be found in literature34. Table 6 provides information on the main components of the fuel along with their respective proportions.
PID control based on improved particle swarm algorithm
PID controller principle
The PID controller, being a second-order linear controller, is influenced by its proportional, integral, and differential parameters, allowing for direct modification of its control impact by adjusting these parameters35. The most commonly used PID controllers operate based on the following principles36:
Expressed by transfer function as:
where Kp is the proportional gain; Ki is the integral gain; Kd is the differential gain. e(h) is the control error; Ti is integral time constant; Td is differential time constant.
e(h) is as follows:
Expression for the discretization of the derivative and integral terms in Eq. (40) is given by:
where Tu is time.
The integral absolute value of error (IAE) is used to calculate the error:
Standard particle swarm algorithm
To optimize the performance of the entire control system and achieve the ideal value for the controller's objectives, coordinate the parameters accordingly. Apply a particle swarm algorithm (PSO) to optimize these three parameters, seeking the most appropriate values within the specified range37.
Standard particle swarm algorithm is a mature swarm intelligence algorithm inspired by foraging scenarios observed in bird flocks and bee colonies38. It treats individual organisms as particles, searching in a D-dimensional space, iteratively seeking the optimal solution39. The algorithm evaluates results based on fitness and ultimately searches for the global optimum based on the best solution found during the current search40. Throughout the iteration process, a particle's motion consists of velocity and position, where the particle's velocity is determined by inertia, self-cognition, and social experience41. The optimization equations for the particle swarm are expressed in Eqs. (45) and (46).
where j indicates the particle's jth dimension; i stands for particle i; t indicates the number of iterations; c3, c4 is the acceleration factor; r1 and r2 are mutually independent stochastic functions (with values between 0 and 1); w is the inertia weight parameter (with values between 0 and 2). Among them, the initial velocity and position of particles are randomly generated, and then iterated continuously according to the formula.
The velocity update of a particle consists of three parts in above equation: the first part, known as the inertia factor, reflects the influence of the particle's current velocity on its direction and speed, playing a role in both local search and balancing global exploration capability; the second part represents the particle's self-awareness, allowing it to explore various points within the search space based on its own memory; and the third part involves interactions among particles, thereby enables the PSO population to collaboratively search for the optimal solution. This highlights the particle swarm optimization algorithm's strong global search capabilities.
Improved particle swarm algorithm
When standard particle swarm algorithm operates for a certain period, particles lose diversity among themselves and tend to hover around local optima. This susceptibility to converging to local optima can lead to stagnation in the overall iteration of the population. The particles cease exploring other regions, ultimately hindering the discovery of the global optimum42.
To tackle the inherent characteristics of PSO, two primary directions for algorithm improvement are identified. One approach involves enhancing algorithmic parameters, with a particular focus on the inertia weight parameter (w). The value of w plays a crucial role in balancing global and local searches. Some researchers have suggested modifications to the inertia weight parameter43. In this context, particles engage in global exploration during the initial stages and transition to local refinement post-convergence to attain precise values. The second direction revolves around augmenting the diversity of the population. By integrating genetic algorithms and introducing velocity mutation, position mutation, and other techniques, the diversity of particles can be increased, thereby enhancing global search capability44. These proposed solutions effectively address the challenges associated with global search difficulty. However, it remains crucial to strike a balance between global exploration and convergence speed for optimal algorithmic performance.
Moreover, Research in particle swarm optimization suggests that the optimal particle (pg), which is identified based on the performance of the particle swarm in the search space, is typically located near the global optimum. This optimal particle may vary during each iteration of the algorithm. Equation (45) reveals that the velocity update formula simplifies to only the first term. When the inertia weight is excessively large, the current pg may overshoot its neighborhood, potentially missing the true global optimum. Therefore, an effective search strategy involves particles closer to pg having smaller velocities, facilitating a fine-grained search within the neighborhood of the optimal particle.
This study introduces a similarity-based approach to dynamically adjust the inertia weight during iterations, relying on the similarity between each particle and the optimal particle. This ensures that each particle possesses a different w value at each iteration. As PSO iterations progress, particles gradually converge toward the optimal point, resulting in increased similarity among particles and a higher likelihood of falling into local optima. The similarity between two particles i and j is defined as follows:
s (i, j) = 0 when d (i, j) → ∞; 0 ≤ s (i, j) ≤ 1 for any particle.
The following equation is defined to calculate the similarity of i and j:
where d (i, j) is expressed in terms of their Euclidean distance, and dmax and dmin are determined based on the search region of the particle.
From the iterative equation, it's evident that as the optimization process nears the optimal point, the impact of w on the flight velocity becomes more pronounced. To enable a fine-grained search within the vicinity of the optimal solution, particles near the optimum should be assigned smaller w values. This implies that particles bearing higher similarity to the current optimal particle should be assigned smaller w values.
The formula for calculating of w is as follows:
The particle's w decreases both linearly with the number of iterations and as the particle's resemblance to the ideal particle rises, as indicated by Eqs. (48) and (49). This algorithm is beneficial for global search because it initiates the iteration with a large weight value that progressively decreases toward the end, demonstrating good convergence ability. Moreover, the inertia weights of different particles vary; those close to the optimal particle (pg) have reduced inertia weights. This implies that particles near pg focus more on fine search than global search, increasing the probability of discovering the true global optimal solution.
Figure 2 illustrates the structure of the improved PSO-PID control system. The fundamental concept behind PSO-PID parameter optimization involves creating a model for optimizing PID controller parameters using an improved particle swarm algorithm. In this model, the three parameters of PID (proportional, integral, and differential) are amalgamated as particles within the particle swarm. During the optimization process, each particle iteratively adjusts its speed and position based on its individual experiences and collective group experiences, gradually converging towards the optimal objective and ultimately achieving the desired outcome. The flowchart of the improved PSO-PID control system is presented in Fig. 3.
Results and discussion
Dual-fuel engine model validation
The simulation model of the dual-fuel engine is constructed using Matlab/Simulink, incorporating the mathematical relationships described above as shown in Fig. 4.
Figures 5 and 6 present a comparison of the main parameters in the diesel mode and gas mode of the dual-fuel engine between simulation and experiment. Notably, key performance indicators reflecting the engine's performance exhibit a close fit between simulation and experiment, the maximum error was 2.51% for the diesel mode and 2.83% for the gas mode, with an error of less than 3%. This suggests that the established dual-fuel engine model is precisely calibrated.
Steady-state and dynamic characteristics of dual-fuel engine
The air–fuel ratio in a dual-fuel engine significantly impacts its overall performance. Based on the theoretical calculations discussed earlier, the target air–fuel ratio for the liquefied natural gas/diesel dual-fuel engine studied in this paper needs to be configured according to different operating conditions. Under low-load conditions, where the compressor intake is limited, and combustion is insufficient, the air–fuel ratio is kept small but not less than 15. This helps reduce the engine's equivalent fuel consumption rate and emissions of pollutants such as NOX and HC. In the middle load region, the optimal air–fuel ratio falls between 15 and 16, contributing to better overall engine performance, in the high-load condition, the air–fuel ratio should not be a larger value, but it should not be less than 16. Figure 7 illustrates the comparison between the target air–fuel ratio and the theoretical air–fuel ratio for the four operating conditions.
Figures 8 and 9 illustrate the variations in NOX and HC under different loads and fuel substitution rates. Notably, a decrease in the fuel substitution rate correlates with a continuous rise in the specific emissions of NOX. This trend is primarily attributed to the reduced natural gas injection quantity, causing an overall decrease in the specific heat capacity of the cylinder due to the larger specific heat capacity of natural gas. Additionally, a higher proportion of diesel in the mixture with natural gas/air expands the ignition area of diesel, promoting complete combustion and elevating the combustion temperature within the cylinder, thus facilitating NOX formation. Furthermore, the reduction in natural gas injection increases the fresh air volume entering the cylinder, expanding the oxygen-rich area and favoring NOX synthesis.
Conversely, at higher fuel substitution rates, where diesel/natural gas/air premixed combustion occurs within the cylinder, the high equivalence ratio of natural gas and a smaller diesel injection mass result in a lower release of heat during the diesel diffusion combustion stage. Consequently, the cylinder temperature does not rise rapidly, leading to a reduction in nitrogen oxide emissions.
However, reducing the fuel substitution rate significantly decreases HC emissions. This is because a larger quantity of natural gas enters the cylinder, increasing the concentration area of gases within the cylinder, worsening the combustion conditions and causing incomplete combustion. Simultaneously, the low temperature and pressure within the cylinder result in poor diesel atomization, uneven mixing of diesel/natural gas/air, and suppression of complete combustion of natural gas. When the injection volume of natural gas decreases, the equivalence ratio of natural gas decreases. The temperature and pressure within the cylinder continually rise, and the increased diesel injection mass raises the heat release, promoting the complete combustion of natural gas and leading to a decrease in HC emissions.
According to the engine operation manual, dual-fuel engines possess the capability to transiently switch from diesel mode to gas mode when the engine load is below 80%, ensuring the safe operation of the engine. Moreover, they can seamlessly switch from gas mode to diesel mode under any load condition. This study specifically focuses on the transition from diesel mode to gas mode at an 80% load. Figure 10 illustrates the transient process of the engine performance parameters' response curve. As can be seen, in the transition from diesel mode to gas mode, the entire fuel conversion process is completed within 2 min. Throughout this transition, the air–fuel ratio and fuel consumption exhibit minimal deviation from the desired values. However, the engine's power and speed display more noticeable fluctuations. The power fluctuates within the range of 5000–8000 kW, while the speed fluctuates in the range of 445–455 rpm. Despite these fluctuations, the developed control system described in this paper proves effective in realizing the control of engine operating conditions.
Comparison of control performance
Control performance under different response patterns
The control performance of air–fuel ratios under various response patterns is depicted in Fig. 11 for traditional PID control, PSO-PID control, and improved PSO-PID control. These patterns include step response, which simulates a sudden change in load; continuous change to node change response, which simulates a gradual and continuous increase or decrease in engine load; and periodic change response, which mimics the periodic load changes experienced by a marine dual-fuel engine on a fixed route. In the improved PSO algorithm, parameters c3 and c4 are set to 1.495. The maximum inertia weight is 1.5, and the minimum inertia weight is 0.4. The number of iteration steps is 60.
The response control simulation is conducted under the scenarios include 25% load with 10% fuel substitution, 50% load with 30% fuel substitution, 75% load with 50% fuel substitution, and 100% load with 70% fuel substitution. As can be seen, the improved PSO-PID control exhibits superior performance in terms of convergence speed and stability compared to traditional PID and PSO-PID across various response modes, ensuring the system's responsiveness. Notably, it excels in controlling step and nodal variations in the air–fuel ratio, displaying greater accuracy and stability in smooth cyclic variations compared to traditional PID and PSO-PID controls. Using the step response of air–fuel ratio as an illustration, the improved PSO-PID controller exhibits notable improvements over both the traditional PID and PSO-PID controllers. Specifically, compared to the traditional PID controller, the improved PSO-PID controller reduces the response time by 0.47 s and the maximum overshoot by 98.43%, while decreasing the absolute errors by 87.42%. Similarly, compared to the PSO-PID controller, the improved PSO-PID controller reduces the response time by 0.21 s, the maximum overshoot by 96.05%, and the absolute errors by 90.55%. Table 7 shows the comparison of PID setting parameters and performance indicators under different control methods and response modes.
Figures 12 and 13 provide a comprehensive view of the impact of traditional PID control, PSO-PID control, and improved PSO-PID control on NOX and HC emissions across various operational conditions and response modes. Notably, traditional PID control exhibits a larger overshoot and requires a longer time to stabilize, as seen in both NOX and HC emissions. Conversely, the improved PSO-PID control demonstrates superior tracking performance, showcasing its effectiveness in promptly and accurately responding to dynamic changes in operating conditions. For example, considering the step response of NOX emissions, compared to the traditional PID and PSO-PID controllers, the improved PSO-PID reduces the response time by 1.15 s and 0.83 s, respectively. Moreover, the maximum overshoot decreases by 98.91% and 97.68%, while the absolute errors reduce by 89.31% and 91.75%, respectively.
Figure 14 presents a comparison of the effects of natural gas and diesel injection volumes under various operating situations. Notably, improved PSO-PID control demonstrates significant enhancements in reducing overshoot and improving stability compared to traditional PID control and PSO-PID control. Particularly depicted in Fig. 14a, compared to the traditional PID and PSO-PID methods, the improved PSO-PID control demonstrates a significant reduction in maximum overshoot by 97.21% and 95.79%, respectively. Additionally, it achieves a shortened response time of 0.68 s and 0.22 s, respectively. Furthermore, the absolute errors were reduced by 90.02% and 89.39%, respectively.
Control performance under mode switching
In addition to load changes, mode switching is also a common operation for dual-fuel engines, which can achieve different emissions, different power requirements. Table 8 shows the comparison of set parameters and performance indexes of the air–fuel ratio under different controls during the mode switching of the dual fuel engine. The stability and response time of the mode switching have an important effect on the operation of the system. Figure 15 provides a comparative analysis of control effects during the engine's transition from diesel mode to gas mode at an 80% load. The illustration clearly indicates that, while the three control methods exhibit similar effects on engine speed control, the improved PSO-PID control method surpasses both PID and PSO-PID controls in terms of air–fuel ratio and specific fuel consumption control, showcasing a superior control effect. Taking air–fuel ratio control as an example, the improved PSO-PID control method demonstrates superior performance compared to traditional PID and PSO-PID methods. The response time is reduced by 5.95 s and 5.17 s, respectively; the maximum overshoot is decreased by 96.36% and 95.29%, respectively; and the absolute errors are reduced by 88.22% and 90.09%, respectively.
Conclusion
A comprehensive thermodynamic model and functional model of a large marine dual-fuel engine were developed in the Matlab/Simulink environment. An improved particle swarm optimization (PSO) algorithm was applied to this simulation model to evaluate its control effectiveness and compared with traditional PID and PSO-PID control methods. Through the analysis of the results, the following conclusions are drawn:
-
1.
The developed model was validated against experimental data, and the results showed good agreement, with an average deviation of less than 3%. The simulations demonstrated that the model can accurately predict fuel consumption, power output, and pollutant emissions.
-
2.
Dual-fuel engines possess the capability to transiently switch from diesel mode to gas mode, completing the entire fuel conversion process within 2 min when the engine load is below 80%. They can also seamlessly switch from gas mode to diesel mode under any load condition.
-
3.
Three different response modes are used to simplify the specific working conditions of dual fuel engine. The improved PSO-PID controller reduces the response time by 0.47 s and 0.21 s, the maximum overshoot by 98.43% and 96.05%, and decreases the absolute errors by 87.42% and 90.55%, respectively, in air–fuel ratio control using the step response method compared with traditional PID and PSO-PID controllers.
-
4.
In the context of mode switching, the improved PSO-PID control demonstrates significantly enhanced performance compared to traditional PID and PSO-PID control methods. Specifically, the response time in air–fuel ratio control is reduced by 5.95 s and 5.17 s, respectively. Additionally, the maximum overshoot is decreased by 96.36% and 95.29%, respectively, and the absolute errors are reduced by 88.22% and 90.09%, respectively.
Data availability
The authors would like to confirm that all data generated or analysed during this study are included in this published article.
References
Banaei, M. et al. Energy management of hybrid diesel/battery ships in multidisciplinary emission policy areas. Energies 13(16), 4719 (2020).
Pathak, P. K. & Yadav, A. K. Fuzzy assisted optimal tilt control approach for LFC of renewable dominated micro-grid: A step towards grid decarbonization. Sustain. Energy Technol. Assess. 60, 103551 (2023).
Mingolla, S. et al. Effects of emissions caps on the costs and feasibility of low-carbon hydrogen in the European ammonia industry. Nat. Commun. 15(1), 3753 (2024).
Agajie, E. F. et al. Optimization of off-grid hybrid renewable energy systems for cost-effective and reliable power supply in Gaita Selassie Ethiopia. Sci. Rep. 14(1), 10929 (2024).
Theotokatos, G. et al. Simulation-based investigation of a marine dual-fuel engine. J. Mar. Eng. Technol. 19(1), 5–16 (2020).
Abedin, M. et al. An overview on comparative engine performance and emission characteristics of different techniques involved in diesel engine as dual-fuel engine operation. Renew. Sustain. Energy Rev. 60, 306–316 (2016).
Khandal, S. V. et al. Influences of hydrogen addition from different dual-fuel modes on engine behaviors. Energy Sci. Eng. 10(3), 881–891 (2022).
Lee, T. et al. Supplementary control of air-fuel ratio using dynamic matrix control for thermal power plant emission. Energies 13(1), 226 (2020).
Ren, S. et al. Application of dual-fuel combustion over the full operating map in a heavy-duty multi-cylinder engine with reduced compression ratio and diesel oxidation catalyst. Energy Convers. Manage. 166, 1–12 (2018).
Guardiola, C. et al. Closed-loop control of a dual-fuel engine working with different combustion modes using in-cylinder pressure feedback. Int. J. Engine Res. 21(3), 484–496 (2019).
Galloni, E. et al. Performance estimation of a downsized si engine running with hydrogen. Energies 15(13), 4744 (2022).
Ramasamy, D. et al. Engine performance, exhaust emission and combustion analysis of a 4-stroke spark ignited engine using dual fuel injection. Fuel 207, 719–728 (2017).
Guardiola, C. et al. Safe operation of dual-fuel engines using constrained stochastic control. Int. J. Engine Res. 23(2), 285–299 (2021).
Lei, Z. & Zhou, Y. A kind of nonlinear PID controller for Refrigeration Systems based on Vapour Compression. IFAC-PapersOnLine 51(4), 716–721 (2018).
Toriki, M. B., Widjiantoro, B. L. & Abdurrakhman, A. Design of output power control system based on mass flow rate comparison of air and fuel ratio (AFR) on dual fuel generator set by using pid control method. IOP Conf. Series Mater. Sci. Eng. 588(1), 012002 (2019).
Lim, D., Rasmussen, B. P. & Swaroop, D. Selecting PID control gains for nonlinear HVAC&R systems. HVAC&R Res. 15(6), 991–1019 (2009).
Najm, A. A. & Ibraheem, I. K. Nonlinear PID controller design for a 6-DOF UAV quadrotor system. Eng. Sci. Technol. Int. J. 22(4), 1087–1097 (2019).
Ramesh, M., Yadav, A. K. & Pathak, P. K. Artificial gorilla troops optimizer for frequency regulation of wind contributed microgrid system. J. Comput. Nonlinear Dynamics 18(1), 011005 (2023).
Sah S V, Prakash V, Pathak P K, et al. Fractional order AGC design for power systems via artificial gorilla troops optimizer. in 2022 IEEE International Conference on Power Electronics, Drives and Energy Systems (PEDES). 2022. IEEE.
Wang, Y. et al. Optimization of air–fuel ratio control of fuel-powered UAV engine using adaptive fuzzy-PID. J. Franklin Inst. 355(17), 8554–8575 (2018).
Shu, Z. et al. Modeling and optimization of fuel-mode switching and control systems for marine dual-fuel engine. J. Mar. Sci. Eng. 10(12), 2004 (2022).
Jansri, A. & Sooraksa, P. Enhanced model and fuzzy strategy of air to fuel ratio control for spark ignition engines. Comput. Math. Appl. 64(5), 922–933 (2012).
Karuppannan, A. & Muthusamy, M. Wavelet neural learning-based type-2 fuzzy PID controller for speed regulation in BLDC motor. Neural Comput. Appl. 33(20), 13481–13503 (2021).
Xu, G. & Yu, G. On convergence analysis of particle swarm optimization algorithm. J. Comput. Appl. Math. 333, 65–73 (2018).
Stoumpos, S. et al. Marine dual fuel engine modelling and parametric investigation of engine settings effect on performance-emissions trade-offs. Ocean Eng. 157, 376–386 (2018).
Zou, F.-K. et al. Implementation and parameter analysis of the knock phenomenon of a marine dual-fuel engine based on a two-zone combustion model. Processes 9(4), 602 (2021).
Miao, H. & Milton, B. Numerical simulation of the gas/diesel dual-fuel engine in-cylinder combustion process. Numer. Heat Transfer Part A Appl. 47(6), 523–547 (2005).
Broekaert, S. et al. Evaluation of empirical heat transfer models for HCCI combustion in a CFR engine. Appl. Energy 205, 1141–1150 (2017).
Zhang, X. et al. Impact of pilot diesel injection timing on performance and emission characteristics of marine natural gas/diesel dual-fuel engine. Sci. Rep. 14(1), 10713 (2024).
Arsie, I. et al. Air-fuel ratio estimation along diesel engine transient operation using in-cylinder pressure. Energy Procedia 101, 670–676 (2016).
Lauber, J., Guerra, T. M. & Dambrine, M. Air-fuel ratio control in a gasoline engine. Int. J. Syst. Sci. 42(2), 277–286 (2010).
Kumar, M. & Shen, T. Estimation and feedback control of air-fuel ratio for gasoline engines. Control Theory Technol. 13(2), 151–159 (2015).
Yang, J., Shen, T. & Jiao, X. Air-fuel ratio control with stochastic L 2 disturbance attenuation in gasoline engines. J. Control Theory Appl. 11(4), 586–591 (2013).
Junwu, G., Leyang, G. & Maqsood, A. Study on the simplification calculation model of marine diesel engine exhaust flow based on air-fuel ratio. Math. Problems Eng. 2022, 1–12 (2022).
Chao, C.-T. et al. An optimal fuzzy PID controller design based on conventional PID control and nonlinear factors. Appl. Sci. 9(6), 1224 (2019).
Al-Dhaifallah, M. Fuzzy fractional-order PID control for heat exchanger. Alexandria Eng. J. 63, 11–16 (2023).
Li, H. et al. Improved adaptive holonic particle swarm optimization. Math. Problems Eng. 2019, 1–22 (2019).
Qian, W. & Li, M. Convergence analysis of standard particle swarm optimization algorithm and its improvement. Soft Comput. 22(12), 4047–4070 (2017).
Xiang, Z. et al. A simple PID-based strategy for particle swarm optimization algorithm. Inform. Sci. 502, 558–574 (2019).
Yang, X. et al. Wireless sensor network congestion control based on standard particle swarm optimization and single neuron PID. Sensors 18(4), 1265 (2018).
Freire, H., Moura Oliveira, P. B. & Solteiro Pires, E. J. From single to many-objective PID controller design using particle swarm optimization. Int. J. Control Autom. Syst. 15(2), 918–932 (2017).
Wu, X.-c et al. Using improved particle swarm optimization to tune PID controllers in cooperative collision avoidance systems. Front. Inform. Technol. Electron. Eng. 18(9), 1385–1395 (2017).
Zhang, H. & Yuan, X. An improved particle swarm algorithm to optimize PID neural network for pressure control strategy of managed pressure drilling. Neural Comput. Appl. 32(6), 1581–1592 (2019).
Yang, D., Lu, H. & Zhang, C. Electronic differential control system based on particle swarm optimization and PID control. J. Phys. Conf. Series 2216(1), 012051 (2022).
Acknowledgements
This work was supported by the National Natural Science Foundation of China (Grant No. 52276010).
Author information
Authors and Affiliations
Contributions
Zhuo Hu : Conceptualization, data curation, formal analysis and draft writing. Weihao Guo: Data collection and investigation. Kege Zhou: Engine modeling. Lei Wang: Software, Validation, Visualization. Fu Wang: Methodology and editing. Jinliang Yuan: Writing-review & editing.
Corresponding author
Ethics declarations
Competing interests
The authors declare no competing interests.
Additional information
Publisher's note
Springer Nature remains neutral with regard to jurisdictional claims in published maps and institutional affiliations.
Rights and permissions
Open Access This article is licensed under a Creative Commons Attribution 4.0 International License, which permits use, sharing, adaptation, distribution and reproduction in any medium or format, as long as you give appropriate credit to the original author(s) and the source, provide a link to the Creative Commons licence, and indicate if changes were made. The images or other third party material in this article are included in the article's Creative Commons licence, unless indicated otherwise in a credit line to the material. If material is not included in the article's Creative Commons licence and your intended use is not permitted by statutory regulation or exceeds the permitted use, you will need to obtain permission directly from the copyright holder. To view a copy of this licence, visit http://creativecommons.org/licenses/by/4.0/.
About this article
Cite this article
Hu, Z., Guo, W., Zhou, K. et al. Optimization of PID control parameters for marine dual-fuel engine using improved particle swarm algorithm. Sci Rep 14, 12681 (2024). https://doi.org/10.1038/s41598-024-63253-y
Received:
Accepted:
Published:
Version of record:
DOI: https://doi.org/10.1038/s41598-024-63253-y
Keywords
This article is cited by
-
Genetic algorithm type 2 fuzzy logic controller of microgrid system with a fractional-order technique
Scientific Reports (2025)
-
Soft sensing modeling of penicillin fermentation process based on local selection ensemble learning
Scientific Reports (2024)

















