Keywords

1 Introduction

The cranes are used as support for heavy loads in various industrial applications such as shipyards, ports, constructions, factories, among others. Generally, the control of these devices is done manually by operators with wide knowledge, practice and dexterity [1]. In industries involving cranes, the punctuality and effectiveness of the handling system are important contributors to the productivity of the process or industry. It is for this reason that the implementation of a control strategy to the gantry crane can bring several advantages, such as support to the operator, safety, automatic operation and rejection or compensation of disturbances. Port cranes are subject to the presence of external disturbances, such as wind or carriage movement, these external forces can cause the load to oscillate. In most applications these oscillations have negative consequences; the load balancing makes the positioning more difficult, thus increasing the discharge time and operator inefficiency; when the payload is dangerous or fragile, the oscillations can cause load damage and insecurity [2, 3]. Some examples are the neural networks [4], Proportional Derivative Control (PD) [5], State feedback [6], fuzzy logic [7], Nonlinear adaptive control [8], Hybrid control (nominal characteristic trajectory (NCT) with Proportional Integral Control (PI)) [9], H infinite [10], Linear Quadratic Regulator (LQR) [10], Output-Delayed feedback control [11], among other strategies that feed the state of the art of these systems. Despite the study of different control strategies, the technique known as state feedback is undoubtedly one of the most used by researchers to mitigate position errors and oscillations. Over the years, engineers have sought to improve ease of use, increase operational efficiency and mitigate crane safety issues by tackling three very important issues; Motion- induced oscillation; Disturbance-induced oscillation; And positioning capability. During the present work several aspects of study were taken into account, starting in the Sect. 2 by the dynamic modeling of the system through the Euler-Lagrange equations in a conservative way. Next, in Sect. 3, the system was modeled taking into account the non-conservative forces and the trajectory was defined for the future simulations. The simulations were performed to compare these results, these are shown in Sect. 4. The Sect. 5 shows each of the steps, criteria and discusses about the crane with for the design of the servo system and finally in the Sect. 6 we present the conclusions of the work.

2 Symbolic Model

The crane type modeling system started from a model in which intervenes a spring at the point where the force is applied for the movement of the carriage on the rail, as shown in Fig. 1 and the real gantry crane as shown in the Fig. 2. For this system the Lagrangian model was developed, in which initially the kinetic and potential energies are calculated.

Fig. 1.
figure 1

Initial system image

Fig. 2.
figure 2

Gantry crane

Fig. 3.
figure 3

\(\theta \) solution for the first 5 s.

The Lagrangian of any system is defined,

$$\begin{aligned} \mathcal {L} = T - U, \end{aligned}$$
(1)

where, T is the kinetic energy and U the potential, therefore, for this model it is,

(2)

In the Euler-Lagrange equations, q, represents the degrees of freedom (DOF) generalized, in this case, there are two DOF, \(\theta \) and x, therefore,

$$\begin{aligned} \frac{d}{dt}\left( \frac{\partial \mathcal {L}}{\partial \dot{\theta }}\right) - \frac{\partial \mathcal {L}}{\partial \theta } = 0 \end{aligned}$$
(3)
$$\begin{aligned} \frac{d}{dt}\left( \frac{\partial \mathcal {L}}{\partial \dot{x}}\right) - \frac{\partial \mathcal {L}}{\partial x} = 0. \end{aligned}$$
(4)

From (3) and (4), the Euler-Lagrange equation, is obtained,

$$\begin{aligned} \ddot{\theta }l^2\,A + (\ddot{x}\,l\cos \theta + g\,l\sin \theta )\,B = 0 \end{aligned}$$
(5)
$$\begin{aligned} \ddot{x}C - (\ddot{\theta }l\cos \theta - l\dot{\theta }^2\sin \theta ) B + K\,x = 0, \end{aligned}$$
(6)

where,

$$\begin{aligned} A= & {} \left( m_1 + \frac{m_2}{3}\right) + \frac{2}{5}m_1\,r^2 \end{aligned}$$
(7)
$$\begin{aligned} B= & {} m_1 + \frac{m_2}{2} \end{aligned}$$
(8)
$$\begin{aligned} C= & {} m_1 + m_2 + M \end{aligned}$$
(9)

The solution for \(\theta \) is shown in Fig. 3 and x for in Fig. 4.

Fig. 4.
figure 4

x solution for the first 5 s.

Fig. 5.
figure 5

Non-conservative model variables.

3 Non-conservative Model

To control the system described above, the spring is deleted, which exerts a force on the mass placed on the rail. The force is determined, but not as exerted by the spring, since this will be the variable being monitored. The objective is to bring the mass of the pendulum from one point to another with a specified distance it to oscillate, so the answer is overdamped. From the system described in Fig. 5, the dynamic model is determined from the Euler-Lagrange equations for generalized force, this is

$$\begin{aligned} \frac{d}{dt}\left( \frac{\partial \mathcal {L}}{\partial \dot{q}_i}\right) - \frac{\partial \mathcal {L}}{\partial q_i} = Q_i, \qquad i = 1, 2 \end{aligned}$$
(10)

where \(q_1 = \theta \), \(q_2 = x\), \(Q_1 = Q_{\theta }\) and \(Q_2 = Q_x\); these last two represent the generalized forces over the system, which will no longer be conservative, due to the existence of an external force F and friction is assumed in the pendulum axis (\(b_1 \dot{\theta }\)) and carriage contact with the rail (\(b_2 \dot{x}\)), according to Fig. 5. With this variation, the new Euler-Lagrange equations, are

$$\begin{aligned} \ddot{\theta }\,D + (\ddot{x}\,l\cos \theta + g\,l\sin \theta )\,B = -b_1\dot{\theta } \end{aligned}$$
(11)
$$\begin{aligned} \ddot{x}\,C + (\ddot{x}\,l\cos \theta + g\,l\sin \theta )\,B = F - b_2\,\dot{x} \end{aligned}$$
(12)

where

$$\begin{aligned} D = \left( \frac{2}{5}m_1\,r^2\right) , \end{aligned}$$
(13)

and B, C are the same terms in the Eqs. (8) and (9), respectively.

A suitable trajectory for the variable x is that in which the speed starts and ends at zero, the trigonometric function \(\tanh \), so that the function of the desired trajectory is,

$$\begin{aligned} x = \frac{d}{2}\tanh \left[ \alpha \left( t - \frac{T}{2}\right) \right] + \frac{d}{2}, \end{aligned}$$
(14)

where d is the distance to travel, t represents time, T the time and \(\alpha \) a factor to vary the slope of the curve. The function type proposed is more than twice differentiable, this ensures a continuous acceleration along the way. Having defined the trajectory to x, these values are entered into Eq. (11), and trajectories for \(\theta \) y \(\dot{\theta }\) are found.

3.1 Matrix Representation of Dynamic Model

Starting from [12], despite the complexity of the dynamic equation (15) that the behavior of manipulative robots, this equation and its formant terms have properties that are of interest in themselves. In addition, these properties are of particular value in the study of control systems for manipulators.

$$\begin{aligned} M(\mathbf {q})\ddot{\mathbf {q}} + C(\mathbf {q}, \dot{\mathbf {q}})\;\dot{\mathbf {q}} + G(\mathbf {q}) + f(\dot{\mathbf {q}}) = \mathbf {\tau }, \end{aligned}$$
(15)

so that (15) is the dynamic equation for mechanical systems of n degrees of freedom (DOF). Where M, is the inertia tensor of the system, C, is the centrifugal forces and Coriolis matrix, G the vector of gravity, f, the friction matrix and \(\mathbf {\tau }\), the external forces. The equations of motion (11) and (12) in matrix form are as follows,

figure a

Clearing the accelerations of the previous representation (16), we obtain the equations that will be used for future simulations and perform the control of the system.

$$\begin{aligned} \ddot{x}=\frac{1}{det (M)}[-D(F-b_{2}\dot{x}-Bgl\sin \theta )], \end{aligned}$$
(16)

and

$$\begin{aligned} \ddot{\theta }=\frac{1}{det (M)}[(-Bl\cos \theta - C)(-b_{1}\dot{\theta }-Bgl\sin \theta )+ (Bl\cos \theta )(F-b_{2}\dot{x}-Bgl\sin \theta )], \end{aligned}$$
(17)

where, \(det(M)=-D(Bl\cos \theta + C)\).

4 Simulation

To validate the linearization obtained, we proceeded to simulate the nonlinear model (Euler-Lagrange equations) and the state space model (Matrix A, B, and \(\widetilde{C}\)), putting them to respond to the same input \(F = 0.1\) of 2 s.

Fig. 6.
figure 6

Block diagram with both models.

The Fig. 6, shows the general scheme of both simulated models, the scheme containing the nonlinear model is shown below (Fig. 7).

Fig. 7.
figure 7

Nonlinear model block diagram.

The block that is called Non-linear model is a function of Matlab, which contains the Euler-Lagrange equations of motion. The system response for the conditions given above is shown in Fig. 8, 9, 10 and 11.

Fig. 8.
figure 8

Cart position for both models

Fig. 9.
figure 9

Cart speed for both models

In Fig. 9, it can be seen that the system increases its velocity while the external force F is acting on the system, after the external force is not present, the velocity decreases until reaching a stationary zone.

Fig. 10.
figure 10

Pendulum position for both models

Fig. 11.
figure 11

Pendulum speed for both models

In Figs. 8, 9, 10 and 11, the red line represents the response of each of the corresponding variables of the nonlinear model, while the blue line is the behavior of the linearized model.

5 System Control

For the design of controllers by state feedback it is necessary to work with the subsystem of minimal realization [13], this subsystem is characterized by complete controllability and observability, because the non-controllable part of a system is independent of inputs, it is not possible to modify the subsystem by any state feedback acting on this. Therefore, it is necessary to verify the complete controllability of the system to be able to design the controller by feedback [14]. For the design of the state feedback controller, it is necessary to verify that the system has a subsystem of minimal realization, for this it is assumed that all states are physically measurable, So the system is fully observable, besides this, it is necessary to know if it is totally controllable or not, For this the controller \(Q = [B\; AB\; A^2B\; A^3B]\), matrix is calculated, this matrix has a range equal to 4, while the matrix A has a range of 3, therefore, the system is fully controllable (oversized system).

5.1 Transformation to Phase Variables

For the design of the controller by state feedback it is convenient to express the matrices of the system in its controllable canonical form, which require a transformation matrix T, which is defined as \(T^{-1} = [\mathrm{e}; \mathrm{e}A; \mathrm{e}A^2; \mathrm{e}A^3]\), where, \(\mathrm{e} = Q^{-1}(n)\), being n, is the last row of the inverse of the matrix Q.

So that \(A_{f} = T^{-1}AT\) and \(B_{f} = T^{-1}B\), where,

$$\begin{aligned} A_{f}= \begin{bmatrix} 0 &{} 1 &{} 0 &{} 0\\ 0 &{} 0 &{} 1 &{} 0\\ 0 &{} 0 &{} 0 &{} 1\\ 0 &{} -10174 &{} -19020 &{} -7075.1\\ \end{bmatrix}, \end{aligned}$$
(18)
$$\begin{aligned} B_{f}= \begin{bmatrix} 0\\ 0\\ 0\\ 1\\ \end{bmatrix}, \end{aligned}$$
(19)

here, \(A_{f}\) and \(B_{f}\), are the representation of the system in phase variables (controllable canonical form). The vector \(\widetilde{C}\), is already in the canonical form.

5.2 Servo System Control

The servosystem is a controller that has certain advantages over other classic controllers, such as its good performance in systems sensitive to disturbances and with modeling inaccuracies, in addition to ensuring a zero position error. It is necessary to know the type of system with which you are working, there are several ways to know the type of a control system, among the most common is to calculate the transfer function or find its own values which give us information from the poles of the system, in this case the own values \(VP = [-1.95, -7077,0, -0.737]\), were calculated, observing that there is a system type 1, so the first feedback constant \(k_{1}\), will be 0.

5.3 Poles Allocation

The design of the controller was done by means of pole assignment, also known as poles location technique. In this case it starts by analyzing the eigenvalues of the system, these eigenvalues represent the poles of the closed-loop system. Next, the desired poles of the system are located with the criterion of \(t_{s} = 4T\) (previously defined a \(T=5\) s, in the defined path), therefore, the desired poles will be located at 20. It suffices that \(b_{0}\ne 0\), to place the desired poles anywhere, being in this case \(b_{0}=1\), since it is the first value of vector \(\widetilde{C}\). For the calculation of the vector K and the proportional action \(K_{0}\) we start from,

$$\begin{aligned} A_{r} = A_{f} + B_{f} K_{f} - K_{0} B_{f}\widetilde{C} \end{aligned}$$
(20)

being, \(A_{r}\), the feedback matrix,

$$\begin{aligned} A_{r}= \begin{bmatrix} 0 &{} 1 &{} 0 &{} 0\\ 0 &{} 0 &{} 1 &{} 0\\ 0 &{} 0 &{} 0 &{} 1\\ -160000 &{} -32000 &{} -2400 &{} -80\\ \end{bmatrix}. \end{aligned}$$
(21)

The \(A_{r}\) matrix contains the polynomial resulting from locating the desired poles \(P_{d} = (s + 20)^{4}\). Clearing the feedback vector \(K_{f}\) and the proportional constant \(K_{0}\) from (20), we obtain,

$$\begin{aligned} K= & {} [0, -1.0727, -13.406, -3.3737]\\ K_{0}= & {} 160000, \end{aligned}$$

being, \(K = K_{f}T^{-1}\).

The matrix A and B represented in physical variables.

Fig. 12.
figure 12

Block diagram with controller

The Fig. 12, shows the system block diagram with the proposed path, the feedback vector K and the proportional action \(K_{0}\).

Fig. 13.
figure 13

Cart outputs

Fig. 14.
figure 14

Pendulum outputs

The Fig. 13, shows the position and speed of the cart under the action of the controller, it is observed that the cart arrives at the desired position by the trajectory defined in a non-abrupt way and without going back. As for the speed, we see that this increases when the cart is starting and decreases when it is reaching its stationary zone, so that the car remains with a null position error. As for the position and velocity of the pendulum shown in Fig. 14, it can be seen that the controller tries to keep the pendulum at its equilibrium point, it can be seen in the red line that the position has few oscillations, with a maximum amplitude of 0.014 radians (\(0.8063^\circ \)) and minimum of 0.0185 radians (\(-1.0588^\circ \)).

6 Conclusions

Because the defined control required a linear model, it was necessary to linearize the system, which allowed us to work with a model that would not go away largely to the real. The servo system is a type of controller in state space that responds well to perturbations. In addition, this driver guarantees us a null position error. It can be seen from Fig. 8, that the controller responds correctly, since it takes the carriage to the desired position in a good way following the path defined in Eq. (14). The criterion selected for the pole assignment gives good results, since the controller obtained guaranteed all the requirements of position, trajectory and oscillations in the system.