Assume that we have a water tank system:
$$A \dot h = Q_\text{in} - Q_\text{out} = Q_\text{in} - a\sqrt{2gh} $$
Where $a$ is the opening area in the bottom of the water tank and $\sqrt{2gh}$ is the velocity for the outflow and $h$ is the water level height. The $A$ is the area of the water tank bottom. $A \dot h$ will therefor be the change in volume for the water tank.
If $a = 0$ then the $A \dot h$ is going to increase. If $a > 0$ then $A \dot h$ is going to decrease.
The sliding mode controller can be designed in this way:
$$S = ek + \dot e = 0$$
Where $k$ is a slope and $e$ is the error $e = r - h$ where $r$ is the reference point.
Sliding Mode Control use the signum formula:
$$\sigma = \operatorname{sgn}(ek + \dot e)$$
where $\sigma$ can be $1$ or $-1$ depending where the trajectory is.
But then I need to have some proportional scalar.
Question:
How do I find the propotional tuning factor for this? Can I just add a P-controller with $\sigma$?
$$u = Ke\sigma$$
where $K$ is a gain factor and $e$ is the error. The problem is that this controller is a linear controller.
Is there a way to describe that system in Lyapunov control theory with $\sigma$?
Or can the controller look like this:
$$u = \frac{Q_{in}-A\dot h}{\sqrt{2gh}}e\sigma $$
When $h=0$ then $u$ is very large. When $\dot h = 0$ it means $e = 0$ and then $ u=0$.
?

In sliding mode control, controller dynamics are mainly determined with the error dynamics. So an error dynamics like in
$$ \sigma(K_1,K_2) = \mbox{sign}(K_1e+K_2 \dot e) $$
have two actions
1) $K_1e$ proportional
2) $K_2\dot e$ derivative
The main problem in slide mode control is the so called chattering effect.