Introduction

Rigid robotic manipulators are widely utilized in various industries for different applications such as painting, welding, assembly, and material handling1,2. Engineers appreciate the versatility of robotic manipulators, but these machines also have complex nonlinear characteristics, significant coupling effects, imprecise physical models, and variable parameters3. These intricate features can greatly affect the accuracy, efficiency, and safety of robotic manipulators. Moreover, developing an effective control technique to achieve high tracking performance in robotic manipulators with these complex characteristics is a challenging task. The presence of uncertainty further complicates the task, especially as the number of linkages increases.

The three main approaches in control theory are generally categorized as computed torque control, robust control and adaptive control4. Computed torque control is utilized for specific applications5. It is a type of feedback linearization in which an inner-loop controller is used to cancel out the robot’s nonlinear dynamics, leaving behind residual linear dynamics that can be controlled using a range of linear control techniques. It is frequently referred to as inverse dynamics control since it depends on the inversion of robot dynamics. Robust control strategies include famous techniques like sliding mode control (SMC) and optimal control which are effectively used for robot manipulators to address the challenges of uncertainty and disturbance rejection. Lee, et al.6 investigated tracking performance and lower energy consumption of robot manipulators by employing adaptive integral sliding mode control (AISMC) and time-delay estimation. Xiao et al.7 worked on two sliding-mode observers to estimate uncertain kinematics torques and proposing a control law to ensure that the desired trajectory converges in a finite time. Norsahperi and Danapalasingam8 investigated robust control in the presence of external disturbances and internal dynamics variations using an improved optimal integral sliding mode control (OISMC) scheme. Adaptive controls are feed-forward controllers that make dynamic adjustments to system parameters in real-time to manage uncertainty and disturbances for optimal performance and stability across different operating conditions9. Enhancing performance often leads to an increase in the order of the total control system. The adaptive control scheme offers an alternative to the robust control scheme, and can also be combined with the computed torque technique. Kino et al.10 suggested a robust PD control approach for parallel-wire driven robots that includes adaptive compensation for the internal force error caused by unpredictable actuator positions. Ming-Chih and An-Chyau11 applied Backstepping with model reference adaptive control to manage time-varying uncertainty and control robots with flexible joints, achieving successful results. To capture manipulator dynamics, Wai and Yang12 developed a continuous-time dynamic fuzzy model with online learning capability. Thus, above the studies emphasize the importance of robust control methodologies such as optimal control and sliding mode for addressing uncertainties and disturbances in robot manipulators. Other controls such as adaptive control, computed torque, and feedback linearization are also active in enhancing tracking performance, stability, and energy efficiency in dynamic environments.

Combining two control schemes, can significantly optimize trajectory tracking and disturbance rejection in robotics systems, making it a powerful solution for complex control challenges. Van et al.13 introduced a novel global finite-time cooperative control by combining finite-time disturbance observer (FTDO) and finite-time integral sliding mode controller (FTISMC) to enhance robustness against model uncertainties and disturbances. The proposed technique ensured effective performance in handling the uncertainties and disturbances. Xian et al.14 developed a two-scheme method GPIO-CSMC to address trajectory tracking for disturbed robots. Tests on a 2-DOF robot comparing PID, SMC and CSMC show the proposed method offers faster tracking and higher anti-disturbance performance. Nguyen15 modeled the FSMPIF algorithm by combining PI, SMC, and Fuzzy algorithms to reduce automobile vibrations. Results showed significant improvements in ride comfort, with displacement and acceleration values decreasing by up to 2.55% and 12.59% compared to passive systems. Rani and Kuma16 introduced an intelligent optimal control scheme for hybrid position and force for reconfigurable manipulators under uncertainties. The controller combines HJB optimization, RBF neural networks, and adaptive bounds. The results demonstrated the method’s effectiveness compared to existing approaches. Admas et al.17 used combine NPID and HOSMC controls for vehicle suspension systems, focusing on non-linear and coupled dynamics. The results demonstrated improved performance and robustness under disturbances. Song et al.18 developed a control for multiple robot manipulators by combining SMC and reinforcement learning (RL). Its effectiveness is validated through Lyapunov stability analysis and found to be an effective control for multiple robot manipulator systems. Yin et al.19 developed an adaptive non-singular terminal sliding mode control (NTSM) with nonlinear disturbance observer (NDO) for trajectory tracking in multi-joint robotic arms. Results showed that the proposed method reduces steady-state errors by 36.58%–44.68% compared to other methods, demonstrating higher accuracy and stability. Pan and Xin20 employed the theta-D optimal control approach for position control to obtain an approximate feedback robust solution by combining the use of perturbation techniques for unknown payloads at the end effector of the robot manipulator. This method holds for specific type of manipulators which follow specific assumptions.

Furtado et al.21 defined impedance control of a robot manipulator using the State-Dependent Riccati Equation (SDRE) approach and compared it with Quadratic Programming (QP). Their results indicate that the SDRE technique outperformed QP. Impedance control is formulated as an optimal control problem aimed at minimizing the distance between the actual and desired states. However, the SDRE method has certain limitations not present in general optimal control formulations, which can affect tracking accuracy and potentially render the problem ill-posed. Elmogy et al.22 introduced an integrated control scheme that combines adaptive PID and continuous second-order sliding mode control (CSOS) with generalized artificial neural networks (GANN) for robot manipulators. The adaptive CSOS-GANN model enhances robustness, handles uncertainties, and eliminates discontinuities in traditional methods. Ali et al.23 worked on the control of robotic manipulators with the aid of geometrical stability using phase portrait of the sliding surfaces which are an alternative way to prove the stability of the system. Thus, combining control schemes addresses multiple challenges simultaneously, such as uncertainties, disturbances, and nonlinearities, making them more effective because classic control may excel in one area like stability or efficiency. Furthermore, the work on position control obtained by Lin24 and the same problem handled by Pan and Xin20 proved the stability and a convergence of a specific class of manipulators that satisfy the strict assumptions, mainly that all nonlinear terms must vanish at the origin for the flexibility of such assumption to have position control of the manipulator.

This article presents a novel two-stage robust optimal control approach for robotic manipulators that addresses uncertainties in payload mass and external disturbances. The scheme is motivated by a combine of schemes applicable to manipulators, where nonlinear terms are categorized into those that vanish at the origin and those that do not. In the first stage, an optimal control framework is employed to address uncertainties in the payload mass at the end effector. In the second stage, a hybrid approach that combines robust optimal control and integral sliding mode control (ISMC) is utilized to address both payload uncertainties and external disturbances. This dual-stage strategy ensures robust stability across a wide range of payload variations and disturbances, enhancing system flexibility. To further validate stability, phase portraits of sliding surfaces are introduced, offering a geometric representation of system stability. This is very important when traditional Lyapunov-based stability analysis is difficult to apply. The proposed method not only improves control accuracy but also provides a more adaptable and reliable solution for robotic manipulators in dynamic and uncertain environments.

The article is organized into several sections to provide a comprehensive understanding of the proposed methodology. Section 2, introduces the robot manipulator model, while Sect. 3 details the two-stage algorithm central to the robust control approach. Section 4 provides the control design of the classical sliding mode control. Section 5 presents numerical results and conducts discussions to validate the efficacy of the method. Finally, Sect. 6 draws conclusions based on the study’s findings.

Robot manipulator dynamical model

Consider the SCARA-type robot manipulator with two joints25. The dynamics of the robot manipulator is modeled as a series of n rigid beams connected in series, with one point fixed as a base and the other end regarded as the end effector used to handle payloads. The beams are connected with either a revolute joint or a prismatic joint while torques are provided at the joints. Here the Considered robot is a two revolute joint robot manipulator, where the schematic diagram of the manipulator is shown in Fig. 1.

Fig. 1
figure 1

Schematic diagram of two-link planar robot manipulator.

The dynamical equation of the robotic manipulator obtained via Euler-Lagrange equation of motion20 which is prescribed as.

$$M(\theta ;\;{m_L})\ddot {\theta }+V(\theta ,\;\dot {\theta };\;{m_L})+F(\dot {\theta })+G(\theta ;\;{m_L})=\tau +{\tau _{ext}}$$
(1)

where, \(\theta\) is generalized coordinate in vector form, \(M(\theta ;\;{m_L})\) is the inertia matrix, \(V(\theta ,\;\dot {\theta };\;{m_L})\) is Coriolis force vector, \(F(\dot {\theta })\) is frictional force at the joints, \(G(\theta ;\;{m_L})\) is gravitational force component, \(\tau\) is a non-conservative generalized force vector and \({\tau _{ext}}\) is disturbance in the input torques/non-conservative generalized force.

$$M(\theta ;\;{m_L})=\left[ {\begin{array}{*{20}{c}} {{M_{11}}}&{{M_{12}}} \\ {{M_{21}}}&{{M_{22}}} \end{array}} \right]\,,\;\;V(\theta ,\;\dot {\theta };\;{m_L})=\left[ {\begin{array}{*{20}{c}} {{V_1}} \\ {{V_2}} \end{array}} \right],\;\;G(\theta ;\;{m_L})=\left[ {\begin{array}{*{20}{c}} {{G_1}} \\ {{G_2}} \end{array}} \right],\;\;F(\theta ,\;\dot {\theta })=\left[ {\begin{array}{*{20}{c}} {{F_1}} \\ {{F_2}} \end{array}} \right]$$
(2)

here, the components in above matrices are expressed as

$$\left. \begin{gathered} {M_{11}}={J_1}+{J_2}+{m_1}r_{1}^{2}+{m_2}l_{1}^{2}+{m_2}r_{1}^{2}+2{m_2}\,{l_1}\,{r_2}\,Cos({\theta _2})+{m_L}l_{1}^{2}+{m_L}l_{2}^{2}+2{m_L}{l_1}{l_2}\,Cos({\theta _2}) \hfill \\ {M_{12}}={M_{21}}={J_2}+{m_2}r_{2}^{2}+{m_2}{l_1}\,{r_2}Cos({\theta _2})+{m_L}l_{2}^{2}+{m_L}{l_1}{l_2}\,Cos({\theta _2})\,, \hfill \\ {M_{22}}={J_2}+{m_2}r_{2}^{2}+{m_L}l_{2}^{2}\,, \hfill \\ {V_1}=( - {m_2}{l_1}{r_2} - {m_L}{l_1}{l_2})(2{{\dot {\theta }}_1}+{{\dot {\theta }}_2}){{\dot {\theta }}_2}Sin({\theta _2})\;, \hfill \\ {V_2}={m_2}{l_1}{{\dot {\theta }}_1}{r_2}Sin({\theta _2})+{m_L}{l_1}{l_2}\,\dot {\theta }_{1}^{2}\,Sin({\theta _2})\;, \hfill \\ {G_1}=({m_1}{r_1}+{l_1}+{m_L}{l_1})\,g\,Cos({\theta _1})+({m_2}{r_2}+{m_L}{l_2})g\;Cos({\theta _1}+{\theta _2})\;, \hfill \\ {G_2}=({m_2}{r_2}+{m_L}{l_2})g\;Cos({\theta _1}+{\theta _2})\;, \hfill \\ {F_1}={b_1}\,{{\dot {\theta }}_1}, \hfill \\ {F_2}={b_2}{{\dot {\theta }}_2}\,. \hfill \\ \end{gathered} \right\}$$
(3)

Now define the state variables in compact notation as

$$q={\left[ {\begin{array}{*{20}{c}} {{q_1}}&{{q_2}} \end{array}} \right]^T}=\left[ {\begin{array}{*{20}{c}} { - {\theta _1}+{\raise0.7ex\hbox{$\pi $} \!\mathord{\left/ {\vphantom {\pi 2}}\right.\kern-0pt}\!\lower0.7ex\hbox{$2$}}}&{{\theta _2}} \end{array}} \right]$$
(4)

Further collecting the Coriolis, friction and gravity force vectors are written as

$$N(q,\,\dot {q};\;{m_L})=V(q,\;\dot {q};\;{m_L})+F(\dot {q})+G(q;\;{m_L})$$
(5)

Therefor the mathematical model by using Eq. (1) and Eq. (5), we have as

$$M(\theta ;\;{m_L})\ddot {\theta }+N(\theta ,\;\dot {\theta };\;{m_L})=\tau +{\tau _{ext}}$$
(6)

here Eq. (6) presents the compact form of the nonlinear mathematical equation of the robot manipulator.

Two-stage algorithm

In this section, a two-stage algorithm for the robust control of the robot manipulator is presented. The mathematical control design is divided into two following robust control techniques, which are applied to the nonlinear control system.

Optimal control approach

Firstly, at this stage we consider the model Eq. (6) without taking into account external disturbances as, and working for the background to apply robust optimal control.

$$M(q;\;{m_L})\ddot {q}+N(q,\;\dot {q};\;{m_L})=\tau$$
$$\ddot{q}=M^{-1}(\tau-N_0)+M^{-1}(N_0-N)$$
(7)

In the current study, there are uncertainties in M(q) and \(N(q,\dot{q})\) due to the unknown load at end effector with the added external disturbances in the considered system. The following bounds on the uncertainties are assumed as

  • There exist the matrices M0 (q) and M1 (q) which are positive definite symmetric such that:

$$0<{M_1}(q) \leqslant M(q;\;{m_L}) \leqslant {M_0}(q)\,.$$
(8)
  • There exists the matrix \(N(q,\dot{q})\) and a nonnegative function \(n(q,\dot{q})\) such that

$$\left\| {N(q,\,\dot {q};\;{m_L}) - {N_0}(q,\,\dot {q})} \right\| \leqslant \eta (q,\,\dot {q}),{\text{ }}such{\text{ }}that~~\eta (0,\;0)=0$$
(9)

By denoting the coordinates for state space presentation as

$${x_1}={q_1},\;{x_2}={q_2},\;{x_3}={\dot {q}_1},\;{x_4}={\dot {q}_2}$$
(10)

Therefore, the input in the state space coordinates is presented as

$$u_0=M_0^{-1}(x_1,x_2)[\tau-N_0(x_1,x_2,x_3,x_4)]$$
(11)

Hence, the state space equation of the model Eq. (7) can be expressed using in Eq. (10) and Eq. (11) as

$$\dot {x}=Ax+B(u+h(x;\;{m_L}){u_0})+Bf(x;\;{m_L})$$
(12)

where

$$\left. \begin{gathered} x={[\begin{array}{*{20}{c}} {{x_1}}&{{x_2}}&{{x_3}}&{{x_4}} \end{array}]^T}\;, \hfill \\ A=\left[ {\begin{array}{*{20}{c}} {{0_2}}&{{I_2}} \\ {{0_2}}&{{0_2}} \end{array}} \right]\;, \hfill \\ B={\left[ {\begin{array}{*{20}{c}} {{0_2}}&{{I_2}} \end{array}} \right]^T}\;, \hfill \\ f(x;\;{m_L})={M^{ - 1}}({x_1},\,{x_2};\;{m_L})\left[ {{N_0}({x_1},\,{x_2},\;{x_3},\;{x_4}) - N({x_1},\,{x_2},\;{x_3},\;{x_4};\;{m_L})} \right]\;, \hfill \\ h(x;\;{m_L})={M^{ - 1}}({x_1},\;{x_2};\;{m_L}){M_0}({x_1},\,{x_2}) - I \hfill \\ \end{gathered} \right\}$$
(13)

The state space model in Eq. (12) has uncertainty in the load mass at the end effector of the robot manipulator. In order to solve the dynamic response of the robot manipulator in Eq. (13), the following bounds are obtained for the optimal control approach to roust control24 as

$$\begin{gathered} \left\| {f({\mathbf{x}};\;{m_L})} \right\|=\left\| {{M^{ - 1}}({\mathbf{x}};\;{m_L})({N_0}({\mathbf{x}})) - N({\mathbf{x}};\;{m_L}))} \right\| \hfill \\ \,\;\quad \quad \; \leqslant \left\| {{M^{ - 1}}({\mathbf{x}};\;{m_L})} \right\|\left\| {{N_0}({\mathbf{x}})) - N({\mathbf{x}};\;{m_L})} \right\| \hfill \\ \,\;\quad \quad \; \leqslant \left\| {{M^{ - 1}}_{1}} \right\|{\eta _{\hbox{max} }}({\mathbf{x}}). \hfill \\ \end{gathered}$$
(14)

Since matching conditions are satisfied in this problem, we follow the approach presented by24 to consider the nonlinear case, stated as

$$\dot {x}=Ax+Bu+Bf(x;\;{m_L})\,,\;\;x \in {R^4}andu \in {R^2}$$
(15)

Additionally, the uncertainty of the nonlinear term \(f(x)\,\)is within the matrix’s range of matrix B. It is more precisely describes as a nonlinear vector function \(f(x;\;{m_L})\,\) spanned by matrix B. The problem described in Eq. (15) satisfies the matching conditions, further \(Ax=0\;\)and \(f(x;\;{m_L})=0\). At \(x=0\) the equilibrium state, for which stability is the desired outcome, employing the following robust control approach.

In this consequence, a feedback control law \(u={u_0}(t)\) is considered to define the following closed loop system

$$\dot {x}=Ax+B{u_0}+Bf(x;\;{m_L})$$
(16)

The system Eq. (16) is globally asymptotically stable for all uncertainties in \(f(x;\;{m_L})\) which are in the range of \({f_{\hbox{max} }}(x)\) defined as

$$\left\| {f(x;\;{m_L})} \right\| \leqslant {f_{\hbox{max} }}(x)$$
(17)

Now to calculate the robust control problem Eq. (16), it is first converted into the following optimal control problem where we consider the auxiliary system as

$$\dot {x}=Ax+B{u_0}$$
(18)

with u = u0 (t) which minimize the following cost functional

$$\int\limits_{0}^{t} {\left( {{x^T}Qx+{x^T}x+u_{0}^{T}{u_0}} \right)} \;dt.$$
(19)

At the first stage, Eq. (18) is solved, and this solution is used to address Eq. (16), as per the result presented by20,24.

Theorem 1

If the solution of the optimal control problem Eq. (18) exists, then it is a solution to the robust control Eq. (16) with the bound in (17).

Proof

We can see that the Cost functional is non-negative for every state \(x\epsilon{R}^n\), we choose Cost functional value as a Lyapunov function.

That is

$$V_1(x)=\int_{0}[x^T{Qx}+x^T{x}+u_0^T{u}_0]dt$$
(20)

According to the Hamilton Jacobi Bellman Equation, we have

$$\mathop {\hbox{min} }\limits_{{{u_0} \in {R^m}}} \left[ {{x^T}Qx+{x^T}x+u_{0}^{T}{u_0}} \right]+V_{{1x}}^{T}\left[ {Ax+B{u_0}} \right]=0,$$
(21)
$$2u_{0}^{T}+V_{{1x}}^{T}B=0.$$
(22)

Since

$${\dot {V}_1}=V_{{1x}}^{T}\dot {x}=V_{{1x}}^{T}\left[ {Ax+B{u_0}+Bf(x;\;{m_L})} \right]$$
(23)

We have,

$$\begin{gathered} {{\dot {V}}_1}= - ({x^T}Qx+{x^T}x+u_{0}^{T}{u_0}) - 2u_{0}^{T}f(x;\;{m_L}) \hfill \\ {\text{ }}= - {x^T}Qx - {x^T}x - u_{0}^{T}{u_0} - 2u_{0}^{T}f(x;\;{m_L}) - {f^T}(x;\;{m_L})f(x;\;{m_L})+{f^T}(x;\;{m_L})f(x;\;{m_L}) \hfill \\ {\text{ }}= - {x^T}Qx+{f^T}(x;\;{m_L})f(x;\;{m_L}) - {x^T}x - {({u_0}+f(x;\;{m_L}))^T}({u_0}+f(x;\;{m_L})) \hfill \\ {\text{ }}< - {x^T}x+{f^T}(x;\;{m_L})f(x;\;{m_L}) - {x^T}Qx \hfill \\ {\text{ }}< - {x^T}x \hfill \\ \end{gathered}$$
(24)

and

$$\begin{gathered} {f^T}(x;\;{m_L})f(x;\;{m_L})<{x^T}Qx, \hfill \\ {\left\| {f(x;\;{m_L})} \right\|^2}<\left\| x \right\|\left\| Q \right\|\left\| x \right\| \leqslant f_{{\hbox{max} }}^{2}(x), \hfill \\ \left\| {f(x;\;{m_L})} \right\|<{f_{\hbox{max} }}(x). \hfill \\ \end{gathered}$$
(25)

Hence, according to Lyapunov stability we assure that the given feedback control is stable24. At the second stage, we deal with the external disturbances and reconsider Eq. (6) for which purpose an integral sliding mode control (ISMC) is adopted as follows.

Integral sliding-mode control

In accordance with the LQR technique for the optimal control approach, using the control input \({u_0}(t)\), it has been demonstrated that the closed-loop dynamical system described in Eq. (15) exhibits asymptotic stability24, and the cost functional defined in Eq (19) is attained. Nevertheless, when the model Eq. (6) includes external disturbances and the control input \(u={u_0}(t)\) is employed, the system may deviate from the desired target value or even become unstable. In this context, a discontinuous switching control signal is developed, inspired by the Integral Sliding Mode Control (ISMC) approach. This control strategy guarantees that the robot’s end effector will reach its desired position, even in the presence of external disturbances26, when the input u is applied.

To design ISMC the following sliding surfaces are assumed

$$S(t)=H(x(t)-x(0))+\phi(x(t),u_0(t))$$
(26)

where \(\dot {\phi }(t)= - H(Ax+B{u_0}+Bf(x;\;{m_L}))\) and H is a constant matrix, defined as a pseudo inverse of matrix B with condition that the matrix HB is nonsingular. Now by considering the state space dynamics as in Eq. (6), we write

$$\dot {x}=Ax+Bu+Bf(x;\;{m_L})+B\gamma (x)$$
(27)

where \(\gamma (x)=M_{0}^{{ - 1}}(x){\tau _{ext}}\).

It is evident from Eq. (6) that external disturbances are incorporated within the matching conditions. Consequently, the control input is redefined as follows

$$u(t)={u_0}(t)+{u_s}(t)$$
(28)

here, u0 represents the control component derived from the initial stage without external disturbances, while corresponds to the ISMC component. Taking the derivative of Eq. (26) leads to the following

$$\dot {S}(t)=H\dot {x} - H(Ax+B{u_0}+Bf(x;\;{m_L}))$$
(29)

By using Eqs. (27, 28 and 29), we arrive at

$$\dot {S}(t)=H(B{u_s}+B\gamma (x))$$
(30)

For the stability criteria, choosing a Lyapunov function of the form

$$V=\frac{1}{2}{S^T}S,{\text{ }}S \in {R^n}$$
(31)
$$\dot {V}={S^T}\dot {S}={S^T}HB({u_s}+\gamma (x))$$
(32)

By assuming the switching control input

$${u_s}= - \rho Sign(S(t)),{\text{ }}\rho \in {R^+}$$
(33)

we have through Eqs. (32) and (33)

$$\begin{gathered} \rho {S^T}HBSign(S)>{S^T}HB\gamma (x), \hfill \\ \Rightarrow \rho>\frac{{\left\| S \right\|\left\| {HB\gamma (x)} \right\|}}{{\left\| S \right\|\left\| {HBSign(S)} \right\|}}, \hfill \\ \Rightarrow \rho>Sup\;\left\| {HB\gamma (x)} \right\|. \hfill \\ \end{gathered}$$
(34)

Since \(HB={I_m}\), therefor \(\rho>Sup\left\| {\gamma (x)} \right\|,\) which agrees with the convergence of the results.

Sliding mode controller

For the trajectory tracking via the classical sliding mode control is applied by defining the sliding variable vector as:

$$\sigma =\dot {q}+{\lambda ^T}q$$
(35)

The time derivative of the sliding surface vector is defined as

$$\dot {\sigma }=\ddot {q}+{\lambda ^T}\dot {q}$$
(36)

For stability purpose applying the constant rate reaching law as:

$$\dot {\sigma }= - {K^T}Sign(\sigma )$$
(37)

Using Eq. (6) we have

$$\ddot {\theta }={M^{ - 1}}(\tau - N)+{M^{ - 1}}{\tau _{ext}}$$
(38)

Where the relation between q and \(\theta\) is defined in Eq. (4). Thus, by using Eq. (4) and Eq. (38)

$$\ddot {q}={M^{ - 1}}(\tau - N)+{M^{ - 1}}{\tau _{ext}}$$
(39)

Through Eqs. (36, 37 and 39) we have:

$$- KSign(\sigma ) - {\lambda ^T}\dot {q}={M^{ - 1}}(\tau - N)+{M^{ - 1}}{\tau _{ext}}$$
(40)

Here choosing feedback controller as:

$$u={M^{ - 1}}(\tau - N)+{M^{ - 1}}{\tau _{ext}}$$
(41)

Therefore, using Eqs. (39, and 40) we have:

$$\ddot {q}+KSign(\sigma )+{\lambda ^T}\dot {q}=0$$
(42)

Where the forces can be calculated through the Eq. (41) as:

$$\tau =Mu+N - {\tau _{ext}}$$
(43)

Numerical simulation

In this section, we present the results obtained by implementation of the proposed two-stage algorithm. These results are acquired while considering the physical parameters20,24, as delineated in Table 1 below.

Table 1 Values of physical parameters.

All numerical simulations in this study are executed using Mathematica. The key variables of interest encompass joint angles, joint angular velocities, and the computed torques. These variables are meticulously computed and presented across a spectrum of mass values applied at the end effector, specifically, loads of 5 oz, 10 oz, 15 oz, and 20 oz. The units of measurement employed are radians for joint angles rad/sec for joint angular velocities, and newton-meters for the torques of each joint. When solving the system’s dynamical response as described in Eq. (9), the following control input is employed:

$${u_0}={M_0}^{{ - 1}}({x_1},{x_2})[\tau - {N_0}({x_1},{x_2},{x_3},{x_4})]$$
(44)

Thereby implying

$${M_0}{u_0}+{N_0}=\tau$$
(45)

Thus yields

$$\begin{gathered} \ddot {q}={M^{ - 1}}{M_0}M_{0}^{{ - 1}}(\tau - {N_0}+{N_0} - N), \hfill \\ \;\;\;={M^{ - 1}}{M_0}{u_0}+{M^{ - 1}}({N_0} - N). \hfill \\ \end{gathered}$$
(46)

The state space representation in Eq. (46) can be expressed in the form

$$\left[ {\begin{array}{*{20}{c}} {{{\dot {x}}_1}} \\ {{{\dot {x}}_2}} \end{array}} \right]=\left[ {\begin{array}{*{20}{c}} {{x_2}} \\ {{M^{ - 1}}(q){M_0}{u_0}+{M^{ - 1}}({N_0} - N)} \end{array}} \right].$$
(47)

By denoting \({M^{ - 1}}{M_0}=I+h({x_1};\;{m_L})\), and \(f(x;\;{m_L})={M^{ - 1}}({x_1};\;{m_L})({N_0}(x) - N(x;\;{m_L}))\) in Eq.(46), we rewrite

$$\begin{gathered} {{\dot {x}}_1}={x_2}, \hfill \\ {{\dot {x}}_2}=(I+h(x;\;{m_L})){u_0}+f(x;\;{m_L}). \hfill \\ \end{gathered}$$
(48)

The weight matrix Q is calculated by using the condition\(\left\| {f(x;\;{m_L})} \right\| \leqslant {f_{\hbox{max} }}(x)\).

It follows that

$${N_0} - N=\left[ {\begin{array}{*{20}{c}} {48{m_L}\left( {2{{\dot {q}}_1} - {{\dot {q}}_2}} \right){{\dot {q}}_2}\sin \left( {{q_2}} \right)+3086.6{m_L}\sin \left( {{q_1}} \right)+2314.9{m_L}\sin \left( {{q_1}+{q_2}} \right)} \\ {48{m_L}\dot {q}_{1}^{2}\sin \left( {{q_1}} \right)+2314.9{m_L}\sin \left( {{q_1}+{q_2}} \right)} \end{array}} \right]$$
(49)

In the simulations, we choose the joints angular velocities bounds with maximum magnitude of 10 rad/s so that \(\mid\dot{q}_1\mid\leqslant{10}\) and \(\mid\dot{q}_2\mid\leqslant{10}\) whereas the maximum load at end effector of the considered robot is taken to be\({m_L}=20\,oz\). Further, the maximum and minimum values of the nonlinear terms in the robotics dynamics are calculated based on minimum and the maximum values of the payload mass.

Equation (49) recasts into

$$\left\| {{N_0} - N} \right\| \leqslant 20\left| {\left[ {\begin{array}{*{20}{c}} {5401.5}&{2314.9}&{960}&{ - 480} \\ {2314.9}&{2314.9}&{480}&0 \end{array}} \right]{{\left[ {\begin{array}{*{20}{c}} {{q_1}}&{{q_2}}&{{{\dot {q}}_1}}&{{{\dot {q}}_2}} \end{array}} \right]}^T}} \right|.$$
(50)

It becomes evident that, following a series of manipulations involving the inertia matrix and the constraints elaborated in Sect. 2, we have derived the following result \(\left\| {{M_1}^{{ - 1}}} \right\|=\frac{1}{{5671}}.\).

Now from the result in Theorem 1, we know that \({x^T}Qx<\left| {{f^T}(x;\;{m_L})f(x;\;{m_L})} \right|\), which implies

$$Q=\left[ {\begin{array}{*{20}{c}} {429.55}&{222.181}&{78.3165}&{ - 32.248} \\ {222.181}&{133.308}&{41.4617}&{ - 13.8206} \\ {78.3165}&{41.4617}&{14.3283}&{ - 5.7313} \\ { - 32.248}&{ - 13.8206}&{ - 5.7313}&{2.86565} \end{array}} \right].$$
(51)

According to LQR theory, the control is given as \({u_0}= - {B^T}Px\), where P can be calculated through the following algebraic Riccati Eq. 

$${A^T}P+PA+Q+I - PB{B^T}P=0.$$
(52)

To compute \({u_s}\), we shall reevaluate Eq. (6) employing the notation of generalized coordinates. Following a series of manipulations, we arrive at the following expression:

$$\ddot {q}={M^{ - 1}}(q:\;{m_L}){M_0}(u+M_{0}^{{ - 1}}{\tau _{ext}})+{M^{ - 1}}({N_0} - N).$$
(53)

Here u= u0+ us, provided \({u_s}= - \rho Sign(s)\).

Furthermore, assume that the dynamical system is subjected to the following external disturbance9. Cogging torque caused by misalignment of the actuators due to uneven spacing eccentricity or manufacturing errors. This disturbance generally exists as a bounded disturbance.

$${\tau _{ext}}=\left[ {\begin{array}{*{20}{c}} {2Sin(0.5t)+0.1Cos(10t)} \\ {Sin(0.5t)+1.6Cos(10t)} \end{array}} \right]$$
(54)

Since, it follows from Eq. (34)

$$\rho>\mathop {\sup }\limits_{x} \left| {\gamma (x)} \right|with\gamma (x)=M_{0}^{{ - 1}}{\tau _{ext}}$$
(55)

By choosing the matrix \(H=(B^TB)^{-1}B^T\) , such as, \(HB={I_2}\) the value of \(\rho=3.6\) is calculated. Thereby the final feedback control is calculated as

$$u= - {B^T}Sx - \rho Sign(s)$$
(56)

Whereas the torque is computed by

$$\tau=M_0u+N_0-\tau_{ext.}$$
(57)

The simulations performed under four different mass loadings to demonstrate the robustness of the proposed two-stage algorithm.

Results and discussion

In this section, the performance of the proposed robust control is discussed using Robust Optimal Control without disturbances (ROCWD) and Robust Optimal Integral Sliding Mode Control with Disturbances (ROISMCWD). To measure the performance, the joint angles and joint velocities are calculated at different mass loads mL of 5 oz, 10 oz, 15 oz and 20 oz and the results are displayed in Figures 2(a)−5(b). In Figures 2(a) and 2(b), joint one converges to its desired position in approximately 1.5 s, while joint two achieves its desired position in about 2 s at a load mass of 5 oz. Subsequently, the joint velocities settle to the desired states around 2.5 s, irrespective of the presence or absence of disturbances. Despite their resemblance, simulations with disturbances exhibit slightly small oscillations in both joint positions and velocities around their equilibrium points. In Figures 3(a) and 3(b), the joints and their corresponding velocities converge to their desired positions within 2 to 3 s at a load mass of 10 oz. Similarly, in Figures 4(a) and (b), the joints and their velocities converge to their desired positions within 2.5 to 3.75 s at a load mass of 15 oz., and within 3.8 to 4.25 s at a load mass of 20 oz. In Figures 5(a) and 5(b), it is evident that as the load mass increases; the joint angles gradually reach their target values after an initial struggle. It is important to note that the optimal control, when not considering external disturbances, exhibits smooth convergence. However, when external disturbances are present, the joint angles and velocities struggle to converge to the desired values with slightly less effort as compared to the joint angles and joint velocities which do not carry the disturbances due to the efficiency of the robust optimal integral sliding mode control method. However, the challenge posed by the chattering phenomenon on the sliding surface is effectively addressed in the computed values of joint angles and velocities with a novel control technique that is ROISMCWD.

In Figs. 6, 7, 8 and 9, the left column represents the input control values obtained via ROCWD, while the right column represents the input control values obtained via ROISMCWD. It is noted that \({q_1}\) and \({q_2}\) are calculated from the actual angles \(\theta\) , which converge \([0\: 0]\) so that \([\theta_1\:\theta_2]\) converges to \(\left[ {\pi /2\quad 0} \right]\) radians. The control torques depicted in Figure 6 show chattering phenomena observed in the joint positions. Initially, the control efforts are relatively high to drive the manipulator to the desired position, but they decrease rapidly as the manipulator approaches the target position. In Figure 7, the control torque required to achieve the desired position stabilizes in about 2 s despite the presence of external disturbances at lower values of the load mass. However, as the load mass increases, a higher level of control input is needed, as evident in Figs. 8 and 9. This indicates that more effort is required to drive the joint trajectories in the presence of disturbances, persisting until the final stage to maintain stability.

Figures 10 and 11 present the phase portraits of the sliding surface for the ROISMCWD method, magnified \({10^{18}} \times {10^{16}}\) for a clearer view of the behavior and visualization of chattering effects. It is observed that the sliding variables are converging to zero, confirming the stability of the nonlinear system. Additionally, Figs. 12 and 13 show the behavior of sliding surface in addressing the chattering phenomenon at different payload masses. These figures illustrate the trajectories of the sliding variables \({s_1}\) and \({s_2}\) under payload masses of 10 oz and 15 oz, respectively. The results show a rapid convergence of the sliding variables to zero within the first second. The chattering amplitude remains minimal, with steady-state fluctuations on the order of \({10^{ - 18}}\), which is significantly lower than what is typically observed in classical SMC. This confirms the system’s stability and the controller’s capability to handle uncertainties and disturbances. The reduction in chattering is achieved through the integral action incorporated into the sliding mode control.

Figures 14 and 15 present a comparison between the newly proposed method and the classical Sliding Mode Controller (SMC). It is observed that the proposed method achieves faster convergence than the SMC for both joint positions and joint velocities. Furthermore, Figure 16 illustrates a compare the control torques calculated using ROCWD and the classical SMC, while Figure 17 illustrates a compare the control torques calculated using ROISMCWD and the classical SMC. The results show that the proposed methods are more energy-efficient than the SMC. It demonstrates superior long-term efficiency with reduced energy consumption. Notice that the values of the parameters used in SMC are chosen as \(\lambda ={[\begin{array}{*{20}{c}} 6&{2.5} \end{array}]^T}\)and the constant rate of reaching as \(K=Diag\{ 20,\;15\}\), where all other parameters remain same as given in Table 1.

Figures 18 and 19 show the phase trajectories that are drawn toward the sliding surface, where they exhibit chattering once they reach the sliding manifold. The trajectories spiral, converging and oscillating around the sliding surface, reflecting the trade-off between robustness and chattering in the proposed ROISMCWD controller under varying payload conditions. Computed over a time span of 0 to 20 s, the results demonstrate rapid convergence toward the origin, confirming that the sliding condition is both achieved and maintained. The initial reaching phase is marked by a swift spiraling motion of the state trajectories toward the designed sliding manifolds. Furthermore, although an increase in mass broadens the spirals during the reaching phase, the final chattering amplitude around the sliding manifold remains unchanged.

Table 2 presents the root mean square error (RMSE) of each trajectory to evaluate the system’s performance at desired position. RMSE measures the average deviation between predicted and actual values, with smaller values representing that the trajectories closely follow the estimated path. The RMSE values for each payload mass, both with and without disturbances are small, validating the system’s convergence.

The performance of the proposed control is compared with other methods in Table 3. The performance is evaluated using two time-domain metrics: Root Mean Square Error (RMSE), and Integral of Squared Control Input (ISU) across two key trajectories: \({q_1}(t)\), and \({q_2}(t)\) representing the major dynamic states of the system. As shown in the Table 3, the proposed controllers ROCWD and ROISMCWD consistently achieves superior values for all metrics across all signals, indicating better control performance in terms of accuracy, speed of convergence, and energy efficiency. Specifically, the RMSE values for the proposed method are significantly smaller compared to SMC, highlighting its sustainability over time. Additionally, ISU values are also the lowest for the proposed controllers, implying that they require less control effort and produce smoother actuation signals. This is advantageous for actuator lifespan and overall system efficiency.

In conclusion, these quantitative results confirm that the proposed control strategy yields better results in tracking performance and control efficiency, making it a robust and energy-effective solution for the system under consideration.

Fig. 2
figure 2

(a,b): Time history plots of the joint velocities at \({m_L}=5\;oz\).

Fig. 3
figure 3

(a,b): Time history plots of the joint velocities at \({m_L}=10\;oz\).

Fig. 4
figure 4

(a,b): Time history plots of the joint velocities at \({m_L}=15\;oz\).

Fig. 5
figure 5

(a,b): Time history plots of the joint velocities at \({m_L}=20\;oz\).

Fig. 6
figure 6

Time history of the input torques for achieving the stable state of the joint angles and joint velocities at \({m_L}=5\;oz\) without disturbances and with disturbances.

Fig. 7
figure 7

Time history of the input torques for achieving the stable state of the joint angles and joint velocities at \({m_L}=10\;oz\) without disturbances and with disturbances.

Fig. 8
figure 8

Time history of the input torques for achieving the stable state of the joint angles and joint velocities at \({m_L}=15\;oz\) without disturbances and with disturbances.

Fig. 9
figure 9

Time history of the input torques for achieving the stable state of the joint angles and joint velocities at \({m_L}=20\;oz\) without disturbances and with disturbances.

Fig. 10
figure 10

Phase portrait of the sliding surfaces for the time of 5 s, at \({m_L}=5\;oz\) .

Fig. 11
figure 11

Phase portrait of the sliding surfaces for the time of 5 s, at \({m_L}=10\;oz\) .

Fig. 12
figure 12

The sliding surfaces, at \({m_L}=10\;oz\) .

Fig. 13
figure 13

The sliding surfaces, at \({m_L}=15\;oz\) .

Fig. 14
figure 14

The comparison results of the joints at \({m_L}=10\;oz\) .

Fig. 15
figure 15

The comparison results of the joints velocities \({m_L}=10\;oz\) .

Fig. 16
figure 16

The comparison results of the input torque at\({m_L}=10\;oz\) .

Fig. 17
figure 17

The comparison results of the input torque at \({m_L}=10\;oz\) .

Fig. 18
figure 18

The chattering response of ROISMCWD at \({m_L}=10\;oz\) .

Fig. 19
figure 19

The chattering response of ROISMCWD at \({m_L}=20\;oz\) .

Table 2 RMSE of the trajectories.
Table 3 Performance comparison of ROISMCWD, ROCWD and classical SMC methods at fixed \({m_L}=10\;oz\).

Conclusion

A novel robust control approach designed for manipulators operating in situations characterized by uncertain dynamics, such as unknown loads, gravitational effects, and external disturbances is being investigated. The robust control method combines optimal control techniques with the integral sliding mode control framework, effectively incorporating uncertainty bounds into the cost functional to achieve both robust stability and optimality. The results, observed under scenarios with and without disturbances, reveal several key findings:

  • Joint angles and velocities under various load masses exhibit consistent convergence trends, with longer stabilization times observed for higher loads.

  • Control inputs depict higher effort requirements in the presence of disturbances, indicating greater struggle to maintain stability.

  • The phase portrait is presented to facilitate stability via a geometrical aspect.

  • The RMSE is calculated to ensure the convergence of the joint angles to reach their desired position.

  • A comparison of the ROCWD and ROISMCWD with classical SMC are provided to validate the proposed methods.

Overall, the robust control scheme demonstrates effective performance across different load conditions and disturbances, highlighting its potential for robust trajectory convergence in mechanical manipulators.