Abstract
This paper addresses the challenge of achieving stable and constraint-satisfying control in high-order nonlinear systems. While terminal sliding mode control ensures the finite-time convergence, it often suffers from chattering and input saturation in practical implementations. In order to improve this, we propose a reinforcement learning framework based on constrained policy optimization to replace the discontinuous switching term with a learned policy, preserving sliding convergence while ensuring smooth and bounded control inputs. In addition, a theoretical input bound for high-order systems is derived and incorporated into the learning process as a safety constraint. Simulations validate the approach, showing reduced control effort and improved convergence within state limits across various initial conditions. This work provides a unified framework for safe and adaptive control, with potential applications in robotics and autonomous systems.
Keywords
Introduction
Sliding mode control (SMC) is a robust nonlinear control strategy that drives system states onto a predefined manifold and maintains their motion along this surface (Utkin, 2003). Since its development, SMC has been widely applied in fields such as autonomous driving, robotic manipulation, and aerospace systems (Guo and Woo, 2003; Jafarov and Tasaltin, 2000; Lukes, 1969; Perruquetti and Barbot, 2002; Slotine and Li, 1991), due to its strong robustness against uncertainties and external disturbances (Emel’yanov et al., 1996; Plestan et al., 2008; Zheng and Tian, 2025).
Among its variants, high-order sliding mode control (HOSMC) has attracted significant attention for its improved performance and reduced chattering (Emel’yanov et al., 1996; He et al., 2018; Plestan et al., 2008; Xi and Hesketh, 2010; Zheng and Tian, 2025). However, the recursive nature of high-order sliding surfaces amplifies higher-order terms in the control law, causing control input overflow or exponential growth beyond actuator limits. Large sampling intervals can lead to oscillations, whereas smaller intervals greatly increase computational cost. Furthermore, parameter sensitivity, dependence on initial conditions, and noise amplification remain unresolved (He et al., 2023; Ríos et al., 2021; Wang et al., 2024; Zhang et al., 2020b). These issues highlight the need for new structures or adaptive mechanisms to improve the robustness and feasibility of HOSMC in discrete implementation.
One promising direction to address these challenges is reinforcement learning (RL), which can autonomously explore optimal policies without complete system knowledge, thus handling the uncertainty and nonlinearity inherent in such systems (Bian and Jiang, 2021; Luo et al., 2016; Pei et al., 2024; Rao et al., 2023). However, standard RL methods focus primarily on maximizing cumulative rewards, often without considering safety constraints, bounded states, or input limits. These factors are crucial for HOSMC to prevent instability and actuator saturation (Liu et al., 2022a; Sun et al., 2025a; Zhao et al., 2023).
To address this limitation, we propose constrained policy optimization (CPO), which explicitly incorporates safety and performance constraints into the learning process. Specifically, CPO uses mechanisms such as Lagrange multipliers to enforce limits on state magnitudes or control amplitudes during policy updates (Achiam et al., 2017; Liu et al., 2022b; Stooke et al., 2020; Zhang et al., 2020a). This enables CPO to ensure both optimal performance and adherence to safety constraints, making it particularly suitable for practical SMC applications where constraint-set or trust-region restrictions are critical for stability. Thus, it provides an effective solution to the limitations of standard RL methods in control applications.
This work integrates CPO-based RL with state magnitude and input constraints in high-order terminal SMC (TSMC), enforcing convergence constraints on all system states and enabling adaptive controller adjustment. Additionally, a refined estimate for the upper bound of the sliding mode magnitude is introduced, improving the reliability of control input limits under high-order conditions. The actor–critic (AC) framework is employed to approximate policy and value functions, enhancing adaptive and optimal control under uncertainty and nonlinearity. The standard AC structure is chosen for its analytical clarity in studying the coupling between CPO constraints and sliding-mode requirements, as well as its compatibility with advanced RL variants. Simulation results demonstrate that the proposed method ensures global convergence and suppresses control overflow, thereby improving the robustness of high-order discrete SMC (DSMC) in complex scenarios. Moreover, it achieves reduced control effort compared with traditional methods, particularly under diverse initial conditions.
The remainder of this paper is organized as follows. Section “TSMC based on Euler’s discretization” introduces the discrete TSMC (DTSMC) model. Section “CPO-based AC method design for TSMC” details the constrained AC-based control scheme. Section “Simulation results and discussion” presents the simulation results and analysis. Section “Conclusion” concludes the study.
TSMC based on Euler’s discretization
System model
Consider the following n-dimensional SISO system in canonical form (Li et al., 2013)
where
Assume that the vector field is locally Lipschitz and let
Here, forward Euler is chosen for its explicit form and ease of implementation in digital controllers. The sampling of the continuous state
where
There exists an integer
and
where
All constants
Analysis of control law behavior
In discrete HOSMC, reducing h or increasing the gains indeed improves the numerical stability, but it also magnifies the terms of high-order difference in the control law (Abidi et al., 2007; Galias and Yu, 2007; He and Bai, 2024; Janardhanan and Bandyopadhyay, 2006; Wang and Yu, 2009). From (5) and (6), we obtain the conventional limit
Because the control input u is the only physically constrained signal, accurately predicting its feasible range is crucial. When the order of the system n increases, maintaining stability with a small h can drive u to scale exponentially with n, leading to prohibitive actuation requirements. Hence, while high-order discrete TSMC guarantees convergence in theory, its practical deployment hinges on tighter, more realistic input bounds.
To resolve this, we derive an improved upper bound expression for u which grows much more slowly than the traditional
The direct term
Here
For every
This theoretical result provides a more accurate upper bound for the maximum control input in high-order discrete sliding-mode systems. In subsequent integration with the RL and CPO methods, this bound can serve as either a hard or soft constraint within the reward or cost function and can be directly used to set the allowed range of control input during RL training. In addition, it offers a reliable reference baseline or disturbance margin for the hybrid control strategy. This facilitates safer and more efficient policy optimization, ensuring that the learned controller operates within theoretically guaranteed safe regions. In the following, we will provide the structure of the RL process based on this work.
CPO-based AC method design for TSMC
Sliding mode system design
Based on the previously defined discrete system in (2), we adopt a modified structure as follows
In the proposed control law (4), the traditional term
To further enhance safety and compliance with constraints, the actor network’s policy update process is enhanced using the CPO algorithm, which enables the explicit enforcement of state and input constraints during learning. With this comprehensive DTSMC framework, the overall AC-CPO control structure and network design are developed, ensuring both fast convergence and explicit constraint satisfaction for high-order sliding-mode systems.
Actor and critic network design
The actor network forms the core of the policy gradient method, parameterizing the deterministic or stochastic policy for the closed-loop system under AC control. For the standard AC framework, a wide range of well-established design and implementation methodologies already exist in the literature. Therefore, this paper does not aim to review the complete derivation of conventional AC algorithms. Instead, we present a concise design framework and the essential mathematical formulations required for the proposed control architecture. Detailed explanations are provided only where necessary to highlight the methodological innovations introduced in this work.
In the standard AC approach, the actor is trained to generate the control input by maximizing the expected cumulative reward (Haarnoja et al., 2018; Lillicrap et al., 2015). For DSMC, this traditionally involves replacing the hand-crafted switching control law, specifically the
where
The policy improvement step for the actor network is typically achieved by maximizing the expected advantage function over the current policy (Yasser et al., 2006), formulated as
where
To address these practical requirements, the actor update is performed under explicit constraints in the CPO framework. For each engineering index i, such as state magnitude or input amplitude, the expected cumulative constraint cost is enforced to remain within a specified bound with discount factor
where
To further enhance the stability of policy updates and prevent abrupt parameter changes in the actor network, a trust region constraint is introduced by bounding the KL divergence between the updated and previous policies
Here
In summary, while the standard actor method focuses solely on reward maximization, the proposed CPO-based approach augments the objective with essential real-world constraints for robust and safe operation. The critic structure remains unchanged, continuing to estimate reward and constraint value functions, whereas the actor update is fundamentally redefined under CPO. This integration establishes a balance between performance optimization and constraint satisfaction, meeting the requirements of high-order discrete SMC and enabling safe and efficient learning-based control.
The most basic AC method employs a single critic network to estimate either the action value function
where D is the replay buffer that contains experience tuples
Alternatively, when using the action-value function, the critic minimizes the following
The action
The gradients of the critic loss functions are computed and used to update the network via standard optimization methods, and the resulting value estimates are further employed to calculate policy gradients for updating the actor network. As the critic in the AC-CPO framework primarily serves for value estimation and policy evaluation, this work adopts a standard update scheme without additional architectural modifications. Specifically, a single critic network is used, without entropy regularization, double Q-networks, or target networks, ensuring theoretical clarity and isolating its role from the CPO-based policy update mechanism.
It is worth noting that the key contribution of CPO lies in modifying the actor update to enforce constraint satisfaction, while the critic structure and update rules remain unchanged. Consequently, the critic update is conceptually decoupled from constraint enforcement and can be readily extended with advanced techniques, such as target networks for improved stability, twin critics (TD3) for reducing overestimation bias, or entropy-augmented value functions (SAC). These extensions can be incorporated without affecting the fundamental CPO-based actor optimization. For conciseness, such implementations are not detailed here.
Coordinated policy optimization with constraint enforcement
The coordinated structure between the actor and critic modules is characterized by a dynamic interplay of policy evaluation and improvement, where the actor’s policy is iteratively updated based on feedback signals provided by the critic. This interaction forms the backbone of the AC-CPO framework, ensuring both performance optimization and constraint satisfaction throughout the training process.
In the critic module, the parameters ϕ are updated by minimizing the Bellman error between the predicted value and the target, based on sampled transitions from the replay buffer. The update gradient for the critic network is given by
Here,
For the actor network, which in this framework is optimized using the CPO algorithm, the update aims to maximize the expected advantage while enforcing explicit engineering and safety constraints. At each iteration, the actor network parameters θ are updated by solving the following constrained optimization problem
This optimization is performed subject to explicit bounds on cumulative constraint costs and a trust region on policy updates. These constraints are imposed to ensure that the learned policy not only maximizes long-term rewards but also satisfies all required safety and operational specifications.
During training, the critic network is updated using sampled transitions to estimate the action value function, providing essential feedback for policy optimization. Simultaneously, the actor network is optimized via the CPO algorithm to produce the SMC switching control action, with policy updates carried out under explicit state and input constraints. This coordinated update scheme enables the policy to achieve high performance and constraint satisfaction throughout the learning process. The experience replay buffer stores tuples
In summary, the AC-CPO framework enables efficient and safe learning by integrating a CPO actor with a value-based critic. To assess the performance of the proposed CPO-based control method, we now turn to the simulation results. The following section presents simulations under various initial conditions, demonstrating system convergence, suppression of control overflow, satisfaction of safety constraints, and comparison with traditional methods.
Simulation results and discussion
Simulation model description
In practical applications of SMC, second-order systems are the most common, while higher-order systems (
Although RL is well suited for compensating unknown system components or bounded disturbances within a certain range, the simulation system in this paper is deliberately kept fully known and deterministic. This is because even for a fully known third-order system, ensuring reliable convergence using HOSMC itself is a highly nontrivial challenge. Furthermore, RL does not rely on prior knowledge of system dynamics. That is, the existence or absence of explicit disturbance terms does not affect the ability of RL to adapt and learn effective compensation in the present framework.
Thus, the third-order DTSMC system used in our experiments is described as follows
Here,
Implementation of CPO-based AC method
The numerical experiments are implemented in Python using the PyTorch library. The actor and critic networks adopt identical three-layer fully connected architectures, with each hidden layer containing 64 ReLU units. For CPO, an additional constraint-critic network of the same architecture is introduced. The Adam optimizer is used for all networks with a learning rate of
The system environment employs coefficients
The reward function is carefully designed to balance the goals of rapid state convergence and minimizing control effort. Specifically, a quadratic penalty is assigned on each state variable, with heavier weights on
This formulation penalizes large deviations of
It is worth mentioning that the Lagrange multiplier λ, introduced as an auxiliary variable in the constrained optimization problem, measures the impact of constraints on the objective function (Schulman et al., 2017). In the RL-CPO framework, the Lagrange multiplier is used to control the penalty for constraint costs. When constraints are violated, the multiplier increases, forcing more conservative policy updates to ensure compliance with the maintaining reward optimization constraints. Simulation outputs, including state trajectories and control inputs, are stored for post-processing and visualization.
To ensure complete reproducibility, the remaining training constants are fixed as follows: the discount factor is
For each episode, the agent first collects transitions, while the Q-critic is updated online. Afterward, a constrained trust-region step is executed to update the actor parameters. The algorithmic skeleton is implementation-agnostic and can be reproduced in any modern RL framework. If the state-value head
All symbols and coefficients are defined in the previous sections or within the algorithm description. The auxiliary functions saturate(·), lineSearch(·), and scale follow standard engineering conventions and are not further elaborated here, representing actuator saturation, trust-region backtracking, and policy output scaling, respectively (Ding et al., 2025; Haripriya et al., 2025; Mei et al., 2026a; Schulman et al., 2015; Sun et al., 2025b, 2026; Yang et al., 2024).
Results and discussion
To examine the baseline behavior, a third-order DTSMC system is simulated using the classical control law (4), without any RL component. As shown in Figure 1, the state trajectories

State trajectories under traditional DTSMC without RL compensation.
These observations underscore the numerical sensitivity and practical limitations of high-dimensional DTSMC operating without adaptive mechanisms. They motivate the integration of RL-based compensation to suppress divergence and stabilize the switching dynamics.
To comprehensively evaluate the behavior of the proposed CPO-enhanced DTSMC controller, we analyze its performance under two different initial condition ranges in Figure 2(a) and (b): a small neighborhood where

State trajectories under different initial conditions for the proposed CPO-enhanced DTSMC controller. (a) Small initial region. (b) Large initial region.
Figure 3(a) and (b) illustrates the absolute values of the states of the system along with their constraint boundaries under different initial conditions. In the small-range case, the initial condition was set to

State absolute values and constraint boundary under different initial conditions for the proposed CPO-enhanced DTSMC controller. (a) Small initial region. (b) Large initial region.
The constraint cost profiles in Figure 4(a) and (b) show that the average constraint cost remains well below the predefined limit under small initial conditions. However, in the large-range case, the average constraint cost (Avg cost/ep) gradually exceeds the red threshold line (limit) as training progresses. This violation does not necessarily mean that

Constraint cost during training under different initial conditions. (a) Small initial region. (b) Large initial region.
Finally, the learning curves in Figure 5(a) and 5(b) further support these conclusions. In the small-range case, the return improves steadily, and the Lagrange multiplier remains close to unity, indicating minimal constraint activation. In contrast, in the large-range setting, the return fluctuates and exhibits slower overall improvement, while the Lagrange multiplier grows larger over time. This behavior reflects more frequent violations of the constraint cost limit, which triggers stronger penalties and restricts policy updates.

Learning curve and Lagrange multiplier evolution. (a) Small initial region. (b) Large initial region.
The Lagrange multiplier λ in the CPO framework plays a critical role in the balance of reward optimization and constraint satisfaction. A higher value indicates that the constraint cost has exceeded the threshold, and the algorithm enforces more conservative updates to ensure safety. This mechanism, while effective for preserving feasibility, also reduces the learning rate and can limit performance in extreme conditions.
As shown in Figure 6, the control input amplitude is significantly higher in the case of a large initial region compared to the small one. The input signal for the large region not only reaches higher peaks, but also exhibits sustained oscillations, suggesting that the controller operates closer to the actuator saturation limits. In contrast, under small initial conditions, the control input remains well within the allowable range, leading to smoother and more stable convergence behavior. This comparison further confirms the trade-off between input feasibility and state convergence in high-energy scenarios, highlighting the importance of appropriate constraint-aware control synthesis.

Comparison of control input amplitude in small and large regions.
It is important to note that the theoretical input bound
Although
In summary, the proposed controller performs well in small-to-moderate initial ranges. However, for larger initial states, policy tuning and adaptation may be required to maintain full convergence and stability.
Conclusion
This work proposed a CPO-based RL framework to enhance DTSMC for nonlinear systems. By replacing the discontinuous switching term with a learned policy, the method ensured smooth, bounded control while preserving convergence. Theoretical input bounds for higher-order systems were also derived and validated in simulations. Within moderate initial states, the approach achieved robust convergence and reduced control effort. For larger deviations, early input saturation limits convergence, suggesting the need for adaptive parameter tuning. The method is promising for constrained applications such as robotics and unmanned aerial vehicles (UAVs). Future research will focus on extending the framework to higher-order systems, real-time adaptation, and continuous-time formulations.
Footnotes
Appendix 1
Funding
The authors disclosed receipt of the following financial support for the research, authorship, and/or publication of this article: This research was supported in part by the National Natural Science Foundation of China under grant 62203188 and grant 62373170, and in part by the National Key Research and Development Program of China under grant 2022YFD200150203.
Declaration of conflicting interests
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.
Data availability statement
Data sharing is not applicable to this article as no datasets were generated or analyzed during the current study.
