Disturbance Observer-Based Discrete Sliding-Mode Control for a Marine Diesel Engine with Variable Sampling Control Technique

.is paper proposes a disturbance observer-based discrete sliding-mode control scheme with the variable sampling rate control for the marine diesel engine speed control in the presence of system uncertainties and disturbances. Initially, a sliding-mode controller based on the fast power reaching law is employed, which has a good dynamic quality of the arrival stage and can suppress chattering. To satisfy the practical requirements in the digital controller and the crank angle-based fuel injection in engine speed control, the proposed method is discretized under the variable sampling rate condition. A disturbance observer based on the second-order sliding-mode control is designed to compensate the system uncertainties and disturbances, by doing such the requirement of the parameters of the sliding-mode controller to be reduced significantly. In addition, a cylinder-bycylinder mean value engine model (MVEM) is built by restructuring the combustion torque model, based on which numerical simulations are carried out by comparing the proposed method with PID and the extended state observer (ESO)-based sliding mode controllers. .e common operation situations of the marine diesel engines are taken into account, including starting process, acceleration and deceleration, load variation, and varied propulsion system parameters. .e results demonstrate that the proposed disturbance observer-based sliding-mode controller has prominent control performance and strong robustness.


Introduction
In the ship domain, diesel engines have been widely used as marine main engines for propulsion [1]. ese engines are usually controlled to work at the specified rotating speed to keep the ship sailing at the appropriate speed, although this adds unknown load disturbances to the main engines [2]. e speed fluctuation and overshoot will cause harm to the whole propulsion system and even paralyze the entire system. Hence, for ship propulsion, good speed control performance of the marine main engines must be guaranteed even in the face of the strong nonlinearity in diesel engines and harsh marine environments. In addition, the emergence of new technologies in recent years also presents new challenges for speed control. Some new techniques greatly introduce additional dynamic nonlinearity for diesel engines, and some put forward higher requirements for speed control [3]. erefore, it is necessary to design an accurate and robust speed controller for marine diesel engines.
Since the implementation of electronic-controlled fuel control system, proportion-integration-differentiation (PID) has always been the most widely used algorithm for the speed control of diesel engines because of its simplicity and reliability [4]. Nevertheless, the PID controller can hardly maintain good control performance in all working conditions for the nonlinear system [5]. To overcome such problem, the PID controller is often studied to combine with other algorithms, such as fuzzy logic control [5], genetic algorithm [6], H∞ algorithm [7], and model predictive control (MPC) [8]. ese composite algorithms improve the control performance by optimizing the PID parameters in real time. Meanwhile, some scholars try to use some other control methods to replace PID. e active disturbance rejection control (ADRC) is introduced to improve the performance of marine main engine under complex operating conditions in [9][10][11]. Ouladsine et al. established a neural controller with pollution constraints which realizes the multivariable control of engine speed and emission [12].
Sliding-mode control (SMC), known as a robust control method [13][14][15], also has been studied in engine speed control. A simple SMC is designed by Zhang for speed control of generators, but the control performance is not satisfactory [16]. Yuan and his collaborators propose discrete sliding-mode variable structure control in the literature [17] and verify the control performance for diesel engine through simulation and experiment, and the results show that its control effect is better than the traditional PID. Afterwards, multisliding surface control is proposed in his literature [18], and different sliding surfaces are selected in the acceleration and steady-state conditions to achieve better control performance in the various working conditions of the marine diesel engine. However, both of these methods rely on the accurate model. However, it should be noted that the simplified and accurate diesel engine model is hard to build, which severely limits the use of these controllers. In [19], the diesel engine model is approximated by the RBF neural network, based on which a sliding-mode controller is developed. Khan [19] and Li [18] use the supertwisting scheme to control engine speed, where the accurate diesel engine model is no longer required but with the sacrifice of robustness.
It is well known that the traditional SMC requires the switching gain larger than the total disturbance, which sacrifices its control performance. Meanwhile, the chattering problem is hard to avoid [20]. Faced with this situation, one way is used to compensate the system disturbance by means of the disturbance observer. By doing such, the switch gain is only required to be larger than the estimated disturbance error rather than the total disturbance. On the basis of such idea, Wei proposes a controller via combining the disturbance observer and terminal SMC for a class of multipleinput-multiple-output continuous nonlinear systems subject to disturbances [21]. In [22], a disturbance observer-based SMC is designed for a class of fractional-order nonlinear systems. By combining the disturbance observer with SMC for the staring-mode spacecraft, the stability of the spacecraft platform is improved and the chattering is reduced [23]. Motived by the statements above, in this study, the disturbance observer-based SMC is employed to regulate the marine diesel engine speed.
ere is another issue should be considered in engine speed control, although the output speed of the diesel engine is continuous, its working process is not continuous with inherent event-triggered property [11,[24][25][26], making the output of the controller can only be executed once per cylinder per cycle. For this reason, the disturbance observerbased SMC employed in this paper should be discrete. To avoid the chatting phenomena caused by high-frequency switching, the fast power reaching law is adopted by referring to [27]. e disturbance observer is structured based on a second-order sliding-mode algorithm which can significantly reduce the chattering in the discrete system. Considering that the controller output can only be executed at a fixed segment on the crank-angle domain, variable sampling rate control is adopted instead of traditional timing control, which guarantees that the controller calculates once per working cycle for each cylinder at any engine speed (refer to [11] and the references therein for more details). In addition, a cylinder-by-cylinder mean value engine model (MVEM) is built for the validation of the proposed controller. Compared with the conventional MVEM, the adopted engine model is closer to the actual diesel engine, making the verification of the control algorithm more practical and reasonable. e rest of the paper is organized as follows. First, the cylinder-by-cylinder MVEM is introduced. en, a simplified discrete mathematical model of the diesel engine is described, based on which a discrete sliding-mode controller and a sliding-mode disturbance observer are designed. After that, based on the proposed cylinder-by-cylinder MVEM, simulation verification is carried out with vast comparative results to demonstrate the superior control performance of the proposed method. Finally, the conclusion about the whole work is summarized, and further research of this paper is discussed.

Cylinder-by-Cylinder Mean Value Model of Marine Diesel Engine
Diesel engine is a complicated system with thermodynamic system, hydraulic system, electronic system, rotary and reciprocation machinery system, etc. Hence, it is difficult to establish an accurate mathematical model. As a compromise, MVEMs composed with primary empirical formula are widely used in correlation control research because of their easier implementation and higher calculating speed compared with detailed models [28]. Besides, it is very convenient to analyse the whole system and design qualified controllers with its intuitive system equations. However, as mentioned above, the actual working process of the diesel engine is periodic and cylinder-by-cylinder, while the traditional MVEMs only consider the average effect of the periodic work. For a four-stroke diesel engine, its working process includes the following features: (1) e working process is cylinder-by-cylinder (2) Each cylinder completes a cycle every two revolutions, including the suction stroke, the compression stroke, the power stroke, and the exhaust stroke (3) e control input, i.e., fuel injection quantity per cylinder per cycle, produces output only after a cylinder has completed its power stroke It can be seen that no matter for the individual cylinder or the whole diesel engine, the working process is discontinuous. erefore, although the study of continuous control algorithm based on continuous MVEMs can realise the rigorous theoretical analysis, there are still some differences with the actual control of diesel engine. To improve the situation, a cylinder-by-cylinder MVEM of a marine diesel engine is presented in this study, which can reflect the practical working characteristics mentioned above. is cylinder-by-cylinder engine model is based on the MVEM with the remodel of the combustion torque model which is the most critical part of the diesel engine model. Figure 1 shows the main structure of the developed model. Figure 1, the engine model is mainly composed of the engine body (cylinders, crankshaft, etc.), turbocharger (turbine and compressor), exhaust manifold, and intake manifold. Except for the indicated torque in the engine body, the rest parts are modelled according to the empirical formula as MVEMs.

Mean Value Engine Model. As shown in
e main function of a diesel engine is to output the effective torque M e through the crankshaft and then drive the load rotation. Here, the loads are the gearbox, the spindle system, and its connected propeller. For the sake of analysis, assume that there is only one propeller and that the gear box has a reduction ratio of 1. us, the rotational dynamics of the total propulsion system including the diesel engine and the loads can be given as where n e is the engine speed, i.e., the rotation speed of crankshaft, J is the total rotational inertia of the moving parts of the propulsion system, M f is the total frictional loss torque, M l is the load torque, and M i and M p denote the total indicated torque and the total pump loss torque for all cylinders, respectively. For MVEMs, M i and M p are usually calculated by empirical formulas: where m f is the fuel injection quantity per cylinder per cycle, q HV is the fuel low calorific value, η i is the gross indicated efficiency, N is the number of cylinders, V d is the total displacement of the engine, and P im and P em , respectively, denote the pressure in intake manifold and exhaust manifold. One can see that only cyclic averages are obtained. In this paper, they are simulated via the cylinder-by-cylinder combustion torque model which will be described in the next subsection. When a diesel engine runs, friction loss is caused by all moving parts, especially crankshaft and pistons. It is generally believed that these losses are mainly related to engine speed. Here, the frictional loss torque M f is assumed to be a quadratic polynomial of engine speed as follows [29]: where k f1 , k f2 , and k f3 are the experimental coefficients.
Ignoring the relatively small friction loss of the gearbox and the spindle system, the load torque M l is considered to be mainly from the propeller torque which can be approximated by where k l is a coefficient depending on the propeller torque coefficient K M , the density of water ρ w , and the propeller diameter D p . e relationship between them can be described by as k l � K M ρ w D 5 p [30]. For a propeller, D p is invariable, but K M varies with the advance coefficient and propeller pitch. So, K M is also varying. Here, two form variations will be taken into account during controller validation as follows.

Remark 1.
As equation (2) shows, the gross indicated efficiency is an important index for diesel engines. Meanwhile, it is affected by many factors among which the excess air coefficient α and engine speed n e are the most important. Referring to [31], it can be described as where a 1 , a 2 , . . . , a 5 are coefficients. If an accurate indicated torque is desired, the excess air coefficient is also needed to  Journal of Control Science and Engineering be accurately modelled. For this purpose, the turbocharger model, exhaust manifold model, and intake manifold model should be considered well. e air mass flow into the cylinders is calculated according to the air pressure and temperature in the intake manifold and the volumetric efficiency which is a function of the pressure and the engine speed [29]. e turbocharger model mainly provides boundary conditions and inlet gas flow to the intake manifold. e exhaust manifold model determines the rotation speed and working state of the turbocharger. For simplicity, the detailed modelling approach is not described here and more details are available in [32].

Cylinder-by-Cylinder Combustion Torque Model.
As mentioned above, only averages of M i and M p are calculated by empirical formulas for MVEMs. It is essential that the torque applied to the crankshaft by the cylinder pressure should be through the crank link mechanism. e force diagram of a single crank link mechanism is shown in Figure 2.
From the figure, the following relationship formulas can be obtained: l sin ϕ � r sin θ, where l is the connecting rod length, r is the crank arm length, and d is the piston diameter. It should be noted that ϕ denotes the tilt angle of the connecting rod and θ denotes the angle at which the crankshaft rotates from the top-deadcenter (TDC). Meanwhile, it is supposed that ∈ (− 90°, 90°) , θ ∈ [0°, 720°], and θ � 360°mean that the crankshaft is at the TDC of the compression phase. According to equation (7), the torque produced by a certain cylinder on the crankshaft can be obtained by e model of the cylinder pressure P(θ) is the core of the cylinder-by-cylinder engine model. According to the working process of the individual cylinder, it is divided into three stages to simulate for a working cycle. e first stage is the working stage, where only the intake valve is open. e second stage is the most complex stage, where both the intake and exhaust valves are closed. e third stage refers to the working stage where only the intake valve is open. In the first and third stages, P(θ) is considered to be approached to the pressure in the intake manifold model and exhaust manifold model, respectively. e second stage includes the compression phase and the power phase, and the cylinder pressure can be treated as the interpolation of that in two ideal processes, namely, the pure compression process and ideal combustion process. e pure compression process refers to the second stage process with no fuel supply, and the cylinder pressure can be measured by the motoring test method. For simulation, it can be regarded as a polytropic process. e pressure P c and temperature T c can be given as where P ivc , T ivc , and V inc , respectively, represent the cylinder pressure, temperature, and volume at the intake valve closing, V(θ) denotes the instantaneous volume of the cylinder, and k c is the polytropic exponent. e ideal combustion process refers to the second stage process with a negligible time from the start of combustion to the end of combustion. Before combustion, the pressure and temperature of this ideal process are the same as the pure compression process, and after combustion, they can be modelled as another polytropic process as follows: where k e is the polytropic exponent and P eos , T eos , and V eos denote the cylinder pressure, temperature, and volume of the ideal combustion process at the end of combustion, respectively. According to the description, the combustion process can be regarded as a constant volume combustion, and the T eoc and P eoc are determined by where θ soc denotes the θ at the start of combustion, c v is the specific heat at constant volume of mixture in the cylinder. And it is important to note that m f keeps the value at the start of combustion during the whole second stage and is updated only once in the next cycle. η f is the fuel conversion efficiency, and it is considered to be proportional to the gross indicated efficiency η i of the MVEM. at is, e pressure ratio proposed by Matekunas is defined as Eriksson has found that the pressure ratio curve is similar to the proportion of fuel already burned [27]. If max(PR(θ)) represents the pressure ratio when it has completely combusted at θ, which can be given as where η m is the percentage of fuel that has been burned which can be described by the well-known Vibe function. According to the ideal combustion process, one can get Combining equations (16)- (18), it yields to As known, η m (θ) � 0 until the start of combustion and η m (θ) � 1 since the end of combustion, which leads to P(θ) � P c (θ) and P(θ) � P e (θ), respectively [34].
In summary, the cylinder pressure of a working cycle can be described as For the blowdown phase and the transitions between these three stages, the pressure can be calculated by interpolation using a cosine function.
Above all, for a six-cylinder diesel engine, the total torque M tot (θ) generated by the cylinders can be obtained as Combined with equation (21), one can see the M i − M p in MVEMs is the cyclic average of M tot (θ). erefore, the rotational dynamics (1) can be rewritten as us, together with other parts of the original MVEM, the new cylinder-by-cylinder MVEM is formed. Some simulation results of this model are presented in Figures 3 and 4.
e cylinder pressure P based on equation (19) is shown in Figure 3, and the three stages described above can be observed. is cylinder pressure produces cyclical fluctuation for the engine speed as shown in Figure 4, which cannot be given by the MVEMs. Moreover, by choosing the appropriate coefficient in equation (15), the speed responses are also similar except for the cyclic fluctuation when the fuel injection of the two models is the same. As can be seen from the acceleration at 3 s, the cylinder-by-cylinder model does not respond to the change of the fuel injection until the next cycle. is also causes the delay in the acceleration process. All these make the model closer to the actual working process of the diesel engine.

Remark 2.
It should be noted that the original MVEM is borrowed from the work [32], which has been verified by extensive experiments. Hence, as shown in Figure 4, the mean effect of engine speed in the proposed engine model is almost the same as that in the original MVEM, which can be regarded as the verification of the proposed engine model.

Disturbance Observer-Based Discrete Sliding-Mode Controller
It can be seen from the model description that the diesel engine is a discontinuous system, and the control input will only be valid after the current working cylinder completes the power stroke. us, the general used constant sampling rate control will have problems; hence, a variable sampling rate control is employed in this study. e controller calculates only at a few fixed crank angles, which means that the sampling interval varies with the engine speed. erefore, in this section, the control problem is simplified and discretized with the variable sampling control theory, based on which the controller and observer are designed.

Control Problem Simplification.
Although the cylinderby-cylinder model is closer to the reality engine, it is not convenient for the design of the controller. On the contrary, the MVEM is not realistic but simple in form, which can be regarded as a simplification of the controlled object. According to equations (1), (2), (4), and (5), the control problem equation can be described as where Obviously, g(t) is not accurate and difficult to obtain for the actual diesel engine or cylinder-by-cylinder model. However, its variation range is limited, so it is regarded as a known constant g 0 with some unknown deviations. For the actual situation, both M f and M l can be measured experimentally, but there is always some offset. Besides, both of them have all kinds of interference in practical work, especially M l is strongly affected by the complex marine environment. As a result, some parts of f are also unknown and unmodelable. Assume that M p is also unknown and  treat all these unknown parts as unknown disturbance D(t), given state variable x � n e , and control input u � m f , and equation (23) can be rewritten as where f 0 is the known part of f and Equation (26) can be discretized with a variable sampling interval as follows: where h(k) is the variable sampling interval which is related to the engine speed.
is function can be regarded as a simplified discrete mathematical model of the diesel engine and the control problem equation when designing the controller in the below section.

Discrete Sliding-Mode Controller.
Most sliding-mode algorithms achieve their control objectives and maintain good robustness by fast switching, resulting in chattering often, especially when the control frequency is not fast enough. e control frequency of a diesel engine is variable and limited by the number of cylinders and the engine speed.
erefore, a suitable sliding-mode controller is needed to suppress chattering. In this study, a sliding-mode controller based on the reaching law proposed in [35] is used for the speed control of a diesel engine. e fast power reaching law is selected, which is helpful to improve the dynamic quality of the arrival stage and suppress chattering [36]. It can be described as where the coefficient k 1 , k 2 > 0 and c ∈ (0, 1). When the initial value s(0) ≠ 0, the solution of this first-order nonlinear equation can be expressed as which shows that equation (28) converges in finite time.
Considering the variable sampling rate control of the diesel engine, equation (28) can be written in discrete form as at is, Obviously, is required to ensure the convergence of equation (30). erefore, the convergence accuracy of the equation in discrete form is (k 1 h(k)/2 − h(k)k 2 ) (1/1− c) . It can be seen that the smaller coefficients are, the higher the steady-state convergence accuracy. However, it also reduces the transient control performance.
is should be taken into account when selecting coefficients.
For system 27, let s � x − x d , and its discrete time derivative can be obtained as where x d denotes the reference speed. Combining equations (27) and (30), it yields to

Journal of Control Science and Engineering
Hence, the control law can be set to be where the disturbance D(k) is unknown. If the disturbance is ignored in equation (35), the system equation becomes the convergence domain of which depends on the bound of the disturbance. is can have serious adverse effects on control performance. erefore, an SMDO is designed to compensate for it.

Sliding-Mode Disturbance Observer.
Treating D as an additional state variable z 2 and assuming D(k + 1) � D(k) + h(k)p(k), the original first-order system can be described as a second-order system: where z 1 � x. e disturbance observer can be given as which is often used by scholars [37][38][39][40]. v 1 (k) and v 2 (k) are the items that need to be designed. Define observation error e 1 � z 1 − z 1 , e 2 � z 2 − z 2 . Considering equations (37) and (38), an error system can be obtained as erefore, the design of disturbance observer becomes design v 1 and v 2 to make the error system converge. If v 2 (k) � 0, z 2 �� 0 and the observer 29 becomes a first-order system. Only v 1 (k) needs to be designed so that e 1 converges to zero and v 1 ⟶ D, as in [40]. However, many scholars usually design both v 1 and v 2 , e.g., the extended state observer (ESO) proposed by Han [37], the nonlinear disturbance observer in [39], and the linear observer with ω 0 -optimization [38]. e purpose of all these observers is to achieve e 1 ⟶ 0 and e 2 ⟶ 0, which is the same as a second-order sliding-mode controller (SOSMC). ere are designs and analysis of second-order sliding modes for continuous systems, such as twisting algorithm, suboptimal algorithm, and supertwisting algorithm [41,42]. However, high control frequency is often required in these algorithms to ensure their control performance and robustness. In this study, the SOSMC controller described in eorem 1 and the similar controller for discrete control are considered as follows.
Theorem 1 (see [43]). Considering the second-order system, Suppose there are c 1 > 0 and r 1 > 0 such that the disturbance |ω(t)| < (1 − (1/c 2 1 ))r 1 and the variable structure control law can suppress the disturbance and make system (40) reach the origin after switching at most once in finite time. Like many sliding-mode controllers, it is difficult to switch accurately on the sliding-mode surface x 1 + (c 1 x 2 |c 1 x 2 |/ 2r 1 ) � 0 when used for discrete control， which easily causes chattering. To overcome the problem, a similar control law for discrete control is proposed based on the principle of control law (41) by Han [29]. It is defined as where r 0 , c, and h 0 are coefficients corresponding to the r 1 and c 1 in control law (41) and the sampling step h of the discrete system, respectively. e two control laws converge system (28) in an almost-uniform trajectory, if the step size is small enough and r 0 � r 1 , c � c 1 , and h 0 � h. Figure 5 gives the phase trajectories and the convergence trajectories of these two controllers where the corresponding parameters are the same except for h 0 . e phase trajectory A shows the second-order sliding-mode characteristics of controller (41). However, it can be seen from phase trajectory B and convergence trajectory B that the control performance becomes worse and chattering occurs easily when the control law is discontinuous. Meanwhile, controller (42) can still guarantee good control performance except for the smaller fluctuation due to discrete calculation.
is fluctuation can also be weakened by appropriately increasing h 0 , and the convergence rate will be slower as a cost as convergence trajectory D shows.
According to the above description, controllers (41) and (42) can be used for continuous and discrete observer design, respectively. In this paper, the observer is proposed as where k h is a coefficient so that h 0 will change with the calculated step h(k). In order to reduce the overshoot and steady-state fluctuation, a part of the convergence rate needs to be sacrificed when selecting the parameters of fhan. Here, − λe 2 (k) is introduced to improve the convergence rate. e error system can be rewritten as can be taken as a new disturbance, and it is bounded in diesel engine systems. According to eorem 1, there are parameters of fhan(·) to make error system (44) converge in finite time.
In conclusion, based on this sliding-mode disturbance observer (SMDO), the designed discrete sliding-mode controller (DSMC) can be described as Combing with system function (27), it yields to Comparing with equation (36) shows that the convergence accuracy will be improved if | e 2 (k)| < |D| which is guaranteed by the SMDO.

Results and Discussion
To verify the effectiveness of the proposed SMDO and DSMC, simulation on the cylinder-by-cylinder diesel engine model is carried out and the results are analysed in this section. Moreover, the ESO proposed in Ref. [37] and a PID controller are employed to compare with the proposed observer and controller, respectively.
In Table 1, the primary parameters of the modelled diesel engine are given. Similar to the general operating conditions of a marine diesel engine, the simulations include the starting process, steady process, acceleration process, deceleration process, and load-changing process. To simulate the starting process in a real engine, the engine is driven by a starting torque until it reaches the set speed 350 rpm, and then it is driven by combustion torque since the controller starts working. After the starting process, the reference speed is increased from 700 rpm to 1900 rpm by 400 rpm each time and then decreased by 600 rpm to 1300 rpm. A slope limit for the reference speed is employed to ensure the safety of the propulsion system as the actual engine runs [30], which is set as 400 rpm/s. When a ship is running in the sea, the propeller torque is affected periodically by waves, which can be simulated by periodic disturbance torque in 13 to 15 seconds. In harsh sea conditions, the propeller inevitably emerges and reenters the water, which would cause dramatic load changing. Given such situation, the load torque M l is discharged and increased by 50% at 9 s and 10 s to simulate the effect of emerging and reentering. Especially, varied inertia moment J is considered to evaluate the robustness of the proposed controller. Detailed simulation results and analysis are presented below.
Journal of Control Science and Engineering 4.1. Sliding-Mode Disturbance Observer Performance. As described above, the ESO is employed for comparison, and the simulation results of the disturbance observers with optimized parameters are given in Figure 6 and 7.
Since equation (27) is the average and simplification of the cylinder-by-cylinder model, the observed disturbance is actually an average. However, the combustion torque of the cylinder-bycylinder model varies periodically with the crank angle; hence, the actual disturbance torque of the model is difficult to calculate. erefore, the comparison between the observed disturbance and the actual disturbance cannot be given. e following results of the two observers for the engine speed n e are shown in Figure 6. It can be seen that, the speed tracking performance of the ESO is better than that of the SMDO in all the compared situations. However, as the speed estimation error is the input of the observers, too fast speed following is sometimes at the expense of disturbance observation effect. It is obvious that the observation of the SMDO is better than that of the ESO at initial stage (as shown in the downside subplot of Figures 6 and 7(a) due to the faster convergence in the SMDO). More detailed disturbance observation comparison is given in Figure 7.
As can be seen from Figure 7(a), the observer starts operation at nearly 0.8 seconds where the engine speed reaches 350 rpm. en, both observers converge quickly, but the ESO converges significantly slower and has a brief oscillation. After that, the two estimated results are close, as shown in Figure 7(c). However, the SMDO is significantly faster than the ESO in response to sudden loading and unloading as present in Figures 7(b) and 7(d), and this will have a great effect on the speed control which will be discussed later. Overall, the SMDO performs better than the ESO. A more intuitive comparison can be seen from the speed tracking effect of the DSMC based on the two observers as shown below.

Discrete Sliding-Mode Controller Performance.
For providing better comparison, three controllers are tested; they are SMDO-based DSMC, ESO-based DSMC, and PID. All these controllers perform the calculation of control input at a preset crank angle before fuel injection occurs in the individual cylinder. In order to avoid introducing meaningless periodic fluctuations which is shown in Figure 4, the engine speed is averaged between two adjacent calculations. Moreover, the disturbances are added to the engine speed calculation and the load torque separately for simulating the actual situation more closely. erefore, the average speed is fluctuating even in steady-state condition, which is more likely to cause chattering of SMC. e overall results of engine speed and control signal response curves for the compared controllers are shown in Figure 8, and some detailed results are shown in  As can be seen from Figure 8, there is no significant chattering under DSMC whether it is based on the ESO or SMDO, and all the compared controllers can achieve satisfactory control performance under the most operation conditions. Detailed presentation and analysis are described below.   Case 1. Starting process As mentioned above, the diesel engine model is firstly driven by a starting torque until the speed reaches to 350 rpm, and then the controller takes over the control and starts the closed-loop control. Furthermore, to avoid overregulation, the desired speed is set to always be 50 rpm higher than the actual speed before the actual speed approaches the idle speed. e simulation results after the controllers start working in the starting process are shown in Figure 9. Visibly, the overshoot and stabilization time of the    Case 2. Acceleration and deceleration process Figure 10 shows the acceleration and deceleration processes. It can be seen that DSMCs based on the ESO and SMDO have a better tracking effect in all processes, except that there are slight overshoots but almost negligible. Meanwhile, the two DSMC methods maintain similar performance during all three acceleration processes, while the performance of the PID controller becomes worse in the processes in Figures 10(a) and 10(c). Figures 11 and 12, respectively, show the engine speed responses of two kinds of load variation mentioned above. During the sudden loading and unloading, one can see that the overshoot of the ESO-based DSMC is higher than that of the other two controllers due to the slow response of the ESO which is shown in Figure 7. e convergence time of the PID controller is almost twice than that of DSMCs. In contrast, the SMDO-based DSMC has the best control performance with the minimum overshoot and the shortest stabilization time. Facing the periodic disturbance, the control performance of the SMDO-based DSMC is still the best with only 31 rpm speed fluctuation, while the PID controller is the worst with 52 rpm speed fluctuation. e DSMC based on the ESO has slightly worse performance than that based on the SMDO, in which the speed fluctuation is 39 rpm. erefore, it can be concluded that the SMDO-based DSMC is more capable of handling the load variation because of the harsh marine environment.

Case 4. Robustness verification
In practice, a diesel engine may be used to different propulsion systems with different parameters such as inertia moment and torque coefficient. is requires the controller to have good robustness, otherwise the controller parameters need to be recalibrated for different propulsion systems. Here, the simulation is carried out to verify the robustness of the controllers, in which the inertia moment of the propulsion system is increased by 25% and the parameters of the controllers remain unchanged. Some simulation results are given in Figure 13.
As can be seen that, during the starting process, the performance of the PID controller is still not satisfactory and the performance of the ESO-based DSMC gets worse with overshoot increasing to 51 rpm. During the first loading process, the control effect of the three controllers becomes better than their original conditions as shown in Figure 9 while DSMCs are obviously better than the PID controller.
In Figures 13(c) and 13(d), the DSMCs based on the ESO and SMDO maintain the good control performance, but the PID controller gains the worse control performance. Due to the increase of rotational inertia, the control performance of the three controllers gets better when suddenly loading and unloading. However, the DSMC based on the SMDO still has the best performance, and the PID controller is still significantly worse than the DSMCs. Facing the periodic disturbance, the speed fluctuation of the DSMCs based on the ESO and SMDO is 25 rpm and 20 rpm, respectively, which means that, for the DSMCs, the control performance under such condition is better than the original condition as shown in Figure 12. On the contrary, the control effect of the PID controller becomes worse, and the speed fluctuation increases to 58 rpm. Summarizing the above analysis and comparison, the DSMCs show superior performance over the PID controller. While ensuring the robustness, the chattering is almost  eliminated. As can be seen from the above simulation results, the steady-state fluctuation is basically the same as the PID controller. e robustness and control effect of the SMDObased DSMC are better than that of the ESO-based DSMC, which further indicates that the performance of the designed SMDO is better than that of the ESO. erefore, control performance of the marine diesel engine speed system can be further improved by the proposed SMDO-based DSMC.

Conclusions
In this article, a disturbance observer-based discrete slidingmode control scheme is proposed for the speed control of the marine diesel engine.
e system uncertainties and external disturbances are estimated by the designed disturbance observer based on the second-order sliding-mode control. With such estimate to compensate the uncertainties and disturbances, a discretized sliding-mode controller based on the fast power reaching law is employed as the speed control law. In order to verify the controller, a cylinder-by-cylinder MVEM of a marine diesel engine is established by remodelling the combustion torque model, which can simulate the periodic operation of the diesel engine. e numerical simulations are carried out on this model. To show the superiority of the proposed method, the PID controller and ESO-based DSMC are employed for comparison. Moreover, the common operation situations of the marine diesel engines are taken into account, including starting process, acceleration and deceleration, load variation, and varied propulsion system parameters. e results show that the designed SMDO is more stable and has better tracking performance than the ESO, and the proposed SMDO-based DSMC has better control performance and stronger robustness under various working conditions than the PID and ESO-based DSMC. erefore, the speed control performance of a marine diesel engine can be significantly improved by using the proposed controller.

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.