Next Article in Journal
Hierarchical Path Planning for Automatic Parking in Constrained Scenarios via Entry-Point Guidance
Next Article in Special Issue
Beyond Linear Limits: Advanced Nonlinear Suspensions for Enhanced Vibration Control
Previous Article in Journal
Brushless Wound-Field Synchronous Machine Topology with Excellent Rotor Flux Regulation Freedom
Previous Article in Special Issue
Effect of Boundary Conditions on Vibration Characteristics of a Sandwich Plate with Viscoelastic Periodic Cores
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Second-Order Nonsingular Terminal Sliding Mode Control for Tracking and Stabilization of Cart–Inverted Pendulum

Mechanics of Adaptive Systems Department, Ruhr-Universität Bochum, 44801 Bochum, Germany
*
Author to whom correspondence should be addressed.
Machines 2026, 14(1), 111; https://doi.org/10.3390/machines14010111
Submission received: 19 November 2025 / Revised: 12 January 2026 / Accepted: 16 January 2026 / Published: 18 January 2026

Abstract

A second-order nonsingular terminal sliding mode control (SONTSMC) is proposed to solve the stabilization and tracking problems of an inverted pendulum. Although, a first-order sliding mode controller with the integral of the cart position can eliminate the offset in the cart position caused by incorrect calibration of the pendulum angle while balancing the pendulum at the upright equilibrium position, its control precision and chattering reduction can be improved by using a higher-order sliding mode controller. Therefore, the SONTSMC is designed by combining nonsingular sliding mode control and first-order sliding mode control to construct a second-order sliding mode controller that enhances tracking accuracy and reduces the chattering problems associated with sliding mode control. The performance of the proposed control is compared with that of the linear quadratic regulator sliding mode control (LQRSMC) and the integral linear quadratic regulator sliding mode control (ILQRSMC) for CIP’s stabilization and tracking. The results indicate that SONTSMC significantly increases the control performance of CIP while efficiently utilizing control energy.

1. Introduction

Underactuated mechanical systems (UMS) are a type of nonlinear system where the number of degrees of freedom to be controlled exceeds the number of control inputs [1,2,3]. By reducing the actuators, UMS offers significant advantages over a fully actuated system in terms of energy conservation, mass reduction, and increased flexibility [4]. There are three main reasons why the systems become underactuated: (i) some systems, such as crane systems [5] and self-balancing vehicles [6], are designed to improve flexibility or are limited by mechanical structures, leading to a reduction in several parts of actuators; (ii) the systems affected by nonholnomic constraints, such as autonomous ground robots [7] and unmanned aerial vehicles (UAVs) [8], cannot move independently in certain directions; (iii) underactuated systems, such as the inverted pendulum [9] and translational oscillations with a rotational actuator (TORA) [10], are often employed as benchmark platforms to test and validate the performance of novel control strategies due to their inherent complexity and challenging dynamics. In addition, when the actuators of fully actuated systems fail, these systems can become underactuated [11]. Consequently, UMS gains more attention from both theories and applications. However, the dynamic model of UMS exhibits nonlinear properties and strong coupling, raising significant challenges for effective control design. Since the number of degrees of freedom (DOF) to be controlled exceeds the number of control inputs, a direct control cannot be applied to unactuated DOF. This problem is exacerbated when high performance is required, because unactuated dynamics are sensitive to disturbances and uncertainties [12]. Consequently, the design of effective controllers for underactuated systems presents greater challenges compared to fully actuated systems.
A cart–inverted pendulum (CIP) is a simple structure of UMS, employed to test and evaluate control algorithms. The system comprises a cart with a pendulum mounted on it. The pendulum can freely rotate around a pivot point attached to the cart, and the cart can move along a horizontal track. The system has two degrees of freedom but only one control input, typically a force applied to the cart. When the pendulum is near the upright equilibrium point, it demonstrates linear properties, making it suitable for testing linear controls. In contrast, when the pendulum deviates from the upright equilibrium position, it exhibits nonlinear properties, posing challenges for traditional linear control methods [13]. Therefore, CIP has gained increased attention in research for advanced control theories and its applications including human gait analysis, mobile robots balancing, and Segway [14]. In most of these CIP systems, a DC motor is employed to generate the force applied to the cart due to their simplicity and ease of control. However, using a DC motor is subject to several limitations, including mechanical backlash and being less practical in industrial applications. In contrast, a stepper motor offers high acceleration accuracy, faster response time, and better low-speed performance, making it suitable for CIP systems. Despite some challenges of stepper motors such as limited torque at high speed and resonance issues, stepper motors can be alternated with DC motors when precise and rapid control is critical for maintaining the upright stability of the pendulum [15].
The CIP system involves two main control tasks: stabilizing the pendulum and tracking the cart position. While stabilization ensures the pendulum remains balanced in its upright position despite disturbances, the tracking problem allows the cart to follow a desired position while keeping the pendulum balanced in its upright position. Sliding mode control (SMC), initially developed by Utkin [16], is well known robust control approach, guaranteeing system stability and performance in the presence of uncertainties and external disturbances. Sliding mode control has been proposed for UMS through using linear sliding surface [17,18]; however, determining parameters of sliding surface and predicting the system response based on chosen parameters [6] remain challenging. To solve this problem, the author [19] proposed an integral linear quadratic sliding mode controller (ILQRSMC) for a CIP system, where the parameters of the linear sliding surface are derived from integral linear quadratic regulator control (ILQRC). The ILQRSMC method inherits the properties of both integral linear quadratic regulator control and sliding mode control, and is simple for control engineers to implement. Moreover, in practical implementation, the cart offset in the inverted pendulum system, caused by calibration errors of the pendulum and often omitted in most sliding mode control designs, is addressed by integrating the cart position error into the sliding mode control strategy. Although the ILQRSMC offers robustness and high control accuracy for the stabilization and tracking problems of the inverted pendulum compared to ILQRC [15], there are still some limitations in the control design. The undesirable chattering phenomenon of ILQRSMC, induced by the discontinuous control law and the high-frequency switching close to the sliding surface [20], is reduced by using the power reaching law [21] s ˙ ( t ) = κ 2 | s ( t ) | α sgn ( s ( t ) ) , 0 < α < 1 . However, the term | s ( t ) | α decreases rapidly because of the fractional exponent α , which diminishes the robustness of the controller near the sliding surface and prolongs the reaching time [22]. In addition, the ILQRSMC is a first-order sliding mode controller, with control accuracy influenced by the measurement intervals and the switching delay. In contrast, an rth-order sliding mode controller can achieve rth-order sliding precision with respect to the measurement interval, and can significantly reduce the chattering problem [23,24,25].
The aforementioned discussion underscores the necessity of designing a high order sliding mode controller to improve the control accuracy and reduce chattering in control input. In addition, it demands a simple structure control that facilitates parameters selection, ensuring the desired system response. The main contributions of this article are summarized as follows:
  • The SONTSMC is proposed for CIP to enhance tracking accuracy and reduce the chattering of the control input. Motivated by [26], the parameters of the sliding surface are designed to meet the desired system dynamic, with the derivative of the sliding surface directly determined without the need for estimation methods.
  • CIP model is employed to design a sliding surface without using any transformation methods to convert it to a regular form, thereby simplifying the control design. By including the integral of the cart position error in the augmented model, the sliding mode controller effectively mitigates cart position offsets caused by pendulum angle calibration errors.
  • The effectiveness and implementation of the proposed control are verified through a stabilization and tracking control experiment with an inverted pendulum in practical environment.
The remainder of the article is organized as follows: Section 2 introduces the formulation of the CIP problem, while Section 3 details the proposed control design. Section 4 presents experimental results that validate the effectiveness of the control approach. Finally, Section 5 concludes the paper and outlines directions for future work.

2. Modeling Cart–Inverted Pendulum

The mechanical configuration and dynamic model of the cart–inverted pendulum driven by a stepper motor, shown in Figure 1, are identical to those presented in [19]. To avoid redundancy, the detailed system derivation is omitted. The augmented error model of the cart–inverted pendulum at the upright equilibrium position ( θ ( t ) , θ ˙ ( t ) ) = ( 0 , 0 ) is expressed as follows [19]:
e ˙ g ( t ) = A g e g ( t ) + b g u ( t ) + ϕ g ( t ) ,
where
e g ( t ) x ( t ) x d ( t ) x ˙ ( t ) x ˙ d ( t ) θ ( t ) θ d ( t ) θ ˙ ( t ) θ ˙ d ( t ) x ( t ) x d ( t ) ;
A g 0 1 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 L g m p ( m p L 2 + I ) k d ( m p L 2 + I ) 0 1 0 0 0 0 ;
b g 0 1 0 L m p ( m p L 2 + I ) 0 ;
In this model, e g ( t ) , A g , and b g denote the error vector, system matrix, and input matrix of the augmented error model, respectively. The system parameters are defined as follows: L is the half-length of the pendulum (m); g is the gravitational constant (m/s2); m p is the mass of the pendulum (kg); k d is the damping coefficient (N·m·s/rad), identified from the free damped vibration; and I is the moment of inertia of the pendulum (kg·m2). The unknown lumped disturbance ϕ g ( t ) is assumed to be bounded and matched such that ϕ g ( t ) = b g ϕ m ( t ) . Subsequently, the augmented error (1) is rewritten as
e ˙ g ( t ) = A g e g ( t ) + b g ( u ( t ) + ϕ m ( t ) ) .
Control objective: This work aims to develop a second-order sliding mode controller for an augmented linear model to address both stabilization and tracking problems of the CIP system in the presence of disturbances and uncertainties. The augmented model incorporates the integral action of cart displacement to eliminate the cart position offset caused by incorrect pendulum angle calibration. The second-order sliding mode controller enhances robustness and reduces chattering compared to first-order sliding mode control. The proposed control approach is implemented and validated on a real CIP system, demonstrating reliable performance and effective control.

3. Controller Design

The overall control structure of the CIP system employing the proposed SONTSMC is illustrated in Figure 2. In this framework, the second-order sliding surface is constructed on a first-order sliding surface. The controller is designed to drive the system states toward the second-order sliding surface. Once this surface is reached, the first-order sliding surface converges to zero, ensuring that the tracking error also converges to zero.
The design of the sliding mode control typically involves two main steps: first, designing a sliding surface to achieve the desired performance, and second, ensuring that the system trajectories converge to this surface [27]. A first-order sliding surface [28] s ( t ) R is designed as follows:
s ( t ) c e g ( t ) ,
where c [ c 1 c 2 c 3 c 4 c 5 ] is a design vector, chosen according to the system’s performance requirements. The components of c are directly determined by [26]
c = [ k 0 1 ] [ A g 2 b g A g b g ] + ,
where [ A g 2 b g A g b g ] + is pseudo inverse of the matrix formed by [ A g 2 b g A g b g ] , and k is calculated using LQR method, given by [29]
k R 1 b g T P ,
where P is obtained from Riccati equation
A g T P + P A g + Q P b g R 1 b g T P = 0 ,
where Q denotes the state weighting matrix and R represents the control weighting matrix. The MATLAB R2025b function care can be used to obtain the solution of this equation, which corresponds to the continuous-time algebraic Riccati equation. A second-order nonsingular terminal sliding surface is proposed as follows:
σ ( t ) s ( t ) + λ s ˙ p / q ,
where λ > 0 is a design parameter; p and q are positive odd integers, which satisfy the following condition 1 < p / q < 2 [30]; s ˙ p / q = | s ˙ | p / q sgn ( s ˙ ) , where sgn ( . ) is the standard sign function. The first-order time derivative of σ ( t ) in (10) is
σ ˙ ( t ) = s ˙ ( t ) + λ p q | s ˙ ( t ) | p q 1 s ¨ ( t ) ,
where
s ˙ ( t ) = c A g e g ( t ) ,
s ¨ ( t ) = c A g 2 e g ( t ) + u ( t ) + ϕ m ( t ) .
Theorem 1. 
Considering the error model (1) with matched disturbances, the tracking error e g ( t ) is guaranteed to converge to a small neighborhood around e g ( t ) = 0 if the SONTSMC sliding surface is chosen as (10) and the control law is designed as follows:
u ( t ) u 0 ( t ) + u 1 ( t ) ,
where u 0 ( t ) is determined by solving σ ˙ ( t ) 0 (11) without the matched disturbance ϕ m ( t )
u 0 ( t ) = λ p q | s ˙ ( t ) | p q 1 1 s ˙ ( t ) c A g 2 e g ( t ) ,
and u 1 ( t ) is power rate reaching law, defined by [21]
u 1 ( t ) κ | σ ( t ) | α sgn ( σ ( t ) ) ,
where κ , α are the design parameters, κ > 0 and 0 < α < 1 . The benefit of this reaching law is that it adjusts the reaching speed according to the system’s position relative to the sliding surface. Specifically, when the system is far from the sliding surface, the control law accelerates the speed. The term | σ ( t ) | α primarily ensures fast convergence to the sliding surface while mitigating the chattering phenomenon in the sliding phase due to the absence of discontinuity. A large value of κ ensures a fast convergence rate; however, excessively large values increase control effort and may lead to potential instability. Similarly, a large value of α reduces chattering in the control input; however, excessively large values can degrade the robustness of control system under disturbances and uncertainties.
Proof. 
The convergence properties of sliding mode controller are typically analyzed using Lyapunov’s method. A Lyapunov function is defined as follows:
V ( σ ) = 1 2 σ ( t ) 2 .
Using (11), and (14), the time derivative of the Lyapunov function V ( σ ) is obtained as
V ˙ ( σ ) = λ p q | s ˙ ( t ) | p q 1 σ ( t ) κ | σ ( t ) | α sgn ( σ ( t ) ) + ϕ m ( t ) = λ p q | s ˙ ( t ) | p q 1 κ | σ ( t ) | α + 1 σ ( t ) ϕ m ( t ) .
In the absence of matched disturbances ϕ m ( t ) = 0 , the equality (18) becomes
V ˙ ( σ ) = λ p q | s ˙ ( t ) | p q 1 κ | σ ( t ) | α + 1 .
In view of (19), it is rewritten as
V ˙ ( σ ) = ϑ | V ( σ ) | α + 1 2 ,
where ϑ κ λ p q | s ˙ ( t ) | p q 1 2 α + 1 2 .
Theorem 2 ([31]). 
Consider a system with a positive Lyapunov function that satisfies the following condition:
V ˙ ( σ ) + ϑ V ξ ( σ ) 0 ,
where 0 < ξ < 1 and ϑ > 0 . Under this condition, the system is finite time stable. The convergence time of V ( σ ) from its initial value V ( 0 ) to zero can be expressed as
t V = V ( 0 ) 1 ξ ϑ ( 1 ξ ) .
According to Theorem 2, from (20), σ ( t ) 0 will be reached in the finite time t r 1
t r 1 = V ( 0 ) 1 α ϑ ( 1 α ) .
When σ ( t ) 0 is obtained after the time t r 1 then (10) is rewritten as
s ( t ) + λ s ˙ ( t ) p / q = 0 ,
According to [32], the sliding mode variable s ( t ) and its derivative s ˙ ( t ) converge to zero in finite time on the sliding surface defined by (24). The finite time t r 2 , representing the duration from s ( t r 1 ) 0 to s ( t r 1 + t r 2 ) = 0 , is given by
t r 2 = λ q p 1 q p | s ( 0 ) | 1 q p .
When s ( t ) 0 , the tracking error e g ( t ) will asymptotically converge to zero [28].
In the presence of the matched disturbances ϕ m ( t ) 0 , finite time stability can be guaranteed based on (18), provided that the following condition is satisfied: κ | σ ( t ) | α + 1 ϕ m ( t ) σ ( t ) > 0 . To satisfy this condition, κ must be designed as κ | ϕ m ( t ) σ ( t ) α | > 0 . It follows that
| σ ( t ) | | ϕ m ( t ) | κ 1 α Δ , Δ > 0 .
can be reached in finite time. Afterwards, the SONTSMC manifold (10) is rewritten as follows:
s ( t ) + λ s ˙ p / q = σ ( t ) , | σ ( t ) | Δ .
s ( t ) + s ˙ p / q λ σ ( t ) s ˙ p / q = 0 , | σ ( t ) | Δ .
When λ σ ( t ) s ˙ p / q > 0 , (27) has the same form of (10) and s ( t ) converges to zero in finite time. When λ σ ( t ) s ˙ p / q < 0 , s ( t ) converges to following region [33]
| s ( t ) | λ | s ˙ | p / q + | σ ( t ) | 2 Δ .
As a result, when s ( t ) converges to small values of 2 Δ due to a sufficiently large choice of κ in (26), e g ( t ) will converge to a neighbourhood of around zero [27].
The design of SONTSMC for inverted pendulum using stepper motor is relatively straightforward, summarized as follows:
  • Step 1: Selecting the matrices Q and R to solve the Riccati Equation (9).
  • Step 2: Solving matrix k from (8), and then determine c from (7).
  • Step 3: Designing first-order sliding surface s ( t ) (6).
  • Step 4: Selecting values of p , q , λ to design second-order sliding mode surface σ ( t ) from (10).
  • Step 5: Designing control law u ( t ) from (14).
To design SONTSMC, R and Q should be determined to solve the Riccati Equation (9). To simplify control design, Q is selected as
Q = diag q 1 q 2 q 3 q 4 q 5 ,
where q 1 , q 2 , q 3 , q 4 , and q 5 represent the weights corresponding to the cart position error x ( t ) x d ( t ) , cart velocity error x ˙ ( t ) x ˙ d ( t ) , pendulum angular position error θ ( t ) θ d ( t ) , pendulum angular velocity error θ ˙ ( t ) θ ˙ d ( t ) , and the integral of cart position error x ( t ) x d ( t ) , respectively. The scalar R is chosen due to the single control input u ( t ) in (14), and for implementation simplicity, it is set to 1. To ensure effective pendulum balancing, the weights q 3 and q 4 are selected to be larger than q 1 and q 2 , as suggested in [34]. Moreover, the parameter q 5 directly influences the reduction of the offset error of cart position. In this work, the ratio of the elements in the matrix Q is fixed as specified in Table 1, with only the overall scaling gain being adjusted. The parameter α involves a trade-off: increasing α helps suppress chattering but may compromise controller robustness. Here, α is fixed at 0.7 to balance effective chattering mitigation with adequate robustness. The parameters p, q, and λ significantly affect the dynamics of the sliding surface defined in (10). Higher values of these parameters result in faster convergence of s ( t ) , as reflected by the convergence time in (25), but also increase the required control effort. Following common practice in the literature, this work sets p = 5 and q = 9 . The parameter κ is gradually increased from small to larger values until further increments no longer improve accuracy but instead amplify chattering in the control signal.

4. Experimental Validation

4.1. Experimental Setup

The experimental system, developed at the Department Mechanics of Adaptive Systems, Ruhr University Bochum, is employed to evaluate the effectiveness of the proposed control for CIP, given in Figure 3. Since the experimental setup has already been described in our previous work [19], it is not presented again. Some essential parameters of our CIP, which are employed in the controller design, are listed as follows: L = 0.34 (m), g = 9.81 (m/s2), k d = 0.01 (N·m·s/rad), m p = 0.2 (kg), and I = 0.03 (kg·m2).
In this work, SONTSMC is compared to two other optimal sliding mode control strategies: linear quadratic regulator sliding mode control (LQRSMC) and integral linear quadratic regulator sliding mode control (ILQRSMC). The LQRSMC and the ILQRSMC are selected as comparison controllers because their prescribed sliding mode dynamics are designed either to match a desired pole spectrum or to achieve optimal behavior in the linear–quadratic regulator (LQR) sense [35]. This makes the sliding-surface design both systematic and straightforward to implement. In addition, these controllers are particularly suitable for systems in which the behavior of the CIP near the upright equilibrium can be accurately approximated by a linearized model, which is the standard modeling approach adopted in many balancing and tracking studies. The structure and design of each controller are detailed in the following.
The linear quadratic regulator sliding mode control [36] is designed as follows:
u LQRSMC ( t ) c 1 A e ( t ) κ 1 | s 1 ( t ) | α sgn ( s 1 ( t ) ) ,
where the sliding surface is defined as
s 1 ( t ) = c 1 e ( t ) ,
and the error vector is
e ( t ) x ( t ) x d ( t ) x ˙ ( t ) x ˙ d ( t ) θ ( t ) θ d ( t ) θ ˙ ( t ) θ ˙ d ( t ) .
The gain vector c 1 is chosen as
c 1 = [ k 1 I ] [ A b ] + , with k 1 R 1 b T P 1 .
Here, P 1 is the solution of the algebraic Riccati equation
A T P 1 + P 1 A + Q 1 P 1 b R 1 1 b T P 1 = 0 ,
where Q 1 is a given symmetric positive definite matrix, and the system matrix A and input matrix b are defined as
A 0 1 0 0 0 0 0 0 0 0 0 1 0 0 L g m p m p L 2 + I k d m p L 2 + I , b 0 1 0 L m p m p L 2 + I .
The integral linear quadratic regulator sliding mode control (ILQRSMC) is designed as follows [19]:
u ILQRSMC ( t ) = c 2 A g e g ( t ) κ 2 | s 2 ( t ) | α sgn ( s 2 ( t ) ) ,
where sliding surface s 2 ( t ) is chosen by s 2 ( t ) = c 2 e g ( t ) and c 2 = [ k 2 I ] [ A g b g ] + , where k 2 R 2 1 b g T P 2 , and P 2 is the solution of Riccati equation
A g T P 2 + P 2 A g + Q 2 P 2 b g R 2 1 b g T P 2 = 0 .
To ensure a fair comparison between the proposed controller and the benchmark methods, all controllers were tested under identical initial conditions. The initial state of the CIP system was set to [ x ( 0 ) x ˙ ( 0 ) θ ( 0 ) θ ˙ ( 0 ) ] T = [ 0.036 m , 0 m / s , 0.124 rad , 0 rad / s ] T . All experiments were carried out on the same hardware platform using a uniform sampling frequency of 1 kHz, a pendulum-angle sensor with a resolution of 0.0015 rad, and a cart-position sensor with resolution of 0.244 μ m . The control parameters of LQRSMC, ILQRSMC, and the proposed controller are provided in Table 1. These parameters were selected through a consistent and systematic tuning process to ensure fairness in the comparison. First, for the LQR component of all controllers, the state-error weighting matrices were chosen such that the resulting closed-loop poles of the sliding dynamics exhibit similar spectral characteristics. Second, the remaining tuning parameters were iteratively adjusted following the same optimization objective for all controllers. Specifically, the integral absolute error (IAE), the integral squared error (ISE), and the integrated absolute control effort (IAC) were minimized to achieve low tracking error, limited overshoot, and reduced control effort in a uniform manner across all controllers. The control algorithms were designed and validated in continuous-time form within Simulink on a desktop computer equipped with an Intel Core i7-10700 processor, manufactured by Lenovo (Beijing, China), with 64 GB of RAM, and running Windows 11. The real-time experiments were conducted using a dSPACE rapid prototyping system, which provides a deterministic environment for implementing advanced control algorithms. The control laws developed in MATLAB R2025b/Simulink were exported to dSPACE Real-Time Workshop, where the continuous-time models were automatically discretized and converted into real-time executable code. A fixed-step size of 0.001 s was used to match the desired control frequency and ensure high-resolution control action. The generated C code was compiled and uploaded to the dSPACE hardware, enabling deterministic real-time execution of the controller.

4.2. Experimental Results

In this work, simulation results are not included because the proposed controller is validated experimentally on the physical CIP system, providing direct evidence of performance under real-world conditions. Simulation is typically used to evaluate controller performance on a nominal linear model; however, the real system exhibits significant nonlinearities such as Coulomb friction, actuator saturation, sensor noise, and mechanical flexibility. These phenomena are difficult to model accurately and often lead to a notable gap between simulated and experimental performance, as reported in previous studies [15]. Both stabilization control and tracking control are employed to evaluate control performance of these controllers. The effectiveness of these controllers is demonstrated through practical experiments, which are documented in videos, available in https://bit.ly/46WNDfB (accessed on 15 January 2026). In the first experiment, these controllers are evaluated by balancing the pendulum at upright position while moving the cart position to zero. In the second experiment, these controllers are validated through balancing the pendulum in the upright position while guiding the cart to the desired positions.

4.2.1. Stabilizing the Cart–Inverted Pendulum

The stabilization control aims to keep the pendulum upright at θ d ( t ) = 0 rad from a small initial deviation while simultaneously maintaining the cart near its desired position x d ( t ) = 0 m.
Figure 4 and Figure 5 compare system response of CIP under three different controllers: LQRSMC, ILQRSMC and SONTSMC. The SONTSMC achieves a shorter convergence time of cart position error compared to the LQRSMC and the ILQRSMC. Specifically, the SONTSMC reduces the convergence time by 44 % and 23 % in the cart position error compared to the LQRSMC and the ILQRSMC, respectively. Taking a closer look at the cart position error in steady state, all controllers provide satisfactory performance with a bounded error 2 × 10 3 ; however, the SONTSMC exhibits a smaller cart position error than the LQRSMC and the ILQRSMC. From the pendulum angle measurements in Figure 5, all three controllers successfully balance the pendulum angle at the upright position from initial angle. A zoomed part reveals that the pendulum angle using three controllers are similar, remaining within the range of 2 × 10 3 2 × 10 3 rad. Figure 6 demonstrates the control input of three controllers. The LQRSMC requires high control effort, whereas SONTSMC achieves lower energy consumption and reduces chattering compared to both the LQRSMC and the ILQRSMC. To quantitatively evaluate the control performance of three controllers, Table 2 provides the index values of integral absolute error (IAE), integral squared error (ISE), and integral absolute control (IAC). These indexes are defined as follows [37,38].
The IAE value of cart position error and pendulum angle error is defined as
IAE x = 0 t | x ( t ) x d ( t ) | d t , IAE θ = 0 t | θ ( t ) θ d ( t ) | d t .
The ISE value of cart position error and pendulum angle error is given by
ISE x = 0 t | x ( t ) x d ( t ) | 2 d t , ISE θ = 0 t | θ ( t ) θ d ( t ) | 2 d t .
The IAC value of controller is defined as
IAC = 0 t | u ( t ) | d t .
Lower IAE values indicate improved tracking performance, as they correspond to smaller accumulated tracking errors. Conversely, higher IAE values represent greater accumulation of errors, reflecting weaker tracking capability. The ISE values represent the control system’s response, with smaller values indicating a faster convergence speed of the cart position error and pendulum angle. The IAC values demonstrate the control effort, where smaller values indicate the efficient control energy. The IAE x value of SONTSMC has been improved by 15 % and 58 % compared to the ILQRSMC and the LQRSMC controllers, respectively. Moreover, the ISE x value of SONTSMC is improved by 34 % and 65 % over the ILQRSMC and the LQRSMC methods. The IAE θ and ISE θ values of SONTSMC are slightly higher than those of ILQRSMC due to the overshoot in cart position during the initial stage. Obviously, the SONTSMC control requires small control effort, as indicated by an IAC value of 13.33 . Moreover, its robustness and accuracy are higher than the ILQRSMC and the LQRSMC. Based on the IAE and ISE index values, the SONTSMC demonstrates faster convergence speed and higher control precision compared to the other two controllers.
The phase portraits of the sliding variable and its time derivative for all controllers are shown in Figure 7, Figure 8 and Figure 9. These plots are used to compare the sliding accuracy, which directly influences the convergence rate, transient response, and steady-state tracking performance. All controllers drive the sliding variable toward a small neighborhood around zero. However, SONTSMC achieves the smallest bounds, with the sliding variable s ( t ) confined within approximately 0.05 and its time derivative s ˙ ( t ) within about 0.02 . This improvement arises from the higher-order sliding mode structure of SONTSMC, which explicitly drives both s ( t ) and s ˙ ( t ) to zero [23]. In contrast, first-order sliding mode controllers such as LQRSMC and ILQRSMC ensure only that the sliding variable s 1 ( t ) or s 2 ( t ) reaches zero, without guaranteeing the same level of accuracy for its derivative.

4.2.2. Reference Tracking Control for the Cart–Inverted Pendulum

The tracking performance of the cart position is tested under LQRSMC, ILQRSMC, and SONTSMC, with the pendulum required to balance around the upright position with θ d = 0 rad . The desired cart position follows a low-frequency sinusoidal function x d = 0.1 sin ( 0.2 t ) . Figure 10 shows the tracking performance of these controllers with the design parameters given in Table 1. The figure shows that all designed controllers can effectively track desired cart position while keeping pendulum balancing at the upright position. Figure 11 compares the detailed errors of the tracking cart position. The SONTSMC demonstrates the fastest convergence speed among the three controllers. From the zoomed in view of cart position error, the SONTSMC achieves smaller errors than the LQRSMC and the ILQRSMC. Additionally, Figure 12 illustrates the pendulum angle response of the three controllers, demonstrating their capability to maintain pendulum balance. Figure 13 compares the control input of three controllers. Although the SONTSMC demands less control input than the ILQRSMC, it still exhibits a good tracking performance and faster convergence speed of both cart position and pendulum angle. The performance indexes of the three controllers in Table 3 provide greater insight into the effectiveness of these controller. The IAE x of SONTSMC is reduced by 63 % and 18 % compared to the LQRSMC and the ILQRSMC, respectively. Moreover, the SONTSMC exhibits the smallest ISE x value among the three controllers, indicating its fast convergence speed of the SONTSMC. The control effort required by the SONTSMC is also more efficient than that of the ILQRSMC and the LQRSMC, as indicated by its lower IAC value of 13.46 m/s2.

5. Conclusions

In this work, the SONTSMC is proposed to address the balancing and tracking control of an inverted pendulum. The results demonstrated that the SONTSMC increases convergence speed and tracking accuracy of cart position and pendulum angle while ensuring effective control effort. Theoretical consideration was verified through experimental results under both stabilization control and tracking control of CIP. Although the proposed controller showed effective performance, actuator saturation constraints were not included in the controller design. The SONTSMC was developed under the assumption of unlimited control signals, and its performance was validated experimentally under the actual hardware limits. While the controller demonstrated satisfactory results in practice, a formal treatment of input constraints remains an important extension. Actuator saturation reduces the effective control authority, which can violate the sliding mode reaching condition and prevent the system from attaining the sliding surface in finite time. Therefore, incorporating actuator saturation into the sliding mode design will be considered in future work to further enhance the robustness and applicability of the method.

Author Contributions

Conceptualization, H.D.L.; methodology, H.D.L.; software, H.D.L.; validation, H.D.L.; formal analysis, H.D.L.; investigation, H.D.L.; writing—original draft, H.D.L.; writing—review and editing, T.N.; visualization, H.D.L. and T.N.; supervision, T.N.; funding acquisition, T.N. All authors have read and agreed to the published version of the manuscript.

Funding

This work was supported by the Research Program of the DAAD (No. 91799091) and the APC was funded by the journal Machines (ISSN 2075-1702).

Data Availability Statement

The raw data supporting the conclusions of this article will be made available by the authors on request.

Conflicts of Interest

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.

Abbreviations

The following abbreviations are used in this manuscript:
SONTSMCsecond-order nonsingular terminal sliding mode control
LQRSMClinear quadratic regulator sliding mode control
ILQRSMCintegral linear quadratic regulator sliding mode control
UMSunderactuated mechanical systems
DOFdegree of freedom
CIPcart–inverted pendulum
SMCsliding mode control
IAEintegral absolute error
ISEintegral squared error
IACintegral absolute control

References

  1. Emran, B.J.; Najjaran, H. A review of quadrotor: An underactuated mechanical system. Annu. Rev. Control 2018, 46, 165–180. [Google Scholar] [CrossRef]
  2. Xiong, J.J.; Wang, X.Y.; Li, C. Recurrent neural network based sliding mode control for an uncertain tilting quadrotor UAV. Int. J. Robust Nonlinear Control 2025, 35, 8030–8046. [Google Scholar] [CrossRef]
  3. Xiong, J.J.; Chen, Y. RBFNN-Based Parameter Adaptive Sliding Mode Control for an Uncertain TQUAV with Time-Varying Mass. Int. J. Robust Nonlinear Control 2025, 35, 4658–4668. [Google Scholar] [CrossRef]
  4. Gupta, S.; Kumar, A. A brief review of dynamics and control of underactuated biped robots. Adv. Robot. 2017, 31, 607–623. [Google Scholar] [CrossRef]
  5. Zhao, B.; Ouyang, H.; Iwasaki, M. Motion trajectory tracking and sway reduction for double-pendulum overhead cranes using improved adaptive control without velocity feedback. IEEE/ASME Trans. Mech. 2021, 27, 3648–3659. [Google Scholar] [CrossRef]
  6. Xu, J.X.; Guo, Z.Q.; Lee, T.H. Design and implementation of integral sliding-mode control on an underactuated two-wheeled mobile robot. IEEE Trans. Ind. Electron. 2013, 61, 3671–3681. [Google Scholar] [CrossRef]
  7. Huang, J.; Wen, C.; Wang, W.; Jiang, Z.P. Adaptive output feedback tracking control of a nonholonomic mobile robot. Automatica 2014, 50, 821–831. [Google Scholar] [CrossRef]
  8. Yang, S.; Xian, B. Energy-based nonlinear adaptive control design for the quadrotor UAV system with a suspended payload. IEEE Trans. Ind. Electron. 2019, 67, 2054–2064. [Google Scholar] [CrossRef]
  9. Wei, C.; Chai, T.; Xin, X.; Chen, X.; Wang, L.; Chen, Y.H. A signal compensation-based robust swing-up and balance control method for the Pendubot. IEEE Trans. Ind. Electron. 2021, 69, 3007–3016. [Google Scholar] [CrossRef]
  10. Wu, X.; Gu, M. Adaptive control of the TORA system with partial state constraint. Trans. Inst. Meas. Control 2019, 41, 1172–1177. [Google Scholar] [CrossRef]
  11. Zhai, M.; Sun, N.; Yang, T.; Fang, Y. Underactuated mechanical systems with both actuator and actuated/unactuated state constraints: A predictive control-based approach. IEEE/ASME Trans. Mechatronics 2022, 28, 1359–1371. [Google Scholar] [CrossRef]
  12. Lu, B.; Fang, Y. Online trajectory planning control for a class of underactuated mechanical systems. IEEE Trans. Autom. Control 2023, 69, 442–448. [Google Scholar] [CrossRef]
  13. Nisar, L.; Koul, M.H.; Ahmad, B. Controller Design Aimed at Achieving the Desired States in a 2-DOF Rotary Inverted Pendulum. IFAC-PapersOnLine 2024, 57, 256–261. [Google Scholar] [CrossRef]
  14. Boubaker, O. The inverted pendulum: A fundamental benchmark in control theory and robotics. In Proceedings of the International Conference on Education and e-Learning Innovations, Sousse, Tunisia, 1–3 July 2012; IEEE: Piscataway, NJ, USA, 2012; pp. 1–6. [Google Scholar]
  15. Dai Le, H.; Nestorović, T. Integral Linear Quadratic Regulator for Inverted Pendulum System Actuated by a Step Motor. In Proceedings of the 2024 10th International Conference on Control, Decision and Information Technologies (CoDIT), Vallette, Malta, 1–4 July 2024; IEEE: Piscataway, NJ, USA, 2024; pp. 367–370. [Google Scholar]
  16. Utkin, V. Variable structure systems with sliding modes. IEEE Trans. Autom. Control 1977, 22, 212–222. [Google Scholar] [CrossRef]
  17. Huang, J.; Guan, Z.H.; Matsuno, T.; Fukuda, T.; Sekiyama, K. Sliding-mode velocity control of mobile-wheeled inverted-pendulum systems. IEEE Trans. Robot. 2010, 26, 750–758. [Google Scholar] [CrossRef]
  18. Ashrafiuon, H.; Erwin, R.S. Sliding mode control of underactuated multibody systems and its application to shape change control. Int. J. Control 2008, 81, 1849–1858. [Google Scholar] [CrossRef]
  19. Le, H.D.; Nestorović, T. Integral Linear Quadratic Regulator Sliding Mode Control for Inverted Pendulum Actuated by Stepper Motor. Machines 2025, 13, 405. [Google Scholar] [CrossRef]
  20. Li, S.; Zhou, M.; Yu, X. Design and implementation of terminal sliding mode control method for PMSM speed regulation system. IEEE Trans. Ind. Inform. 2012, 9, 1879–1891. [Google Scholar] [CrossRef]
  21. Gao, W. Variable structure control of nonlinear systems: A new approach. IEEE Trans. Ind. Electron. 1993, 40, 45–55. [Google Scholar] [CrossRef]
  22. Fallaha, C.J.; Saad, M.; Kanaan, H.Y.; Al-Haddad, K. Sliding-mode robot control with exponential reaching law. IEEE Trans. Ind. Electron. 2010, 58, 600–610. [Google Scholar] [CrossRef]
  23. Levant, A. Higher-order sliding modes, differentiation and output-feedback control. Int. J. Control 2003, 76, 924–941. [Google Scholar] [CrossRef]
  24. Behnamgol, V.; Asadi, M.; Aphale, S.S.; Sohani, B. Recursive PID-NT Estimation-Based Second-Order SMC Strategy for Knee Exoskeleton Robots: A Focus on Uncertainty Mitigation. Electronics 2025, 14, 1455. [Google Scholar] [CrossRef]
  25. Liu, Y.C. Disturbance-observer-based second-order sliding-mode position control for permanent-magnet synchronous motors: A continuous twisting algorithm-based approach. Energies 2024, 17, 2974. [Google Scholar] [CrossRef]
  26. Veselić, B.; Milosavljević, Č.; Draženović, B.; Huseinbegović, S. Sliding manifold design for higher-order sliding mode control of linear systems. Int. J. Control Autom. Syst. 2021, 19, 2652–2663. [Google Scholar] [CrossRef]
  27. Utkin, V.I. Sliding Modes in Control and Optimization; Springer Science & Business Media: Berlin/Heidelberg, Germany, 2013. [Google Scholar]
  28. Utkin, V. Methods for constructing discontinous planes in multidimensional variable structure systems. Autom. Remote Control 1977, 31, 1466–1470. [Google Scholar]
  29. Malkapure, H.G.; Chidambaram, M. Comparison of two methods of incorporating an integral action in linear quadratic regulator. IFAC Proc. Vol. 2014, 47, 55–61. [Google Scholar] [CrossRef]
  30. Feng, Y.; Yu, X.; Man, Z. Non-singular terminal sliding mode control of rigid manipulators. Automatica 2002, 38, 2159–2167. [Google Scholar] [CrossRef]
  31. Moulay, E.; Perruquetti, W. Finite time stability and stabilization of a class of continuous systems. J. Math. Anal. Appl. 2006, 323, 1430–1443. [Google Scholar] [CrossRef]
  32. Zheng, J.; Wang, H.; Man, Z.; Jin, J.; Fu, M. Robust motion control of a linear motor positioner using fast nonsingular terminal sliding mode. IEEE/ASME Trans. Mechatronics 2014, 20, 1743–1752. [Google Scholar] [CrossRef]
  33. Yu, S.; Yu, X.; Shirinzadeh, B.; Man, Z. Continuous finite-time control for robotic manipulators with terminal sliding mode. Automatica 2005, 41, 1957–1964. [Google Scholar] [CrossRef]
  34. Ghosh, A.; Krishnan, T.; Subudhi, B. Robust proportional–integral–derivative compensation of an inverted cart–pendulum system: An experimental study. IET Control Theory Appl. 2012, 6, 1145–1152. [Google Scholar] [CrossRef]
  35. Draženović, B.; Milosavljević, Č.; Veselić, B.; Gligić, V. Comprehensive approach to sliding subspace design in linear time invariant systems. In Proceedings of the 2012 12th International Workshop on Variable Structure Systems, Mumbai, India, 12–14 January 2012; IEEE: Piscataway, NJ, USA, 2012; pp. 473–478. [Google Scholar]
  36. Draženović, B.; Milosavljević, Č.; Veselić, B. Comprehensive approach to sliding mode design and analysis in linear systems. In Advances in Sliding Mode Control: Concept, Theory and Implementation; Springer: Berlin/Heidelberg, Germany, 2013; pp. 1–19. [Google Scholar]
  37. Smaeilzadeh, S.M.; Golestani, M. Finite-time fault-tolerant adaptive robust control for a class of uncertain non-linear systems with saturation constraints using integral backstepping approach. IET Control Theory Appl. 2018, 12, 2109–2117. [Google Scholar] [CrossRef]
  38. Wang, S.; Na, J.; Xing, Y. Adaptive optimal parameter estimation and control of servo mechanisms: Theory and experiments. IEEE Trans. Ind. Electron. 2020, 68, 598–608. [Google Scholar] [CrossRef]
Figure 1. Mechanical diagram of cart–inverted pendulum system.
Figure 1. Mechanical diagram of cart–inverted pendulum system.
Machines 14 00111 g001
Figure 2. Overall control block diagram of the CIP using the proposed SONTSMC.
Figure 2. Overall control block diagram of the CIP using the proposed SONTSMC.
Machines 14 00111 g002
Figure 3. Experimental rig with CIP: ① stepper motor; ② cart; ③ rotary magnetic encoder module pendulum clamp; ④ pendulum; ⑤ miniature incremental magnetic encoder module; ⑥ magnetic scale; ⑦ belt; ⑧ dSPACE; ⑨ microstep driver; ⑩ nuts; ⑪ pendulum clamp.
Figure 3. Experimental rig with CIP: ① stepper motor; ② cart; ③ rotary magnetic encoder module pendulum clamp; ④ pendulum; ⑤ miniature incremental magnetic encoder module; ⑥ magnetic scale; ⑦ belt; ⑧ dSPACE; ⑨ microstep driver; ⑩ nuts; ⑪ pendulum clamp.
Machines 14 00111 g003
Figure 4. Cart position of stabilization problem.
Figure 4. Cart position of stabilization problem.
Machines 14 00111 g004
Figure 5. Pendulum angle of stabilization problem.
Figure 5. Pendulum angle of stabilization problem.
Machines 14 00111 g005
Figure 6. Control input of stabilization problem.
Figure 6. Control input of stabilization problem.
Machines 14 00111 g006
Figure 7. Phase plot of s 1 ( t ) s ˙ 1 ( t ) for LQRSMC.
Figure 7. Phase plot of s 1 ( t ) s ˙ 1 ( t ) for LQRSMC.
Machines 14 00111 g007
Figure 8. Phase plot of s 2 ( t ) s ˙ 2 ( t ) for ILQRSMC.
Figure 8. Phase plot of s 2 ( t ) s ˙ 2 ( t ) for ILQRSMC.
Machines 14 00111 g008
Figure 9. Phase plot of s ( t ) s ˙ ( t ) for SONTSMC.
Figure 9. Phase plot of s ( t ) s ˙ ( t ) for SONTSMC.
Machines 14 00111 g009
Figure 10. Cart position of tracking problem.
Figure 10. Cart position of tracking problem.
Machines 14 00111 g010
Figure 11. Cart position error of tracking problem.
Figure 11. Cart position error of tracking problem.
Machines 14 00111 g011
Figure 12. Pendulum angle of tracking problem.
Figure 12. Pendulum angle of tracking problem.
Machines 14 00111 g012
Figure 13. Control input of tracking problem.
Figure 13. Control input of tracking problem.
Machines 14 00111 g013
Table 1. Parameters setting of each controller in four cases.
Table 1. Parameters setting of each controller in four cases.
ControllerTuning Parameters
LQRSMC R 1 = 1 ; Q 1 = 20 diag [ 1 0.1 5 0.2 10 ] ; κ 1 = 0.2 ; α = 0.7 .
ILQRSMC R 2 = 1 ; Q 2 = 0.01 diag [ 1 0.1 5 0.2 10 ] ; κ 2 = 1 ; α = 0.7 .
SONTSMC R = 1 ; Q = 0.01 diag [ 1 0.1 5 0.2 10 ] ; κ = 0.5 ; α = 0.7 ; p = 9 ; q = 5 ; λ = 10 .
Table 2. Index values of control strategies in stabilization control.
Table 2. Index values of control strategies in stabilization control.
  IAE x (m) ISE x (m) IAE θ (rad) ISE θ (rad)IAC (m/s2)
LQRSMC1.27500.12860.08470.001418.4326
ILQRSMC0.62330.06660.12920.002516.0692
SONTSMC0.52750.0440.09380.001913.3387
Table 3. Index values of control strategies in tracking control.
Table 3. Index values of control strategies in tracking control.
  IAE x (m) ISE x (m) IAE θ (rad) ISE θ (rad)IAC (m/s2)
LQRSMC1.56700.14360.09350.001518.4257
ILQRSMC0.70550.07660.13480.002715.3816
SONTSMC0.5720.04820.10.001913.4628
Disclaimer/Publisher’s Note: The statements, opinions and data contained in all publications are solely those of the individual author(s) and contributor(s) and not of MDPI and/or the editor(s). MDPI and/or the editor(s) disclaim responsibility for any injury to people or property resulting from any ideas, methods, instructions or products referred to in the content.

Share and Cite

MDPI and ACS Style

Le, H.D.; Nestorović, T. Second-Order Nonsingular Terminal Sliding Mode Control for Tracking and Stabilization of Cart–Inverted Pendulum. Machines 2026, 14, 111. https://doi.org/10.3390/machines14010111

AMA Style

Le HD, Nestorović T. Second-Order Nonsingular Terminal Sliding Mode Control for Tracking and Stabilization of Cart–Inverted Pendulum. Machines. 2026; 14(1):111. https://doi.org/10.3390/machines14010111

Chicago/Turabian Style

Le, Hiep Dai, and Tamara Nestorović. 2026. "Second-Order Nonsingular Terminal Sliding Mode Control for Tracking and Stabilization of Cart–Inverted Pendulum" Machines 14, no. 1: 111. https://doi.org/10.3390/machines14010111

APA Style

Le, H. D., & Nestorović, T. (2026). Second-Order Nonsingular Terminal Sliding Mode Control for Tracking and Stabilization of Cart–Inverted Pendulum. Machines, 14(1), 111. https://doi.org/10.3390/machines14010111

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop