## 4 Controller Design
### Proposed Method  
In the proposed method where a pendulum like movable mechanism is added to the wheelchair, the number of control inputs (\(\tau_{\text{w}}\) and \(\tau_{p}\)) is equal to the number of controlled variables. A QSMC control scheme is suitable in this case. To develop the QSMC controller for the system, the two sliding surfaces \(\sigma_{1}\) and \(\sigma_{2}\) defined in Equation (5) are used. According to Equation (7), we have  
\[\begin{cases}\ddot{\theta}_{b}=-M_{11}^{-1}(H_{1}+G_{1})-M_{12}^{-1}(H_{2}+G_{ 2}-\tau_{\text{w}})-M_{13}^{-1}(H_{3}+G_{3}-\tau_{p})\\ \ddot{\theta}_{\text{w}}=-M_{21}^{-1}(H_{1}+G_{1})-M_{22}^{-1}(H_{2}+G_{2}- \tau_{\text{w}})-M_{23}^{-1}(H_{3}+G_{3}-\tau_{p}).\end{cases} \tag{20}\]  
Combining Equations (6) and (20) yields  
\[\begin{cases}\dot{\sigma}_{1}=c_{1}e_{2}-M_{11}^{-1}(H_{1}+G_{1})-M_{12}^{-1}( H_{2}+G_{2}-\tau_{\text{w}})-M_{13}^{-1}(H_{3}+G_{3}-\tau_{p})-\ddot{\theta}_{b _{d}},\\ \dot{\sigma}_{2}=c_{2}e_{4}-M_{21}^{-1}(H_{1}+G_{1})-M_{22}^{-1}(H_{2}+G_{2}- \tau_{\text{w}})-M_{23}^{-1}(H_{3}+G_{3}-\tau_{p})-\ddot{\theta}_{\text{w}_{d}}.\end{cases} \tag{21}\]  
Note, to avoid the chattering phenomenon, a smooth sigmoid function is replaced with the non-smooth function \(\text{sign}(\sigma)\). To obtain equivalent control inputs, \(\dot{\sigma}_{1}\) and \(\dot{\sigma}_{2}\) are considered as  
\[\dot{\sigma}_{1}=-\rho_{1}\frac{\sigma_{1}}{\mid\sigma_{1}\mid+\varepsilon_{1 }},\hskip 28.452756 pt\dot{\sigma}_{2}=-\rho_{2}\frac{\sigma_{2}}{\mid\sigma_{2} \mid+\varepsilon_{2}}, \tag{22}\]  
where \(\rho_{1}\) and \(\rho_{2}\) are two positive controller gains and \(\varepsilon_{1}\) and \(\varepsilon_{2}\) are two small positive scalars [33]. Therefore, the control inputs can be obtained as  
\[\begin{cases}\tau_{\text{w}}=(F_{1}-\frac{M_{13}^{-1}}{M_{23}^{-1}}F_{2})/(M_ {12}^{-1}-\frac{M_{22}^{-1}M_{13}^{-1}}{M_{23}^{-1}}),\\ \tau_{p}=(F_{1}-M_{12}^{-1}\tau_{\text{w}})/M_{13}^{-1},\end{cases} \tag{23}\]  
where  
\[\begin{cases}F_{1}=-\rho_{1}\frac{\sigma_{1}}{\mid\sigma_{1}\mid+\varepsilon_ {1}}-c_{1}e_{2}+M_{11}^{-1}(H_{1}+G_{1})+M_{12}^{-1}(H_{2}+G_{2})+M_{13}^{-1}( H_{3}+G_{3})+\ddot{\theta}_{b_{d}},\\ F_{2}=-\rho_{2}\frac{\sigma_{2}}{\mid\sigma_{2}\mid+\varepsilon_{2}}-c_{2}e_{4 }+M_{21}^{-1}(H_{1}+G_{1})+M_{22}^{-1}(H_{2}+G_{2})+M_{23}^{-1}(H_{3}+G_{3})+ \ddot{\theta}_{\text{w}_{d}}.\end{cases}\]  
To prove the stability of the QSMC controller, the [PERSON] function candidates can be chosen as  
\[V_{2}=\frac{1}{2}\sigma_{1}^{2},\hskip 28.452756 ptV_{3}=\frac{1}{2}\sigma_{2}^{2}. \tag{24}\]  
The below conditions should be satisfied to provide stability of QSMC controller [33].  
\[\dot{V}_{2}<0\hskip 8.535827 pt\text{for}\hskip 8.535827 pt\sigma_{1}\
eq 0 \hskip 28.452756 pt\dot{V}_{3}<0\hskip 8.535827 pt\text{for}\hskip 8.535827 pt\sigma_{2}\
eq 0.\]  
From Equations (22) and (24), we have  
\[\begin{cases}\dot{V}_{2}=\sigma_{1}\dot{\sigma}_{1}=-\rho_{1}\frac{\sigma_{1}^{ 2}}{\mid\sigma_{1}\mid+\varepsilon_{1}}<0\hskip 8.535827 pt\text{for} \hskip 8.535827 pt\sigma_{1}\
eq 0\\ \dot{V}_{3}=\sigma_{2}\dot{\sigma}_{2}=-\rho_{2}\frac{\sigma_{2}^{2}}{\mid \sigma_{2}\mid+\varepsilon_{2}}<0\hskip 8.535827 pt\text{for}\hskip 8.535827 pt\sigma_{2}\
eq 0.\end{cases}\]  
Therefore, the stability of the QSMC controller is guaranteed.