Reaching Laws¶
Reaching laws dictate how the system state approaches the sliding surface. They represent the desired dynamics of the sliding variable \(s(e, t)\), often in the form of \(\dot{s} = f(s)\).
Usage Example¶
from opensmc.reaching import SuperTwistingLaw
# Create a Super-Twisting reaching law for chattering reduction
reaching = SuperTwistingLaw(k1=1.5, k2=1.1)
# Compute the required reaching rate for a given surface value s
s_dot_req = reaching.compute(s=0.2)
Available Reaching Laws¶
reaching
¶
OpenSMC Reaching Laws — 5 reaching law implementations.
Classes¶
ConstantRate
¶
Bases: ReachingLaw
Constant-rate reaching law: u_r = -k * sign(s).
Parameters¶
k : float Switching gain (must exceed disturbance bound for robustness).
Source code in opensmc/reaching/constant.py
ExponentialRate
¶
Bases: ReachingLaw
Exponential reaching law: u_r = -k * sign(s) - q * s.
Parameters¶
k : float Switching gain (must exceed disturbance bound). q : float Exponential/linear gain (controls convergence rate far from surface).
Source code in opensmc/reaching/exponential.py
PowerRate
¶
Bases: ReachingLaw
Power-rate reaching law: u_r = -k * |s|^alpha * sign(s).
Parameters¶
k : float Gain. alpha : float Power exponent, typically 0 < alpha < 1 for finite-time convergence.
Source code in opensmc/reaching/power.py
Functions¶
compute(s, t=0.0, **kwargs)
¶
Compute reaching control signal.
Parameters¶
s : float Sliding variable. t : float, optional Time (unused).
Returns¶
u_r : float Reaching control: -k * |s|^alpha * sign(s).
Source code in opensmc/reaching/power.py
Saturation
¶
Bases: ReachingLaw
Saturation reaching law: u_r = -k * sat(s / phi).
Parameters¶
k : float Gain. phi : float Boundary layer thickness. Larger phi reduces chattering but increases steady-state error.
Source code in opensmc/reaching/saturation.py
Functions¶
compute(s, t=0.0, **kwargs)
¶
Compute reaching control signal.
Parameters¶
s : float Sliding variable. t : float, optional Time (unused).
Returns¶
u_r : float Reaching control: -k * sat(s / phi).
Source code in opensmc/reaching/saturation.py
SuperTwisting
¶
Bases: ReachingLaw
Super-twisting reaching law (Levant, 1993).
u_r = -k1 * |s|^(1/2) * sign(s) + z, zdot = -k2 * sign(s)
Parameters¶
k1 : float Proportional gain on |s|^(1/2) term. k2 : float Integral gain (drives zdot). dt : float Time step for Euler integration of the internal state z.
Source code in opensmc/reaching/super_twisting.py
Functions¶
compute(s, t=0.0, **kwargs)
¶
Compute reaching control signal and update internal state.
Parameters¶
s : float Sliding variable. t : float, optional Time (unused).
Returns¶
u_r : float Reaching control: -k1 * |s|^(1/2) * sign(s) + z.