Sliding mode control (SMC) is a robust and computationally efficient model-based controller design technique for highly nonlinear systems, in the presence of model and external uncertainties. However, the implementation of the conventional continuous-time SMC on digital computers is limited, due to the imprecisions caused by data sampling and quantization, and the chattering phenomena, which results in high-frequency oscillations. One effective solution to minimize the effects of data sampling and quantization imprecisions is the use of higher-order sliding modes. To this end, in this paper, a new formulation of an adaptive second-order discrete sliding mode controller (DSMC) is presented for a general class of multi-input multi-output (MIMO) uncertain nonlinear systems. Based on a Lyapunov stability argument and by invoking the new invariance principle, not only the asymptotic stability of the controller is guaranteed but also the adaptation law is derived to remove the uncertainties within the nonlinear plant dynamics. The proposed adaptive tracking controller is designed and tested in real time for a highly nonlinear control problem in spark ignition (SI) combustion engine during transient operating conditions. The simulation and real-time processor-in-the-loop (PIL) test results show that the second-order single-input single-output (SISO) DSMC can improve the tracking performances up to 90%, compared to a first-order SISO DSMC under sampling and quantization imprecisions, in the presence of modeling uncertainties. Moreover, it is observed that by converting the engine SISO controllers to a MIMO structure, the overall controller performance can be enhanced by 25%, compared to the SISO second-order DSMC, because of the dynamics coupling consideration within the MIMO DSMC formulation.

## Introduction

Converting a high-dimensional tracking control problem into a low dimensional stabilization control problem is the key feature of sliding mode control (SMC) [1]. SMC shows robust characteristics against external disturbances and model uncertainty/mismatch, while requiring low computational efforts. However, there are challenging issues that arise during implementation of SMC on digital processors, which limit the real-time application of SMC. The two well-recognized challenging issues include: (i) high-frequency oscillations due to chattering phenomenon and (ii) implementation imprecisions due to the analog-to-digital converter (ADC) unit [2–4].

The concept of higher-order sliding modes for continuous-time systems is shown to be an effective approach for reducing the oscillation due to chattering. This approach was first introduced in the 1980s [5]. The basic idea of the higher-order SMC is to not only steer the sliding function to the sliding manifold but also drive all the higher-order derivatives of the sliding variable to zero. Higher-order SMC reduces the high-frequency oscillations by transferring the chattering caused by the discontinuity to the higher-order sliding mode derivatives [5]. Higher-order SMC leads to less oscillations; however, it adds complexity to the calculations. Moreover, it has been shown in Refs. [6] and [7] that converting the continuous-time SMC to a discrete sliding mode controller (DSMC), by using an implicit Euler discretization, allows for a drastic decrease in the chattering in both the input and the output. Thus, according to Ref. [8], which presents a second-order DSMC, the idea of higher-order DSMC can be an ideal solution for the chattering problem by taking advantage of characteristics of the higher-order SMC and discretized SMC.

In addition to the high-frequency oscillations issue, a gap often occurs between the designed and the implemented conventional SMCs, which degrades the controller performance from its expected behavior significantly [3,9]. This gap is mostly created due to: (i) data sampling and quantization imprecisions that are introduced by the ADC at the controller input/output (I/O) and (ii) uncertainties in the modeled dynamics. Fortunately, the SMC structure allows for further modification to improve the controller robustness against ADC (sampling and quantization) imprecisions and compensate for the uncertainties within the plant model [9].

There are several works in the literature aimed at improving the robustness of conventional SMC design against ADC and modeling uncertainties. The results for SMC with incorporated maximum ADC uncertainty bounds [10], and uncertainty adaptive SMC [4] have shown that the continuous-time SMC performance can be improved against implementation imprecisions. However, these improvements are limited, and SMC fails at higher sampling times. On the other side, it has been shown in Ref. [11] that the DSMC and DSMC with incorporated maximum ADC uncertainty bounds can significantly improve the controller robustness against sampling and quantization imprecisions. In the recent works [12,13], we have shown that by incorporating an online ADC uncertainty prediction and propagation mechanism, not only the robustness of the DSMC is guaranteed but also the conservative controller design, which occurs by using the maximum uncertainty bounds, is avoided.

In addition to implementation imprecisions issue, it has been shown in the literature that the SMC structure allows for handling the uncertainties in the plant model. The results in Ref. [14] showed that the bounded uncertainties can be addressed without any adaptation by applying a saturation function into the SMC formulation that generates the boundary layer. The SMC with adaptation for handling modeling uncertainty/mismatch in the previous studies are limited to the continuous-time domain [1], linear systems [15], and first-order sliding control [9,13,16].

In this paper, a new adaptive second-order DSMC formulation is developed for a general class of *uncertain nonlinear systems*. Moreover, the asymptotic stability of the new controller is guaranteed via a Lyapunov stability argument and invoking the new Invariance Principle for nonlinear systems with discontinuity. Compared to a conventional first-order DSMC, the proposed adaptive second-order DSMC with predicted implementation imprecisions provides: (i) higher robustness against implementation imprecisions and modeling uncertainties and (ii) faster tracking performance under unknown external disturbances. These benefits come at the cost of slightly more complex control logic (i.e., first-order sliding mode versus second-order sliding mode). However, the real-time test results show that the required computational power for the second-order DSMC is almost the same as the first-order DSMC. Thus, the real-time implementation of the proposed controller on a real engine control unit (ECU) is feasible and it does not add any further computational demand, compared to the first-order DSMC.

The proposed adaptive second-order DSMC is generic and can be applied to broad engineering system applications. However, the most notable impact is anticipated for industry applications with intensive verification and validation practices, like automotive industries. This is because imprecisions which arise during controller implementation, and uncertainties within the model lead to iterative and costly verification and validation. In this paper, application of the proposed control design is tested for control of a spark ignition (SI) combustion engine which exhibits highly nonlinear and coupled dynamics, and includes ADC and modeling uncertainties with required processing time of 2–10 ms per iteration. The contribution of this paper is threefold:

- (1)
Developing a new formulation of an

*adaptive second-order DSMC*for a general class of multi-input multi-output (MIMO) nonlinear affine systems with inclusion of uncertainties within the plant model. - (2)
Derivation of an innovative adaptation law to remove the uncertainty within the model in finite time via a discrete Lyapunov stability analysis, that also guarantees the asymptotic stability of the closed-loop system.

- (3)
Presenting the first application of the adaptive second-order DSMC for a combustion engine control problem. The proposed second-order DSMC not only demonstrates robust behavior against data sampling and quantization imprecisions but also removes the uncertainties in the engine model quickly and steers the dynamics to their nominal values in finite time.

## Second-Order Discrete Sliding Mode Control

where $x=[x1,x2,\u2026,xr]\u22ba\u2208\mathbb{R}r$, and $u\u2208\mathbb{R}$ are the state vector, and the scalar input variable, respectively. Moreover, it is assumed that *f* is smooth and sufficiently differentiable [17]. The sliding mode order is the number of continuous successive derivatives of the differentiable sliding variable $s\u2208\mathbb{R}$, and it is a measure of the degree of smoothness of the sliding variable in the vicinity of the sliding manifold.

*α*) can be presented using the following state-space equation:

_{i}*i*) are provided to represent a single scalar value.

*α*, which represents the errors/mismatches in the plant model, is unknown and constant. The continuous-time model in Eq. (2) is discretized by utilizing the first-order Euler approximation

_{i}*T*is the sampling time. The second-order discrete sliding variable is defined [8]

where $si(k)=xi(k)\u2212xi,d(k)$, and *β* is a constant second-order sliding mode gain. Moreover, *x _{i}*

_{,}

*is the known desired trajectory of*

_{d}*x*.

_{i}where *ρ _{α}* > 0 is a tunable adaptation gain chosen for the numerical sensitivity of the unknown parameter estimation. As can be seen from Eq. (10), the proposed Lyapunov function is positive definite and quadratic with respect to the sliding variable (

*s*(

_{i}*k*)) and the unknown parameter estimation error ($\alpha \u0303i(k)$). The desired condition is asymptotic and finite time convergence of both

*s*and $\alpha \u0303i$ to zero, which is guaranteed by exploiting the following results.

_{i}*If the following adaptation law is used to estimate the unknown multiplicative term (α*

_{i}):*then the difference function of the proposed Lyapunov function in Eq. (10) becomes*

*where,*$\Delta si(k)\u2261si(k+1)\u2212si(k)$

*and*$\Delta \alpha \u0303i(k)\u2261\alpha \u0303i(k+1)\u2212\alpha \u0303i(k)$. The proof of Proposition 1 is presented in the Appendix section.

*Tλ*> 0 condition should be met to guarantee that states of the system will move monotonically toward the switching plane (

*s*= 0), and cross it in finite time [18]. Next, the first-order sliding variable (

_{i}*s*) in Eq. (14) is replaced with the second-order sliding variable (

_{i}*ξ*)

_{i}*If the second-order sliding function (ξ*

_{i}) has the dynamic shown in Eq. (15), then by applying the calculated equivalent control input of the second-order DSMC from Eq. (8) along with the so-called switching control input (u_{i,sw}), it can be concluded that:The proof of Proposition 2 is presented in the Appendix section.

Proposition 2 (Eq. (16)) states that, if 1 > β > β^{2} > 0, the proposed equivalent control input of the second-order DMSC along with the switching function in Eq. (B9) fulfills Gao's discrete sliding mode reaching law, which guarantees finite time convergence of the system's states to the sliding manifold [18].

*O*(.)) in Eq. (12), and assuming a small enough sampling time (

*T*), which means all terms that contain

*T*

^{2}can be neglected, Eq. (12) can be re-arranged as follows:

*ξ*definition (Eq. (5)) and Eq. (16),

_{i}*s*(

_{i}*k*+ 1) and

*s*(

_{i}*k*+ 2) can be replaced by $\u2212\beta si(k)$ and $\beta 2si(k)$, respectively. By doing these replacements, Eq. (17) can be simplified as

$\u2212\beta 3\u2212\beta 2+\beta +1$ is positive if 1 > *β* > 0. In other words, if 1 > *β* > 0, then $\Delta Vi(k)\u22640$, which guarantees the stability of the system ($\xi i(k)\u21920$). Of interesting note is the 1 > *β* > 0 constraint which is consistent with the earlier concluded condition on *β* to make sure Gao's sliding reaching law is fulfilled by the equivalent control input of the second-order DSMC.

*u*

_{eq}from Eq. (8),

*u*

_{i}_{,}

*from Eq. (B9), and the adaptation law from Eq. (11), the negative semidefinite condition of the Lyapunov difference function is guaranteed. This means that the sliding variable (the tracking error,*

_{sw}*s*) converges to zero, and the error in estimating the unknown parameter ($\alpha \u0303i$) is at least bounded. Moreover, according to Eq. (16), since 1 >

_{i}*β*> 0, it is obvious that 1 >

*β*>

*β*

^{2}> 0. Existence of a negative semidefinite Lyapunov difference function means that

On the other side, based on the results of Proposition 2, we have $si(k+2)\u2248\beta 2si(k)$. Thus, $si(k+2)=si(k)$, only if $si(k+2)=si(k)=0$; otherwise, $si(k+2)<si(k)$. We also know that based on the second-order sliding control law $si(k+2)+\beta si(k+1)=0$ and $si(k+1)+\beta si(k)=0$. Therefore, if $si(k+2)=si(k)=0$, then $si(k+1)=0$. Overall, based on the negative semidefinite Lyapunov difference function, it can be shown that $si(k+2)<si(k)$, unless $si(k)=si(k+1)=si(k+2)=0$. Therefore, the second-order DSMC guarantees asymptotic decrease of *s* over a two-step horizon. However, in order to guarantee the global asymptotic convergence and stability characteristics of the second-order DMSC over the reaching and sliding modes, it is required to show that all the higher-order Lyapunov difference functions vanish as *s _{i}* → 0 [9,20]. This will be proofed in the following section by invoking the new Invariance Principle for nonautonomous systems [21].

### Global Asymptotic Stability of the Second-Order Discrete Sliding Mode Controller.

*s*(

_{i}*k*) = 0. According to Eq. (20), it is obvious that $\Delta Vi(k+1)\u2212\Delta Vi(k)=0$ if $si2(k+1)\u2212si2(k)=0$. $si2(k+1)\u2212si2(k)=0$

_{,}if either of the following conditions is met:

Equation (18) says that if *s _{i}*(

*k*) = 0, then $\Delta Vi(k)=0$. If one assumes that the unknown uncertainty term is removed from the model using the proposed adaptation algorithm, the second-order sliding mode condition denotes that $\xi i(k+1)=\xi i(k)=0$, which means $si(k+1)=\u2212\beta si(k)$. Thus, if $si(k)=0,\u2009si(k+1)$ also becomes zero, and consequently, $\Delta Vi(k+1)\u2212\Delta Vi(k)=0$. This means that condition (I) in Eq. (21) is realizable.

According to Eq. (19), $si(k+1)<si(k)$. This means $si(k+1)<si(k)$ unless $si(k+1)=si(k)=0$. Thus, the condition (II) in Eq. (21) cannot be true and only condition (I) is feasible. According to condition (*I*), if *s*(*k*) = 0, not only $\Delta Vi(k)=0$ but also $\Delta Vi(k+1)\u2212\Delta Vi(k)=0$.

Again, since $si(k+2)<si(k+1)<si(k),\u2009si(k+2)\u2260si(k+1)/si(k)$ unless $si(k+2)=si(k+1)=si(k)=0$. Thus, if $si(k)=0$, not only $si(k+1)=si(k+2)=0$ but also $\Delta Vi(k)=0,\u2009\Delta Vi(k+1)\u2212\Delta Vi(k)=0$, and $(\Delta Vi(k+2)\u2212\Delta Vi(k+1))\u2212(\Delta Vi(k+1)\u2212\Delta Vi(k))=0$. In a same manner as the first-, second-, and third-order difference functions, it can be shown that higher-order Lyapunov difference functions (>3) become zero only, and only if $si(k)=0$ [9,20]. This is a key conclusion that allows for proof of the global asymptotic stability by invoking the new Invariance Principle for nonautonomous systems [22].

Continuity is one of the required conditions for the LaSalle's invariance principle [23] to conclude the asymptotic stability with respect to a negative semidefinite derivative of a positive definite Lyapunov function. LaSalle's invariance principle has been extended in Ref. [22] to nonlinear systems with discontinuity. The extension of LaSalle's invariance principle to discrete systems, which is called the new invariance principle theorem, removes the continuity requirement, and allows us to conclude the asymptotic stability with respect to a negative semi definite difference function of a positive definite Lyapunov discrete equation. It was shown that when $si(k)=0$, the Lyapunov difference function, all the future values of the sliding variable, and higher-order Lyapunov differences become zero. Therefore, all the trajectories of the system approach the set defined by $\Delta Vi(k)\u22610$. Since *s*(*k*) = 0 and $\alpha \u0303i(k)=0$ are the only trajectories which satisfy the nonlinear uncertain system equations, this trajectory ($s(k)=0,\alpha \u0303i(k)=0$) is a limit point, and also an equilibrium point, of the closed-loop system [9,20].

where $xi,0$=$xi(0)$ is the initial condition. The negative semi definite condition of the Lyapunov difference function means that all system states are bounded and contained within the domain $\Omega 0$ [22]. For a small enough sampling time, if the following condition holds [22]:

$|xi(k)+Tfi+Tgiui(k)|$ is bounded for any bounded *x _{i}* then, $si(k)$ = $\alpha \u0303i(k)$ = 0, which is the only limit point (equilibrium point) of the system, belongs to Ω

*= $\Omega 0\u2229\Omega i$. Therefore, $si(k)$ and $\alpha \u0303i(k)\u21920$ as $k\u2192\u221e$. Thus, according to the new Invariance Principle theorem [22], the asymptotic convergence of the two variables to zero with a positive definite Lyapunov function and a negative semidefinite Lyapunov difference equation is concluded.*

_{f}where *u _{i}*

_{,eq}and

*u*

_{i}_{,}

*are calculated according to Eq. (8), and Eq. (B9), respectively. The main reason to add the switching function to the calculated equivalent control input of the SMC is reducing the chattering [5]. As it has been shown in Refs. [9], [11], and 12], the addition of the switching function with a fix or variable gain enhances the robustness of the controller against uncertainties, which could overpower the chattering issues. The gain of the switching function ($sgn(\xi i(k\u22121))$), which depends on the DSMC tuning parameters ($\lambda ,\beta $) and*

_{sw}*g*(Eq. (2)), is the key to ensure the controller robustness against external uncertainties [9]. By looking into Eq. (B9), it can be seen that the gain of the switching function has the same unit of the control input. This gain represents the boundary of the external uncertainties on the control signals, i.e., ADC imprecisions [3,11].

*λ*and

*β*is hard to achieve. Instead, an online sampling and quantization uncertainty prediction mechanism was proposed in Ref. [12], which allows for estimating and propagating the ADC uncertainty bounds on the control signal, and avoids conservative controller design. The switching function with the predicted ADC uncertainty bounds has the following structure:

## Multi-Input Multi-Output Adaptive Second-Order Discrete Sliding Mode Controller

*κ*($\u22111h\kappa j<r$), the discrete dynamics of the first-order sliding surface (

_{j}**s**) in the presence of the model uncertainties is

*λ*[20]. In the absence of the model uncertainties, it is obvious that $\Lambda \u0302=\Lambda $. In this paper, we assume a relative degree of one ($\kappa j=1$) for the output. Thus, according to the sliding surface definition and the relative degree of the outputs, the nonsingular $\u03d2\u2208\mathbb{R}h\xd7h$ matrix in Eq. (30) becomes

_{j}It is assumed that here we deal with an MIMO system that has an output with a relative degree of one. Therefore, according to Eq. (29), $sj(k)$ = $yj(k)\u2212ydj(k)$. For the sake of simplicity it can be assumed that *r* = *h* (which means *i* = *j* = *p* = 1:*r*), $mi(x)$ = $xi(k)$, and $ydi(k)$ = $xdi(k)$. The latter assumption means that here, state space variables of the state vector are treated as the output variables, and for each state variable (*x _{i}*), a sliding surface (

*s*) is defined and it is assumed that a unique control input (

_{i}*u*), either physical or synthetic, exists for every single sliding surface within the sliding surface vector (

_{i}**s**).

*positive definite*matrix of the second-order sliding mode gains. The equivalent control input vector which satisfies the second-order sliding mode condition ($\xi (k+1)=\xi (k)=0$) can be found by solving the following equation for $ueq$:

where $a\u0303(k)=a\u2212a\u0302(k)$.

where $\Gamma \u2208\mathbb{R}r\xd7r$ is the tunable adaptation *symmetric positive* matrix.

*If the following adaptation law is used to estimate the vector of the unknown multiplicative terms (*$a\u0303$

*)*

*then the Lyapunov difference function of Eq. (37) becomes*

*where, ΔV is negative semidefinite if eigenvalues of*$\beta $

*lie within the unit circle [20].*The proof of Proposition 3 is presented in the Appendix section.

One can easily find the analogous structure between MIMO (Eq. (38)) and SISO (Eq. (11)) adaptation laws.

According to Proposition 3, the Lyapunov function in Eq. (37) guarantees the finite time zero convergence of the first-order sliding vector (**s**), and intuitively gives the adaptation law to remove the uncertainty in the model. However, still it is required to prove the asymptotic convergence of the second-order sliding vector ($\xi $) to zero. To this end, first it is assumed that the uncertainty in the model is removed permanently by incorporating the adaptation rule from Eq. (38). Validity of this assumption will be testified in Sec. 5. Next, the system switches to another Lyapunov function ($V*$, proposed in Eq. (40)), which covers the time interval after the completion of the adaptation period.

*V*

^{*}with respect to

**s**(

*k*) and

**s**(

*k*+ 1), and knowing that all the higher-order partial derivatives and also second-order cross derivative are zero, the Lyapunov difference function becomes

*V*

^{*}in Eq. (45) is negative semidefinite in

**s**(

*k*) when $\beta $ is chosen such that its eigenvalues lie within the unit circle. More importantly, due to the analogous structure between MIMO and SISO adaptive second-order DSMCs, the asymptotic stability of the MIMO controller can be proved by invoking the new invariance principle [21,22] and noting that the higher-order Lyapunov difference functions are zero, if and only if

**s**=

**0**[16].

## Case Study: Automotive Engine Control

In this section, the proposed adaptive second-order DSMC is designed for an experimentally validated physics-based SI engine model [25] during transient cold start period. The engine model [25] is parameterized for a 2.4-l, 4-cylinder, DOHC 16-valve Toyota 2AZ-FE engine. The engine rated power is 117 kW *@* 5600 rpm, and it has a rated torque of 220 Nm *@* 4000 rpm. The experimental validation of different components of the engine model is available in Ref. [26]. The nonlinear model has four states including the exhaust gas temperature (*T*_{ex}* _{h}*), fuel mass flow rate into the cylinders ($m\u02d9f$), the engine speed (

*ω*), and the mass of air inside the intake manifold (

_{e}*m*). The engine performance is controlled by three inputs: (i) $m\u02d9ai$ (air mass flow rate into the intake manifold) controls the engine speed via the air throttle body, (ii) $m\u02d9fc$ (amount of injected fuel into the cylinder) regulates the air–fuel ratio (AFR) via the fuel injector, and (iii) Δ (spark timing) controls the exhaust gas temperature via the spark plug. Details of the functions and constants in the engine model are found in Ref. [25]. The schematic of the SI engine control system is shown in Fig. 2.

_{a}*T*,

_{exh}*ω*, AFR to their desired values. To this end, with respect to each desired trajectory ($Texh,d,\u2009\omega e,d$, AFR

_{e}*), a sliding variable (tracking error) is defined. Additionally, as can be seen from Eq. (46), since there is no explicit control input in the engine speed equations,*

_{d}*m*

_{a}_{,}

*is defined as a synthetic control input for the rotational dynamics. The calculated*

_{d}*m*

_{a}_{,}

*will be used as the desired trajectory for the air mass flow controller over the next engine cycle. Thus, the sliding vector is*

_{d}The equivalent control input vector (**u**_{eq}) of the *baseline* second-order DSMC for the engine case study can be obtained by substituting **F**, ϒ, and **s** into Eq. (35). For the SISO DSMC, $\beta $ is chosen to be diagonal, while for the MIMO controller, the dynamic coupling is included via the off-diagonal element of $\beta $. For the second-order DSMC *with ADC uncertainties*, according to Eq. (44), the predicted ADC uncertainties are incorporated into the DSMC structure through the switching control input (**u*** _{sw}*) gains. For the engine case study, the gains of the switching control input ($\mu \Delta ,\u2009\mu m\u02d9fc,\u2009\mu m\u02d9ai,\u2009\mu ma,d$) are estimated online using the mechanism previously shown in Fig. 1. The accuracy of the sampling and quantization imprecisions prediction and propagation mechanism has been shown in our previous works [9,12,13]. The engine controller is tuned manually, by using the try and error method, to achieve the best performance. The performed simulation and real-time results, which will be presented later in this section, show that once the controller is tuned properly, there is almost no need to re-tune the controller, unless the sampling and quantization level changes, which in practice those are known and fixed.

### Handling Implementation Imprecisions.

In order to demonstrate the robustness characteristics of the second-order DSMC compared to the first-order controller in handling ADC uncertainties, first we assume that the engine model is ideal and there is no uncertainty in the modeled dynamics ($\alpha Texh$ = $\alpha m\u02d9f$ = $\alpha \omega e$ = $\alpha ma$ = 1). Figure 3 shows the desired trajectories (AFR, *T*_{ex}* _{h}*, and engine speed) tracking results, using the first- and second-order DSMCs for sampling times of 20 ms and 80 ms, and quantization level of 16-bit and 10-bit, respectively. The mean tracking errors for both controllers are listed in Table 1. It can be observed from Fig. 3 and Table 1 that, when the signals at the controller I/O are sampled every 20 ms, both first- and second-order baseline DSMCs illustrate smooth and acceptable tracking performances, while the second-order controller is more accurate by up to 67% in terms of the tracking errors.

Upon increasing the sampling rate from 20 ms to 80 ms, and changing the ADC quantization level from 16-bit to 10-bit, the first-order DSMC performance degrades significantly. On the other side, the second-order DSMC still presents accurate tracking results. By comparing the first- and second-order DSMC results at *T* = 80 ms and quantization level of 10-bit, it can be concluded that the proposed second-order DSMC offers higher robustness against ADC uncertainties and outperforms the first-order controller by up to 90% in terms of the mean tracking errors:

For the SI engine case study, AFR controller is the most uncertainty-sensitive controller, in comparison with the engine speed and exhaust gas temperature controllers [4,27]. Figure 4 shows the tracking results of the first-order (SISO) and second-order (SISO and MIMO) DSMCs under a relatively large sampling rate of 200 *ms*, which causes significant uncertainty at the controller I/O. As shown in Fig. 4, the first-order DSMC fails to track all the desired trajectories under these extreme ADC uncertainties, but the SISO second-order DSMC shows acceptable tracking performances.

where, $m\u02d9ao=AFRm\u02d9f$. Moreover, Fig. 4 shows that the changes in desired engine speed profile have an effect on *T*_{ex}* _{h}* controller performance. Similar to the AFR controller, the link between

*T*

_{ex}

*and engine speed controllers is the exhaust gas temperature time constant (*

_{h}*τ*), which is calculated with respect to the engine speed as $\tau e=(2\pi /\omega e)$.

_{e}The coupling within the engine dynamics can be represented in the MIMO DSMC design via $\beta $ matrix. The diagonal elements of $\beta $ are the same as the SISO controller, while the off-diagonal element represents the coupling between various sliding variables. According to Eq. (50) and *τ _{e}*, $\beta $ is defined to present the coupling between AFR,

*T*

_{ex}

*, and engine speed controllers. Additionally, the engine speed and air mass flow dynamics are inherently coupled because of the synthetic $ma,d$ control input, which is the input to the engine speed controller and the reference trajectory for the air mass flow controller. Previously, the results in Ref. [28] showed that allowing $m\u02d9f,c$ (used to regulate AFR) to depend upon the cam phasing (rotational dynamics) leads to smaller transients in AFR tracking results. With a similar trend to Ref. [28], here, Fig. 4 shows that by utilizing the MIMO controller with predicted ADC uncertainties, not only the AFR tracking error decreases (by 46%) but also the effects of the engine speed trajectory variation on the AFR tracking become smaller.*

_{h}In a similar manner to AFR controller, by utilizing the MIMO second-order controller for *T*_{ex}* _{h}*, the desired

*T*

_{ex}

*tracking performance improves slightly (by 11%) compared to the SISO second-order DSMC, and the large overshoot at the beginning of the simulation will be removed. On the other side, by looking into Fig. 4, it can be seen that changing the engine speed controller to MIMO structure has almost no significant effect on the tracking performance. As highlighted in Fig. 4, the MIMO controller results in small spikes, which occur when the desired AFR trajectory has a sudden change (Fig. 4).*

_{h}### Handling Model Uncertainties.

In the next step, the performs of the proposed adaptation mechanism for the SISO/MIMO second-order DSMC is investigated under up to 50% multiplicative uncertainty within the engine model. In the following, the adaptation law for each of the engine controllers, along with the physical interpretation of the considered uncertain terms are discussed.

*Exhaust gas temperature controller.*According to Eq. (47),*T*_{ex}dynamics is a strong function of the exhaust gas time constant (_{h}*τ*). Thus, any error in estimating the_{e}*τ*directly affects the_{e}*T*_{ex}dynamics and causes deviation from the nominal model. Error in estimating_{h}*τ*is represented by the multiplicative uncertainty term ($\alpha Texh$). The error in the modeled_{e}*T*_{ex}dynamics is removed by using the following adaptation law with respect to Eq. (11)_{h}$\alpha \u0302Texh(k+1)=\alpha \u0302Texh(k)+T(s1(k))\tau e\rho \alpha 1(600AFI\u2212Texh(k))$(51)*Fuel flow rate controller*. The fuel evaporation time constant*τ*plays an important role in the fuel flow rate dynamics. This means that any error in estimating_{f}*τ*can deviate the model under the test from the nominal model considerably. $\alpha m\u02d9f$ can represent any potential errors or variations in the estimated_{f}*τ*. The adaptation law for $\alpha m\u02d9f$ becomes_{f}$\alpha \u0302m\u02d9f(k+1)=\alpha \u0302m\u02d9f(k)\u2212T(s2(k))\tau f\rho \alpha 2m\u02d9f(k)$(52)

where, $m\u02d9f,d$ is calculated according to desired AFR in Eq. (50).

*Engine speed controll*er. In the engine speed dynamics, the torque loss on the crankshaft (*T*_{loss}), is defined as $Tloss=0.4\omega e+100$. The*T*_{loss}is estimated by reading a torque map. Thus, the multiplicative uncertainty term $\alpha \omega e$ compensates for any error in reading the torque map. The adaptation law for the engine speed controller is$\alpha \u0302\omega e(k+1)=\alpha \u0302\omega e(k)\u2212T(s3(k))J.\rho \alpha 3(0.4\omega e(k)+100)$(53)*Air mass flow controller*. Air mass flow into the cylinder ($m\u02d9ao$) is determined by $m\u02d9ao=k1\eta volma\omega e$ [25].*η*is the volumetric efficiency, and is calculated by using an empirical curve fit [9]. Thus, $\alpha ma$ can represent the uncertainty in $m\u02d9ao$ that is extracted from_{vol}*η*curve fit. $\alpha \u0302ma$ is estimated by using the following adaptation law:_{vol}$\alpha \u0302ma(k+1)=\alpha \u0302ma(k)\u2212T(s4(k))\rho \beta 4m\u02d9ao.$(54)

As long as the adaptation algorithm parameter ($\rho \alpha $) is tuned properly, there is no extra condition for convergence of the unknown parameters within the model. This has been examined and confirmed through extensive simulations for different trajectories and operation conditions, as shown in Sec. 5. In Sec. 5, the performance of both SISO and MIMO adaptive second-order DSMCs will be evaluated in real-time by testing the controller software on a real ECU in a processor-in-the-loop (PIL) setup.

## Real-Time Second-Order Discrete Sliding Mode Controller Verification

The designed adaptive SISO and MIMO second-order DSMCs in Sec. 4.2 are tested in a PIL setup (see Ref. [9] for the schematic and details of the PIL setup) to verify the performances of the adaptive DSMC in real time. The PIL setup has two different processors, namely National Instrument (NI) PXI processor (NI PXIe-8135) and dSPACE MicroAutobox II (MABX). The model of the engine plant is built into the PXI processor. The output of the PXI processor is the controller feedback signal from the plant. Using embedded ADC units, the feedback signal is sampled and quantized at 80 ms and 16-bit, respectively. On the other side, the adaptive second-order DSMC logic along with the adaptation and uncertainty prediction mechanisms are implemented into the MABX, which is the main ECU. The output of the MABX is the control signal which is set to be updated at every 80 ms.

NI VeriStand and dSPACE Control Desk software on an interface desktop computer are used to configure the PIL setup, and conduct real-time tests, including desired trajectories tracking, unknown parameters estimation, and engine operation. Figure 5 shows the results of four unknown multiplicative parameters estimation from SISO and MIMO second-order DSMCs with predicted ADC uncertainties. It can be seen that under up to 50% uncertainty on each of the engine model's dynamics, by using the proposed adaptation mechanism, the unknown terms converge to their nominal values, “1”, in less than 4 *s*. Moreover, the MIMO controller shows faster convergence for $\alpha Texh$ and $\alpha m\u02d9f$, while for $\alpha ma$ and $\alpha \omega e$, SISO and MIMO controllers show similar convergence behavior.

Additionally, it can be observed that for all cases, despite the variation in the desired trajectories, after completion of the adaptation period, the uncertainties in the models are removed permanently. Finally, the PIL testing results show that the proposed adaptation mechanism is able to operate in real time since it is computationally efficient. The adaptation time is significantly reduced if shorter sampling time is applied.

Figure 6 shows the desired trajectory tracking results from the nonadaptive, and SISO/MIMO second-order DSMCs. First of all, it can be seen that in the absence of the adaptation mechanism, due to the large uncertainties in the plant model (50%), the nonadaptive controller fails to track the desired trajectories for all the cases. Upon activation of the adaptation mechanism, it can be seen that after completion of the adaptation period, both SISO and MIMO adaptive second-order DSMCs with predicted ADC uncertainties provide accurate tracking performances. By comparing the nonadaptive and adaptive DSMCs it is revealed that the adaptation mechanism is able to remove the uncertainties in the model by more than 95%, that consequently results in more than 90% improvement in the controller tracking performance.

Figure 6 shows that the MIMO and SISO second-order DSMCs have similar tracking behavior for the engine speed tracking. However, by using the MIMO structure, the tracking performance for AFR and *T*_{ex}* _{h}* controllers can be improved by 43%, and 33%, respectively. These improvements are more significant during the adaptation period, and also at those points where there are sudden changes in the desired engine speed profile. The latter observations can be explained based on the engine dynamics, in which the engine speed loop acts as a disturbance to AFR and

*T*

_{ex}

*(Eq. (50)). By using the MIMO controller, $m\u02d9fc$ and Δ, which are used, respectively, to regulate AFR and*

_{h}*T*

_{ex}

*can be configured to depend upon the engine speed dynamics. Linking the control input of the AFR and*

_{h}*T*

_{ex}

*controllers to the rotational dynamics allows for better AFR and*

_{h}*T*

_{ex}

*tracking performances during the engine speed transients.*

_{h}As another example, Fig. 7 shows the closed-loop performance of the proposed second-order adaptive DSMC in tracking non-smooth trajectories, under modeling and implementation imprecisions. The results in Fig. 7 also show the evolution of the control signals, $m\u02d9ai,\u2009m\u02d9fc$, and Δ. As can be seen, during the first few seconds, while the adaptation mechanism is estimation the unknown parameters, the control signals are rather aggressive, which results in deviations in the tracking. Once the unknown parameters estimation period is over in less than 5 *s*, the trajectory tracking performance becomes nominal, and the control signals are smooth, except for those instants when a sudden change in the desired trajectory occurs.

## Summary and Conclusion

A new formulation of an adaptive second-order DSMC for MIMO nonlinear uncertain systems, along with an adaptation mechanism and a new switching control input, was presented in this paper. First, the adaptation law, for handling the uncertainties within the model, was driven based on a discrete Lyapunov stability theorem. Second, the behavior of the second-order DSMC was studied on both reaching and sliding phases. In order to ensure the controller robustness against external ADC imprecisions, a new switching control input was introduced, which contains the knowledge of ADC imprecisions via an online sampling and quantization uncertainties prediction and propagation mechanism. Third, the asymptotic stability of the proposed controller was guaranteed by invoking the new Invariance Principal for nonlinear discontinuous systems.

The proposed controller was evaluated for a highly nonlinear combustion engine tracking control problem. The designed second-order adaptive MIMO/SISO DSMC was tested in real time on a real ECU inside a PIL setup. The simulation, and experimental real-time comparison results between the first- and second-order DSMCs revealed that:

- (1)
The second-order DSMC shows higher robustness against ADC uncertainties. When the sampling rate is changed from 20 ms to 80 ms, and the quantization level changed from 16-bit to 10-bit, the second-order DSMC is able to improve the tracking errors by more than 90% compared to the first-order DSMC.

- (2)
Inclusion of the physical coupling within the engine dynamics in the controller structure via the MIMO formulation allows for further improvement in AFR and

*T*_{ex}controllers tracking performance (by up to 46% and 11%, respectively). However, the engine speed seems to lean strongly toward a decoupled or minimally coupled structure._{h} - (3)
In the presence of model uncertainties, it was shown that the proposed adaptation mechanism is able to remove the errors in the model permanently in less than 4 s of the engine operation time. Moreover, compared to the SISO DSMC, the MIMO controller shows faster unknown parameters convergence rates for the AFR and

*T*_{ex}controllers. The MIMO adaptive second-order DSMC is able to improve the AFR and_{h}*T*_{ex}tracking errors by 43% and 33%, respectively, compared to the SISO second-order adaptive DSMC under modeling and ADC uncertainties._{h}

## Acknowledgment

The Late Professor J. Karl Hedrick from University of California, Berkeley, Professor Rush Robinett III from Michigan Technological University, and Dr. Ken Butts from Toyota Motor Engineering & Manufacturing North America are gratefully acknowledged for their technical comments during the course of this study.

## Funding Data

National Science Foundation (Grant No. 1434273).

### Appendix

*Proof of Proposition*1. To guarantee the asymptotic stability and finite-time convergence of both

*s*and $\alpha \u0303$ to zero, in the discrete time domain, the difference function of

*V*(Eq. (10)) should be at least negative semi-definite to ensure the stability of the closed-loop system [13, 29]. The Lyapunov difference function (Δ

*V*(

*k*) =

*V*(

*k*+ 1) −

*V*(

*k*)) is calculated using a Taylor series expansion

*V*(

*k*) =

*V*(

*k*+ 1) −

*V*(

*k*)) can be obtained by substituting the values of the partial derivatives into Eq. (A1):

*s*(

_{i}*k*) ≡

*s*(

_{i}*k*+ 1) −

*s*(

_{i}*k*), and Δ$\alpha \u0303$

_{i}(

*k*) ≡ $\alpha \u0303$

_{i}(

*k*+ 1) − $\alpha \u0303$

_{i}(

*k*) at

*k*and

*k*+ 1 time steps:

*β*> 0. As the Lyapunov difference function must be at least negative semidefinite, the second and third terms in Eq. (A4) should become zero, which leads to the following adaptation law (Eq. (11)):

*Proof of Proposition*2. By recalling Eq. (4), we have

*Proof of Proposition*3. The Lyapunov difference function of Eq. (37), Δ

*V*(

*k*) =

*V*(

*k*+1)

*V*(

*k*), is obtained by performing the Taylor series expansion on Eq. (37). To this end, first we define Δs and Δ$a\u0303$ vectors as follows:

*V*(

*k*) is calculated:

*O*(

*k*) is defined based on the second-order terms in Eq. (C5)