Homogeneous Sliding Mode Control (HSMC)
$\textbf{Model of the control system:}$$\dot x\!=\!{\color{blue}A}x+{\color{blue}B}(u+\gamma(t,x)), \;\;\; y\!=\!Cx, \;\;\; x\!\in\! \mathbb{ R } ^n, \;\;\; u\!\in\! \mathbb{ R } ^m, \;\;\; {\color{blue}A}\!\in\! \mathbb{ R } ^{n\times m}, \;\;\; {\color{blue}B}\!\in\! \mathbb{ R } ^{n\times m}, \;\;\; {\color{blue}C}\!\in\! \mathbb{ R } ^{p \times n} $ where $y\in \mathbb{ R } ^p$ is a controllable output and $\gamma:\mathbb{ R } \times \mathbb{ R } ^n \mapsto \mathbb{ R } ^m$ is an unknown uniformly bounded function.
$\textbf{Control law:}$
$u_{hsmc}={\color{magenta}{K_0}}x+ {\color{magenta}K}\mathbf{ d } (-\ln \|{\color{blue}C}x\|_{\mathbf{ d } }){\color{blue}C}x, \quad {\color{magenta}{K_0}}\in \mathbb{ R } ^{m\times n}, \quad {\color{magenta}K}\in \mathbb{ R } ^{m\times p}, \quad $
where $\mathbf{ d } (s)=e^{s{\color{magenta}{G_{\mathbf{ d } }}}}$ is a dilation in $\mathbb{ R } ^p$, ${\color{magenta}{G_{\mathbf{ d } }}}\in \mathbb{ R } ^{p\times p}$ and the homogeneous norm $\|x\|_{\mathbf{ d } }$ is induced by the weighted Euclidean norm $\|x\|=\sqrt{x^{\top} {\color{magenta}P} x}$ in $\mathbb{ R } ^p$, ${\color{magenta}P}\in \mathbb{ R } ^{p\times p}$.
$\textbf{Properties:}$
- enforces sliding mode on the surface $Cx=0$ in a finite time
- the output dynamics $\dot y=C\dot x$ is $\mathbf{ d } $-homogeneous of degree $-1$.
- ejection of the matched perturbation $\gamma$ if
    HSMC Design    
The function ${\color{red} { \texttt{hsmc_design }} } $ computes parameters $ {\color{magenta}{K_0,K,G_d}}$ and ${\color{magenta} P}$ of HPC for given $ {\color{blue}A}, {\color{blue}B}, {\color{blue}C}, {\color{blue}\rho}>0$ and ${\color{blue}\gamma_{\max}}\geq 0$
- $\textbf{Input parameters}: {\color{blue}A}, {\color{blue}B}, {\color{blue}C}, {\color{blue}\rho}$ (by default $\rho=1$) and ${\color{blue}{\gamma_{\max}}}$ (by default $\gamma_{\max}=0$)
- $\textbf{Output parameters}: {\color{magenta}{K_0,K,G_d}} $ and $ {\color{magenta} P} $
    HSMC Implementation    
- The function ${\color{red} { \texttt{e_smc }} } $ computes $\textit{explicit} $ discretization of $u_{hsmc}$
- $\textbf{Input parameters}: x$, ${\color{blue}C}, {\color{magenta}{K_0, K}}, {\color{magenta}{G_{\mathbf{ d } }, P}} $
- $\textbf{Output parameters}: u_{hsmc}$
- The function ${\color{red} { \texttt{si_hpc }} } $ computes $ \textit{semi-implicit}$ discretization of $u_{hsmc}$
- $ \textbf{Input parameters}: h\, $ (sampling period), $x, {\color{blue}{A,B}}, {\color{blue}C}, {\color{magenta}{K_0,K}}, {\color{magenta}{G_{\mathbf{ d } },P}} $
- $ \textbf{Output parameters}: u_{hsmc}$
${\color{red} { \texttt{demo_hsmc.m}} } $
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%% % Example of the disign of a Homogenenous Sliding Mode Control (HSMC) for % % System: dx/dt=A*x+B*(u+gamma(t)) % % where % x - system state vector (n x 1) % u - control input (m x 1) % A - system matrix (n x n) % B - control matrix (m x m) % gamma(t) - unknown bounded perturbation % % Control aim: % % Given matrix C (k x n) the goal is to design a control law such that % independently of a bounded function gamma (with |gamma(t)|