1 Introduction

As an important transportation tool, overhead crane systems are widely used in factories, harbors, and so on. As a typical underactuated system [1,2,3], the overhead crane system is difficult to be controlled properly and due to the fact that the payload is dragged by the trolley, inappropriate operation for overhead cranes may lead to large payload swing which is very dangerous. In practice, overhead cranes are usually operated by experienced workers. However, possible operation mistakes may result in uncontrollable payload swing and even accidents. Hence, the study on automatic control design for overhead crane systems is very meaningful and useful.

Generally speaking, the control objective of the overhead crane system consists of two parts, known as fast and accurate trolley positioning, and effective payload swing suppression. However, these two parts are actually contradictory with each other, and hence, to achieve them simultaneously is of great difficulty. Recently, the control problem of overhead cranes has attracted attentions from many researchers all over the world, with a series of control methods proposed. To simplify the control design difficulty, partial feedback linearization technique is used to obtain proper control performance in [4] and [5]. A flatness-based control method is proposed for 2-dimension overhead crane systems in [6]. In the references of [7,8,9], adaptive control-based methods are proposed for overhead cranes, which do not require the exact model knowledge. Utilizing the passivity theory, many energy-based control methods are proposed in [10, 11], which can obtain asymptotic stability results. Considering the existence of unknown disturbance, as well as system model uncertainties, sliding mode-based control methods [12,13,14] are also designed for crane systems, which show great robustness. A series of open loop control methods based on the idea of input shaping are proposed for crane systems in [15,16,17], which need few sensors and can successfully suppress the payload swing. To deal with system constraints and the input saturation problem, model predictive control (MPC)-based methods are also proposed for overhead cranes in [18] and [19]. Low energy consumption results are also achieved for overhead crane systems by MPC-based method in [20]. In recent years, intelligent methods, including fuzzy control method [21], genetic algorithm (GA)-based method [22], neural network-based method [23], which can utilize human experience to improve the control performance, are applied to control crane systems.

Because there exists strong coupling between the trolley movement and the payload swing, more directly, we can plan a suitable trajectory for the trolley with the coupling behavior being considered. Based on this idea, a lot of trajectory planning methods have been proposed so far [24,25,26,27,28,29]. For example, Sun et al. [26] propose a phase plane-based trajectory planning method, using which a three-segment trajectory is obtained by geometric analysis in the phase plane, which can achieve the objective of swing suppression and residual swing elimination. In [27], Wu et al. propose a model conversion method, based on which three kinds of optimal trajectories, including swing-optimal, energy-optimal, and time-optimal, are presented for overhead cranes.

Though a lot of methods have been proposed for overhead crane systems, most of them need the following assumption: The payload can bee seen as a mass point. However, in some situations, for example, the payload shape is too large to be ignored, or the hook mass cannot be simply ignored, this kind of assumption is not satisfied and the overhead crane system behaves more like a double pendulum system. The dynamic behavior of a pendulum system can also be very complex, which is widely researched by many scholars [30, 31]. As a result, the control performance of many controllers may be degraded or even instability results may occur, which is very dangerous. So far, there exist few methods which can deal with this problem. In [32,33,34], input shaping methods are extended for double pendulum cranes, which can suppress double pendulum swing. A polynomial-based trajectory planning method is proposed by Sun et al. [35], which can deal with various system constraints. Tuan et al. propose some sliding mode control-based methods for double pendulum crane systems in [36], which are testified to be robust by simulation results. An amplitude-saturated nonlinear output feedback control method [37] is presented for double pendulum crane systems, which can suppress double pendulum swing and achieve accurate trolley positioning.

Focusing on the control problem of double pendulum crane systems, we propose a time-optimal trajectory planning method in this paper, which can achieve both fast and accurate trolley positioning and double pendulum swing suppression. Specifically, by taking consideration of various system constraints, we first formulate an optimization problem, with the transportation time being the to-be-optimized function. Then a discrete system model for the double pendulum crane is presented by using the discretization technique, which can be seen as the basis to solve the obtained optimization problem. Based on this discrete model, the entire optimization problem, including optimization function and constraints, is converted into a discrete formulation. By deeply analyzing the structure of the optimization problem, it is proved that the optimization function is a quasiconvex function while the constraints are all convex, which further implies that the optimization problem is a quasiconvex problem. After that, we propose a bisection-based method to solve this problem and obtain the optimal transportation time, together with the corresponding time-optimal trajectory. Also, to make the trolley track the planned trajectory properly, a tracking controller is designed, which is proved to achieve exponential convergence results. At last, some simulation results and experimental results are included to show the great performance of the proposed method.

Fig. 1
figure 1

Schematic figure of double pendulum crane systems

The rest of this paper is organized as follows: Sect. 2 introduces the double pendulum crane dynamics, as well as the control objectives. The proposed trajectory planning method, including optimization problem formulation, system transformation, optimization problem solution, and tracking controller design, is detailed in Sect. 3. To verify the performance of this method, some simulation tests, as well as experimental tests, are implemented in Sect. 4. Section 5 provides the main conclusion of this paper.

2 Problem statement

In this paper, we focus on the control problem of a double pendulum crane system, whose schematic figure is shown in Fig. 1. By some mathematical analysis and calculations, we can obtain the kinematic energy and potential energy as follows:

$$\begin{aligned} K= & {} \frac{1}{2}(M+{m}_{1}+{m}_{2})\dot{x}^{2}+\frac{1}{2}({m}_{1}+{m}_{2}){l}_{1}^{2}\dot{\theta }_{1}^{2}\\&+\,\frac{1}{2}{m}_{2}{l}_{2}^{2}\dot{\theta }_{2}^{2}+({m}_{1}+m2){l}_{1}\cos \theta _{1}\dot{x}\dot{\theta }_{1}\\&+\,{m}_{2} {l}_{2} \cos \theta _{2}\dot{x}\dot{\theta }_{2}+{m}_{2} {l}_{1} {l}_{2} \cos (\theta _{1}-\theta _{2})\dot{\theta }_{1}\dot{\theta }_{2}, \\ P= & {} ({m}_{1}+m2)g{l}_{1}(1-\cos \theta _{1})+{m}_{2}g {l}_{2}(1-\cos \theta _{2}), \end{aligned}$$

where K(t)andP(t) denote the kinematic and potential energies, respectively. Then, the Lagrangian function is defined as \(L(t)=K(t)-P(t)\). After that, we can calculate the crane system dynamic model using the following Lagrangian equations:

$$\begin{aligned}&\frac{\hbox {d}}{\hbox {d}t}\left( \frac{\partial L}{\partial \dot{x}}\right) -\frac{\partial L}{\partial x}=F, \\&\frac{\hbox {d}}{\hbox {d}t}\left( \frac{\partial L}{\partial \dot{\theta }_{1}}\right) -\frac{\partial L}{\partial \theta _{1}}=0,\\&\frac{\hbox {d}}{\hbox {d}t}\left( \frac{\partial L}{\partial \dot{\theta }_{2}}\right) -\frac{\partial L}{\partial \theta _{2}}=0, \end{aligned}$$

which is explicitly given as

$$\begin{aligned}&(M+{m}_{1}\,{+}\,{m}_{2})\ddot{x}\,{+}\,({m}_{1}\,{+}\,{m}_{2}){l}_{1}(\cos {\theta _{1}}\ddot{\theta }_{1}-\dot{\theta }_{1}^{2} \sin {\theta _{1}}) \nonumber \\&\quad +\,{m}_{2} {l}_{2}\ddot{\theta }_{2} \cos {\theta _{2}}-{m}_{2} {l}_{2} \dot{\theta }_{2}^{2} \sin {\theta _{2}}=F, \end{aligned}$$
(1)
$$\begin{aligned}&({m}_{1}+{m}_{2}){l}_{1} \cos {\theta _{1}} \ddot{x}+ ({m}_{1}+{m}_{2}){l}_{1}^{2}\ddot{\theta }_{1} \nonumber \\&\quad +\,{m}_{2} {l}_{1} {l}_{2} \cos {(\theta _{1}-\theta _{2})} \ddot{\theta }_{2}+{m}_{2} {l}_{1} {l}_{2} \sin {(\theta _{1}-\theta _{2})}\dot{\theta }_{2}^{2} \nonumber \\&\quad +\,({m}_{1}+{m}_{2})g {l}_{1} \sin {\theta _{1}}=0, \end{aligned}$$
(2)
$$\begin{aligned}&{m}_{2} {l}_{2} \cos \theta _{2} \ddot{x} + {m}_{2} {l}_{1} {l}_{2} \cos (\theta _{1}-\theta _{2})\ddot{\theta }_{1} + {m}_{2} {l}_{2}^{2} \ddot{\theta }_{2} \nonumber \\&\quad -\,{m}_{2} {l}_{1} {l}_{2} \dot{\theta }_{1}^{2} \sin (\theta _{1}-\theta _{2}) + {m}_{2} g {l}_{2} \sin \theta _{2}=0, \end{aligned}$$
(3)

where \(M,{m}_{1}, and {m}_{2}\) represent the trolley mass, the non-negligible hook mass, and the payload mass, respectively; \({l}_{1}\) denotes the rope length; and \({l}_{2}\) is the distance between centers of the hook and the payload; g represents the gravity acceleration constant. The trolley displacement is described by x(t). The double pendulum swing angles, known as the hook swing angle and the payload swing angle, are expressed by \(\theta _{1}(t)\) and \(\theta _{2}(t)\). It is seen that \(x(t), \theta _{1}(t), \theta _{2}(t)\) constitute the to-be-controlled system states. F(t) is the force actuated on the trolley, which is the only control input of this system.

It is obvious that the number of control input is less than that of degrees of freedom, which clearly shows that the double pendulum system is a typical underactuated system. At the same time, due to the existence of hook swing angle, the system states of this kind of crane system are more than those of a single pendulum crane system while there is still one control input, which increases the control difficulty of this system. Like the single pendulum crane system, the control objective of the double pendulum crane consists of two parts, fast and accurate trolley positioning and double pendulum swing suppression. To achieve this objective, in this paper, we decide to plan a suitable trajectory for the trolley, with the consideration of swing suppression during the planning process. In the next section, the coupling relationship of the system states will be analyzed deeply, which is the key for trajectory planning.

3 Time-optimal trajectory planning strategy

In this section, a novel time-optimal trajectory planning strategy is proposed for the double pendulum crane system to achieve the objective of both fast and accurate trolley positioning and effective system swing suppression. Specifically, we first formulate an optimization problem with the consideration of various constraints, by solving which we can obtain the time-optimal trolley trajectory. Then by utilizing the discretization technique, the discrete system model is obtained, based on which, the optimization problem is transformed into a discrete form. After that, the discrete optimization problem is proven to be a quasiconvex optimization problem, which is then solved by a bisection method. At last, a global time-optimal trolley trajectory is obtained, following which, the transportation process can be finished with no residual swing.

3.1 Optimization problem formulation

To obtain the time-optimal trolley trajectory, we need to formulate an optimization problem with the following constraints taken into consideration:

  1. (1)

    Considering the control objective, the trolley should reach the desired position \({x}_{f}\) from the initial position \({x}_{i}\) within transportation time \({t}_{f}\), while the trolley velocity and acceleration should be equal to zero when the trolley reaches the target position. At the same time, both double pendulum swing angles ought to be zero, as well as the swing angular velocities. That is

    $$\begin{aligned}&x(0)=0,\quad \dot{x}(0)=0,\quad \ddot{x}(0)=0, \\&x({t}_{f})={x}_{f}, \quad \dot{x}({t}_{f})=0,\quad \ddot{x}({t}_{f})=0,\\&\theta _{1}(0)=\theta _{2}(0)=0,\quad \dot{\theta }_{1}(0)=\dot{\theta }_{2}(0)=0,\\&\theta _{1}({t}_{f})=\theta _{2}({t}_{f})=0,\quad \dot{\theta }_{1}({t}_{f})=\dot{\theta }_{2}({t}_{f})=0. \end{aligned}$$

    Without loss of generality, the initial time is chosen as zero and \({x}_{i}\) is set as zero.

  2. (2)

    Due to the actuator saturation, the trolley velocity and acceleration should be within suitable domains, in the sense that,

    $$\begin{aligned} |\dot{x}(t)|\le v_{\max }, \quad |\ddot{x}(t)|\le a_{\max }, \end{aligned}$$

    where \(v_{\max }, a_{\max }\), respectively, denote the permitted trolley velocity and acceleration amplitudes.

  3. (3)

    To ensure safety, the maximum amplitudes of double pendulum swing angles should be less than allowable values. Thus, we have the following relationship:

    $$\begin{aligned} |\theta _{1}(t)|\le \theta _{1\max },\quad |\theta _{2}(t)|\le \theta _{2\max }, \end{aligned}$$

    wherein \(\theta _{1\max }, \theta _{2\max }\) represent the allowed upper bounds of the double pendulum swing angles, respectively.

In summary, we can formulate an optimization problem with respect to the transportation time \({t}_{f}\) as follows:

$$\begin{aligned} \mathrm{minimize}\,&{t}_{f} \nonumber \\ \mathrm{subject~to}\,&x(0)=0,\quad \dot{x}(0)=0,\quad \ddot{x}(0)=0,\nonumber \\&x({t}_{f})={x}_{f}, \quad \dot{x}({t}_{f})=0,\quad \ddot{x}({t}_{f})=0, \nonumber \\&\theta _{1}(0)=\theta _{2}(0)=0,\quad \dot{\theta }_{1}(0)=\dot{\theta }_{2}(0)=0,\nonumber \\&\theta _{1}({t}_{f})=\theta _{2}({t}_{f})=0,\quad \dot{\theta }_{1}({t}_{f})=\dot{\theta }_{2}({t}_{f})=0,\nonumber \\&|\dot{x}(t)|\le v_{\max }, \quad |\ddot{x}(t)|\le a_{\max },\nonumber \\&|\theta _{1}(t)|\le \theta _{1\max },\quad |\theta _{2}(t)|\le \theta _{2\max }. \end{aligned}$$
(4)

3.2 System discretization

Linearizing the system dynamics shown in (1)–(3) around the equilibrium point and after some simplifications, we can obtain

$$\begin{aligned}&(M+{m}_{1}+{m}_{2})\ddot{x}+({m}_{1}+{m}_{2}){l}_{1} \ddot{\theta }_{1} +{m}_{2} {l}_{2} \ddot{\theta }_{2} = F, \nonumber \\\end{aligned}$$
(5)
$$\begin{aligned}&\ddot{x}+{l}_{1} \ddot{\theta }_{1}+ \frac{{m}_{2} {l}_{2}}{{m}_{1}+{m}_{2}} \ddot{\theta }_{2} + g \theta _{1}=0, \end{aligned}$$
(6)
$$\begin{aligned}&\ddot{x} + {l}_{1} \ddot{\theta }_{1} + {l}_{2} \ddot{\theta }_{2} + g \theta _{2}=0. \end{aligned}$$
(7)

Then after some transformations, the double pendulum swing angular accelerations can be expressed as follows:

$$\begin{aligned} \ddot{\theta }_{1}= & {} -\frac{\ddot{x}}{{l}_{1}}-\frac{g({m}_{1} + {m}_{2})}{{m}_{1} {l}_{1}}\theta _{1}+\frac{g {m}_{2}}{{m}_{1} {l}_{1}} \theta _{2}, \end{aligned}$$
(8)
$$\begin{aligned} \ddot{\theta }_{2}= & {} \frac{g({m}_{1}+{m}_{2})}{{m}_{1} {l}_{2}}\theta _{1}-\frac{g({m}_{1}+{m}_{2})}{{m}_{1} {l}_{2}}\theta _{2}. \end{aligned}$$
(9)

Treat the trolley acceleration as the system input and then (8) and (9) can be rewritten as the state-space representation:

$$\begin{aligned} \dot{\varvec{\xi }}=A {\varvec{\xi }} + {\varvec{B}} u, \end{aligned}$$
(10)

where u(t) is the system input, which is equal to the trolley acceleration \(\ddot{x}(t)\); \({\varvec{\xi }}(t) \in \mathbb {R}^{6 \times 1}\) denotes the full state vector defined as follows:

$$\begin{aligned} {{\varvec{\xi }}}=[\begin{array}{cccccc} x&\quad \dot{x}&\quad \theta _{1}&\quad \dot{\theta }_{1}&\quad \theta _{2}&\quad \dot{\theta }_{2} \end{array}]^{{T}}, \end{aligned}$$

\(A \in \mathbb {R}^{6 \times 6},{\varvec{B}} \in \mathbb {R}^{6 \times 1}\) represent system parameter matrices with the following expressions:

$$\begin{aligned} A= & {} \left[ \begin{array}{cccccc} 0 &{}\quad 1 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{}\quad 0 \\ 0 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{} \quad 0 \\ 0 &{}\quad 0 &{}\quad 0 &{}\quad 1 &{}\quad 0 &{}\quad 0 \\ 0 &{}\quad 0 &{}\quad -\frac{g({m}_{1} + {m}_{2})}{{m}_{1} {l}_{1}} &{}\quad 0 &{}\quad \frac{g {m}_{2}}{{m}_{1} {l}_{1}} &{} 0 \\ 0 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{}\quad 0 &{}\quad 1 \\ 0 &{}\quad 0 &{}\quad \frac{g({m}_{1}+{m}_{2})}{{m}_{1} {l}_{2}} &{}\quad 0 &{}\quad -\frac{g({m}_{1}+{m}_{2})}{{m}_{1} {l}_{2}} &{}\quad 0 \end{array}\right] , \\ {\varvec{B}}= & {} \left[ \begin{array}{cccccc} 0&\quad 1&\quad 0&\quad -1/{l}_{1}&\quad 0&\quad 0 \end{array}\right] ^{{T}}. \end{aligned}$$

To facilitate trajectory planning, select the sample time as T, and (10) can be then discretized as follows:

$$\begin{aligned} {{\varvec{\xi }}(k+1)={A}_{d}{\varvec{\xi }}(k)+{\varvec{B}}_{d}} u(k), \end{aligned}$$
(11)

where \({\varvec{\xi }}(k)\hbox { and }u(k)\) denote the system state vector and the system input at time k, respectively; \({A}_{d} and {\varvec{B}}_{d}\) represent the discrete system parameter matrices which can be calculated as

$$\begin{aligned} {A}_{d} = \exp (AT), \quad {\varvec{B}}_{d} = \int ^T_0{\exp (AT)}\hbox {d}t {\varvec{B}}, \end{aligned}$$
(12)

where \(\exp (*)\) denotes the natural exponential function.

Based on the discrete system model (11), the original optimization problem can be converted into a discrete structure as follows:

$$\begin{aligned} \mathrm{minimize}\quad&{k}_{f} \nonumber \\ \mathrm{subject~to}\quad&{\varvec{\xi }}(0)={\varvec{\xi }}_i,\quad {\varvec{\xi }}({k}_{f})={\varvec{\xi }}_f, \nonumber \\&u(0)=0,u({k}_{f})=0, \nonumber \\&|u(k)|\le a_{\max },\quad |{\varvec{{E}}_{v} {\varvec{\xi }}}(k)|<v_{\max }, \nonumber \\&|{\varvec{E}}_{t1} {\varvec{\xi }}(k)|<\theta _{1\max },\quad |{\varvec{E}}_{t2} {\varvec{\xi }}(k)|<\theta _{3\max },\nonumber \\ \end{aligned}$$
(13)

where \({k}_{f}\) represents the to-be-optimized discrete time variable and we have the following relationship:

$$\begin{aligned} {t}_{f} ={k}_{f} T. \end{aligned}$$

\({\varvec{\xi }}_i ,{\varvec{\xi }}_f \in \mathbb {R}^{6\times 1}\) denote the initial and target position system state vectors, respectively, which are defined as follows:

$$\begin{aligned} {\varvec{\xi }}_i&=[\begin{array}{cccccc} 0&\quad 0&\quad 0&\quad 0&\quad 0&\quad 0 \end{array}]^{{T}}, \\ {\varvec{\xi }}_f&=[\begin{array}{cccccc} {x}_{f}&\quad 0&\quad 0&\quad 0&\quad 0&\quad 0 \end{array}]^{{T}}, \end{aligned}$$

\({\varvec{E}}_{v},{\varvec{E}}_{t1},{\varvec{E}}_{t2} \in \mathbb {R}^{1\times 6}\) are auxiliary matrices with the following expressions:

$$\begin{aligned} {\varvec{E}}_{v}=[\begin{array}{cccccc} 0&\quad 1&\quad 0&\quad 0&\quad 0&\quad 0 \end{array}], \\ {\varvec{E}}_{t1}=[\begin{array}{cccccc} 0&\quad 0&\quad 1&\quad 0&\quad 0&\quad 0 \end{array}], \\ {\varvec{E}}_{t2}=[\begin{array}{cccccc} 0&\quad 0&\quad 0&\quad 0&\quad 1&\quad 0 \end{array}]. \end{aligned}$$

Next, we will solve the optimization problem to construct the optimal trolley trajectory.

3.3 Optimization problem analysis and solution

At first, an auxiliary function should be formulated to describe the transportation time \({k}_{f}\). Choose \(K\in \mathbb {R}^+\) as a sufficiently large integer and the control objective of the overhead crane system can be achieved by selecting proper control input sequence \(u(0), u(1),\ldots ,u(K)\) to drive (11) from the initial state to the target state with constraints satisfied. Considering the transportation time \({k}_{f}\), it is obvious that the following relationship is satisfied:

$$\begin{aligned} {k}_{f} \in \{{k}_{f}|{\varvec{\xi }}({k}_{f})={\varvec{\xi }}_f, u(k)=0\quad {\mathrm{for}}\quad {k}_{f} \le k \le K \}. \end{aligned}$$
(14)

Based on (14), the optimal transportation time can be expressed as a function with respect to the control input sequence as follows:

$$\begin{aligned}&\phi (u(0),\ldots ,u(K))=\min \{{k}_{f}|{\varvec{\xi }}({k}_{f})={\varvec{\xi }}_f,\nonumber \\&\quad ~u(k)=0\quad {\mathrm{for}}\quad {k}_{f} \le k \le K \}. \end{aligned}$$
(15)

Next we need to prove that the to-be-optimized function \(\phi (u(0),\ldots ,u(K))\) is a quasiconvex function with the following definition:

Definition 1

Quasiconvex function [38]: a function \(f:\mathbb {R}^n\rightarrow \mathbb {R}\) is called quansiconvex (or unimodal) if its domain and all its sublevel sets

$$\begin{aligned} S_{\alpha }=\{x\in \, dom \, f|f(x)\le \alpha \}, \end{aligned}$$

for \(\alpha \in \mathbb {R}\), are convex.

For the function \(\phi \), giving an arbitrary value \(\alpha \in \mathbb {Z}^+\), the sublevel set can be expressed as follows:

$$\begin{aligned} S_{\alpha }= & {} \{(u(0),\ldots ,u(K))|{\varvec{\xi }}(\alpha )={\varvec{\xi }}_f,\nonumber \\&\qquad u(k)=0\,{\mathrm{for}}\,\alpha \le k \le K\}. \end{aligned}$$
(16)

Now consider the discrete system model shown in (11). Utilizing the integration technique, the system state at time k can be expressed in the following manner:

$$\begin{aligned} {\varvec{\xi }}(k)= & {} {A}_{d}^k{\varvec{\xi }}_i+{A}_{d}^{k-1}{\varvec{B}}_{d} u(0)+\cdots +{\varvec{B}}_{d} u(k-1)\nonumber \\= & {} {A}_{d}^k{\varvec{\xi }}_i+\sum ^k_{j=1}{{A}_{d}^{k-j} {\varvec{B}}_{d} u(j-1)}. \end{aligned}$$
(17)

Then using (17), the sublevel set (16) can be converted into the following expressions:

$$\begin{aligned} S_{\alpha }= & {} \bigg \{(u(0),\ldots ,u(K))|u(k)=0\,{\mathrm{for}}\,\alpha \le k \le K, \nonumber \\&\quad {A}_{d}^{\alpha }{\varvec{\xi }}_i+\sum ^{\alpha }_{j=1}{{A}_{d}^{\alpha -j} {\varvec{B}}_{d} u(j-1)}={\varvec{\xi }}_f\bigg \}. \end{aligned}$$
(18)

After some analysis, it is seen that \({S}_{\alpha }\) is affine with respect to the control input sequence, implying that any line with two distinct points in \({S}_{\alpha }\) lies in the plane \({S}_{\alpha }\), and we can further conclude that \({S}_{\alpha }\) is also convex, which indicates that \(\phi (u(0),\ldots ,u(K))\) is a quasiconvex function based on Definition 1.

Next, utilizing (17), the constraints in (13) can all be converted into the following expressions:

$$\begin{aligned}&{\varvec{\xi }}(0)={\varvec{\xi }}_i,u(0)=u({k}_{f})=0, \end{aligned}$$
(19)
$$\begin{aligned}&{A}_{d}^{{k}_{f}}{\varvec{\xi }}_i+\sum ^{{k}_{f}}_{j=1}{{A}_{d}^{{k}_{f}-j} {\varvec{B}}_{d} u(j-1)}={\varvec{\xi }}_f,\end{aligned}$$
(20)
$$\begin{aligned}&{\varvec{E}_{v}}{A}_{d}^k{\varvec{\xi }}_i+{\varvec{E}_{v}}\sum ^k_{j=1}{{A}_{d}^{k-j} {\varvec{B}}_{d} u(j-1)}\le v_{\max },\end{aligned}$$
(21)
$$\begin{aligned}&-{\varvec{E}_{v}}{A}_{d}^k{\varvec{\xi }}_i-{\varvec{E}_{v}}\sum ^k_{j=1}{{A}_{d}^{k-j} {\varvec{B}}_{d} u(j-1)}\le v_{\max },\end{aligned}$$
(22)
$$\begin{aligned}&{{\varvec{E}}_{t1}}{A}_{d}^k{\varvec{\xi }}_i+{{\varvec{E}}_{t1}}\sum ^k_{j=1}{{A}_{d}^{k-j} {\varvec{B}}_{d} u(j-1)}\le \theta _{1\max },\end{aligned}$$
(23)
$$\begin{aligned}&-{{\varvec{E}}_{t1}}{A}_{d}^k{\varvec{\xi }}_i-{{\varvec{E}}_{t1}}\sum ^k_{j=1}{{A}_{d}^{k-j} {\varvec{B}}_{d} u(j-1)}\le \theta _{1\max },\nonumber \\\end{aligned}$$
(24)
$$\begin{aligned}&{{\varvec{E}}_{t2}}{A}_{d}^k{\varvec{\xi }}_i+{{\varvec{E}}_{t2}}\sum ^k_{j=1}{{A}_{d}^{k-j} {\varvec{B}}_{d} u(j-1)}\le \theta _{2\max },\end{aligned}$$
(25)
$$\begin{aligned}&-{{\varvec{E}}_{t2}}{A}_{d}^k{\varvec{\xi }}_i-{{\varvec{E}}_{t2}}\sum ^k_{j=1}{{A}_{d}^{k-j} {\varvec{B}}_{d} u(j-1)}\le \theta _{2\max },\nonumber \\\end{aligned}$$
(26)
$$\begin{aligned}&u(k)\le a_{\max },-u(k)\le a_{\max }, \end{aligned}$$
(27)

which are all linear constraints with respect to the control input sequence, implying that the constraints of the optimization problem are all convex with respect to the control input sequence. In summary, we can find that the to-be-optimized function is a quasiconvex function while the corresponding constraints are all convex, which conforms the request of the following definition:

Definition 2

Quasiconvex optimization [38]: A quasiconvex optimization problem has the standard form

$$\begin{aligned} \mathrm{minimize}\quad&{f}_{0}(x) \nonumber \\ \mathrm{subject~to}\quad&{f}_{i}(x)\le 0,\quad i=i,\ldots ,m \nonumber \\&Ax=b, \end{aligned}$$
(28)

where the inequality constraint function \(f_{1},\ldots ,{f}_{m}\) are convex, and the objective \({f}_{0}\) is quasiconvex.

Based on Definition 2, it is concluded that (13) is a quasiconvex optimization problem which can be reformulated as:

$$\begin{aligned} \mathrm{minimize} \quad&\phi (u(0),\ldots ,u(K)) \nonumber \\ \mathrm{subject~to} \quad&{\varvec{\xi }}(0)={\varvec{\xi }}_i,\nonumber \\&{A}_{d}^{{k}_{f}}{\varvec{\xi }}_i+\sum ^{{k}_{f}}_{j=1}{{A}_{d}^{{k}_{f}-j} {\varvec{B}}_{d} u(j-1)}={\varvec{\xi }}_f, \nonumber \\&u(k)=0,\quad \hbox {for}\quad {k}_{f} \le k \le K,\nonumber \\&(21){-}(27),\quad \hbox {for}\quad 0\le k \le K. \end{aligned}$$
(29)

As stated in [38], quasiconvex optimization problems, such as (29), can be solved by the bisection method with the globally optimal solution being obtained. To describe the detailed process of solving (29), we include Algorithm 1 to show the corresponding pseudo codes of the bisection method, wherein \({k}_{a},{k}_{b}\), respectively, denote the lower and upper bounds of the optimal time which are changing in every loop until the optimal time \({k}_{f}^*\) is found. Using Algorithm 1, we can solve the optimization problem with the minimum transportation time, as well as the corresponding optimal control input sequence \(u^*(k),0\le k \le {k}_{f}^*\), being obtained. Then by utilizing this sequence and (17), we can calculate the system state trajectories and finish the time-optimal trajectory planning process.

Remark 1

After the above analysis, it is seen that a series of feasibility problems need to be solved to find the feasible control sequence \(u(0),\ldots ,u(K)\) with (21)–(27) being satisfied. Because the constraints are all linear with respect to the control input sequence, this feasibility problem is essentially a linear programming problem. In fact, there exist a lot of linear programming methods to solve this kind of problem, which are included in many optimization software toolboxes.

figure a

3.4 Tracking controller design

To make the trolley go along the planned trajectory, an effective tracking controller is needed. Consider the linearized system dynamics in (5)–(7). Using (5) and (6), we can obtain the following relationship:

$$\begin{aligned} M\ddot{x}-g({m}_{1}+{m}_{2})\theta _{1}=F. \end{aligned}$$
(30)

Define the tracking error as follows

$$\begin{aligned} e = x-{x}_{r}, \end{aligned}$$
(31)

where e(t) denotes the trolley tracking error and \({x}_{r}(t)\) represents the planned optimal trolley trajectory, which can be obtained by the method in the previous section. Differentiate (31) with respect to time twice and the following relationship is obtained:

$$\begin{aligned} \ddot{e}=\ddot{x}-\ddot{x}_{r}, \end{aligned}$$
(32)

where \(\ddot{x}_{r}(t)\) denotes the second-order time derivative of the planned trajectory \({x}_{r}(t)\). Based on (30) and (32), we can present the following tracking error system:

$$\begin{aligned} M\ddot{e}=F+g({m}_{1}+{m}_{2})\theta _{1}-m\ddot{x}_{r}. \end{aligned}$$
(33)

Then, we can design the tracking controller as follows:

$$\begin{aligned} F=M\ddot{x}_{r}-g({m}_{1}+{m}_{2})\theta _{1}-M {k}_{p} e-M {k}_{d} \dot{e}, \end{aligned}$$
(34)

wherein \({k}_{p},{k}_{d} \in \mathbb {R}^+\) denote positive control gains. Substitute (34) into (33) and the following closed-loop system is obtained:

$$\begin{aligned} \ddot{e}+{k}_{d}\dot{e}+{k}_{p} e=0. \end{aligned}$$
(35)

Utilizing Routh–Hurwitz stability theory and after some mathematical calculations, it can be proved that this closed-loop system is exponentially stable when the control gains satisfy the conditions of \({k}_{p}>0,{k}_{d}>0\), which means that \(e(t),\dot{e}(t),\ddot{e}(t)\rightarrow 0\). In summary, we can conclude that the designed tracking controller can drive the trolley to the desired position along the planned optimal trajectory.

It should be noted and emphasized that during the tracking controller design process, the assumption of known model knowledge, as well as negligible external disturbances, has been used. To obtain better robustness, we will try to design robust control strategies in our future work.

Remark 2

The control gains of the proposed tracking controller are selected by trail and error. In general, by utilizing Routh-Hurwitz stability theory, we can select \({k}_{p},{k}_{d}\) to obtain exponential results. To obtain better tracking performance, after numerous simulation and experimental tests, we have summarized the following guidelines. The larger the \({k}_{p}\) is, the shorter the convergence time will be. However, severe oscillation may occur for \(x(t),\theta _{1}(t)\) and \(\theta _{2}(t)\), if \({k}_{p}\) is selected too large. The larger the \({k}_{d}\) is, the longer the convergence time will be; on the other hand, less oscillation may occur.

Remark 3

It should be noted that even though the considered double pendulum system is linearized, it is still more accurate than the single one to describe the real behavior of cranes in some situations, when the shapes of payloads need to be considered or the hook mass cannot be ignored. Additionally, for the trajectory planning methods [15, 16, 26, 27], linearization is a widely accepted practice to deal with the high coupling and simplify mathematical analysis. Even though the system model is linearized, the double pendulum behavior still exists in this model, which implies that this model can still describe the real behavior of cranes in some situations. Therefore, the linearized model is adopted to facilitate the description. Generally speaking, model uncertainties and disturbances are usually ignored for trajectory planning methods, since this kind of method is an open loop control strategy, which is suitable in situations without severe disturbances. On the other hand, please kindly note that there exist some regulation/stabilization methods for overhead crane systems, which use system states/outputs as feedback and show great robustness. For complex working condition with various disturbances, tracking controllers with specific consideration on disturbance rejection can be successfully combined with the designed trajectory planner, so as to achieve satisfactory control performance.

4 Simulation and experiments

In this section, some simulation and experimental tests of the proposed method are implemented to illustrate the satisfactory performance.

4.1 Simulation results

To verify the performance of the proposed time-optimal trajectory planning method, we implement some simulation tests in the environment of MATLAB/Simulink. In particular, the time-optimal trajectory is first obtained by some off-line calculations and then tested to show the effectiveness.

In this paper, to solve the feasibility problem in the bisection method, we use CVX, a package for specifying and solving convex programs [39, 40]. In the simulation, the system parameters are selected as follows:

$$\begin{aligned} M&=6.5\,\mathrm{kg},\quad {m}_{1}=2.0\,\mathrm{kg},\quad {m}_{2}=0.5\,\mathrm{kg}, \\ {l}_{1}&=0.53\,\mathrm{m},\quad {l}_{2}=0.4\,\mathrm{m},\quad g=9.8~\mathrm{m/s^{2}}, \end{aligned}$$

which are the same with those of the self-built double pendulum crane test bed. The sample time for the discrete system is \(T=0.005\,\mathrm{s}\). The target position for the trolley is set as \({x}_{f}=0.6\,\mathrm{m}\), and the system constraints are chosen as

$$\begin{aligned}&{a}_{\max }=0.15\,\mathrm{m/s^{2}},\quad v_{\max }=0.5\,\mathrm{m/s}, \\&\theta _{1\max }=2\,\mathrm{deg},\quad \theta _{2\max }=2\,\mathrm{deg}. \end{aligned}$$

For the bisection method, \(K,{k}_{a},{k}_{b}\) are set as \({k}_{a}=200,{k}_{b}=K=1000\). After some off-line calculations, we can obtain the optimal \({k}_{f}^*\) as \({k}_{f}^*=689\), as well as the corresponding optimal control input sequence.

Fig. 2
figure 2

Simulation results of the proposed trajectory planning method (trolley position and first- and second-order swing angles). Solid line simulation results; red dashed line swing angle constraints \(\theta _{1\max }=\theta _{2\max }=2\,\mathrm{deg}\); green dashed line trolley target position \({x}_{d}=0.6\,\mathrm{m}\). (Color figure online)

Fig. 3
figure 3

Simulation results of the proposed trajectory planning method (trolley velocity and acceleration). Solid line simulation results; red dashed line trolley acceleration constraint \(a_{\max }=0.15\,\mathrm{m/s}^2\). (Color figure online)

The simulation results are shown in Figs. 2 and 3. We can find that when the trolley goes along the obtained optimal trajectory, it takes \({t}_{f}^*={k}_{f}^* T=3.445\,\mathrm{s}\) to reach the target position and there is no residual swing for the double pendulum swing angles. At the same time, it is found that all system constraints, including double pendulum swing constraints, trolley velocity constraint, and trolley acceleration constraint, are satisfied during the entire transportation process. In summary, it is concluded that the proposed trajectory planning method can achieve the control objectives of fast and accurate trolley positioning and double pendulum swing suppression, while it can also deal with various system constraints to ensure safety.

4.2 Experimental results

To implement the proposed method, a self-built test bed, whose mechanical structure is shown in Fig. 4, is utilized. The first rope and the second rope in this figure correspond to \({l}_{1},{l}_{2}\) of the system dynamics. Different from the traditional crane test bed, to measure the double pendulum swing angle in real-time, the traditional hook has been replaced by a new hook of a special structure designed by us, which is shown in Fig. 4. In particular, the payload is connected to the new hook by a massless rope. When the payload swings around the hook, a structure of a half arc fixed on the hook is driven to rotate at the same time. Using the encoder equipped at the rotating shaft of the arc, the double pendulum swing with respect to the hook can be measured in real time. For the control system, the real-time control command is calculated by MATLAB/Simulink Real-Time Windows Target and then transferred to the hardware by a motion control board, which can also obtain the measured data by encoders. For the self-built crane test bed, the sample time is determined by the chosen control board, which is set as 5 \(\mathrm{ms}\).

Fig. 4
figure 4

Main mechanical structure of the self-built double pendulum crane test bed

To show the great performance of the proposed method, we have chosen two comparative methods, the sliding mode method from [36] and the linear quadratic regulator (LQR) method. The system parameters of the experiment test bed can be measured, which are the same with those in simulation tests. Also, for all these three methods, the trolley target position is selected as \({x}_{f}=0.6\,\mathrm{m}\).

Due to the space limitation, the expression of the sliding mode controller is omitted here, and we only include the selected control gains as follows:

$$\begin{aligned} K=30,\quad \lambda =1,\quad \alpha =2,\quad \beta =-0.2. \end{aligned}$$

For the LQR method, the controller expression is provided as:

$$\begin{aligned} {F}_{L}= & {} -k_{1}(x-{x}_{f})-k_{2} \dot{x} - k_{3} \theta _{1} - k_{4} \dot{\theta }_{1} \\&-\,k_{5} \theta _{2} - k_{6} \dot{\theta }_{2}, \end{aligned}$$

and the cost function of this method is defined as

$$\begin{aligned} J=\int _{0}^{\infty }({\varvec{\zeta }}^\mathrm{T}Q{\varvec{\zeta }}+RF_L^{2})\hbox {d}t, \end{aligned}$$

wherein \({\varvec{\zeta }} \in \mathbb {R}^{6\times 1}\) is defined as follows:

$$\begin{aligned} {\varvec{\zeta }} = [\begin{array}{cccccc} {e}_{l}(t)&\quad \dot{e}_{l}(t)&\quad \theta _{1}(t)&\quad \dot{\theta }_{1}(t)&\quad \theta _{2}(t)&\quad \dot{\theta }_{2}(t) \end{array}]^{{T}}, \end{aligned}$$

\({e}_{l}(t)\) denotes the trolley positioning error defined as \({e}_{l}(t) = x(t)-{x}_{f}\). \(Q \in \mathbb {R}^{6\times 6}, R \in \mathbb {R} \) are auxiliary matrices selected as

$$\begin{aligned} Q={\mathrm{diag}}\{180,1,100,1,100,1\},\quad R=0.05. \end{aligned}$$

Then, by using MATLAB, the control gains are calculated as

$$\begin{aligned} {k}_{1}= & {} 60.00,\quad {k}_{2}=45.46,\quad {k}_{3}=-95.78, \\ {k}_{4}= & {} -5.98,\quad {k}_{5}=17.41,\quad {k}_{6}=-4.17. \end{aligned}$$

For the proposed method, the system constraints are selected the same with those in the simulation test, while the parameters of the bisection method are also the same. Thus, the obtained time-optimal trajectory is just the one in the simulation tests. On the other hand, for the designed tracking controller, the control gains are selected as \({k}_{p}=120,{k}_{d}=80\).

In the experimental environment, there exists friction between the trolley and the rail, and to obtain proper control performance, it needs to be well compensated. The expression of the friction can be obtained using the modeling and identification technique, which is approximately described by the following model [41]:

$$\begin{aligned} {F}_{f}={F}_{f1}\tanh (\epsilon _{x}\dot{x})+{F}_{f2}|\dot{x}|\dot{x}, \end{aligned}$$

where \(\dot{x}(t)\) is the trolley velocity and \({F}_{f1},{F}_{f2},\epsilon _{x} \in \mathbb {R}\) denote the friction related parameters which can be identified by a series of off-line experiments and data fitting. Then, it is summarized that utilizing the obtained model, the friction can be approximately compensated, which is widely used in crane control related papers [10, 19]. Additionally, from the experimental results of the proposed method, we can conclude that using this compensation method, satisfactory tracking performance is obtained, which further shows the effectiveness of the constructed friction model.

Fig. 5
figure 5

Results for the proposed method. Solid line experimental results; dashed line the planned time-optimal trajectory; dotted-dashed line the swing angle constraints \(\theta _{1\max }=\theta _{2\max }=2\,\mathrm{deg}\)

Fig. 6
figure 6

Results for the sliding mode control method. Solid line experimental results

Fig. 7
figure 7

Results for the LQR method. Solid line experimental results

Table 1 Quantified results

The experimental results of the proposed method, the SMC method, and the LQR method are shown in Figs. 56, and 7. Also, some quantified results are included in Table 1. From these figures and the table, it is seen that among all three methods, the time cost of the proposed method is the least, which demonstrates the time-optimal property of the proposed method. On the other hand, for the proposed method, we can find that the first and second pendulum swing angles are both within permitted domains, which implies that the given swing angle constraints are satisfied. However, the comparative methods cannot ensure the swing angle constraints, implying that these methods may be inapplicable in some situations. In summary, we can conclude that the proposed method can achieve satisfactory performance.

By comparing Figs. 2 and 5, it is seen that some differences exist between simulation and experimental results of the proposed method. Generally speaking, for the same control method, numerical simulation and experimental results are usually different due to the existence of such factors as friction, dead-zone, hysteresis, and so on [42,43,44]. In particular, since unavoidable disturbance exists, the experimental results in this paper are not exactly the same with the simulation ones, which can be seen as an ideal situation. On the other hand, from these figures, it can be seen that though differences exist, the main trends of the system state trajectories are similar, which shows the effectiveness of the proposed method.

5 Conclusion

In this paper, we propose a global time-optimal trajectory planning method, as well as a tracking controller, for the double pendulum crane system. A series of system constraints, including the permitted amplitudes of double pendulum swing angles, are taken into full consideration when constructing the trajectory. Specifically, the discrete double pendulum crane model is obtained from the original system dynamics, by some linearization and discretization. After that, a time optimization problem is formulated subject to various system constraints, which is equivalent to finding a proper control input sequence. Based on this, the optimization problem is converted into a new formulation, which is proven to be a quasiconvex optimization problem. Then, a bisection-based algorithm is presented to solve this problem and obtain the optimal control input sequence. Utilizing the discrete system model and the obtained control input sequence, we can calculate the corresponding optimal system state trajectories. At last, we design a tracking controller, which can make the trolley track the obtained trajectory properly. Simulation results and experimental results of the proposed method and some comparative methods are included, which show the great performance of our method. In our future work, we will focus on designing feedback control methods to deal with model uncertainties and disturbances, so as to achieve even better performance.