1 Introduction

Inverted pendulum-like systems have been extensively studied and even today provide a rich source of examples of challenging nonlinear dynamics. In the vast literature of dynamics and control, many configurations can be found, such as the rotary inverted pendulum [1, 2], reaction wheel pendulums [3,4,5,6], wheeled inverted pendulums [7,8,9,10,11], 3D pendulum [12, 13], reaction mass pendulum [14, 15], the Cubli [16, 17], among many other examples [18,19,20,21,22,23,24,25,26]. All these dynamic systems have contributed to either approximating the dynamics of real-world systems such as satellite launchers, cranes, and humanoid robots, or providing research benchmarks for analysis and design of controllers.

Specifically, this paper investigates the 3D pendulum, thus extending the discussion introduced in references [12, 27]. This device consists of a rigid body fixed to a pivot, both subjected to gravity, allowing three rotational degrees of freedom. A controllable 3D pendulum is a fully actuated dynamic system with three independent control torques applied to each rotational degree of freedom [12, 28, 29]. The asymptotic stabilization of the 3D pendulum has been investigated in references [28,29,30,31,32]. Chaturvedi et al. [31] have designed several controllers that either use only angular velocity feedback for the hanging equilibrium case or angular velocity feedback and reduced attitude that asymptotically stabilize the axially symmetric 3D pendulum for both hanging and inverted equilibrium. Zou and Ge [32] have presented a neural-network-based fuzzy logic control for a 3D pendulum which also assured the asymptotic stabilization. In particular, the author of [13] has proposed a robust finite-time attitude control law for the tracking control of the 3D pendulum with the addition of a disturbance observer in order to exactly estimate the external disturbances acting on the system. The control strategy proposed in [13] guarantees the finite-time stability, however the settling time cannot be set in advance by the user independently of initial conditions.

The sliding mode control (SMC) approach has been investigated for many decades [33,34,35,36]. The main advantage provided by the SMC, i.e., insensitivity to bounded uncertainties and unmodeled dynamics, has popularized it in many control applications [37,38,39,40], including the inverted pendulums [5, 6, 8, 11, 23, 41]. In the global sliding mode control (GSMC) design, also referred to as integral sliding mode, the sliding variable is chosen so as to be zero at the initial condition [35, 42]. Therefore, by ensuring the existence of sliding mode from the very beginning, the reaching phase of the conventional design is eliminated, and robustness is assured from the initial condition [35, 42].

The classical SMC design uses a linear surface which assures the asymptotic convergence of the states to the equilibrium. The introduction of the terminal SMC has provided the property of adjustable finite-time convergence to the origin [43]; however, the bound for the settling time usually depends on initial conditions, on tunable parameters and it is an unbounded function. Due to this fact, other sliding mode control designs have been proposed assuring a stronger form of stability, known as fixed-time stability [44, 45]. The concept of fixed-time stability has presented a bounded fixed convergence time independent of initial conditions. However, choosing the settling time for fixed-time control strategies is still a difficult task due to a relation between the tuning gains and the fixed stabilization time not being direct and easy to obtain [46, 47]. Furthermore, the bound for the settling-time obtained for fixed-time controllers can be very conservative, i.e., the actual convergence can occur far too early compared to that bound [46, 47].

Sánchez-Torres et al. [48] have introduced the concept of predefined-time stability with sliding modes where the settling time can be set as a design parameter. They have also shown the design of first-order sliding mode control with predefined-time reaching phase. Jiménez-Rodríguez et al. [46] have investigated the predefined-time tracking of a class of mechanical systems, for instance, a two-link robot manipulator. However, they only considered the case where no external disturbances are applied to the system. Moreover, Sánchez-Torres et al. [47] have presented a class of dynamic systems which are predefined-time stable, i.e., they are fixed-time stable and the settling time is a design parameter that can be set in advance. Jiménez-Rodríguez et al. [49] have studied the variable structure stabilization of second-order systems with predefined-time settling time verifying the method’s effectiveness in a two-link robotic manipulator. Sánchez-Torres et al. [50] have designed an integral sliding mode control for second-order systems with predefined settling time. Recently, the predefined-time control has been studied for some dynamic systems, for instance, see [51,52,53,54]. Only reference [50] have investigated the predefined-time control combined it with a GSMC approach.

The present paper is concerned with the design and analysis of a predefined-time global sliding mode control strategy. For many engineering systems and practical applications, it is useful that the controller designer can choose directly the settling time within which the dynamic system will converge to the desired reference and also that this parameter be independent of initial conditions. In this sense, the recent predefined-time control schemes allow this choice. Combining it with a global sliding mode can assure the robustness to bounded disturbances and uncertainties since the initial time. In summary, to the best of our knowledge, the main contributions of this paper are: (1) the design of a novel global predefined-time sliding mode control for multi-input nonlinear systems in the regular form and (2) the application of the designed control to the three-axis attitude control of a 3D pendulum. Different from other approaches presented in the literature for the 3D pendulum, the designer can choose in advance the predefined time which is independent of initial conditions, and the states converge to the desired reference within the time chosen. Additionally, the sliding variable introduced by our work is different from [50], and the control design is simpler, presenting a novel control design with predefined settling time for multi-variable systems.

This paper is organized as follows: Sect. 2 presents the problem definition. Section 3 shows the design of the predefined-time global sliding mode controller for the 3D pendulum. Section 4 reports the numerical results of two different scenarios, taking the pendulum to the upright (inverted) position and tracking a desired command, to demonstrate the method effectiveness comparing the obtained results to two other global sliding mode methods. Finally, Sect. 5 brings forward the concluding remarks of the paper.

2 Problem definition

This section presents the notation used throughout the paper, describes the mathematical model of the 3D pendulum, and shows how to obtain the model of this dynamical system in terms of the attitude and angular velocity errors described in the regular form. Furthermore, the control objective is defined.

2.1 Notation

Denote an algebraic vector by a lowercase boldface letter, e.g., \(\mathbf{a}\), and a matrix by an uppercase boldface letter, e.g., \(\mathbf{A}\). The notation \(\mathbf{A} \succ 0 \) represents a positive definite matrix. Consider a Cartesian coordinate system (CCS) \(\mathcal {S}_r = \{R; \hat{r}_1, \hat{r}_2, \hat{r}_3 \}\), where \(\hat{r}_1\), \(\hat{r}_2\), and \(\hat{r}_3\) are orthogonal unit three-dimensional vector describing the space. The representation of a coordinate-free vector in an arbitrary CCS \(\mathcal {S}_r\) is denoted by the lowercase boldface letter as the corresponding coordinate-free vector, but with a subscript r, e.g., \(\mathbf{a}_r \in \mathbb {R}^3\). The norm 2 of an algebraic vector or a matrix is denoted by \(\left| \left| . \right| \right| \). Denote the special orthogonal group as

$$\begin{aligned} \mathrm{SO}(3) \triangleq \left\{ \mathbf{D} \in \mathbb {R}^{3\times 3}: \mathbf{D}^T \mathbf{D} = \mathbf{I}_3\right\} , \end{aligned}$$
(1)

where \(\mathbf{I}_3 \in \mathbb {R}^{3 \times 3}\) is an identity matrix. The relation between the representations of a coordinate-free vector in two different CCS is \(\mathbf{a}_r = \mathbf{D}^{r/s}{} \mathbf{a}_s\), where \(\mathbf{D}^{r/s} \in \mathrm{SO}(3)\) is the attitude matrix of \(\mathcal {S}_r\) with respect to \(\mathcal {S}_s\). The inverse of \(\mathbf{D}^{r/s}\) is sometimes denoted by \(\mathbf{D}^{s/r}\) and it coincides with its transpose. The symbol \(\mathbf{e}_i\) denotes a n-dimensional unit vector in \(\mathbb {R}^n\). The i-th component of \(\mathbf{a}\) is denoted by \(a_i\) and sometimes by \(\mathbf{e}_i^T\mathbf{a}\). Now, consider two vectors \(\mathbf{a}_r\) and \(\mathbf{b}_r\) represented in \(\mathcal {S}_r\). Denote the representation of the cross product by the matrix multiplication \([\mathbf{a}_r\times ]\mathbf{b}_r\), where \([\mathbf{a}_r\times ]\) is the following skew symmetric matrix

$$\begin{aligned} {[}{} \mathbf{a}_r \times ] = \left[ \begin{array}{ccc} 0 &{} -a_3 &{} a_2\\ a_3 &{} 0 &{} -a_1 \\ -a_2 &{} a_1 &{} 0 \end{array}\right] . \end{aligned}$$
(2)

2.2 Dynamic modeling

Consider an inertial and a body-fixed CCS denoted by \(\mathcal {S}_n \triangleq \left\{ N; \hat{n}_1,\hat{n}_2, \hat{n}_3 \right\} \) and \(\mathcal {S}_b \triangleq \left\{ B; \hat{b}_1,\hat{b}_2, \hat{b}_3 \right\} \), respectively. Assume that their origins are coincident, i.e., \(N = B\). Figure 1 shows a generic 3D pendulum and the CCSs.

Fig. 1
figure 1

Generic 3D pendulum

The modified Rodrigues parameters (MRP) are used to describe the attitude of the 3D pendulum. Considering its shadow set property, the MRP provides a 3D singularity-free attitude description [55]. The MRP \(\mathbf{p} \in \mathbb {R}^3\) is defined as

$$\begin{aligned} \mathbf{p} \triangleq \tan \frac{\phi }{4} \hat{\mathbf{e}}, \end{aligned}$$
(3)

where \(\phi \in (-2\pi , 2\pi )\) is the principal angle of rotation, \(\hat{\mathbf{e}}\) is the principal-axis unit vector referring to the Euler’s principal rotation theorem. The kinematic differential equation describing the attitude motion of \(\mathcal {S}_b\) with respect to \(\mathcal {S}_n\) in terms of the MRP is [55]:

$$\begin{aligned} \dot{\mathbf{p}}^{b/n} = \frac{1}{4} \varvec{\varSigma }\left( \mathbf{p}^{b/n}\right) \varvec{\omega }_b^{b/n}, \end{aligned}$$
(4)

where \(\varvec{\varSigma }\left( \mathbf{p}^{b/n}\right) \in \mathbb {R}^{3\times 3}\) is given by

$$\begin{aligned} \varvec{\varSigma }\left( \mathbf{p}^{b/n}\right) = \left( 1- \mathbf{p}^T \mathbf{p}\right) \mathbf{I}_3 + 2 [\mathbf{p} \times ] + 2\mathbf{p} \mathbf{p}^T \end{aligned}$$
(5)

and \(\varvec{\omega }_b^{b/n}\) is the body angular velocity with respect to inertial frame represented in the body frame.

The angular momentum of the 3D pendulum with respect to point B is given by

$$\begin{aligned} \mathbf{h}_b = \mathbf{J}_b\varvec{\omega }^{b/n}_ b, \end{aligned}$$
(6)

where \(\mathbf{J}_b \in \mathbb {R}^{3 \times 3}\) is the 3D pendulum centroidal inertia matrix. The Euler’s equation establishes

$$\begin{aligned} \dot{\mathbf{h}}_b + \varvec{\omega }^{b/n}_ b \times \mathbf{h}_b = \varvec{\tau }_b, \end{aligned}$$
(7)

where \( \varvec{\tau }_b\) is the resultant external torque acting on the pendulum with respect to B. Taking the time derivative of the angular momentum given in (6) and detailing the resultant external torque, it is possible to obtain the following equation of motion for the 3D pendulum:

$$\begin{aligned} \mathbf{J}_b\dot{\varvec{\omega }}_b^{b/n} = -\varvec{\omega }_b^{b/n} \times \mathbf{J}_b \varvec{\omega }_b^{b/n} + \varvec{\ell }_b + \mathbf{u}_b + \mathbf{d}_b, \end{aligned}$$
(8)

where \(\dot{\varvec{\omega }}_b^{b/n} \in \mathbb {R}^{3}\) is the body angular acceleration, \(\mathbf{u}_b \in \mathbb {R}^{3}\) the control torque vector, \(\mathbf{d}_b \in \mathbb {R}^{3}\) represents the unknown disturbances, \(\varvec{\ell }_b = -mg \mathbf {r}^{cm/n}_n \times \mathbf{D}^{b/n} \mathbf{e}_3\) describes the external torque caused by gravity, where m is the mass of the 3D pendulum, \({\mathbf{r}^{cm/n}_{n}} \in \mathbb {R}^{3}\) the position vector of the center of mass represented in \(\mathcal {S}_n\), \( \mathbf{D}^{b/n}\) is the attitude matrix of \(\mathcal {S}_b\) w.r.t. \(\mathcal {S}_n\), and \(\mathbf{e}_3 {\triangleq \left( 0,0,1\right) }\).

Equations (4) and (8) completely describe the dynamic model of the 3D pendulum.

2.3 Error dynamics

For designing the tracking control law, let us define the attitude control error in terms of the attitude matrix as

$$\begin{aligned} \tilde{\mathbf{D}} \triangleq \mathbf{D}^{b/n} \left( \bar{\mathbf{D}}^{b/n}\right) ^T , \end{aligned}$$
(9)

where \(\bar{\mathbf{D}}^{b/n}\) is the attitude command considering an implicit reference CCS. Now, consider the following parametrization of \(\tilde{\mathbf{D}}\) in terms of MRP:

$$\begin{aligned} \tilde{\mathbf{p}} = \frac{1}{\zeta (\zeta + 2)} \left[ \begin{array}{c} \tilde{D}_{23} - \tilde{D}_{32} \\ \tilde{D}_{31} - \tilde{D}_{13} \\ \tilde{D}_{12} - \tilde{D}_{21} \end{array}\right] , \end{aligned}$$
(10)

where \(\zeta \triangleq \sqrt{\text{ trace }(\tilde{\mathbf{D}}) + 1}\).

On the other hand, define the angular velocity control error as

$$\begin{aligned} \tilde{\varvec{\omega }} = \varvec{\omega }_b^{b/n} - \tilde{\mathbf{D}} \bar{\varvec{\omega }}_b^{b/n}, \end{aligned}$$
(11)

where \(\bar{\varvec{\omega }}_b^{b/n}\) is the commanded body angular velocity.

The attitude error kinematics in terms of MRP is then described by

$$\begin{aligned} \dot{\tilde{\mathbf{p}}} = \frac{1}{4} \varvec{\varSigma }(\tilde{\mathbf{p}}) \tilde{\varvec{\omega }}. \end{aligned}$$
(12)

Differentiating equation (11) with respect to time yields

$$\begin{aligned} \dot{\tilde{\varvec{\omega }}}= & {} \dot{\varvec{\omega }}_b^{b/n} + [\tilde{\varvec{\omega }} \times ]\tilde{\mathbf{D}} \bar{\varvec{\omega }}_b^{b/n} - \tilde{\mathbf{D}}\dot{\bar{\varvec{\omega }}}_b^{b/n}. \end{aligned}$$
(13)

By substituting Eq. (8) into Eq. (13), we can finally obtain the dynamic equation in terms of the attitude and angular velocity control errors as

$$\begin{aligned} \dot{\tilde{\varvec{\omega }}}= & {} \mathbf{J}_b^{-1}\left( -[\varvec{\omega }_b^{b/n}\times ]\mathbf{J} \varvec{\omega }_b^{b/n} + \varvec{\ell }_b \right) + [\tilde{\varvec{\omega }} \times ]\tilde{\mathbf{D}} \bar{\varvec{\omega }}_b^{b/n} + \nonumber \\&- \tilde{\mathbf{D}}\dot{\bar{\varvec{\omega }}}_b^{b/n} + \mathbf{J}_b^{-1}\left( \mathbf{u}_b + \mathbf{d}_b\right) . \end{aligned}$$
(14)

Equations (12) and (14) can now be written in the following regular form:

$$\begin{aligned} \dot{\mathbf{x}}_1= & {} \mathbf{f}_1 ({\mathbf{x}_1,\mathbf{x}_2}), \end{aligned}$$
(15)
$$\begin{aligned} \dot{\mathbf{x}}_2= & {} \mathbf{f}_2 ({\mathbf{x}_1,\mathbf{x}_2}) + \mathbf{B}{} \mathbf{u} + \mathbf{B}{} \mathbf{d}, \end{aligned}$$
(16)

where \({\mathbf{x}_1 \triangleq \tilde{\mathbf{p}}}\) denotes the attitude error in terms of the MRP vector and \({\mathbf{x}_2 \triangleq \tilde{\varvec{\omega }}}\) represents the angular velocity error. The functions \(\mathbf{f}_1 ({\mathbf{x}_1,\mathbf{x}_2})\) and \(\mathbf{f}_2 ({\mathbf{x}_1,\mathbf{x}_2})\) are given by

$$\begin{aligned} \mathbf{f}_1 ({\mathbf{x}_1,\mathbf{x}_2})\triangleq & {} \frac{1}{4} \varvec{\varSigma }(\tilde{\mathbf{p}}) \tilde{\varvec{\omega }}, \end{aligned}$$
(17)
$$\begin{aligned} \mathbf{f}_2 ({\mathbf{x}_1,\mathbf{x}_2})\triangleq & {} \mathbf{J}^{-1}\left( -[\varvec{\omega }_b^{b/n}\times ]\mathbf{J} \varvec{\omega }_b^{b/n} + \varvec{\ell }_b \right) + \nonumber \\&+ {[}\tilde{\varvec{\omega }} \times ]\tilde{\mathbf{D}} \bar{\varvec{\omega }}_b^{b/n} - \tilde{\mathbf{D}}\dot{\bar{\varvec{\omega }}}_b^{b/n}, \end{aligned}$$
(18)

and matrix \(\mathbf{B} \triangleq \mathbf{J}_b^{-1}\). Finally, the control input is \(\mathbf{u} \triangleq \mathbf{u}_b\) and the disturbance is \(\mathbf{d} \triangleq \mathbf{d}_b\) which includes bounded matched disturbances and uncertainties.

Assumption 1

Assume that the unknown disturbance \(\mathbf{d}\) is bounded according to \(\Vert \mathbf{d}\Vert \le \rho \), with known \(\rho \in \mathbb {R}_+\).

Now, we can enunciate the control objective.

Problem 1

The main problem is to design a robust control law \(\mathbf{u}\) that ensures sliding mode during all time and makes the control errors \(\mathbf{x}_1\) and \(\mathbf{x}_2\) converge to zero within a time period predefined by the designer independent of the initial conditions.

3 Predefined-time global sliding mode control design

3.1 Preliminaries

This subsection provides some important definitions and previous results reported in the literature that aid in the control design.

Consider the following differential equation

$$\begin{aligned} \dot{\mathbf{x}} = \mathbf{f}\left( t,\mathbf{x}\right) , \end{aligned}$$
(19)

where \(\mathbf{x} \in \mathbb {R}^n\) is the state variable, \(t \in \mathbb {R}_{\ge 0}\) is the time, and \(\mathbf{f}: \mathbb {R}^n \rightarrow \mathbb {R}^n\) with \( \mathbf{f}(t,\varvec{0}) = \varvec{0}\). Denote the solution of Eq. (19) from the initial condition \(\mathbf{x}_0 \triangleq \mathbf{x}(0)\) by \(\varvec{\phi }(t,\mathbf{x}_0)\).

As follows, we present three stability definitions involving finite-time convergence that are the basis for the present investigation. Note that they are incremental.

Definition 1

(Finite-time stability [56,57,58]) The origin of the system (19) is said to be finite-time stable if it is asymptotically stable and for any solution \({\varvec{\phi }(t,\mathbf{x}_0)}\) there exists a finite time \(0 \le \tau < \infty \), such that \({\varvec{\phi }(t,\mathbf{x}_0)} = \varvec{0}\), \(\forall t \ge \tau \).

The above definition involves a finite-time convergence. However, the time of convergence, known as settling time, in general, depends on the initial condition \(\mathbf{x}_0\). In this sense, if \(\mathbf{x}_0\) is far from the origin, we would expect a larger settling time.

For convenience, let us define a settling-time function \(T: \mathbb {R}^n \rightarrow \mathbb {R}_{\ge 0}\) as

$$\begin{aligned} T({\mathbf{x}_0}) \triangleq \mathrm{inf} \left\{ \tau \ge 0: {\varvec{\phi }(t,\mathbf{x}_0)} = \varvec{0}, ~ \forall t \ge \tau \right\} . \end{aligned}$$
(20)

Definition 2

(Fixed-time stability [44, 45, 57, 58]) The origin of the system (19) is said to be fixed-time stable if it is finite-time stable and the settling-time function T is bounded according to

$$\begin{aligned} {\mathrm{sup}}_{{\mathbf{x}_0} \in \mathbb {R}^n} T({\mathbf{x}_0}) \le T_{\mathrm{max}}, \end{aligned}$$
(21)

for some possibly unknown \(T_{\mathrm{max}} \in \mathbb {R}_{>0}\).

Note that, different from Definition 1, the above one imposes a bound \(T_{\mathrm{max}}\) on the settling time function. However, it does not allow the flexibility to set that bound as desired.

Definition 3

(Predefined-time stability [47, 57, 58]) The origin of the system (19) is is said to be predefined-time stable if it is fixed-time stable and the settling time function satisfies

$$\begin{aligned} T({\mathbf{x}_0}) \le T_c, \end{aligned}$$
(22)

where \(T_c {\in \mathbb {R}_{>0}}\) is a predefined time.

This paper is particularly interested in the latter definition.

Reference [47] has shown that

$$\begin{aligned} \dot{\mathbf{x}} = - \mathbf{g}_{p}(\mathbf{x}), \end{aligned}$$
(23)

where

$$\begin{aligned} \mathbf{g}_{p}(\mathbf{x}) \triangleq \frac{1}{{T_c} ~p} \hbox {exp}\left( \vert \vert \mathbf{x} \vert \vert ^{p}\right) \frac{\mathbf{x}}{\vert \vert \mathbf{x} \vert \vert ^{p}}, \end{aligned}$$
(24)

with \(0 < p \le 1\) and \(T_c > 0\) is globally predefined-time stable with predefined time \(T_c\). Some important properties of this function are discussed in [46,47,48].

The authors of [46] have shown that the derivative of the stabilizing function presented in (24) along the trajectories of (23) is

$$\begin{aligned} \frac{d \mathbf{g}_p(\mathbf{x}) }{dt}= & {} - \frac{\partial \mathbf{g}_p(\mathbf{x}) }{\partial \mathbf{x}} \mathbf{g}_p(\mathbf{x}), \end{aligned}$$
(25)

which yields

$$\begin{aligned} \frac{d \mathbf{g}_p(\mathbf{x}) }{dt} = - \left( \frac{\exp (\vert \vert \mathbf{x} \vert \vert ^p)}{T_c ~ p}\right) ^2 \left( p \frac{\mathbf{x}}{\vert \vert \mathbf{x} \vert \vert ^p} + (1 - p) \frac{\mathbf{x}}{\vert \vert \mathbf{x} \vert \vert ^{2p}} \right) ,\nonumber \\ \end{aligned}$$
(26)

where \(0< p < 1/2\), and \(d\mathbf{g}_p(\mathbf{x})/dt\) is continuous.

3.2 Control design

In this subsection, we present the design of a novel global predefined-time sliding mode controller. To do so, we consider the following sliding variable:

$$\begin{aligned} \mathbf{s}\left( \varvec{\sigma }(\mathbf{x}_1),t\right) \triangleq \varvec{\sigma }(\mathbf{x}_1) - \mathbf{P}(t) \mathbb {I}_{[0,\mathrm{T}]} \varvec{\sigma }({\mathbf{x}_{10}}), \end{aligned}$$
(27)

where

$$\begin{aligned} \varvec{\sigma }(\mathbf{x}_1) \triangleq \dot{\mathbf{x}}_1 + \mathbf{g}_{p_1}(\mathbf{x}_1), \end{aligned}$$
(28)

and \(\mathbf{x}_{10} \triangleq \mathbf{x}_1(0)\). The function \(\mathbf{g}_{p_1}(\mathbf{x}_1)\) is defined as in (24) and \(T_c\) is the predefined time. Moreover, \(\mathbf{P}(t)\) is chosen as

$$\begin{aligned} \mathbf{P}(t) = \mathbf{I}_3 p(t), \end{aligned}$$
(29)

with \(p(t) = 1 - 2 t / T + t^2 / T^2 \), where \(T > 0\) is a constant design parameter. In the proposed sliding variable (27), the function \(\mathbf{P}(t)\) is multiplied by an indicator function \(\mathbb {I}_{[0,\mathrm{T}]}\) given by

$$\begin{aligned} \mathbb {I}_{[0,\mathrm{T}]} = {\left\{ \begin{array}{ll} 1 &{} \text{ if } ~ t \in [0, \mathrm T] \\ 0 &{} \text{ if } ~ t \notin [0, \mathrm T] \end{array}\right. }, \end{aligned}$$
(30)

where one can note that after the time constant T, the term \(\mathbf{P}(t) \mathbb {I}_{[0,\mathrm{T}]} \varvec{\sigma }({\mathbf{x}_{10}})\) goes to zero and only the predefined-time term given in (28) remains. Considering the construction of the sliding variable presented in (27), the predefined time is such that \(T_c > T\).

Now, consider the following set:

$$\begin{aligned} \mathcal {S} \triangleq \{ \left( \mathbf{x}_1, \mathbf{x}_2\right) \in \mathbb {R}^{6} : \mathbf{s}\left( \varvec{\sigma }(\mathbf{x}_1),t\right) = 0, \forall t\ge 0 \}, \end{aligned}$$
(31)

as the eventual sliding set. To assure that all trajectories are constrained to this set, we propose the following control law:

$$\begin{aligned} \mathbf{u}= & {} - \varvec{\varDelta }\left( \frac{\partial \mathbf{f}_1}{\partial \mathbf{x}_1} \mathbf{f}_1 + \frac{\partial \mathbf{f}_1}{\partial \mathbf{x}_2} \mathbf{f}_2 {-} \mathbf{P}(t) \mathbb {I}_{[0,\mathrm{T}]} \dot{\varvec{\sigma }}({\mathbf{x}_{10}})\right) + \nonumber \\&- \varvec{\varDelta } \left( -\dot{\mathbf{P}}(t)\mathbb {I}_{[0,\mathrm{T}]}\varvec{\sigma }({\mathbf{x}_{10}}) + \frac{\partial \mathbf{g}_{p_1}}{\partial \mathbf{x}_1} \mathbf{g}_{p_1}{(\mathbf{x}_1)} +\kappa \frac{\mathbf{s}}{\vert \vert \mathbf{s} \vert \vert } \right) , \nonumber \\ \end{aligned}$$
(32)

where \(\kappa \in \mathbb {R}_{+}\) is the switching gain, and \(\varvec{\varDelta }\) is denoted by

$$\begin{aligned} \varvec{\varDelta } = \left( \frac{\partial \mathbf{f}_1}{\partial \mathbf{x}_2} \mathbf{B}\right) ^{-1}. \end{aligned}$$
(33)

Theorem 1

Considering the error dynamic model given in (15)–(16), the control law \(\mathbf{u}\) presented in Eq. (32) assures that the state errors \(\mathbf{x}_1\) and \(\mathbf{x}_2\) converge to zero within the predefined time \(T_c\), while maintaining \(\mathbf{s}(\varvec{\sigma }(\mathbf{x}_1),t) = \varvec{0}\), \(\forall t \ge 0.\)

Proof

let us consider the Lyapunov candidate function as

$$\begin{aligned} V = \frac{1}{2}{} \mathbf{s}^T \mathbf{s}. \end{aligned}$$
(34)

Evaluating its derivative yields

$$\begin{aligned} \dot{V} = \mathbf{s}^T \dot{\mathbf{s}}, \end{aligned}$$
(35)

with

$$\begin{aligned} \dot{\mathbf{s}}= & {} \frac{\partial \mathbf{f}_1}{\partial \mathbf{x}_1} \mathbf{f}_1 + \frac{\partial \mathbf{f}_1}{\partial \mathbf{x}_2} \left( \mathbf{f}_2 + \mathbf{B}{} \mathbf{u} + \mathbf{B}{} \mathbf{d} \right) + \frac{\partial \mathbf{g}_{p_1}(\mathbf{x}_1)}{\partial \mathbf{x}_1} {\mathbf{g}_{p_1}(\mathbf{x}_1)} +\nonumber \\&- \dot{\mathbf{P}}(t)\mathbb {I}_{[0,\mathrm{T}]}\varvec{\sigma }({\mathbf{x}_{10}}) - \mathbf{P}(t) \mathbb {I}_{[0,\mathrm{T}]} \dot{\varvec{\sigma }}({\mathbf{x}_{10}}). \end{aligned}$$
(36)

Substituting the proposed control law presented in Eq. (32) into Eq. (36), we can obtain the closed-loop s-dynamics

$$\begin{aligned} \dot{\mathbf{s}} = \frac{\partial \mathbf{f}_1}{\partial \mathbf{x}_2}{} \mathbf{B}{} \mathbf{d} - \kappa \frac{\mathbf{s}}{\vert \vert \mathbf{s} \vert \vert }. \end{aligned}$$
(37)

Let us now substitute the closed loop s-dynamics, Eq. (37), into the derivative of the Lyapunov candidate function, Eq. (35), which yields

$$\begin{aligned} \dot{V} = \mathbf{s}^T\frac{\partial \mathbf{f}_1}{\partial \mathbf{x}_2}{} \mathbf{B}{} \mathbf{d} - \kappa \vert \vert \mathbf{s} \vert \vert . \end{aligned}$$
(38)

The above equation implies

$$\begin{aligned} \dot{V} \le - \left( \kappa - \left| \left| \frac{\partial \mathbf{f}_1}{\partial \mathbf{x}_2} \right| \right| \vert \vert \mathbf{B} \vert \vert \rho \right) \vert \vert \mathbf{s}\vert \vert . \end{aligned}$$
(39)

Therefore, if

$$\begin{aligned} \kappa > \left| \left| \frac{\partial \mathbf{f}_1}{\partial \mathbf{x}_2} \right| \right| \vert \vert \mathbf{B} \vert \vert \rho , \end{aligned}$$
(40)

equation (39) can be written as

$$\begin{aligned} \dot{V} \le -\eta \vert \vert \mathbf{s} \vert \vert , \end{aligned}$$
(41)

with \(\eta > 0\), which is sufficient for the existence of sliding mode.

Now, let us verify the behavior of the sliding variable at the initial time given by

$$\begin{aligned} \mathbf{s}\left( \varvec{\sigma }({\mathbf{x}_{10}}),0\right) = \varvec{\sigma }({\mathbf{x}_{10}}) - \mathbf{P}(0) \mathbb {I}_{[0,\mathrm{T}]} \varvec{\sigma }({\mathbf{x}_{10}}). \end{aligned}$$
(42)

Note that \(\mathbf{P}(0) = \mathbf{I}_3\), which results

$$\begin{aligned} \mathbf{s}\left( \varvec{\sigma }({\mathbf{x}_{10}}),0\right) = \varvec{0}, \end{aligned}$$
(43)

thus, showing that the sliding motion is assured at initial time. Since we have shown that V is a non-increasing function, one can see that \(\mathbf{s}\) remains at zero, which guarantees the sliding motion from the initial time on.

Furthermore, note that the proposed sliding variable has a term that assures that the error state \(\mathbf{x}_1\) goes to zero within the predefined time \(T_c\), which means that \(\dot{\mathbf{x}}_1\) also converges to zero. From equation (15), we can see that \(\dot{\mathbf{x}}_1\) converging to zero implies that \(\mathbf{x}_2\) also goes to zero once \(\frac{1}{4} \varvec{\varSigma }(\tilde{\mathbf{p}}) \ne 0\), implying that \(\tilde{\varvec{\omega }} = 0\). Thus, we can see that both \(\mathbf{x}_1\) and \(\mathbf{x}_2\) converge to zero within the predefined time \(T_c\), thus completing the proof. \(\square \)

4 Results and discussion

This section presents the numerical results for controlling the 3D pendulum for two different scenarios, driving the pendulum to the upright position and tracking a sinusoidal reference. The proposed global predefined-time sliding mode controller (GPTSMC) is compared to two other approaches, a classical global sliding mode controller (GSMC) based on [42] which has been investigated for the 3D pendulum in [59], and a global fast nonsingular terminal sliding mode controller (GFNTSMC) based on [40].

To carry out the numerical simulations, we have set the following physical parameters for the 3D pendulum based on [13]: \(m = 30.5\) kg, \(\mathbf{J} = \text{ diag }(5.3 ~ 9.5 ~ 14.5)\) kgm\(^2\), and \({\mathbf{r}^{cm/n}_{n}} = (0,~0,~0.22)\) m. The script was coded in MATLAB using Euler integration method with a time step of 0.001 s. Disturbances are applied as sinusoidal signals with frequency of 0.5 Hz and amplitude 0.1 Nm for both cases investigated and for the three controllers.

Fig. 2
figure 2

Controlled attitude for upright position command

For driving the 3D pendulum to the upright position, the initial condition for the angular position is \((-180^{\circ }, 10^{\circ }, 10^{\circ })\) in a 123 Euler angles sequence which is converted to MRP. For tracking a desired trajectory, the initial condition is \((-25^{\circ },-35^{\circ }, 25^{\circ })\) and the reference command is

$$\begin{aligned} \bar{\mathbf{p}}= \left( 0.1 \cos (0.5 t), ~ 0.1 \cos (0.6 t), ~ 0.1\cos (0.4 t) \right) . \end{aligned}$$
(44)

The predefined time is chosen as \(T_c = 4\) s, the parameter \(p_1\) is selected as \(p_1 = 0.45\), the parameter \(T = 0.8\), and the switching gain is \(\kappa = \vert \vert \mathbf{d} \vert \vert + 0.05\).

Figure 2 shows the controlled attitude for driving the pendulum to the upright position. One can note that the proposed GPTSMC reaches the desired reference for the three components before the other two controllers and within the predefined time set. None of the controllers present overshoot.

Let us analyze the norm 2 of the attitude and angular velocities errors depicted in fig. for this case. We can observe that the norms have converged to values very close to zero, but the error norms for the proposed GPTSMC have presented a better outcome, and they have converged within the predefined time set.

Fig. 3
figure 3

Norm 2 of attitude and angular velocities errors for upright position command

Since the controllers we have designed are in the category of global sliding mode control strategies, the sliding variable must be zero for all the simulation time in order to assure robustness to bounded disturbances. Therefore, fig. 4 exhibits the behavior of the sliding variables for all three controllers and they are very similar. As expected, they remained very close to zero. One of the main drawbacks of SMC strategies is the chattering phenomenon. To cope with that, we have used a common approximation for the sign function as a sigmoid \(\frac{\mathbf{s}}{||\mathbf{s} || + 0.001}\).

Fig. 4
figure 4

Sliding variables for upright position command

Figure 5 presents the control torques for driving the pendulum to the upright position. The magnitude of the torques for the three controllers tested is similar, and taking into account that the inverted position is a natural equilibrium point of the 3D pendulum, the control torques go to values around zero once the system has reached the equilibrium.

Fig. 5
figure 5

Control torques for upright position command

Fig. 6
figure 6

Controlled attitude for tracking a sinusoidal command

Let us now evaluate the proposed controller performance when tracking a sinusoidal command. Figure 6 shows the controlled attitude in terms of the MRPs. In this case, we can see at the peaks of the trajectory that the proposed GPTSMC has a better performance staying closer to the command.

We have also evaluated the norm of the control errors for this case. Figure 7 (a) exhibits the attitude error norm, where we can observe that the proposed GPTSMC presents a smaller magnitude. Figure 7 (b) depicts the angular velocity error norm, where a similar behavior for all controllers can be seen. We attribute this oscillation to the disturbances that have been applied to all controllers.

Fig. 7
figure 7

Norm 2 of attitude and angular velocities errors for tracking a sinusoidal command

Figure 8 shows the behavior of the sliding variable for tracking a sinusoidal command, and, as expected, the values stayed close to zero as proposed.

Fig. 8
figure 8

Sliding variables for tracking a sinusoidal command

The control torques for tracking sinusoidal command are presented in fig. 9. Note that similar magnitudes are obtained for all controllers. Although these values are high, they are consistent with the parameters used for the simulations.

Fig. 9
figure 9

Control torques for tracking a sinusoidal command

5 Final remarks

This work has presented the dynamic modeling of the 3D pendulum and the design of a novel predefined-time global sliding mode control law. The results of the proposed control approach are compared to two other control laws, a classical global sliding mode control law and a global fast nonsingular terminal sliding mode control law. Furthermore, two cases have been investigated, driving the pendulum to the upright (inverted) position and tracking a sinusoidal command. For both cases, the GPTSMC law has outperformed the other two control approaches reaching the desired reference faster, presenting no overshoot, and within the predefined time chosen by the user as a tunable parameter. To the best of our knowledge, such control law has not been proposed in the literature yet nor designed for the 3D pendulum. The proposed approach is suitable for dynamic systems that can be written in the regular form. Future work includes the experimental application of the proposed control approach.