# Sliding Mode Integral Separation PID Control for Hydrogen Fuel Cell Systems
## 3 Sliding Mode Integral Separation PID Control (SMC\(-\)Is\(-\)Pid)
### Sliding Mode Control (SMC)  
The fuel cell mechanism model serves as the basis for writing the state space equations, and the fundamental design procedures of the sliding mode controller, including switching control and equivalent control, are presented.  
The fuel cell state space equation of state is as follows:  
\[\left\{\begin{array}{l}\dot{x}=A_{f}(x)+B_{f}(x)u\\ y=C_{f}(x)\end{array}\right., \tag{14}\]  
where: \(A_{f}(x)\), \(B_{f}(x)\), and \(C_{f}(x)\) are all functions of state variables. The state variable \(x\), the control quantity \(\u\), and the output quantity \(\y\) in the system model are shown below:  
\[x=\left[\begin{array}{c}OER\\ T_{\text{st}}\\ P_{\text{an}}-P_{\text{ca}}\end{array}\right]\quad u=\left[\begin{array}{c}V _{\text{cm}}\\ V_{\text{cw}}\\ \theta\end{array}\right]\quad y=\left[\begin{array}{c}W_{\text{cp}}\\ T_{\text{st}}\\ \Delta P\end{array}\right], \tag{15}\]  
where: \(P_{\text{an}}\)-\(P_{\text{ca}}\) is cathode-anode differential pressure, \(V_{\text{cm}}\) is the voltage of the air pump, \(V_{\text{cw}}\) is the voltage of the radiator, \(\theta\) is the valve openness adjustment, \(W_{\text{cp}}\) is the flow rate of the air compressor, and \(\Delta P\) is the cathode-anode pressure difference.  
The target value expectation is \(x_{\text{ref}}=[OER_{\text{ref}}\ T_{\text{ref}}\ \Delta P_{\text{ref}}]\), so the error \(e\) is:  
\[e=x_{\text{ref}}-x, \tag{16}\]  
Derivation of (16) yields:  
\[\dot{e}=x_{\text{ref}}^{\cdot}-\dot{x}, \tag{17}\]  
The design slip mold surface s is:  
\[s=ce+\dot{e}=c(x_{\text{ref}}-x)+(x_{\text{ref}}^{\cdot}-\dot{x}), \tag{18}\]  
where: \(c\) is the performance parameter of SMC, which takes a value greater than zero.  
Derive the sliding mode surface function of (18) and make it zero:  
\[\dot{s}=ce+\ddot{e}=c(x_{\text{ref}}^{\cdot}-\dot{x})+(x_{\text{ref}}^{\cdot }-\ddot{x})=0, \tag{19}\]  
The second\(-\)order derivative of a variable in a second\(-\)order nonlinear system is specified with:  
\[\ddot{x}=A_{f}(x,\dot{x},t)+B_{f}(x,\dot{x},t)u(t)+d(t), \tag{20}\]  
where: \(A_{f}\big{(}x,\dot{x},t\big{)}\), \(B_{f}\big{(}x,\dot{x},t\big{)}\) is a function of the state variable \(x\) and its derivative, \(u(t)\) is the control input, and \(d(t)\) is the exogenous interference factor. Equation (18) can be reduced to:  
\[\dot{s}=c\dot{e}+\ddot{x}_{\text{ref}}-\ddot{x}=c\dot{e}+\ddot{x}_{\text{ref} }-[f+g\cdot u+d]=0, \tag{21}\]  
Then the equivalent control in the SMC is obtained as:  
\[u_{\text{eq}}=\frac{1}{g}(c\dot{e}+\ddot{x}_{\text{ref}}-f-d), \tag{22}\]There are various design methods for the form of sliding mode control convergence law. The convergence law introduces hyperbolic tangent variable exponential power terms, nonlinear function terms, and saturation function terms to reduce the convergence time of the control. The improved convergence law is as follows:  
\[\dot{s}=-k_{1}|s|^{\pi}\cdot\tanh(s)-k_{2}\cdot fal(s,a,\delta)-k_{3}sat(s) \cdot s, \tag{23}\]  
The specific expressions for the hyperbolic tangent exponential power term, the nonlinear function term, and the saturation function term in (24)-(26) [12; 17; 19] are as follows:  
\[\tanh(s)=\frac{e^{\textit{as}}-e^{-\textit{as}}}{e^{\textit{as}}+e^{-\textit{ as}}}, \tag{24}\]  
\[fal(s,a,\delta)=\left\{\begin{array}{l}s/\delta^{1-a},\qquad\quad|s|\leq \delta\\ |s|^{a}\cdot\tan(s),\delta<|s|<1\\ 0.8,\qquad\quad 1\leq|s|\end{array}\right., \tag{25}\]  
\[sat(s)=\left\{\begin{array}{l}1,\quad 1\leq|s|\\ s,\quad-1<|s|<1\\ -1,\qquad\quad|s|\leq-1\end{array}\right., \tag{26}\]  
The output of the improved sliding mode control using the approach law control for switching control is as follows:  
\[\begin{array}{ll}u_{\text{s}}&=u_{\text{eq}}+u_{\text{conv}}\\ &=\frac{1}{\textit{s}}(\dot{c}\dot{e}+\ddot{x}_{\text{ref}}-f-d)-k_{1}|s|^{ \textit{a}}\cdot\tanh(s)-k_{2}\cdot fal(s,a,\delta)-k_{3}sat(s)\cdot s\end{array} \right., \tag{27}\]