Research on Speed Optimization and Adjusting Strategy of Variable Speed Diesel Generator Base on Sliding Interval

: A marine variable speed generator can dynamically adjust the set speed of a diesel engine according to the actual power load level by the grading method, so the goal of energy conservation is achieved. However, the grading method relies on engineering experience. The actual range of power load ﬂuctuation is uncertain, which leads to a decrease in fuel efﬁciency. Therefore, a method based on load sliding interval is put forward. In this method, a ﬁxed width load interval is set at ﬁrst, and then the interval slides on the diesel engine load at a step of 1%. The minimum fuel consumption rate speed for the interval is optimized during the sliding process. Finally, a minimum fuel consumption rate speed curve corresponding to the sliding interval position is obtained. The optimization objective is to have the minimum weighted average fuel consumption rate at the integer load points within each interval. The actual power load is monitored and used to determine the current load interval during the calculation of the set speed. The minimum fuel consumption rate speed curve optimized was applied to query the setting value of the diesel speed. The mean value engine model was applied for simulation under three load conditions. The results show that the sliding interval method could achieve the best fuel saving effect under any power load; the set value of the diesel engine speed changed smoothly under the ﬂuctuating power load conditions, and the fuel saving ability was better according to the actual power load conditions on the ship.


Introduction
Compared with a constant speed diesel generator, the set speed of the marine variable speed diesel generator can be adjusted according to the variations in the power load. Therefore, a diesel engine can always work in a state of high efficiency and low fuel consumption when it runs under partial load, so the objective of energy conservation and emission reduction can be achieved [1]. The load of a fixed speed generator is generally not less than 50% rated power. However, a variable speed diesel generator can operate at lower speeds and provide power that is much less than the 50% rated power [2]. Due to the excellent energy-saving effect of the application of a variable speed diesel generator in the DC power grid, it is increasingly widely used in the field of marine industry [3].
A variable speed diesel generator can cause voltage response lag when there is a large range of changes in the electrical load and diesel speed. Lee et al. [4] used supercapacitors and four-leg inverters to improve the voltage response speed. Lidozzi et al. [5] used adaptive direct-tuning control to improve the response of the DC-link voltage during largescale changes in grid load and diesel speed. Miloud et al. [6] studied the control mode and method of the DC-link voltage in a doubly fed motor with battery energy storage system, which improved the response speed. Zhou et al. [7] demonstrated good performance in the investigate the actual load and determine the load stepping interval based on experience, then select the most efficient speed within the corresponding interval as the minimum fuel consumption rate speed corresponding to the grade interval [7][8][9]. While the load changes within a certain interval, the speed remains unchanged; when the load changes beyond the interval, the corresponding speed of the new load interval is used. To avoid the system oscillation caused by the small fluctuations in load close to the boundary value, it is necessary to set hysteresis loops at the boundary of the graded interval to improve the steady performance.
The method of setting the graded speed can reduce fuel consumption and maintain relative stability of the system. Due to the uncertainty of the position of the actual power load in each grading interval and the uneven distribution of the variation in intervals, the method cannot fully utilize the fuel saving performance of a variable speed diesel generator. When the basic power load fluctuates near the boundary point of the interval, the fuel saving effect will be reduced, and it may still cause frequent changes in the set speed. Meanwhile, due to the fact that the method needs to be analyzed based on the actual load conditions to determine the load intervals, it is not conducive to promotion and application.
To further enhance the fuel saving performance of a variable speed diesel generator, this article adopted the sliding window concept, which is widely used in signal processing and other fields, introduced a load sliding interval with a certain width, and proposed an optimization objective function for the minimum fuel consumption rate speed according to the sliding interval. During the sliding process from the minimum load to the maximum load, the grey wolf algorithm was used to solve the minimum fuel consumption rate speed within the range of the sliding interval. In the speed setting stage, a sliding interval was used to calculate the speed, and there was no need to preset grading intervals. The algorithm can select the optimal speed within the entire available load range based on the interval that the actual power load is in. Only when the power load change exceeds the boundary of the sliding interval will the set speed of the diesel engine be adjusted. In this way, the best fuel saving effect under any power load is achieved. Finally, the simulation research was conducted based on the mean value engine model and the effectiveness of the sliding interval method was verified.

Single Point Load Speed Optimization
When the diesel unit operates below the rated load, reducing the speed can improve the efficiency and save fuel. The specific value of the speed needs to be calculated by optimization algorithms. For single point loads, the optimization objective function can be described by Equation (1).
s.t. n e ≤ n max n e ≥ n min n e ≥ g(L) , where BSFC is the diesel fuel consumption rate (g/kWh); f (n e , L) is a function of the fuel consumption rate, which is a function of diesel engine speed and load; n e is the speed of the diesel engine (r/min); L is the load of the diesel engine, which corresponds to the actual power load, expressed as a percentage of the rated power of the diesel engine; n max is the maximum speed of the diesel engine; n min is the minimum speed of the diesel engine; g(L) is the limit function between the speed and load, which corresponds to a load and the diesel engine has a minimum speed limit. Each type of diesel engine has its own limiting characteristics, and the speed limit cannot be exceeded during the optimization process. Due to the complex structure of diesel engines, it is difficult to express f (n e , L) with simple functional relationships, which are greatly influenced by factors such as fuel, control system parameters, etc. This article used neural network fitting to obtain the relationship among fuel consumption rate, speed, and load based on the experimental data of relevant diesel engines. The input layer of the neural network consisted of two nodes representing the diesel engine speed and load; the hidden layer consisted of 12 nodes; the output layer consisted of one node representing the fuel consumption rate of the diesel engine. During the optimization process, the optimization algorithm calls the trained neural network to calculate the fuel consumption rate at the corresponding speed and load.

Load Sliding Interval
The actual power load has the characteristic of random fluctuations. Using the single point load optimization results to continuously adjust the diesel engine speed can cause the diesel engine speed to be adjusted too frequently, reducing the operation stability of the unit. When using a graded interval to set the speed, the method cannot fully utilize the fuel saving performance of the variable speed generator sets due to the uncertainty of the actual power load position and variation in each graded interval. When the basic power load fluctuates near the interval boundary point, it may also cause frequent changes in the speed setting. To avoid the above problems, this article adopted a load sliding interval to optimize and set the minimum fuel consumption rate speed of the diesel engine.
A load sliding interval with a certain width is preset at first, which moves within the entire available load range at a 1% load step, as shown in Figure 1. In the diagram, ∆ represents the size of the sliding interval, L min represents the minimum load, and L max represents the maximum load. For marine diesel engines, L min would be 10-15% and L max would be 105-110%. During the movement of the sliding interval, the speed is optimized corresponding to the minimum fuel consumption rate speed within the load range of the sliding interval. The sliding interval moves according to the 1% load, so an optimal speed corresponding to the load interval will be obtained each 1% load step, which constructs a continuously changing optimal speed. The optimal speed corresponds to a load range rather than a load point, which can improve the stability of the system and avoid the issue of energy efficiency reduction caused by grading. engine has its own limiting characteristics, and the speed limit cannot be exceeded during the optimization process.
Due to the complex structure of diesel engines, it is difficult to express ( , ) e f n L with simple functional relationships, which are greatly influenced by factors such as fuel, control system parameters, etc. This article used neural network fitting to obtain the relationship among fuel consumption rate, speed, and load based on the experimental data of relevant diesel engines. The input layer of the neural network consisted of two nodes representing the diesel engine speed and load; the hidden layer consisted of 12 nodes; the output layer consisted of one node representing the fuel consumption rate of the diesel engine. During the optimization process, the optimization algorithm calls the trained neural network to calculate the fuel consumption rate at the corresponding speed and load.

Load Sliding Interval
The actual power load has the characteristic of random fluctuations. Using the single point load optimization results to continuously adjust the diesel engine speed can cause the diesel engine speed to be adjusted too frequently, reducing the operation stability of the unit. When using a graded interval to set the speed, the method cannot fully utilize the fuel saving performance of the variable speed generator sets due to the uncertainty of the actual power load position and variation in each graded interval. When the basic power load fluctuates near the interval boundary point, it may also cause frequent changes in the speed setting. To avoid the above problems, this article adopted a load sliding interval to optimize and set the minimum fuel consumption rate speed of the diesel engine.
A load sliding interval with a certain width is preset at first, which moves within the entire available load range at a 1% load step, as shown in Figure 1. In the diagram, Δ represents the size of the sliding interval, Lmin represents the minimum load, and Lmax represents the maximum load. For marine diesel engines, Lmin would be 10-15% and Lmax would be 105-110%. During the movement of the sliding interval, the speed is optimized corresponding to the minimum fuel consumption rate speed within the load range of the sliding interval. The sliding interval moves according to the 1% load, so an optimal speed corresponding to the load interval will be obtained each 1% load step, which constructs a continuously changing optimal speed. The optimal speed corresponds to a load range rather than a load point, which can improve the stability of the system and avoid the issue of energy efficiency reduction caused by grading.

Optimization of the Minimum Fuel Consumption Rate Speed Based on Sliding Interval
The optimization objective function given in Equation (1) is designed for single point loads. In the sliding interval method, the speed is not adjusted when the load changes within a certain range. Therefore, the minimum fuel consumption rate speed corresponds

Optimization of the Minimum Fuel Consumption Rate Speed Based on Sliding Interval
The optimization objective function given in Equation (1) is designed for single point loads. In the sliding interval method, the speed is not adjusted when the load changes within a certain range. Therefore, the minimum fuel consumption rate speed corresponds to a load range, and its optimization equation should also be designed for a specific range.
Within the entire load range, the sliding interval increases by 1% load. Use the midpoint value of the load interval to represent the interval. For example, while the sliding interval width is 5 (%), the corresponding load interval for interval 17 is [15,20), and interval 18 represents the load interval [16,21). The minimum fuel consumption rate speed in the sliding interval can be described by Equation (2).
n e ≤ n max n e ≥ n min n e ≥ g(L i+n u ) , where BSFC i is the average fuel consumption rate of a diesel engine within the sliding interval i; L j is each integer load value within the interval; g(L i+n u ) represents the limitation of the speed by the upper limit of the load interval; r j is the proportion of each integer load of this power in the i interval, where n l is the number of integer loads less than the midpoint value of the load interval; n u is the number of integer loads greater than the midpoint value of the load interval, where ∆ is the width of the sliding interval, which is the number of integer loads contained in the sliding interval; [·] represents the integer operation. Equation (2) actually calculates the minimum fuel consumption rate speed corresponding to a certain load interval by the weighted average based on the proportion of each integer load to the total load within the entire interval. Equation (3) calculates the proportion of each integer load in the current load interval with the denominator being the sum of all integer loads in the interval and the numerator being the integer load value. For example, in the load (%) interval of [15,20), the integer load values (%) contained in this interval are 15, 16, 17, 18, and 19, and the sum of all integer load values is 85. Therefore, the proportion of each integer load in the entire load interval can be calculated as 0.1765, 0.1882, 0.2000, 0.2118, and 0.2235. Therefore, the optimal speed is obtained by the weighted average of the load, reflecting the decisive role of the load in obtaining the minimum fuel consumption rate speed.
When the given load is less than or equal to the minimum load, the minimum load value is used. For example, if the minimum load is 10% while the given load is 9%, the actual corresponding speed is the load interval [10,12]. When the given load is 11%, the corresponding load interval is [10,14), and so on. When approaching the upper limit of the load, a similar method is used to limit the given load to the maximum load.
The flowchart for optimizing the minimum fuel consumption rate speed based on the sliding interval is shown in Figure 2. Firstly, parameters such as sliding interval width, speed range, and load range are set. Secondly, the optimization algorithm parameters are set. The optimization algorithm can adopt swarm intelligence optimization methods (such as particle swarm optimization, gray wolf optimizer, etc.) or other algorithms. Considering that the grey wolf optimizer is simple, efficient, and has good global optimization ability, this paper adopted the grey wolf optimizer. The fitness function in the grey wolf optimizer is the objective function in Equation (2). After the parameters set, the optimization algorithm is started to perform optimization calculations on each load interval starting from the minimum load interval. When optimization is finished each time, the load interval and its minimum fuel consumption rate speed is saved. The current load interval should be checked: if it reaches the maximum, the calculation is completed; otherwise, the sliding interval step forward by adding 1, the optimization will be restarted, and the minimum fuel consumption rate speed corresponding to the next load interval will be calculated until the sliding intervals reach their maximum. methods (such as particle swarm optimization, gray wolf optimizer, etc.) or other algorithms. Considering that the grey wolf optimizer is simple, efficient, and has good global optimization ability, this paper adopted the grey wolf optimizer. The fitness function in the grey wolf optimizer is the objective function in Equation (2). After the parameters set, the optimization algorithm is started to perform optimization calculations on each load interval starting from the minimum load interval. When optimization is finished each time, the load interval and its minimum fuel consumption rate speed is saved. The current load interval should be checked: if it reaches the maximum, the calculation is completed; otherwise, the sliding interval step forward by adding 1, the optimization will be restarted, and the minimum fuel consumption rate speed corresponding to the next load interval will be calculated until the sliding intervals reach their maximum.

Calculation Method of Speed Setting Value Based on the Sliding Interval
The calculation of the speed setting value is to find the minimum fuel consumption rate speed corresponding to the actual power load. The set speed of the constant speed

Calculation Method of Speed Setting Value Based on the Sliding Interval
The calculation of the speed setting value is to find the minimum fuel consumption rate speed corresponding to the actual power load. The set speed of the constant speed diesel generator set is fixed, while the set speed of the variable speed diesel generator set varies according to the power load.
The ship power load includes the base load and random fluctuation load, large loads (such as air compressor, ship cranes, etc.) that change periodically or non-periodically with the ship operating conditions, and special large loads (such as electric propulsion system, etc.). When a special large load (such as electric propulsion) changes, regardless of whether the speed setting method that changes continuously or the grading speed setting method is used, the speed setting value will change. The speed setting method based on the sliding interval described in this paper will inevitably lead to a change in the speed setting value. Therefore, the differences in the various methods can be ignored during special large load changing. During the normal navigation of ships, the propeller load can be considered as the basic load. The sliding interval method mainly aims at the small load stack with random variation and the large load with periodic variation, as shown in Figure 3. In Figure 3, the base load is about 40%, the random fluctuating load is about 2%, and the large periodicity is caused by two devices; when the two devices are superimposed, the load fluctuation is about 12% (the fluctuation caused by a single device is about 7% and 5%, respectively). The actual power load changes are more complex than that shown in Figure 3, and the range and shape of the random and periodic load may also change. Overall, the above assumptions can be used to verify the correctness of the speed setting method.
electric propulsion system, etc.). When a special large load (such as electric propulsion) changes, regardless of whether the speed setting method that changes continuously or the grading speed setting method is used, the speed setting value will change. The speed setting method based on the sliding interval described in this paper will inevitably lead to a change in the speed setting value. Therefore, the differences in the various methods can be ignored during special large load changing. During the normal navigation of ships, the propeller load can be considered as the basic load. The sliding interval method mainly aims at the small load stack with random variation and the large load with periodic variation, as shown in Figure 3. In Figure 3, the base load is about 40%, the random fluctuating load is about 2%, and the large periodicity is caused by two devices; when the two devices are superimposed, the load fluctuation is about 12% (the fluctuation caused by a single device is about 7% and 5%, respectively). The actual power load changes are more complex than that shown in Figure 3, and the range and shape of the random and periodic load may also change. Overall, the above assumptions can be used to verify the correctness of the speed setting method. While the power load changes, if the speed setting value is continuously calculated based on power, the speed setting value will continue to change, which leads to a decrease in system stability and reliability. The speed setting value changing frequency can be reduced by using the speed setting value calculated by the power grading method. However, if the basic power load is near the boundary point of the interval, the fluctuation in the actual power load will still lead to frequent changes in the speed set value, which will lead to an increase in the fuel consumption rate.
The method of using sliding intervals to calculate the set speed can eliminate the problems described above. The core idea is to change the fixed grading interval of the load into a sliding interval. The speed set value will only be adjusted when the change in power load exceeds the boundary of the sliding interval, and no fixed grading interval of loads is required throughout the entire load interval.
The speed setting calculation module based on the sliding interval is shown in Figure 4. The power signal is obtained from the power sensor. Passed through a low-pass filter, the power signal is converted to current power, which is input into the load sliding interval calculation module. This module calculates the load interval corresponding to the current power based on the sliding interval width setting value. The load interval is input into the minimum fuel consumption rate query module. The minimum fuel con- While the power load changes, if the speed setting value is continuously calculated based on power, the speed setting value will continue to change, which leads to a decrease in system stability and reliability. The speed setting value changing frequency can be reduced by using the speed setting value calculated by the power grading method. However, if the basic power load is near the boundary point of the interval, the fluctuation in the actual power load will still lead to frequent changes in the speed set value, which will lead to an increase in the fuel consumption rate.
The method of using sliding intervals to calculate the set speed can eliminate the problems described above. The core idea is to change the fixed grading interval of the load into a sliding interval. The speed set value will only be adjusted when the change in power load exceeds the boundary of the sliding interval, and no fixed grading interval of loads is required throughout the entire load interval.
The speed setting calculation module based on the sliding interval is shown in Figure 4. The power signal is obtained from the power sensor. Passed through a low-pass filter, the power signal is converted to current power, which is input into the load sliding interval calculation module. This module calculates the load interval corresponding to the current power based on the sliding interval width setting value. The load interval is input into the minimum fuel consumption rate query module. The minimum fuel consumption rate query module selects the corresponding optimal speed curve based on the set sliding interval width. The module looks up the table according to the input load interval value to obtain the minimum fuel consumption rate speed as the speed setting value, which will be the speed setting point of the diesel governor.
Firstly, in the load sliding interval calculation module, the input current power value is converted into the load value, where L i is the current power load, which should be taken as an integer load value; P is the current power (kW); P e is the rated power (kW).
sumption rate query module selects the corresponding optimal speed curve based on the set sliding interval width. The module looks up the table according to the input load interval value to obtain the minimum fuel consumption rate speed as the speed setting value, which will be the speed setting point of the diesel governor. Firstly, in the load sliding interval calculation module, the input current power value is converted into the load value, where i L is the current power load, which should be taken as an integer load value; P is the current power (kW); e P is the rated power (kW).
Then, the load sliding interval calculation module calculates the difference between the current load and the output load. If the absolute value of the difference is larger than or equal to half of the sliding interval width, update the output load; if the absolute value of the difference is less than half of the sliding interval width, the output load interval remains unchanged, as shown in Equation (7).
where i L is the current power load; o L is the output load interval and its value is the integer load value representing the load interval; Δ is the width of the sliding window.
Equation (7) actually has the function of filtering, which can improve the stability of the output load interval.

Diesel Engine Model
To verify the performance of the optimization methods and the speed setting calculation methods during transient processes, a dynamic model of the diesel engine was built using the mean value engine model, and the results were compared with the experimental data.

Research Plant
A medium-speed diesel engine (6KTAA25-G32) made by Shanghai Diesel Engine Co. Ltd. was selected as the simulation plant, which is a six cylinder, four valve, four-stroke, turbocharged, intercooled, electronically controlled, common rail, direct injection diesel engine. The basic parameters are shown in Table 1.  Then, the load sliding interval calculation module calculates the difference between the current load and the output load. If the absolute value of the difference is larger than or equal to half of the sliding interval width, update the output load; if the absolute value of the difference is less than half of the sliding interval width, the output load interval remains unchanged, as shown in Equation (7).
where L i is the current power load; L o is the output load interval and its value is the integer load value representing the load interval; ∆ is the width of the sliding window. Equation (7) actually has the function of filtering, which can improve the stability of the output load interval.

Diesel Engine Model
To verify the performance of the optimization methods and the speed setting calculation methods during transient processes, a dynamic model of the diesel engine was built using the mean value engine model, and the results were compared with the experimental data.

Research Plant
A medium-speed diesel engine (6KTAA25-G32) made by Shanghai Diesel Engine Co., Ltd. (Shanghai, China) was selected as the simulation plant, which is a six cylinder, four valve, four-stroke, turbocharged, intercooled, electronically controlled, common rail, direct injection diesel engine. The basic parameters are shown in Table 1. Brake specific fuel consumption (rated) (g/(kWh)) ≤210 7 Overload total power (kW) 800 8 Overload speed (r/min) 1550 9 Minimum speed (r/min) 600 According to the limit characteristic curve of this type of diesel engine, the corresponding speed limits under different loads can be obtained, simplified as Equation (8), Equation (8) combines with the maximum and the minimum diesel speed limit to form the constraint conditions of the minimum fuel consumption rate speed optimization problem.

Mean Value Engine Model
The mean value engine mode (MVEM) combines the advantages of the mechanism model and data model. Compared with the volumetric method model, the mean value engine model has a faster calculation speed and wider applicability. Compared with the data model, the mean value engine model can partially reflect the mechanism of diesel engines, so it is easier to achieve modular modeling. According to the working principle, the turbocharged diesel engine is divided into several interrelated and relatively independent components, as shown in Figure 5. The diesel engine body includes cylinders, crank connecting rod mechanisms, crankshaft, and other components, which is used to generate the mean value of external working by the diesel engine within a working cycle. The working medium is ideally gas. The intake manifold and exhaust manifold are regarded as a fixed volume. The turbine is considered as a nozzle, and calculated according to isentropic adiabatic flow. The compressor adopts a thermodynamic model [17]. The governor is used to control the speed of the diesel engine. In this article, the governor is able to receive the speed setting value of the speed setting module.
According to the limit characteristic curve of this type of diesel engine, the corresponding speed limits under different loads can be obtained, simplified as Equation (8) Equation (8) combines with the maximum and the minimum diesel speed limit to form the constraint conditions of the minimum fuel consumption rate speed optimization problem.

Mean Value Engine Model
The mean value engine mode (MVEM) combines the advantages of the mechanism model and data model. Compared with the volumetric method model, the mean value engine model has a faster calculation speed and wider applicability. Compared with the data model, the mean value engine model can partially reflect the mechanism of diesel engines, so it is easier to achieve modular modeling. According to the working principle, the turbocharged diesel engine is divided into several interrelated and relatively independent components, as shown in Figure 5. The diesel engine body includes cylinders, crank connecting rod mechanisms, crankshaft, and other components, which is used to generate the mean value of external working by the diesel engine within a working cycle. The working medium is ideally gas. The intake manifold and exhaust manifold are regarded as a fixed volume. The turbine is considered as a nozzle, and calculated according to isentropic adiabatic flow. The compressor adopts a thermodynamic model [17]. The governor is used to control the speed of the diesel engine. In this article, the governor is able to receive the speed setting value of the speed setting module. The diesel engine governor monitors the speed signal, adjusts the rank, and controls the fuel injection volume of the fuel injection system. During combustion, the fuel is injected into the cylinder and mixed with air, and then the chemical energy is converted The diesel engine governor monitors the speed signal, adjusts the rank, and controls the fuel injection volume of the fuel injection system. During combustion, the fuel is injected into the cylinder and mixed with air, and then the chemical energy is converted into mechanical energy with a certain thermal efficiency. The average indicated torque generated by a diesel engine is calculated as Equation (9).
where T i is the mean indicated torque (Nm); . m f is the mean fuel mass flow rate (kg/s); H u is the low calorific value of the fuel (kJ/kg); η i is the indicated thermal efficiency.
The core of the mean value model is the calculation of the indicated thermal efficiency, whose accuracy directly determines the overall accuracy of the model. For medium speed diesel engines, the indicated thermal efficiency can simplified as a function of speed, load, and excess air coefficient, as Equation (10), According to Newton's second law, a diesel engine rotor motion model can be obtained by Equation (11), where J e is the average moment of inertia of moving parts of diesel engine (kgm 2 ); J l is the moment of inertia of the load (kgm 2 ); T L is the load torque (Nm); τ i is the time delay that fuel undergoes from injection into the cylinder to combustion for work (s), which is proportional to the number of strokes and inversely proportional to the number of cylinders and diesel engine speed. The mean effective fuel consumption rate of a diesel engine can be calculated using the following equation, where g f is the effective fuel consumption rate (g/kWh); m is the fuel injection rate per cycle for a single cylinder (kg); N cyl is the number of cylinders. A practical PID controller is used for the diesel engine governor, as shown in following equation, where u is the controller output; e is the speed deviation; k p is the proportional coefficient; k i is the integration coefficient; k d is the differential coefficient; T d is the differential time; s is the Laplace operator.

Simulation Results
A diesel engine model was built in MATLAB/Simulink, as shown in Figure 6. Cylinder module corresponds to diesel engine body; Intake module corresponds to the intake manifold; Exhaust module corresponds to the exhaust manifold; Intercooler module corresponds to the intercooler; Turbocharger module corresponds to the turbocharger. The neural network algorithm for calculating the indicated thermal efficiency is in the Cylinder module, which uses the neural network algorithm to convert the thermal energy of fuel into the mechanical energy of the diesel engine. The comparison between the simulation data and experimental data under propulsion characteristics is shown in Table 2. In Table 2, the errors in parameters such as diesel engine speed, torque, power, and fuel consumption rate were all very small, which meets the calculation requirements for the fuel consumption rate. The experimental data are the average value of a diesel engine running steadily for 10 min. The calculation of  Table 2. In Table 2, the errors in parameters such as diesel engine speed, torque, power, and fuel consumption rate were all very small, which meets the calculation requirements for the fuel consumption rate. The experimental data are the average value of a diesel engine running steadily for 10 min. The calculation of the fuel consumption rate is based on the total fuel consumption in 10 min. The comparison of the total universal characteristics between diesel engine model testing and simulation is shown in Figure 7. The simulated fuel consumption rate can effectively reproduce the fuel consumption rate at the test point and expand the operating range of the diesel engine. This indicates that the performance parameters of diesel engines under various operating conditions can be calculated accurately using the average value model for diesel engines, and the mean value model can be used for algorithm validation and analysis.

Optimization Results Based on Sliding Interval
The grey wolf optimizer was used for optimization, with a population size of 30 and an iteration count of 300. The convergence factor was updated using the elliptical curve. The comparison of the minimum fuel consumption rate speed obtained by optimization using different sliding interval widths is shown in Figure 8. The solid line in the figure represents the optimal speed curve corresponding to a single load point. The curves corresponding to intervals of 5%, 10%, 15%, and 20% are the minimum fuel consumption rate speed curves obtained by setting the width of the load sliding interval to 5, 10, 15, and 20, respectively. The difference is relatively small between the curve of the 5% load sliding interval and the curve of single load points. The larger the sliding interval width, the greater the difference between the minimum fuel consumption rate speeds.

Optimization Results Based on Sliding Interval
The grey wolf optimizer was used for optimization, with a population size of 30 and an iteration count of 300. The convergence factor was updated using the elliptical curve. The comparison of the minimum fuel consumption rate speed obtained by optimization using different sliding interval widths is shown in Figure 8. The solid line in the figure represents the optimal speed curve corresponding to a single load point. The curves corresponding to intervals of 5%, 10%, 15%, and 20% are the minimum fuel consumption rate speed curves obtained by setting the width of the load sliding interval to 5, 10, 15, and 20, respectively. The difference is relatively small between the curve of the 5% load sliding interval and the curve of single load points. The larger the sliding interval width, the greater the difference between the minimum fuel consumption rate speeds.
represents the optimal speed curve corresponding to a single load point. The curves corresponding to intervals of 5%, 10%, 15%, and 20% are the minimum fuel consumption rate speed curves obtained by setting the width of the load sliding interval to 5, 10, 15, and 20, respectively. The difference is relatively small between the curve of the 5% load sliding interval and the curve of single load points. The larger the sliding interval width, the greater the difference between the minimum fuel consumption rate speeds. The minimum fuel consumption curve for different sliding interval widths is shown in Figure 9. The fuel consumption rate obtained by optimizing with different sliding intervals in the 40%~60% load interval was similar to the fuel consumption rate obtained by continuous optimization under single point load. In a higher load range exceeding 60% load and a low load range below 40% load, the minimum fuel consumption rate increased with the increase in the sliding interval width. This phenomenon is in line with the actual situation. Because the sliding interval algorithm was used to calculate the weighted average fuel consumption rate within the load interval, there was a significant difference in the fuel consumption rates corresponding to each load in the high and low load range, resulting in an increase in the minimum fuel consumption rate compared to The minimum fuel consumption curve for different sliding interval widths is shown in Figure 9. The fuel consumption rate obtained by optimizing with different sliding intervals in the 40%~60% load interval was similar to the fuel consumption rate obtained by continuous optimization under single point load. In a higher load range exceeding 60% load and a low load range below 40% load, the minimum fuel consumption rate increased with the increase in the sliding interval width. This phenomenon is in line with the actual situation. Because the sliding interval algorithm was used to calculate the weighted average fuel consumption rate within the load interval, there was a significant difference in the fuel consumption rates corresponding to each load in the high and low load range, resulting in an increase in the minimum fuel consumption rate compared to the single point load. At both ends of the entire load range (maximum load, minimum load), the fuel consumption rate obtained by using the sliding intervals was actually lower, which may be related to two factors: firstly, the accuracy of the endpoint location data may be reduced; secondly, the endpoint position data still use some load point data within the endpoint, thereby it reduces the weighted average value. The situation of endpoints is not common, so it has little impact on the operations of the engine. the single point load. At both ends of the entire load range (maximum load, minimum load), the fuel consumption rate obtained by using the sliding intervals was actually lower, which may be related to two factors: firstly, the accuracy of the endpoint location data may be reduced; secondly, the endpoint position data still use some load point data within the endpoint, thereby it reduces the weighted average value. The situation of endpoints is not common, so it has little impact on the operations of the engine. In Figures 8 and 9, it can also be observed that the optimization results with the 5% sliding interval width were not significantly different from those of single point load optimization; when the width of the sliding interval exceeded 15%, there was a significant difference between its optimization results and those of the single point load optimization results. Therefore, it is recommended that the width of the sliding interval used in practice should not exceed 15% and not be less than 5%. The above analysis was based on steady-state calculation results, and more reasonable values need to be verified in the actual dynamic process.
An increase in the fuel consumption curve with a 15% interval was observed at loads of 80-90% in Figure 9. This phenomenon should not occur, and can be avoided by improving the accuracy of the fuel consumption calculation model.

Performance Analysis of Fuel Saving Based on Set Speed by Sliding Interval
In order to verify the fuel saving effect based on the set speed by the sliding interval under different load conditions of diesel engines, three load conditions were simulated for verification. Each load profile was obtained by adding two periodic loads with different periods and amplitudes to the basic load and then adding white noise. The three load characteristics were named condition 1, condition 2, and condition 3. The basic loads under these three conditions were 20%, 40%, and 60%, respectively. The amplitudes of the two periodic loads were about 6.2% and 4.6%, with periods of 150 s and 180 s, respectively. The purpose of using shorter periodic loads in this article was to reduce the simulation time, and the actual cycle may be much larger than these cycles. The cutoff angular frequency of the low-pass filter parameters was 31.4 rad/s. The S-function was used to calculate the corresponding load interval. The instantaneous power under
In Figures 8 and 9, it can also be observed that the optimization results with the 5% sliding interval width were not significantly different from those of single point load optimization; when the width of the sliding interval exceeded 15%, there was a significant difference between its optimization results and those of the single point load optimization results. Therefore, it is recommended that the width of the sliding interval used in practice should not exceed 15% and not be less than 5%. The above analysis was based on steadystate calculation results, and more reasonable values need to be verified in the actual dynamic process.
An increase in the fuel consumption curve with a 15% interval was observed at loads of 80-90% in Figure 9. This phenomenon should not occur, and can be avoided by improving the accuracy of the fuel consumption calculation model.

Performance Analysis of Fuel Saving Based on Set Speed by Sliding Interval
In order to verify the fuel saving effect based on the set speed by the sliding interval under different load conditions of diesel engines, three load conditions were simulated for verification. Each load profile was obtained by adding two periodic loads with different periods and amplitudes to the basic load and then adding white noise. The three load characteristics were named condition 1, condition 2, and condition 3. The basic loads under these three conditions were 20%, 40%, and 60%, respectively. The amplitudes of the two periodic loads were about 6.2% and 4.6%, with periods of 150 s and 180 s, respectively. The purpose of using shorter periodic loads in this article was to reduce the simulation time, and the actual cycle may be much larger than these cycles. The cutoff angular frequency of the low-pass filter parameters was 31.4 rad/s. The S-function was used to calculate the corresponding load interval. The instantaneous power under three working conditions is shown in Figure 10, and the load comparison after filtering is shown in Figure 11.  The output of the load interval after filtering and the sliding interval calculation are shown in Figure 12, and the enlarged view of the circled area in Figure 12 is shown in Figure 13. The thin and solid blue lines in Figures 12 and 13 represent the output curve of a single point load (consistent with the blue curve in Figure 11), while the other curves represent the output curves of the load intervals by different sliding interval widths. The load output set according to single point speed changes the most frequently, and the impact of random fluctuations in the power load is also the most significant. The output of the load interval changes smoothly by using sliding interval processing, which is mainly influenced by large load fluctuations. The smaller the width of the sliding inter-  The output of the load interval after filtering and the sliding interval calculation are shown in Figure 12, and the enlarged view of the circled area in Figure 12 is shown in Figure 13. The thin and solid blue lines in Figures 12 and 13 represent the output curve of a single point load (consistent with the blue curve in Figure 11), while the other curves represent the output curves of the load intervals by different sliding interval widths. The load output set according to single point speed changes the most frequently, and the impact of random fluctuations in the power load is also the most significant. The output of the load interval changes smoothly by using sliding interval processing, which is mainly influenced by large load fluctuations. The smaller the width of the sliding inter- The output of the load interval after filtering and the sliding interval calculation are shown in Figure 12, and the enlarged view of the circled area in Figure 12 is shown in Figure 13. The thin and solid blue lines in Figures 12 and 13 represent the output curve of a single point load (consistent with the blue curve in Figure 11), while the other curves represent the output curves of the load intervals by different sliding interval widths. The load output set according to single point speed changes the most frequently, and the impact of random fluctuations in the power load is also the most significant. The output of the load interval changes smoothly by using sliding interval processing, which is mainly influenced by large load fluctuations. The smaller the width of the sliding interval, the better the output of the load interval can follow the actual load fluctuation, but the greater the load fluctuation. The larger the width of the sliding interval, the weaker the ability to follow the actual load, but the smoother the variation in the output load interval. The load interval output of condition 3 is shown in Figure 14, which also shows the same law.   The output of the minimum fuel consumption rate speed setting is shown in Figure  15, and the enlarged view of the circled part is shown in Figure 16. The solid blue line represents the output of the single point load speed setting, while the other curves represent the speed output of different sliding interval widths of 5%, 10%, 15%, and 20% as Load (%)   The output of the minimum fuel consumption rate speed setting is shown in Figure  15, and the enlarged view of the circled part is shown in Figure 16. The solid blue line represents the output of the single point load speed setting, while the other curves represent the speed output of different sliding interval widths of 5%, 10%, 15%, and 20% as Load (%)   The output of the minimum fuel consumption rate speed setting is shown in Figure  15, and the enlarged view of the circled part is shown in Figure 16. The solid blue line represents the output of the single point load speed setting, while the other curves represent the speed output of different sliding interval widths of 5%, 10%, 15%, and 20% as Load (%) Figure 14. Load interval output of condition 3.
The output of the minimum fuel consumption rate speed setting is shown in Figure 15, and the enlarged view of the circled part is shown in Figure 16. The solid blue line represents the output of the single point load speed setting, while the other curves represent the speed output of different sliding interval widths of 5%, 10%, 15%, and 20% as well as the output of the 10% graded speed setting. There is a similar law with the load output: the output of a single point load speed setting changes frequently, and it is significantly affected by the random fluctuations of power load; the output change in the speed setting by sliding interval processing is stable and is mainly affected by large load fluctuations; the larger the width of the sliding interval, the smoother the speed fluctuation. The smaller the sliding interval, the closer its speed output is to that of a single load, which indicates that its fuel saving effect should be higher. However, the larger the width of the sliding interval, the greater the difference between the set speed and the minimum fuel consumption rate speed required by the actual load, which may lead to a decrease in fuel efficiency. Therefore, the width of the sliding interval should be chosen based on the actual changes in power load.
tion. The smaller the sliding interval, the closer its speed output is to that of a single load, which indicates that its fuel saving effect should be higher. However, the larger the width of the sliding interval, the greater the difference between the set speed and the minimum fuel consumption rate speed required by the actual load, which may lead to a decrease in fuel efficiency. Therefore, the width of the sliding interval should be chosen based on the actual changes in power load.
By observing the speed setting curve of the 5% load width, it was found that the speed setting value for the sliding interval varied slightly under the same load range that the speed range for a single point load was basically the same. The reason is that during the process of load variation from the higher range to the lower range or vice versa, the sliding interval according to the same load may be different, which in turn results in different corresponding minimum fuel consumption rate speeds. This indicates that the sliding interval algorithm will set the corresponding diesel speed according to the fluctuation in load. The method is suitable for both environments with stable load changes and environments with frequent load changes. The curve of condition 3 shown in Figure  17 also illustrates the above phenomenon.
Compared with the set speed of the 10% fixed grading method, it can be found that the set speed obtained by the sliding interval was closer to the set speed corresponding to the single point load, which means that the fuel saving effect is better. In addition, in the case of load variation, the fixed grading method can also cause fluctuations in the speed, and it has no advantage compared to the sliding interval method.  By observing the speed setting curve of the 5% load width, it was found that the speed setting value for the sliding interval varied slightly under the same load range that the speed range for a single point load was basically the same. The reason is that during the process of load variation from the higher range to the lower range or vice versa, the sliding interval according to the same load may be different, which in turn results in different corresponding minimum fuel consumption rate speeds. This indicates that the sliding interval algorithm will set the corresponding diesel speed according to the fluctuation in load. The method is suitable for both environments with stable load changes and environments with frequent load changes. The curve of condition 3 shown in Figure 17 also illustrates the above phenomenon.   Table 3. The fuel consumption rate was significantly the highest at the rated speed; the fuel consumption rate significantly decreased by the 10% load grading method but was higher than the speed setting method of a single point load and sliding interval. If the load grade is specially optimized for the commonly used load conditions in power plants, the fuel saving effect may be further improved. However, under variable loads, the fuel saving effect of the grading speed setting is lower than that of the sliding interval setting. The minimum fuel consumption rate speed setting method based on the sliding interval can better follow the variation in the power load, and its minimum fuel consumption rate speed is more closely related to the actual power load, which means that a better fuel saving effect can be achieved under various working conditions.
In conditions 1 and 2, the fuel consumption rate with a sliding interval width of 5% was lower than the fuel consumption rate by single point load; in condition 3, the fuel consumption rates of both were almost the same. The reason for this situation is that the set speed change is relatively stable when using the sliding interval method to adjust the set speed of a diesel engine. This advantage not only benefits the improvement in the steady state performance, but also reduces the transient processes and further improves the fuel efficiency. It can also be seen from Table 3 that the fuel consumption decreases Compared with the set speed of the 10% fixed grading method, it can be found that the set speed obtained by the sliding interval was closer to the set speed corresponding to the single point load, which means that the fuel saving effect is better. In addition, in the case of load variation, the fixed grading method can also cause fluctuations in the speed, and it has no advantage compared to the sliding interval method.
Within a simulation time of 3600 s, the comparison of the fuel consumption results under different sliding interval widths is shown in Table 3. The fuel consumption rate was significantly the highest at the rated speed; the fuel consumption rate significantly decreased by the 10% load grading method but was higher than the speed setting method of a single point load and sliding interval. If the load grade is specially optimized for the commonly used load conditions in power plants, the fuel saving effect may be further improved. However, under variable loads, the fuel saving effect of the grading speed setting is lower than that of the sliding interval setting. The minimum fuel consumption rate speed setting method based on the sliding interval can better follow the variation in the power load, and its minimum fuel consumption rate speed is more closely related to the actual power load, which means that a better fuel saving effect can be achieved under various working conditions. In conditions 1 and 2, the fuel consumption rate with a sliding interval width of 5% was lower than the fuel consumption rate by single point load; in condition 3, the fuel consumption rates of both were almost the same. The reason for this situation is that the set speed change is relatively stable when using the sliding interval method to adjust the set speed of a diesel engine. This advantage not only benefits the improvement in the steady state performance, but also reduces the transient processes and further improves the fuel efficiency. It can also be seen from Table 3 that the fuel consumption decreases first and then increases when the sliding interval width changes from small to large. Therefore, there should be an optimal sliding interval width for specific working conditions to minimize the average fuel consumption rate of a variable speed diesel generator. The optimal sliding interval width can be obtained by enumeration or optimization methods based on commonly used load characteristics in practice.

Conclusions
The minimum fuel consumption speed optimization method of a variable speed diesel generator set based on the load sliding interval and the calculation method of diesel engine set speed were proposed, and the average value model of a diesel engine was built. The proposed method was simulated and verified. Several conclusions are as follows: (1) By the sliding interval method, the best fuel saving effect could be achieved under any power load because it is not necessary to set the speed setting value according to the power load grading in advance. Under condition 1, the average BSFC of the continuous method, the 10% grading method and the 10% load sliding interval method were 216.26, 215.70 and 222.11 (g/kWh) respectively. Its overall fuel saving effect was better than the grading setting method, and even better than the single point load speed setting method. (2) By optimizing the minimum fuel consumption rate speed using a load sliding interval, the minimum fuel consumption rate speed will be continuous according to the load interval. Under fluctuating power load conditions, the speed setting value by the continuous method changes instantaneously, but the speed setting value by the load sliding interval method changes smoothly. It can better follow the variation in the ship power load, resulting in a higher fuel saving ability and better adaptability to variable loads. (3) The change in the sliding interval width will result in the application of different minimum fuel consumption rate speed curves. The sliding interval width can be changed to better adapt to the actual power consumption conditions of ships. It is recommended that the width of the sliding interval used in practice should not exceed 15% and not be less than 5%.