## 3 Control System Design
### Upper Controller
#### 3.2.5 Stability Analysis of the Upper Controller  
The upper controller of the distributed drive electric vehicle lateral stability control system based on the ASSM algorithm needs to be effective under a certain stability condition. Therefore, this section constructs a Lyapunov function to analyze the stability of the upper controller, and finally obtains the stability conditions, which are as follows:  
\[V(s,\dot{s},\alpha)=V_{0}(s,\dot{s})+\frac{1}{2\theta}(\alpha-\alpha^{*})^{2} \tag{38}\]  
In Formula (38):  
\[V_{0}(s,\dot{s})=\alpha^{2}s^{2}+\kappa|s|^{\frac{3}{2}}\text{sgn}(s)\dot{s}+ \alpha|s|^{2}+\frac{1}{4}\dot{s}^{4} \tag{39}\]  
In Formula (39), \(\kappa\) and \(\alpha^{*}\) are both positive constants. First, prove that it converges in a finite time:  
\[V_{0}(s,\dot{s})=|s|^{T}AS+\frac{1}{4}\dot{s}^{4} \tag{40}\]  
In Formula (40): \(S=\left[|s|^{\frac{1}{2}}\text{sgn}(s)\dot{s}\right]^{T}\), \(A=\left[ \begin{array}{cc}\alpha^{2}&\frac{\kappa}{2}\\ \frac{\kappa}{2}&\alpha\end{array} \right]\). When \(0<\kappa<2\alpha 3/2\) is satisfied, \(V_{0}(s,\dot{s})\geq 0\) is established. Derivation of \(V_{0}(s,\dot{s})\):  
\[ \begin{array}{ll}\dot{V}_{0}(s,\dot{s})&=2\alpha^{2}s\dot{s}+\kappa|s|^{ \frac{3}{2}}\text{sgn}(s)\ddot{s}+\frac{3}{2}\kappa|s|^{\frac{1}{2}}\dot{s}^{2 }+2\alpha|s|\ddot{s}\ddot{s}+\dot{s}^{3}\ddot{s}\\ &=2\alpha^{2}s\dot{s}+\frac{3}{2}\kappa|s|^{\frac{1}{2}}\dot{s}^{2}+\kappa|s|^ {\frac{3}{2}}\text{sgn}(s)\Big{\{}d^{*}-\alpha[\text{sgn}(s)+\frac{1}{2}\text {sgn}(\dot{s})]\Big{\}}\\ &+2\alpha|s|\dot{s}\Big{\{}d^{*}-\alpha[\text{sgn}(s)+\frac{1}{2}\text{sgn}( \dot{s})]\Big{\}}+\dot{s}^{3}\Big{\{}d^{*}-\alpha[\text{sgn}(s)+\frac{1}{2} \text{sgn}(\dot{s})]\Big{\}}\end{array}  \tag{41}\]  
In Formula (41), \(d^{*}=\frac{1}{l_{z}}\big{|}\dot{d}\big{|}<D\), \(D\) is a positive constant. Simplify \(V_{0}(s,\dot{s})\) to obtain the following:  
\[ \begin{array}{ll}\dot{V}_{0}(s,\dot{s})&=-\alpha^{2}|s|\big{|}\dot{s}|+ \kappa|s|^{\frac{3}{2}}\text{sgn}(s)\Big{\{}d^{*}-\alpha[\text{sgn}(s)+\frac{1 }{2}\text{sgn}(\dot{s})]\Big{\}}\\ &+\frac{3}{2}\kappa|s|^{\frac{1}{2}}\dot{s}^{2}+2\alpha|s|\dot{s}d^{*}+\dot{s} ^{3}\Big{\{}d^{*}-\alpha[\text{sgn}(s)+\frac{1}{2}\text{sgn}(\dot{s})]\Big{\}} \end{array}  \tag{42}\]  
Simplify the right side of Equation (42) and enlarge it appropriately to obtain the following:  
\[ \begin{array}{ll}\dot{V}_{0}(s,\dot{s})\leq-\kappa|s|^{\frac{3}{2}}(\frac{1 }{2}\alpha-D)-\alpha^{2}|s|\big{|}\dot{s}\big{|}+\frac{3}{2}\kappa|s|^{\frac{ 1}{2}}\dot{s}^{2}+2\alpha|s|\big{|}\dot{s}\big{|}D+(D-\frac{1}{2}\alpha)\dot{s} ^{3}\end{array}  \tag{43}\]  
The right side of Formula (43) is written as:  
\[-\kappa|s|^{\frac{3}{2}}(\frac{1}{2}\alpha-D)-\big{|}\dot{s}\big{|}{S^{*}}^{T} BS^{*}=-\kappa|s|^{\frac{3}{2}}(\frac{1}{2}\alpha-D)-\big{|}\dot{s}\big{|}V_{0}^{*}( \dot{s}) \tag{44}\]  
In Formula (44), \(S^{*}=\big{[}\big{|}\dot{s}\big{|}^{\frac{1}{2}}\big{|}\big{|}\big{|}\big{|}^{T},B=\left[ \begin{array}{cc}\alpha(\alpha-2D)&-\frac{3}{4}\kappa\\ \frac{3}{4}\kappa&\frac{\kappa}{2}-D\end{array} \right]\). If \(\alpha>2D\) and \(0<\kappa<\frac{2\sqrt{2}\alpha}{3}(\frac{\kappa}{2}-D)\) are satisfied, then  
\[\dot{V}_{0}(s,\dot{s})\leq-\kappa|s|^{\frac{3}{2}}(\frac{1}{2}\alpha-D)-\big{|} \dot{s}\big{|}V_{0}^{*}(\dot{s})\leq 0 \tag{45}\]Substituting Formula (45) into Formula (38), and we find the derivative:  
\[ \begin{array}{ll}\dot{V}(s,\dot{s},\alpha)&=V_{0}(s,\dot{s})+\frac{1}{\theta}( \alpha-\alpha^{*})\dot{\alpha}\\ &\leq-\kappa|s|^{\frac{3}{2}}(\frac{1}{2}\alpha-D)-|\dot{s}|V_{0}^{*}(\dot{s})- \frac{\omega}{\sqrt{2\theta}}|\alpha-\alpha^{*}|\\ &\qquad\qquad+\frac{\omega}{\sqrt{2\theta}}|\alpha-\alpha^{*}|+\frac{1}{ \theta}(\alpha-\alpha^{*})\dot{\alpha}\end{array}