HUNGARIAN JOURNAL OF INDUSTRY AND CHEMISTRY VESZPRÉM Vol. 42(2) pp. 71–77 (2014) THE APPLICATION OF UNKNOWN INPUT ESTIMATORS TO DAMP LOAD OSCILLATIONS OF OVERHEAD CRANES BÁLINT PATARTICSB AND BÁLINT KISS Department of Control Engineering and Information Technology, Budapest University of Technology and Economics, Magyar Tudósok krt. 2, Budapest, 1111, HUNGARY BE-mail: patarticsbalint@gmail.com This paper focuses on the development of state estimation methods for mechanical systems with uncertain frictional pa- rameters. The goal of the study is to provide reliable angle estimation for state-feedback-based crane control solutions, designed to reduce load sway. Cranes are underactuated systems, usually unequipped with the sensors necessary to measure the swinging angle, therefore the damping of their oscillatory behaviour is a challenging task. Two estimators are proposed for the calculation of the unmeasured states. One is based on an ’unknown input Kalman filter’ (UIKF), the other applies the ’unscented Kalman filter’ (UKF) with load prediction. Simulation results are provided to demonstrate the accuracy of the algorithms. Keywords: overhead crane, state estimation, nonlinear systems, unknown inputs, Kalman filter Introduction The sway of the load carried by cranes is an unwanted phenomenon. Friction may decouple load motion from the remaining crane mechanism. This causes difficulty for inexperienced operators, especially when they try to land the cargo. The friction present in the crane mech- anism makes the reduction of the swinging particularly demanding. Therefore the goal of the design of crane con- trol systems is often to ensure minimal swinging along a specified trajectory [1–6]. There are numerous algorithms available in the liter- ature for the solution to this problem. The design of such a control system can be addressed using soft computing methods such as fuzzy logic and neural network with genetic algorithm. These solutions require however the measurement of the load position, which is often based on workspace visualization [1]. Hard commuting techniques are also widely applied for sway reduction. An H2 opti- mal solution is described in Ref.[2], which also relies on image processing for the measurement of the load coordi- nates. There are a variety of algorithms taking advantage of the flatness property (or exact linearizability) of over- head cranes [7]. The control systems in Refs.[3] and [4] consider all the states measurable, however an estimator is proposed in Ref.[3] for the computation of the uncer- tain parameters. In the case of navy cranes, local asymptotic stability can be achieved without the measurement of the swing- ing angle, if trajectory planning exploits the flatness prop- erty of the system [6]. There is also a tracking control algorithm specifically designed for overhead cranes, that is capable of effectively reducing the sway despite the friction [5]. For the calculation of the unmeasured states, this controller uses a linear observer. In this paper we propose new methods of state observation for systems that take into account friction, and are applicable to over- head cranes. These estimators can replace the linear ob- server in Ref.[5] or the need to measure the load coor- dinates in any other state-feedback-based method to en- hance the precision of the control. Our estimation meth- ods are based on the assumption that the effect of the fric- tion on the inputs can be reduced. This is true for most mechanical systems (including overhead cranes), where the actuating signals are usually forces and torques. In the following section, the modelling of Lagrangian mechanical systems is overviewed, and it is shown how the friction can be handled as an input disturbance. In the next section the state estimation techniques are presented based on the possible approaches of interpreting the fric- tion. The next section describes the results of the applica- tion of these methods to the state estimation problem of overhead cranes and presents the simulation results. Lagrangian-Based Models of Mechanical Systems The nonlinear dynamics of the controlled system can be obtained using the Euler-Lagrange equations. If the gen- eralized coordinates are q = ( q1 q2 . . .qn )T and the generalized forces are τ = ( τ1 τ2 . . .τn )T , the Euler- Lagrange equations read d dt ∂L ∂q̇i − ∂L ∂qi = τi, (1) 72 where L is the so-called Lagrangian, the difference be- tween the kinetic and potential energy of the system, q̇i = dqi dt and i = 1, 2, . . .n. Using these equations, under some conditions the controlled system’s model can be written in the form H(q)q̈ + h(q, q̇) + hs(s) = τ, (2) where H(q) is the inertia matrix, h(q, q̇) comprises the centrifugal, Coriolis and gravitational terms, and hs(s) is the frictional term with s being the vector of the fric- tional forces. In this form hs(s) can be reorganized to the right-hand-side of the equation. Introducing the dis- turbance torques as τ̃ = τ −hs(s), Eq.(2) yields H(q)q̈ + h(q, q̇) = τ̃. (3) The state-space representation of the model is ẋ = f(x, u) y = g(x), (4) where x is the state, u is the input, y is the output of the system, and f and g are nonlinear functions. This form can be obtained from Eq.(5) assuming that xT =( qT q̇T ) , and the output is not directly dependent on the torques. The state-space equations read ẋ = ( q̇ −H−1(q)h(q, q̇) ) + ( 0 H−1(q) ) τ̃ y = g(x). (5) The inputs of mechanical systems are usually forces and torques, consequently they are only dependent on τ̃. This means, that the effect of the friction can be reduced to the actuated degrees of freedom of the system. If it is necessary for the design of the control system, the nonlinear dynamics can be approximated by a first order Taylor series expansion around a setpoint (x0, u0). The linear model then becomes δẋ = Aδx + Bδu δy = Cδx, (6) where the quantities prefixed with δ mean the distance from the setpoint, e.g. δx = x−x0, and the matrices are Jacobians [8]. State Estimation Methods Since the friction can be interpreted in our setup as an input disturbance, we consider two ways for its compen- sation in the state estimation. Either all input variables can be disregarded, or the additive disturbance can be es- timated using a load predictor. These ideas form the basis of the two estimator design techniques described as fol- lows. The computations of the controllers implemented in embedded systems are based on sampled signals. Hence the design of the estimators is done in discrete-time. Unknown Input Approach Consider the discrete-time linear stochastic system model x[k + 1] = Φx[k] + Γdd[k] + ω[k] z[k] = Cx[k] + v[k], (7) where x is the state, d is the unknown input (disturbance) of the system and z is the measurement of the output y[k] = Cx[k]. Φ and Γd are obtained from the matrices of Eq.(6) in the form of Φ = eATs, Γd = ∫ Ts 0 eAtB dt, (8) where Ts is the sample time. The measurement and pro- cess noise v and ω are assumed to be additive, white, and Gaussian with mean of zero. Notice, that in Eq.(7), all of the system inputs are considered to be disturbances. The state and the unknown input of such a system can be estimated using an ’unknown input Kalman filter’ (UIKF) [9], if the system satisfies the conditions dim{d}≤ dim{y} (9) rank{C} = dim{y} (10) rank{Γd} = dim{d} (11) rank{CΓd} = dim{d} . (12) Additive Disturbance Approach In the case of input disturbances, load prediction is of- ten applied. Let us introduce the discrete-time nonlinear model of a system in the form x[k + 1] = φ(x[k], ũ[k]) + ω[k] z[k] = g(x[k]) + v[k], (13) where ũ is the disturbed input of the system, and φ and g are nonlinear functions. We will follow the assumption, that the disturbance is additive to the input, thus ũ[k] = u[k] + Λd[k], where u is the vector of actuating signals, and Λ is a constant matrix. We also assume a constant disturbance model with process noise ωd, d[k + 1] = d[k] + ωd[k], resulting in the model x̃[k + 1] = φ̃(x̃[k],u[k]) + ω̃[k] z[k] = g̃(x̃[k]) + v[k]. (14) In Eq.(14) x̃T = ( xT dT ) is the extended state and ω̃T = ( ωT ωTd ) is the extended process noise. The ex- tended nonlinear mappings of the system are given by g̃(x̃[k]) = g(x[k]) and φ̃(x̃[k], u[k]) = ( φ(x[k], u[k] + Λd[k]) d[k] ) . (15) In most cases the continuous-time differential equa- tion of the observed system is available, in the form 73 M uF uC r ` θ J ρ cartwinch m load rail Figure 1: The two-dimensional ovearhead crane of Eq.(4). The discrete-time state-transition equation can then be obtained by φ(x[k], u[k]) = x[k] + (k+1)Ts∫ kTs f(x, u[k]) dt, (16) where the input is piecewise constant and u[k] = u(kTs). If the integral in Eq.(16) cannot be given in closed form and Ts is sufficiently small, the left rectangle rule approx- imation (k+1)Ts∫ kTs f(x, u[k]) dt ≈ Tsf(x[k], u[k]). (17) can be used. Substituting this into Eq.(15), the expression reads φ̃(x̃[k],u[k]) = ( x[k] + Tsf(x[k], u[k] + Λd[k]) d[k] ) . (18) For the observation of the system described by Eq.(14) and Eq.(18) the ’unscented Kalman fil- ter’ (UKF) [10] is applicable. We chose one of the implementation variants of this filter from Ref.[10]. Application of the Methods to Overhead Cranes System Dynamics We will now consider the state estimation problem of the two-dimensional overhead crane (Fig.1). Let us denote the horizontal displacement of the cart by `, the length of the rope by r and the angle between the vertical and the rope by θ. The generalized coordinates of the system are chosen to be q = ( ` r θ )T , and the state is x =( ` r θ ˙̀ ṙ θ̇ )T . Based on the sensors available, the output is y = ( ` r ˙̀ ṙ )T . Overhead cranes is a typical example of underactu- ated systems. It is actuated by two motors, one apply- ing the force uF on the cart, and another delivering the estimated system s Λ + + u u system model s = η(x,ẋ,u) ẋ = f(x,ũ) y = g(x) ũ y∫ẋ x Figure 2: Dynamics of the estimated system torque uC to the winch. The system input consists of these, u = ( uF uC )T . The parameters of the system are the mass of the cart M, the mass of the load m, the moment of inertia of the winch J and the radius of the winch ρ. The acceleration in the gravitational field is denoted by g. The following assumptions are made of the system. • The rope connecting the load to the winch is mass- less and behaves as a rigid rod during the motion. • The load is a point mass. • M, m, J and ρ are known. • In the initial state of the system the unmeasured states are zero: θ = 0 rad and θ̇ = 0 rad/s. • The effect of the aerodynamic resistance is negligi- ble. The Lagrangian of overhead cranes reads L = 1 2 (M + m) ˙̀2 + 1 2 J ρ2 ṙ2 + + 1 2 m ( ṙ2 + r2θ̇2 ) + ml̇ṙ sin θ + ml̇rθ̇ cos θ + mgr cos θ. (19) Using Eq.(1), the model can be written in the form of Eq.(2), where the expressions become H(q) =   ( M + m sin2 θ ) m sin θ 0 m sin θ ( J ρ2 + m ) 0 cos θ 0 r   , (20) h(q, q̇) = −  m(rθ̇2 + g cos θ) sin θmrθ̇2 + mg cos θ −2ṙθ̇ −g sin θ   , (21) hs(s) = −  sFsC 0   , τ =   uF−uC ρ 0   , (22) where sF is the frictional force between the cart and the rail and sC is the frictional force applied to the winch. The continuous-time linear model of the crane is com- puted around the setpoint x0 = ( 0 r0 0 0 0 0 )T , u0 = ( 0 mgρ )T , and sF = sC = 0 is substituted 74 Table 1: Numeric values of the parameters Value Unit M 5 kg m 0.05 kg J 3.802 · 10−4 kg m2 ρ 0.02 m g 9.81 m s−2 Ts 1 ms r0 0.47 m `D 0.5 m into Eq.(5). The resulting Jacobians are A =   0 0 0 1 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0 0 m M g 0 0 0 0 0 0 0 0 0 0 0 −m+M Mr0 g 0 0 0   , B =   0 0 0 0 0 0 1 M 0 0 − ρ mρ2+J − 1 Mr0 0   , C =   1 0 0 0 0 0 0 1 0 0 0 0 0 0 0 1 0 0 0 0 0 0 1 0   . (23) Substituting Eq.(22), the disturbance torque term in Eq.(3) reads τ̃ =   uF + sF−1 ρ (uC −ρsC) 0   . (24) Eq.(24) shows, that the disturbed input of the system can be introduced in the form ũ = u + Λs, where Λ = ( 1 0 0 −ρ ) . (25) The frictional forces usually depend on the actuating signals, state variables, and the derivative of the state as well. The general characteristics of the friction reads as s = η(x, ẋ, u). The block diagram of the dynamics of the system is illustrated in Fig.2. Only the system model block is used for estimator design, which is Eq.(5) if the effect of the friction is disregarded, hs(s) = 0. Proposition 1. The discrete-time linear crane model ob- tained from the matrices in Eq.(23) and using Eq.(8) sat- isfies the design conditions of the UIKF in Eq.(9-12). Proof. It is clear that dim{y} = 4, dim{d} = 2 and rank{C} = 4, thus Eq.(9) and (10) are satisfied. Us- ing Eq.(8) and the numerical values in Table 1, Γd = 10 −2   0.0001 0 0 −0.025 −0.0002 0 0.2 0 0 −49.975 −0.4255 0   , CΓd = 10 −2   0.0001 0 0 −0.025 0.2 0 0 −49.975   . (26) We obtain rank{Γd} = 2 and rank{CΓd} = 2, which are both equal to the number of unknown inputs. This sat- isfies Eqs.(11) and (12). The continuity argument holds for the rank of the matrices in Eq.(26), therefore there ex- ists a neighbourhood around our parameter set where the design conditions are still satisfied. Simulation The estimation results were obtained by simulation of overhead cranes in a closed-loop scenario using a simple discrete-time pole-placement-based linear controller. The simulation also took into account friction. There are var- ious models of the friction phenomenon, ours included Coulomb, Stribeck, viscous friction, and stiction [11]. The numerical values of the parameters used in the simu- lation are given in Table 1. Because of friction, but mainly stiction, the position of the crane can not be accurately controlled without in- tegrators in the controller. Consequently we included the integral of the measurable positions in the controller de- sign as proposed on page 309 of Ref. [8]. The outputs to be integrated are yI = ( ` r )T . In- tegrals of these quantities are approximated by the left rectangle rule as xI[k + 1] = xI[k] + TsyI[k] = xI[k] + TsCIx[k], (27) where CI is defined so that yI[k] = CIx[k]. In our case CI is the first two rows of C in Eq.(23). Using Eq.(27) and Eq.(7) a new system model is introduced in the form x̃[k + 1] = Φ̃x̃[k] + Γ̃u[k] y[k] = C̃x̃[k]. (28) where the expanded state is x̃T = ( xT xTI ) and the matrices are Φ̃ = ( Φ 0 TsCI I ) , Γ̃ = ( Γd 0 ) , and C̃ = ( C 0 ) . (29) For the controller design the process and measurement noises are omitted. 75 ∫ DAC system in Fig. 2 ADC UKF K KI u[k] y y[k]u u0 + +- - + yI D - + xD ADC x[k] x yI [k] = (`[k] r[k]) T y[k] yI [k] x̂[k] ŝ[k] UIKF x̂[k] ˆ̃u[k] u[k] CKF x̂[k] Figure 3: Closed-loop estimation setup used in the simulation 0 1 2 3 4 5 6 7 time [s] −10 0 10 20 30 40 50 60 u F , ˆ̃ u F , [N ] uF UIKF UKF 0 1 2 3 4 5 6 7 time [s] −1.0 −0.5 0.0 0.5 1.0 1.5 2.0 2.5 3.0 3.5 u C , ˆ̃ u C , [N m ] uC UIKF UKF Figure 4: Actuating signals and the estimated inputs of the system We want the state-feedback controller to output u[k] = −K̃x̃[k] = −Kx[k] − KIxI[k]. The gain K̃ can be computed using the eigenvalue placement method implemented in Matlab’s place algorithm: K̃ = place(Φ̃, Γ̃, λ), where λ contains the chosen eigenvalues of the closed-loop system. In continuous time they are −1 + 0.5j, −1 − 0.5j, −5.1, −5.2, −5.3 −5.4, −5.5, and −5.6. The controller gains are K =   100.594 −0.1273 0.6011 −1.6765 −185.407 0.0458 81.4011 −0.0558 0.0562 −0.3166 −4.2257 −0.0195   T , and KI = ( 46.641 1.6026 −0.074 −2.955 ) . (30) The closed-loop setup is illustrated in Fig.3. Here the integration is done using the left rectangle rule, and the 0 1 2 3 4 5 6 7 time [s] −0.1 0.0 0.1 0.2 0.3 0.4 0.5 m e a su re d st a te s [m , m / s] ` r ˙̀ ṙ 0 1 2 3 4 5 6 7 time [s] −0.4 −0.3 −0.2 −0.1 0.0 0.1 0.2 u n m e a su re d st a te s [r a d , ra d / s] θ θ̇ Figure 5: State evolution of the controlled crane using the true states as feedback ADC and DAC blocks are analogue-digital and digital- analogue converters respectively. The DAC uses the zero- order hold method for signal reconstruction. The desired state of the system is xD = ( `D r0 0 0 0 0 )T , `D is the desired position of the cart and yID = CIxD. Since we only want to demonstrate the results of the state estimation, first the real states are fed back to the controller. To compare the accuracy of our me- thods to a traditional solution, the classical Kalman filter (CKF) [12] is also implemented. As a result, the Kalman filters compute the estimated state of the system x̂[k], and they also provide information about the input. The UIKF estimates the friction loaded actuating signals directly, while the UKF estimates the frictional forces superposed to the actuating signals. The actuating signals along with the estimates of the real inputs pro- vided by the filters can be seen in Fig.4. Here, the esti- mated input of the UKF is computed as ˆ̃u = u[k] + Λŝ[k]. Because of friction, the real inputs are estimated to be 76 0 1 2 3 4 5 6 7 time [s] 0.00000 0.00005 0.00010 0.00015 0.00020 0.00025 0.00030 0.00035 ` − ˆ̀ [m ] UIKF UKF 0 1 2 3 4 5 6 7 time [s] −0.001 0.000 0.001 0.002 0.003 0.004 0.005 ˙̀ − ˆ̇ ` [m / s] UIKF UKF Figure 6: Error of the position and velocity estimations much less than the actuating signals. The large offset in Fig.4 is a consequence of the stiction, the cart will not move until uF becomes greater than a certain value (in our case about 28 N). When the cart finally stops mov- ing, the fluctuation of uF tries to counter the load sway, during which the measured states do not change. This is the reason why the estimators find the input to be zero. Fig.5 shows the transient of the states in a closed- loop. Results show that the controller can bring the sys- tem into the desired state, but friction prevents it from stopping the low amplitude swinging of the load, because it makes quick, short motions impossible. Error estimates are illustrated by Figs. 6 and 7. In all cases, the error be- comes zero when the crane reaches the desired state. This is not true for the angle and its derivative in Fig.8. The error decreases at the end of the state transient, but does not become zero. When the cart stops and the load swings, the measurements are all constant thus they carry no information regarding θ and θ̇. In these situations the cart and winch are usually also motionless due to fric- tion. Consequently, the estimation error of these quanti- ties never becomes zero. It is possible to decrease the estimation error using two laser slot sensors. With the help of such devices, θ can be measured accurately in two positions and through the application of proper sensor fusion techniques the es- timation of the angle can become more precise in between the chosen positions as well. In Fig.9 the estimation error of θ and θ̇ is illustrated using CKF. The filter was designed for the dynamics given by Eq.(7) except that it does not consider the inputs unknown. The results show that the error is substantially higher than in the case of the UIKF or UKF. 0 1 2 3 4 5 6 7 time [s] −0.00005 0.00000 0.00005 0.00010 0.00015 r − r̂ [m ] UIKF UKF 0 1 2 3 4 5 6 7 time [s] −0.0010 −0.0005 0.0000 0.0005 0.0010 0.0015 0.0020 0.0025 0.0030 0.0035 ṙ − ˆ̇ r [m / s] UIKF UKF Figure 7: Error of the rope length and hoisting velocity estimations 0 1 2 3 4 5 6 7 time [s] −0.003 −0.002 −0.001 0.000 0.001 0.002 0.003 0.004 0.005 θ − θ̂ [r a d ] UIKF UKF 0 1 2 3 4 5 6 7 time [s] −0.020 −0.015 −0.010 −0.005 0.000 0.005 0.010 0.015 0.020 0.025 θ̇ − ˆ̇ θ [r a d / s] UIKF UKF Figure 8: Error of the angle and angular velocity estimations Fig.8 shows the estimation error of the UKF to be less. We applied this estimator in a closed-loop scenario identical to the one presented in Fig.3, but instead of x[k] the x̂[k] of the UKF was used in the feedback loop. The state evolution of the crane in this simulation is illustrated in Fig.10. The system’s behaviour is only slightly differ- ent from the case when the actual states were used in the feedback control in Fig.5. 77 0 1 2 3 4 5 6 7 time [s] −0.2 0.0 0.2 0.4 0.6 0.8 1.0 1.2 1.4 θ − θ̂ [r a d ] 0 1 2 3 4 5 6 7 time [s] −5 −4 −3 −2 −1 0 1 2 3 θ̇ − ˆ̇ θ [r a d / s] Figure 9: Error of the angle and angular velocity estimations using CKF Conclusion It was shown that in most mechanical systems the dis- turbing effect of friction can be reduced to the actuating signals. Based on this statement, two estimation meth- ods were provided for the computation of the unmeasured states. One of these techniques considers the inputs com- pletely unknown and uses UIKF for the estimation. The other algorithm treats the inputs as distorted by an addi- tive disturbance, and applies UKF with a load predictor extension. Simulation results in a closed-loop controlled scenario were provided to prove the applicability of the concepts. It was also pointed out, that the precision of the estimators could be improved using laser slot sensors. This will be the subject of a forthcoming paper. REFERENCES [1] HYLA P.: The crane control systems: A survey, Proc. 17th Int. Conf. Methods and Models in Au- tomation and Robotics (MMAR), 2012, 505–509 [2] SCHINDELE D., MENN I., ASCHEMANN H.: Non- linear optimal control of an overhead travelling crane, Proc. 18th IEEE Int. Conf. Control Applica- tions, 2009, 1045–1050 [3] BOUSTANY F., D’ANDREA NOVEL B.: Adap- tive control of an overhead crane using dynamic feedback linearization and estimation design, Proc. IEEE Int. Con. Robotics and Automation, 1992, 1963–1968 0 1 2 3 4 5 6 7 time [s] −0.1 0.0 0.1 0.2 0.3 0.4 0.5 m e a su re d st a te s [m , m / s] ` r ˙̀ ṙ 0 1 2 3 4 5 6 7 time [s] −0.4 −0.3 −0.2 −0.1 0.0 0.1 0.2 u n m e a su re d st a te s [r a d , ra d / s] θ θ̇ Figure 10: State evolution of the controlled crane using the UKF’s estimated states as feedback [4] NEUPERT J., HILDEBRANDT A., SAWODNY O., SCHNEIDER K.: Trajectory tracking for boom cranes using a flatness based approach, Proc. Int. Joint Conf. SICE-ICASE, 2006, 1812–1816 [5] RÓZSA T., KISS B.: Tracking control for tow- dimensional overhead crane, Proc. 8th Int. Conf. Informatics in Control, Automation, and Robotics, ICINCO, 2011, 1, 427–432 [6] KISS B., LEVINE J., MULLHAUPT P.: A simple output feedback PD controller for nonlinear cranes, Proc. 39th IEEE Conference on Decision and Con- trol, 2000, 5, 5097–5101 [7] KISS B., LÉVINE J., MÜLLHAUPT P.: Modelling, flatness and simulation of a class of cranes, Electri- cal Engineering, 1999, 43, 215–225 [8] LANTOS B.: Theory and design of control systems I., Akadémia Kiadó, 2001 (in Hungarian) [9] DAROUACH M., ZASADZINSKI M., ONANA A.B., NOWAKOWSKI S.: Kalman filtering with unknown inputs via optimal state estimation of singular sys- tems, Int. J. Sys. Sci., 1995, 26(10), 2015–2028 [10] HAYKIN S.S.: Kalman filtering and neural net- works, John Wiley & Sons, Inc., 2001 [11] ARMSTRONG-HÉLOUVRY B., DUPONT P., DE WIT C.C.: A survey of models, analysis tools and compensation methods for the control of machines with friction, Automatica, 1994, 30, 1083–1138 [12] KALMAN R.E.: A new approach to linear filtering and prediction problems, Journal of basic Engineer- ing, 1960, 82, 35–45