Plant: ẍ = -a·ẋ - b·x + u + d(t), a=1, b=2, x(0)=2, ẋ(0)=0, disturbance d(t)=d·sin(5t), dt=0.01, T=5s.
Top: phase-plane (x₁, x₂) trajectory (blue) and sliding surface s=c·x₁+x₂=0 (green line). Bottom: time response x₁(t), x₂(t) and control input u(t).
For the 2nd-order plant $\ddot x = -a\dot x - b x + u + d(t)$, define the states $x_1=x,\ x_2=\dot x$ and design a sliding surface.
Sliding surface $s$; $c$ is the positive coefficient that sets the surface slope:
$$s = c\,x_1 + x_2$$Control law combining feedback linearization with a switching term; $k$ is the switching gain:
$$u = -k\,\mathrm{sign}(s) - c\,x_2 + a\,x_2 + b\,x_1$$Chattering suppression via a boundary layer $\varphi$ (smoothing):
$$\mathrm{sign}(s)\;\longrightarrow\;\tanh(s/\varphi)$$Sliding condition and on-surface dynamics:
$$s\,\dot s < 0,\qquad s=0\ \Rightarrow\ \dot x_1 = -c\,x_1$$If $k$ exceeds the disturbance amplitude, the reaching condition is satisfied. Once on the surface, convergence is exponential with rate $c$.