1 Introduction

Underactuated systems, which possess fewer actuators than degrees of freedom, take the form of various applications. Typical examples of such systems include cranes [21, 29], unmanned aircraft [24], underwater vehicles [5], flexible links [16, 30], gymnastic robots [13], and intentionally designed systems using reduced actuation. Currently, applications of underactuated systems in cutting-edge fields like high-performance robotics and biomimetics have attracted increasing attention. Reference [9] presented a motion optimization strategy for a planar spring-loaded monopod robot with single actuator executing double backflip. Reference [10] designed a minimalist underactuated brachiating robot composed of one actuator and two grippers, and realized brachiation with three different control schemes. Reference [4] proposed a novel path-following scheme for an underactuated robotic fish subjected to time-varying sideslip, which utilizes sliding-mode controllers and nonlinear disturbance observer. Reference [8] drew inspiration from birds, and investigated the control problem of tracking a trajectory while maintaining balance for an n-link manipulator with static friction at the unactuated first revolute joint. Reference [3] developed a biomimetic morphing wing made up of forty underactuated feathers and four controllable joints to study the morphing pattern of birds, providing insight for bioinspired aircraft design.

Within the advances and broad spectrum of underactuated systems, multi-link planar robots serve as typical models for studying underactuated dynamics. In the context of these robots, [14] defined the link angle as the angle between a link and the positive vertical direction. The joint angle is designated as the difference between the link angles of two adjacent links connected at a joint, with the first joint angle being identical to the first link angle. Consequently, a link (joint) is active if the corresponding link (joint) angle represents an actuated variable, and passive if that angle represents an unactuated variable [14].

For a three-link planar robot with passive first joint, [27] addressed the swing-up control by introducing the notion of virtual composite link, which combines the last two links as a single virtual link. In [13], this notion was further extended to tackle the set-point control for a folded configuration. Regarding stabilizing control, [11] estimated the region of attraction of an equilibrium point with sum of squares and trajectory reversing methods, and enlarged the estimation by using impulse manifold method. For a three-link planar robot with single active joint, prior works have mainly focused on achieving the swing-up control via trajectory planning. Reference [22] designed a two-segment trajectory for the active joint, and optimized the trajectory parameters with PSO algorithm to ensure the simultaneous convergence of the passive joints. Reference [2] introduced the time-reversal symmetry characteristic of such system and utilized this characteristic to design a swing-up trajectory by reversing a swing-down trajectory in time. However, these approaches require meticulous design or selection of suitable trajectories.

For underactuated systems exhibiting nonholonomic characteristics and complex dynamics, [6, 12] proposed an energy-based control approach, whose objective is to design a controller to stabilize the actuated variable(s) and regulate the system’s total mechanical energy to a predetermined value simultaneously. The feasibility of this objective has been examined for several systems with one underactuated variable [7, 12, 26].

However, it remains a challenging problem to investigate whether the energy-based control objective can be achieved for systems containing more than one underactuated variable, especially for multi-link planar robots. For the double pendulum on a cart, [25] demonstrated a parallel control of regulating the system’s total mechanical energy and stabilizing the cart’s horizontal displacement. For a three-link planar robot with active first link, [15] proved that the objective corresponding to the robot’s upright equilibrium point (UEP), where all links extend upward, can be achieved for almost all initial states. In either case, the closed-loop analysis under the energy-based controller was carried out with the aid of an important property; that is, if the actuated variable remains stationary under a constant control input, then the underactuated variables of the system remain stationary. Despite the physical intuition, an effective method was proposed in [15] to strictly prove this property, which involves the derivation and utilization of a holonomic constraint and does not require any prior assumption regarding the mechanical parameters of the system or the constant input.

Shifting focus to other actuator configuration, the feasibility of achieving the energy-based control objective for three-link planar robots with a single actuator acting on the last link has not yet been reported. Following the definition in [14], two distinct types of such robots exist. The directly driven type uses the joint angle of the last link as the actuated variable. In contrast, the remotely driven type treats the link angle of the last link as the actuated variable. The directly driven type can be compared to a simplified depiction of a gymnast performing on rings [20], thereby serving as platform for robotic and biomimetic investigation. However, controlling this type with energy-based control approach proves more challenging compared to its remotely driven counterpart.

For this reason, and as an initial focus, this paper investigates the remotely driven type of three-link planar robot, which comprises a passive first link, a passive second link, and an active last link. This robot is referred to as the PPA robot. The present work is based on the idea sketched in [23] and extended and proven in the general case here. First, we extend the method proposed in [15] to prove an essential property for the PPA robot, regardless of its mechanical parameters or the constant control input. This property states that if the active last link is held fixed under a constant control input, then the PPA robot stays at an equilibrium point. Due to inherent difference in actuator configuration, the strict proof for the PPA robot requires a deeper utilization of the aforementioned holonomic constraint, compared to its proximal-actuated counterparts in [15] and [25]. More complicated manipulations and extra discretion are thereby demanded. Next, we derive an energy-based controller for the PPA robot and explore the feasibility of achieving the control objective that corresponds to the UEP. Leveraging the above property, we analyze the global motion of the closed-loop system by examining the convergence of energy. Results show that the control objective can be achieved for almost all initial states. Finally, we verify the theoretical results via numerical simulation and demonstrate the effectiveness of the energy-based controller along with an LQR controller for the swing-up and stabilizing task [19], which involves swinging the robot to a vicinity of its UEP and stabilizing it at that point.

In summary, the contributions of this paper are as follows.

  1. (1)

    Strict proof of a property of the PPA robot that the system stays at an equilibrium point, if the active last link is held fixed under constant control input.

  2. (2)

    Global motion analysis of the closed-loop system under the energy-based controller, showing the feasibility of achieving the objective targeting the UEP.

  3. (3)

    Simulation demonstration of performing swing-up and stabilizing task with the energy-based control and the LQR control.

The structure of the remainder is as follows: The dynamics of the PPA robot and the control objective are given in Sect. 2. An important property of the robot is presented in Sect. 3. The energy-based controller is derived and the closed-loop solution is analyzed in Sect. 4, followed by numerical simulations in Sect. 5 and the conclusion in Sect. 6. Two proofs are included in the appendices to increase readability.

2 System dynamics and control objective

In this section, we revisit the dynamics of the three-link planar robot and state our control objective regarding the energy-based control approach.

2.1 System dynamics

The three-link planar robot with active last link, as depicted in Fig. 1, is considered. The symbols involved are defined and collected in the Nomenclature section.

Fig. 1
figure 1

PPA robot: three-link planar robot with active last link

The robot’s dynamics are derived in [28] and expressed as

$$\begin{aligned} \varvec{M}\left( \varvec{\theta }\right) \ddot{\varvec{\theta }}+\varvec{C}\big (\varvec{\theta },{\dot{\varvec{\theta }}}\big ){\dot{\varvec{\theta }}}+\varvec{G}\left( \varvec{\theta }\right) =\varvec{B}u_{3}, \end{aligned}$$
(1)

where \((\theta _1,\theta _2)\in {\mathbb {S}}\times {\mathbb {S}}\) (a torus) and \(\theta _3\in {\mathbb {R}}\) constitute the generalized coordinate vector \(\varvec{\theta }=[\theta _1,\theta _2,\theta _3]^\textrm{T}\); \(\varvec{M}(\varvec{\theta })\in {\mathbb {R}}^{3\times 3}\) is the symmetric positive definite inertia matrix \(\varvec{M}(\varvec{\theta })=[\alpha _{ij}\cos (\theta _j-\theta _i)]\); \(\varvec{C}(\varvec{\theta },{\dot{\varvec{\theta }}})\in {\mathbb {R}}^{3\times 3}\) is \(\varvec{C}(\varvec{\theta },{\dot{\varvec{\theta }}})=[-\alpha _{ij}{\dot{\theta }}_j\sin (\theta _j-\theta _i)]\); \(\varvec{G}(\varvec{\theta })\in {\mathbb {R}}^3\) is \(\varvec{G}(\varvec{\theta })=[-\beta _i\sin \theta _i]\); and \(\varvec{B}=[0,\ 0,\ 1]^\textrm{T}\). In these expressions,

$$\begin{aligned} \left\{ \begin{array}{l} \alpha _{ii}=J_{i}+m_{i}l_{ci}^2+l_i^2\sum \limits _{k=i+1}^{3}m_k,\ 1\le i\le 3,\\ \alpha _{ij}=\alpha _{ji}=m_jl_il_{cj}+l_il_j\sum \limits _{k=j+1}^{3}m_k,\ 1\le i < j \le 3,\\ \end{array} \right. \end{aligned}$$
(2)
$$\begin{aligned} \beta _i=\left( m_il_{ci}+l_i\sum \limits _{k=i+1}^{3}m_k\right) g,\ 1\le i\le 3. \end{aligned}$$
(3)

The PPA robot’s total mechanical energy is

$$\begin{aligned} E\big (\varvec{\theta },{\dot{\varvec{\theta }}}\big )=\frac{1}{2}{\dot{\varvec{\theta }}}^\textrm{T}\varvec{M}\left( \varvec{\theta }\right) {\dot{\varvec{\theta }}}+P\left( \varvec{\theta }\right) , \end{aligned}$$
(4)

where \(P(\varvec{\theta })=\sum _{i=1}^3\beta _i\cos \theta _i\) is the potential energy. Direct computation gives

$$\begin{aligned} {\dot{E}}\big (\varvec{\theta },{\dot{\varvec{\theta }}}\big )={\dot{\theta }}_{3}u_3. \end{aligned}$$
(5)

2.2 Control objective

In this paper, we design an energy-based controller for the PPA robot in (1) that aims at achieving the following control objective:

$$\begin{aligned} \lim _{t\rightarrow \infty }E\big (\varvec{\theta },{\dot{\varvec{\theta }}}\big )=E_\textrm{r},\quad \lim _{t\rightarrow \infty }\theta _3=0,\quad \lim _{t\rightarrow \infty }{\dot{\theta }}_3=0, \end{aligned}$$
(6)

which corresponds to the UEP \((\theta _1,\theta _2,\theta _3,{\dot{\theta }}_1,{\dot{\theta }}_2,{\dot{\theta }}_3)=(0,0,0,0,0,0)\) with \(E_\textrm{r}=\sum _{i=1}^3\beta _i\) being the potential energy of the robot at the UEP.

3 Property of PPA robot

In this section, we present an important property of the PPA robot, which is stated in Theorem 1 below and proved in “Appendix A”.

Theorem 1

Suppose that link 3 of the PPA robot satisfies constraints

$$\begin{aligned} \theta _3\equiv \theta _3^{*},\quad u_3\equiv u_3^{*}, \end{aligned}$$
(7)

with \(\theta _3^{*}\) and \(u_3^{*}\) being constants; that is, the angle of link 3 is held fixed under a constant control input. Then, links 1 and 2 of the PPA robot maintain static positions; that is,

$$\begin{aligned} {\dot{\theta }}_1\equiv 0,\quad {\dot{\theta }}_2\equiv 0, \end{aligned}$$
(8)

regardless of its mechanical parameters, \(\theta _3^{*}\), and \(u_3^{*}\). Equivalently, \(\theta _1\equiv \theta _1^{*}\) and \(\theta _2\equiv \theta _2^{*}\), with \(\theta _1^{*}\) and \(\theta _2^{*}\) being constants.

The essence of the property in Theorem 1 is that if the actuated variable remains still under a constant control input, then the whole system stays at an equilibrium configuration. We have tried to prove this property from a physical perspective by looking into the forces exerting on each joint; however, we cannot extract new information beyond the dynamics in (1). Even so, this property cannot be simply revealed by straightforward analysis of the dynamics, which are in the form of second-order nonholonomic constraints. Thus, we transform the dynamics with (7) into a holonomic constraint in terms of a \(28\textrm{th}\)-order polynomial. Under this particular constraint, we show that the PPA robot cannot move for any possible mechanical parameters in (2) and (3), any position of the actuated link 3, and any corresponding constant control input.

It is worth noting that the most difficult part of the proof is to prove the following result, which represents a special case of Theorem 1 with the constraint in (7) being further specified.

Corollary 1

Suppose that link 3 of the PPA robot is further constrained to the horizontal position, with \(\theta _3\equiv \theta _3^{*}=\pm \pi /2\) and \(u_3\equiv u_3^{*}\). Then, the motion of the PPA robot satisfies: \(\textrm{i})\) the link 3 is parallel to X-axis with its distance to X-axis remains fixed, and \(\textrm{ii})\) (8) holds.

Fig. 2
figure 2

Illustrative example of the equilibrium configuration of the PPA robot, when link 3 is held in a horizontal position under a constant control input

Similarly, Corollary 1 indicates a special equilibrium configuration for the PPA robot, such as the illustrative example shown in Fig. 2. The proof of Corollary 1 is given in Case 2.2 of “Appendix A”.

4 Energy-based control

In this section, we derive an energy-based controller targeting the UEP and analyze the global motion of the closed-loop system by utilizing the property in Theorem 1.

4.1 Design of energy-based controller

Take the Lyapunov candidate proposed in [28] as

$$\begin{aligned} V=\frac{1}{2}\left( E\big (\varvec{\theta },{\dot{\varvec{\theta }}}\big )-E_\textrm{r}\right) ^2 +\frac{k_D}{2}{\dot{\theta }}_3^2+\frac{k_P}{2}\theta _3^2, \end{aligned}$$
(9)

where \(k_D\in {\mathbb {R}}^{+}\) and \(k_P\in {\mathbb {R}}^{+}\) are constant control gains. Taking the time derivative of V along (1) with (5) gives

$$\begin{aligned} {\dot{V}}={\dot{\theta }}_3\Big (\big (E\big (\varvec{\theta },{\dot{\varvec{\theta }}}\big ) -E_\textrm{r}\big )u_3+k_D\ddot{\theta }_3+k_P\theta _3\Big ). \end{aligned}$$

If we can design \(u_3\) satisfying

$$\begin{aligned} \big (E\big (\varvec{\theta },\dot{\varvec{\theta }}\big ) -E_\textrm{r}\big )u_3+k_D\ddot{\theta }_3+k_P\theta _3=-k_V{\dot{\theta }}_3, \end{aligned}$$
(10)

where \(k_V\in {\mathbb {R}}^{+}\) is a constant control gain, then we have

$$\begin{aligned} {\dot{V}}=-k_V{\dot{\theta }}_3^2\le 0. \end{aligned}$$
(11)

Since \(\varvec{M}(\varvec{\theta })\) is a positive definite matrix, from (1), we have

$$\begin{aligned} \ddot{\theta }_3=\varvec{B}^\textrm{T}\varvec{M}^{-1}\left( \varvec{\theta }\right) \big (\varvec{B}u_3-\varvec{C}\big (\varvec{\theta },{\dot{\varvec{\theta }}}\big ){\dot{\varvec{\theta }}}-\varvec{G}\left( \varvec{\theta }\right) \big ). \end{aligned}$$
(12)

Substituting (12) into (10) yields

$$\begin{aligned} \varLambda \big (\varvec{\theta },{\dot{\varvec{\theta }}}\big )u_3{} & {} =k_D\varvec{B}^\textrm{T}\varvec{M}^{-1} \left( \varvec{\theta }\right) \big (\varvec{C}\big (\varvec{\theta },{\dot{\varvec{\theta }}}\big ){\dot{\varvec{\theta }}}\\{} & {} \quad +\varvec{G}\left( \varvec{\theta }\right) \big )-k_P\theta _3-k_V{\dot{\theta }}_3, \end{aligned}$$

where

$$\begin{aligned} \varLambda \big (\varvec{\theta },{\dot{\varvec{\theta }}}\big )=\big (E\big (\varvec{\theta },{\dot{\varvec{\theta }}}\big ) -E_\textrm{r}\big )+k_D\varvec{B}^\textrm{T}\varvec{M}^{-1}\left( \varvec{\theta }\right) \varvec{B}. \end{aligned}$$
(13)

Hence, if \(\varLambda (\varvec{\theta },{\dot{\varvec{\theta }}})\) is nonzero for any state \((\varvec{\theta },{\dot{\varvec{\theta }}})\), then we obtain

$$\begin{aligned} u_3=\frac{k_D\varvec{B}^\textrm{T}\varvec{M}^{-1}\left( \varvec{\theta }\right) \big (\varvec{C}\big (\varvec{\theta },{\dot{\varvec{\theta }}}\big ){\dot{\varvec{\theta }}}\ +\varvec{G}\left( \varvec{\theta }\right) \big )-k_P\theta _3 -k_V{\dot{\theta }}_3}{\varLambda \big (\varvec{\theta },{\dot{\varvec{\theta }}}\big )}. \end{aligned}$$
(14)

We present Lemma 1 below regarding the controller in (14) and the behavior of the corresponding closed-loop system.

Lemma 1

Consider the closed-loop system consisting of the PPA robot in (1) and the energy-based controller in (14). The controller in (14) is free of singular points if and only if

$$\begin{aligned} k_D>k_{Dm}=\max _{\begin{array}{c} -\pi \le \theta _{i}\le \pi \\ \left( 1\le i \le 3\right) \end{array}}\Big (\big (E_\textrm{r}-P\left( \varvec{\theta }\right) \big ) \big (\varvec{B}^\textrm{T}\varvec{M}^{-1}\left( \varvec{\theta }\right) \varvec{B}\big )^{-1}\Big ). \end{aligned}$$
(15)

Consequently, any closed-loop trajectory approaches an invariant set described as:

$$\begin{aligned}{} & {} \frac{1}{2}\alpha _{11}{\dot{\theta }}_1^2+\alpha _{12}{\dot{\theta }}_1{\dot{\theta }}_2 \cos \left( \theta _2-\theta _1\right) \nonumber \\{} & {} \quad +\frac{1}{2}\alpha _{22} {\dot{\theta }}_2^2+P\left( \theta _1,\theta _2,\theta _3^{*}\right) \equiv E^{*}, \end{aligned}$$
(16)
$$\begin{aligned}{} & {} W=\left\{ \big (\varvec{\theta },{\dot{\varvec{\theta }}}\big )\big |\big (\theta _1,\theta _2,{\dot{\theta }}_1,{\dot{\theta }}_2\big )\ \textrm{satisfies}\ (28),\ \theta _3\equiv \theta _3^{*} \right\} ,\nonumber \\ \end{aligned}$$
(17)

with \(E^{*}\) and \(\theta _3^{*}\) being constants.

Proof

We say that the controller in (14) is free of singular points if \(\varLambda (\varvec{\theta },{\dot{\varvec{\theta }}})\ne 0\). Owing to \(E(\varvec{\theta },{\dot{\varvec{\theta }}})\ge P(\varvec{\theta })\) and \(E_\textrm{r}\ge P(\varvec{\theta })\), if (15) holds, we obtain \(\varLambda (\varvec{\theta },{\dot{\varvec{\theta }}})>0\) directly from (13). Thus, (15) is a sufficient condition such that the controller in (14) is free of singular points. Note that in (15) we have

$$\begin{aligned} \varvec{B}^\textrm{T}\varvec{M}^{-1}\left( \varvec{\theta }\right) \varvec{B}=\frac{\alpha _{11}\alpha _{22} -\alpha _{12}^2\cos ^2\left( \theta _1-\theta _2\right) }{\left| \varvec{M}\left( \varvec{\theta }\right) \right| }>0, \end{aligned}$$
(18)

since \(\varvec{M}(\varvec{\theta })\) is positive definite.

We now show that (15) is also a necessary condition by revealing that for any specific \(k_D\) satisfying \(0<k_D\le k_{Dm}\), there exists a state \((\varvec{\theta },{\dot{\varvec{\theta }}})\) rendering \(\varLambda (\varvec{\theta },{\dot{\varvec{\theta }}})=0\). To this end, let \(\varvec{\zeta } \in {\mathbb {R}}^3\) be the value of \(\varvec{\theta }\) at which the function in (15) takes its maximum value, then we have

$$\begin{aligned} k_{Dm}=\big (E_\textrm{r}-P\left( \varvec{\zeta }\right) \big )\big (\varvec{B}^\textrm{T}\varvec{M}^{-1}\left( \varvec{\zeta }\right) \varvec{B}\big )^{-1}. \end{aligned}$$
(19)

Take \(\varvec{\zeta }_d \in {\mathbb {R}}^3\) such that

$$\begin{aligned} \frac{1}{2}\varvec{\zeta }_d^\textrm{T}\varvec{M}\left( \varvec{\zeta }\right) \varvec{\zeta }_d=\left( k_{Dm}-k_D\right) \left( \varvec{B}^\textrm{T}\varvec{M}^{-1}\left( \varvec{\zeta }\right) \varvec{B}\right) \ge 0. \end{aligned}$$

Then, by using (4) and (13), we have

$$\begin{aligned}{} & {} \varLambda \left( \varvec{\zeta },\varvec{\zeta }_d\right) =\frac{1}{2}\varvec{\zeta }_d^ \textrm{T}\varvec{M}\left( \varvec{\zeta }\right) \varvec{\zeta }_d \\{} & {} \quad +P\left( \varvec{\zeta }\right) -E_\textrm{r}+k_D\varvec{B}^\textrm{T}\varvec{M}^{-1}\left( \varvec{\zeta }\right) \varvec{B}=0. \end{aligned}$$

Thus, the controller in (14) is free of singular points if and only if (15) holds.

From (11), since \({\dot{V}}\le 0\), using LaSalle’s invariance principle with (9) and (11) shows that the closed-loop trajectory eventually approaches an invariant set W where \(E(\varvec{\theta },{\dot{\varvec{\theta }}})\) and \(\theta _3\) are constants denoted as \(E^{*}\) and \(\theta _3^{*}\), respectively. Finally, substituting \(E=E^{*}\) and \(\theta _3=\theta _3^{*}\) into (4) gives the characterization of W in (17). \(\square \)

4.2 Global motion analysis

We further analyze the closed-loop trajectory by studying the convergence of the system’s total mechanical energy.

Define the set

$$\begin{aligned}{} & {} \begin{aligned}&\frac{1}{2}\alpha _{11}{\dot{\theta }}_1^2+\alpha _{12}{\dot{\theta }}_1{\dot{\theta }}_2 \cos \left( \theta _2-\theta _1\right) +\frac{1}{2}\alpha _{22}{\dot{\theta }}_2^2\\&+\beta _1\left( \cos \theta _1-1\right) +\beta _2\left( \cos \theta _2-1\right) =0, \end{aligned} \end{aligned}$$
(20)
$$\begin{aligned}{} & {} \begin{aligned} W_\textrm{r}=\left\{ \big (\varvec{\theta },{\dot{\varvec{\theta }}}\big )\big |\big (\theta _1,\theta _2,{\dot{\theta }}_1,{\dot{\theta }}_2\big )\ \textrm{satisfies}\ (20),\ \theta _3\equiv 0\right\} , \end{aligned}\nonumber \\ \end{aligned}$$
(21)

and the equilibrium set

$$\begin{aligned} \varOmega _\textrm{s}=\left\{ \left( \varvec{\theta }^{*}, \varvec{0}_3\right) \big |\varvec{\theta }^{*}\equiv \left[ \pi ,\pi ,0\right] ^\textrm{T},\ \left[ \pi ,0,0\right] ^\textrm{T},\ \left[ 0,\pi ,0\right] ^\textrm{T} \right\} , \end{aligned}$$
(22)

which comprises the down–down–up, down–up–up, and up–down–up equilibrium points. The terms “down” and “up” denote the downward (\(\theta _i=\pi \)) and upward (\(\theta _i=0\)) positions of link i, respectively. Define function

$$\begin{aligned}{} & {} f\left( \psi \right) =\frac{\left( -2\left( \beta _1+\beta _2\right) +\left( \cos \psi -1\right) \beta _3\right) \beta _3\sin \psi }{\psi }, \nonumber \\{} & {} \quad {\psi \in [\pi ,2\pi ].} \end{aligned}$$
(23)

We are ready to present another main result of this paper.

Theorem 2

Consider the closed-loop system consisting of the PPA robot in (1) and the energy-based controller in (14) with \(k_D\) satisfying (15), \(k_P>0\), and \(k_V>0\). If \(k_P\) further satisfies

$$\begin{aligned} k_P>k_{Pm}=\max _{\pi \le \psi \le 2\pi }f\left( \psi \right) , \end{aligned}$$
(24)

where \(f(\psi )\) is defined in (23). Then, the following statements hold:

1 If \(E^{*}=E_\textrm{r}\), then the closed-loop trajectory converges to the invariant set \(W_\textrm{r}\) in (21), where the only equilibrium point UEP is strictly unstable.

2 If \(E^{*}\ne E_\textrm{r}\), then the closed-loop trajectory converges to \(\varOmega _\textrm{s}\) in (22), where all three equilibrium points are strictly unstable.

Proof

Substituting \(\theta _3=\theta _3^{*}\) and \(E(\varvec{\theta },{\dot{\varvec{\theta }}})=E^{*}\) into (10) yields

$$\begin{aligned} \left( E^{*}-E_\textrm{r}\right) u_3+k_P\theta _3^{*}=0. \end{aligned}$$
(25)

If \(E^{*}=E_\textrm{r}\), we obtain \(\theta _3^{*}=0\) from (25), which turns (17) into \(W_\textrm{r}\) in (21). Substituting \({\dot{\theta }}_1=0\) and \({\dot{\theta }}_2=0\) into (21) gives \(\theta _1=0\) and \(\theta _2=0\). This suggests that \(W_\textrm{r}\) contains the UEP as the unique equilibrium point.

If \(E^{*}\ne E_\textrm{r}\), we obtain \(u_3=u_3^{*}\) from (25). Since links 1 and 2 are stationary according to Theorem 1, using (1), (4), and (10) with \(\varvec{\theta }^{*}=[\theta _1^{*},\theta _2^{*},\theta _3^{*}]^\textrm{T}\) then gives

$$\begin{aligned}{} & {} \sin \theta _i^{*}\equiv 0,\ i=1,2, \end{aligned}$$
(26)
$$\begin{aligned}{} & {} \beta _3\left( E_\textrm{r}-P\left( \varvec{\theta }^{*}\right) \right) \sin \theta _3^{*}+k_P\theta _3^{*}=0. \end{aligned}$$
(27)

From (26), we have \(\theta _1^{*}\) and \(\theta _2^{*}\) equal 0 or \(\pi \) under modulo \(2\pi \). In case where \(\theta _3^{*}\ne 0\), (27) can be further expressed as

$$\begin{aligned} k_P=\frac{-\beta _3\left( E_\textrm{r}-P\left( \varvec{\theta }^{*}\right) \right) \sin \theta _3^{*}}{\theta _3^{*}}, \end{aligned}$$

where the numerator of the right-hand side is an even and periodic function with period of \(2\pi \). Due to \(E_\textrm{r}\ge P(\varvec{\theta }^{*})\) and \(P(\varvec{\theta }^{*})\ge -\beta _1-\beta _2+\beta _3\cos \theta _3^{*}\), (27) has an unique solution \(\theta _3^{*}=0\) if \(k_P\) satisfies (24). This implies that the closed-loop trajectory converges to one of the three equilibrium points in \(\varOmega _\textrm{s}\).

In what follows, we apply Routh–Hurwitz criterion to check the stability of equilibrium points in \(W_\textrm{r}\) and \(\varOmega _\textrm{s}\). By calculating the characteristic polynomial of the robot’s linearization at the UEP, we obtain

$$\begin{aligned} \left| s\varvec{I}-\varvec{J}_{uuu} \right| =s^6+a_1s^5+a_2s^4+a_3s^3+a_4s^2+a_5s+a_6, \end{aligned}$$

where \(\varvec{J}_{uuu}\) is the corresponding Jacobian matrix, and

$$\begin{aligned}&a_1=\frac{k_V}{k_D},\ a_2=\frac{k_P}{k_D}-\frac{\alpha _{22}\beta _1 +\alpha _{11}\beta _2}{\alpha _{11}\alpha _{22}-\alpha _{12}^2},\\&{a_3=-\frac{k_V\left( \alpha _{22}\beta _1+\alpha _{11}\beta _2\right) }{k_D\left( \alpha _{11}\alpha _{22}-\alpha _{12}^2\right) },}\\&{a_4=\frac{k_D\beta _1\beta _2-k_P\left( \alpha _{22}\beta _1+\alpha _{11} \beta _2\right) }{k_D\left( \alpha _{11}\alpha _{22}-\alpha _{12}^2\right) },}\\&a_5=\frac{k_V\beta _1\beta _2}{k_D\left( \alpha _{11}\alpha _{22}-\alpha _{12}^2\right) }, \ a_6=\frac{k_P\beta _1\beta _2}{k_D\left( \alpha _{11}\alpha _{22}-\alpha _{12}^2\right) }. \end{aligned}$$

Using \(\alpha _{11}\alpha _{22}-\alpha _{12}^2>0\) due to \(M(\varvec{\theta })|_{\varvec{\theta }=\varvec{0_3}}>0\) shows that \(a_3<0\), regardless of the control gains and mechanical parameters. Hence, it can be concluded that the UEP is strictly unstable, since \(\varvec{J}_{uuu}\) possesses no less than one eigenvalue in the open right-half plane.

The proof of all the equilibrium points in \(\varOmega _\textrm{s}\) being strictly unstable is given in “Appendix B”. \(\square \)

Fig. 3
figure 3

Configurations of the PPA robot at all possible closed-loop equilibrium points described in Theorem 2

Figure 3 depicts the configurations of the PPA robot at all possible equilibrium points described in Theorem 2. We give the following remark about Theorem 2.

Remark 1

Since all three equilibrium points in \(\varOmega _\textrm{s}\) are strictly unstable, the set of initial states from which the closed-loop trajectory converges to \(\varOmega _\textrm{s}\) is of Lebesgue measure zero, see, e.g., [18] (p. 1225). Thus, under the energy-based controller in (14), every initial state apart from those in a set of Lebesgue measure zero converges to \(W_\textrm{r}\). This indicates that the objective in (6) is achieved.

5 Simulation results

In this section, we provide simulation verification for the developed theoretical results, and demonstrate an application to the swing-up and stabilizing task. Notably, in addition to simulations without friction, we also conduct simulation in the presence of linear viscous friction to showcase the robustness of our proposed control approach. The mechanical parameters listed in Table 1 for simulation are extracted from the physical device of the three-link planar robot in [17]. The gravitational acceleration g is set to \(9.81~\mathrm{m/s^2}\).

Table 1 Mechanical parameters of the physical device of a three-link planar robot in [17]

Since the PPA robot is linearly controllable at the UEP regardless of mechanical parameters [14], stabilization around the UEP, if the robot ever comes close under the controller in (14), can then be accomplished by switching to a local stabilizing controller:

$$\begin{aligned} u_3=-\varvec{F}\varvec{x}, \end{aligned}$$
(28)

where \(\varvec{x}=[\theta _{1},\theta _{2},\theta _{3},{\dot{\theta }}_{1},{\dot{\theta }}_{2},{\dot{\theta }}_{3}]^\textrm{T}\) and \(\varvec{F}\) is the state-feedback gain obtained by the LQR method. Using the MATLAB function “lqr” with

$$\begin{aligned} \varvec{Q}=\textrm{diag}\{1,1,1,0.1,0.1,0.1\},\quad R=1, \end{aligned}$$

we obtain

$$\begin{aligned} \varvec{F}{} & {} =[847.7247,\ -197.3587,\ 1.4521,\ \nonumber \\{} & {} \quad 109.9323,\ 10.6374,\ 0.9831]. \end{aligned}$$
(29)

The local stabilizing controller in (28) is switched when the PPA robot enters a vicinity of the UEP defined by

$$\begin{aligned} d= \big | \theta _1 \big | + \big | \theta _2 \big | + \big | \theta _3 \big | +0.3 \big | {\dot{\theta }}_1 \big | + \big | {\dot{\theta }}_2 \big | + \big | {\dot{\theta }}_3 \big |<0.5. \end{aligned}$$
(30)

5.1 Swing-up and stabilizing without friction

Under the mechanical parameters in Table 1, the conditions of the control gains in (15) and (24) are \(k_D>0.3088\) and \(k_P>3.1235\). Below are the results of the simulation conducted for three initial states. The dashed vertical line in the figures marks the switch from the energy-based controller to the local stabilizing controller.

The first simulation starts from initial state 1:

$$\begin{aligned} \left( \theta _{1},\theta _{2},\theta _{3},{\dot{\theta }}_{1},{\dot{\theta }}_{2}, {\dot{\theta }}_{3}\right) =\left( \frac{5\pi }{6},\frac{6\pi }{7},\frac{7\pi }{8},0,0,0\right) , \end{aligned}$$
(31)

under the controller in (14) with \(k_D=0.3270\), \(k_P=3.1240\), and \(k_V=3.0281\). The results are shown in Figs. 4 and 5.

Fig. 4
figure 4

Time responses of V, \(E-E_\textrm{r}\), and \(u_3\) with initial state 1 in (31) under the swing-up controller in (14) and the LQR controller in (28)

Fig. 5
figure 5

Time responses of \(\theta _1\), \(\theta _2\), and \(\theta _3\) with initial state 1 in (31) under the swing-up controller in (14) and the LQR controller in (28)

Fig. 6
figure 6

Time responses of V, \(E-E_\textrm{r}\), and \(u_3\) with initial state 2 in (32) under the swing-up controller in (14) and the LQR controller in (28)

Fig. 7
figure 7

Time responses of \(\theta _1\), \(\theta _2\), and \(\theta _3\) with initial state 2 in (32) under the swing-up controller in (14) and the LQR controller in (28)

From Fig. 4, we see that Lyapunov function V in (9) decreased to 0, and the total mechanical energy E converged to \(E_\textrm{r}\). From Fig. 5, \(\theta _3\) converged to 0. This verifies that the closed-loop trajectory converged to \(W_\textrm{r}\) in (21), and the objective in (6) is achieved.

Next, by linearizing the closed-loop system at the down–down–up equilibrium point \((\theta _{1},\theta _{2},\theta _{3},{\dot{\theta }}_{1},{\dot{\theta }}_{2},{\dot{\theta }}_{3})=(\pi ,\pi ,0,0,0,0)\) in (22), we obtain the characteristic equation as

$$\begin{aligned} \begin{aligned}&s^6+50.98s^5+416.42s^4+8615.30s^3\\&\quad +46599.37s^2+164756.28s+852119.92=0. \end{aligned} \end{aligned}$$

The roots of the above equation are \(-45.53\), \(-5.70\), \(0.03\pm 4.72j\), and \(0.09\pm 12.14j\). This verifies that the down–down–up equilibrium point is strictly unstable. The instability verification for other equilibrium points is omitted.

From Fig. 5, where we plotted \(\theta _1\) and \(\theta _2\) modulo \(2\pi \), the PPA robot entered the vicinity of the UEP in (30) at \(t=72.38\ \textrm{s}\), and thus triggered the switch of controller. The local stabilizing controller in (28) then stabilized the robot around the UEP. This demonstrates a successful swing-up and stabilizing control via the combination of controllers in (14) and (28).

The second simulation starts from initial state 2:

$$\begin{aligned} \left( \theta _{1},\theta _{2},\theta _{3},{\dot{\theta }}_{1},{\dot{\theta }}_{2},{\dot{\theta }}_{3}\right) =\left( \frac{\pi }{2},\frac{\pi }{2},\frac{\pi }{2},0,0,0\right) , \end{aligned}$$
(32)

under the controller in (14) with \(k_D=0.3163\), \(k_P=3.1240\), and \(k_V=4.5572\). From the results shown in Figs. 6 and 7, we see that the closed-loop trajectory converged to \(W_\textrm{r}\) in (21). This indicates that the objective in (6) is achieved for another initial state. Under the energy-based controller in (14), the PPA robot was driven to the UEP at \(t=50.57\ \textrm{s}\), the switch of controller was then executed to stabilize the robot.

Finally, the third simulation starts from initial state 3:

$$\begin{aligned} \left( \theta _{1},\theta _{2},\theta _{3},{\dot{\theta }}_{1},{\dot{\theta }}_{2},{\dot{\theta }}_{3}\right) =\left( \frac{\pi }{6},\frac{\pi }{7},\frac{\pi }{8},0,0,0\right) , \end{aligned}$$
(33)

under the controller in (14) with \(k_D=0.3527\), \(k_P=3.1240\), and \(k_V=4.9321\). The simulation results are shown in Figs. 8 and 9. The analysis of the closed-loop trajectory is similar to previous simulations and hence is omitted for brevity.

Fig. 8
figure 8

Time responses of V, \(E-E_\textrm{r}\), and \(u_3\) with initial state 3 in (33) under the swing-up controller in (14) and the LQR controller in (28)

Fig. 9
figure 9

Time responses of \(\theta _1\), \(\theta _2\), and \(\theta _3\) with initial state 3 in (33) under the swing-up controller in (14) and the LQR controller in (28)

Fig. 10
figure 10

Time responses of V, \(E-E_\textrm{r}\), and \(u_3\) with initial state 1 in (31) in the presence of linear viscous friction under the swing-up controller in (14) and the LQR controller in (28)

Fig. 11
figure 11

Time responses of \(\theta _1\), \(\theta _2\), and \(\theta _3\) with initial state 1 in (31) in the presence of linear viscous friction under the swing-up controller in (14) and the LQR controller in (28)

5.2 Swing-up and stabilizing with linear viscous friction

Generally, if friction exists, then the energy-based control approach cannot theoretically guarantee that (6) holds. However, it is suggested in [1] that the effect of friction can be well reduced by increasing \(E_\textrm{r}\) with an excess of \(10\%\)-\(20\%\) over the theoretical value in (6). This would inject more energy than theoretically needed into the system to compensate the energy loss due to friction.

Below, we demonstrate the swing-up and stabilizing task in the presence of linear viscous friction:

$$\begin{aligned} \varvec{f}({\dot{\varvec{\theta }}})=\left[ \mu _1{\dot{\theta }}_1,\ \mu _2{\dot{\theta }}_2,\ \mu _3{\dot{\theta }}_3\right] ^{\textrm{T}}, \end{aligned}$$

where \(\mu _i\ (i=1,2,3)\) are set to 0.001. We take \(E_\textrm{r}=1.1(\beta _1+\beta _2+\beta _3)\), where \(\beta _1+\beta _2+\beta _3\) is the theoretical value in (6) for the frictionless case. The control gains are tuned as \(k_D=0.3346\), \(k_P=3.2810\), and \(k_V=2.1549\).

Starting from initial state 1 in (31), the simulation results are depicted in Figs. 10 and 11. As can be observed, a successful switch from the swing-up controller in (14) to the local stabilizing controller in (28) was achieved at \(t=44.93\ \textrm{s}\), and the PPA robot was stabilized at the UEP in spite of the existence of friction. This indicates the robustness of our proposed control approach.

6 Conclusion

This paper studied a three-link planar robot with active last link (the PPA robot). In this paper, we made the following contributions: First, we presented a property of the PPA robot with a strict proof. This property reveals that if the active last link of the PPA robot remains stationary under a constant control input, then the whole system maintains an equilibrium configuration. Though similar properties have been proved for the double pendulum on a cart and the three-link planar robot with active first link, we showed in this paper that the proof for the PPA robot demonstrates new challenges and distinctions, which demand more complicated manipulations and extra discretion. Second, with the above property, we derived an energy-based controller and studied the behavior of the closed-loop system without any prior assumption on the robot’s mechanical parameters. The results are: \(\textrm{i})\) we presented a necessary and sufficient condition to rid the energy-based controller of singular points, and showed that the total mechanical energy and the angle of the active last link converge under this controller; \(\textrm{ii})\) we derived a sufficient condition for the controller to ensure that the robot stays at one of three equilibrium points with link 3 being upward, provided that the energy convergence does not equal its value at the upright equilibrium point (UEP); \(\textrm{iii})\) we showed that all three equilibrium points are strictly unstable, and thus proved that the energy-based control objective targeting the UEP can be achieved for almost all initial states. In addition, we presented numerical simulations to validate the developed theoretical results, and to demonstrate the effectiveness of applying the derived controller along with an LQR controller to the swing-up and stabilizing task of the PPA robot. This paper gained an insight into the complexity of analyzing the motion of underactuated systems with underactuation degree of two under the energy-based control.