Control of rotary cranes using fuzzy logic

Rotary cranes (tower cranes) are common industrial structures that are used in building construction, factories, and harbors. These cranes are usually operated manually. With the size of these cranes becoming larger and the motion expected to be faster, the process of controlling them has become difficult without using automatic control methods. In general, the movement of cranes has no prescribed path. Cranes have to be run under different operating conditions, which makes closed-loop control attractive. In this work a fuzzy logic controller is introduced with the idea of “split-horizon”; that is, fuzzy inference engines (FIE) are used for tracking the position and others are used for damping the load oscillations. The controller consists of two independent sub-controllers: radial and rotational. Each of these controllers has two fuzzy inference engines (FIE). Computer simulations are used to verify the performance of the controller. Three simulation cases are presented. In the first case, the crane is operated in the gantry (radial) mode in which the trolley moves along the jib while the jib is fixed. In the second case (rotary mode), the trolley moves along the jib and the jib rotates. In the third case, the trolley and jib are fixed while the load is given an initial disturbance. The results from the simulations show that the fuzzy controller is capable of keeping the load-oscillation angles small throughout the maneuvers while completing the maneuvers in relatively reasonable times. Nomenclature rd(t) Radial distance desired by the operator. ra(t) Actual radial distance. Er(t) Radial distance error. r̈(t) Radial acceleration. γd(t) Rotational angle desired by the operator. γa(t) Actual rotational angle. Eγ(t) Rotational angle error. γ̈(t) Rotational acceleration. φ(t) In-plane angle. θ(t) Out-of-plane angle. P Positive. N Negative. L Large. ∗Corresponding author. Tel.: +1 540 231 5453; FAx: +1 540 231 2290; E-mail: anayfeh@vt.edu. M Medium. S Small.


Introduction
The crane can be considered as one of the most important tools used in industry to transfer loads and cargo from one spot to another.Usually cranes have very strong structures in order to lift heavy payloads in factories, in building construction, on ships, and in harbors.In factories, cranes speed up the production processes by moving heavy materials to and from the factory as well as moving the products along production or assembly lines.In building construction, cranes facilitate the transport of building materials to high and critical spots.Similarly on ships and in harbors, cranes save time and consequently money in making the process of loading and unloading ships fast and efficient.Until recently, cranes were manually operated.But since cranes are becoming larger and are being moved at high speeds, their manual operation is becoming increasingly difficult.Consequently, methods of automating their operations are being sought [1].
Several researchers have investigated the control of rotary cranes.Parker et al. [2,3] presented several input-shaping techniques to bring the load to rest at the end point of a predefined motion profile.However, oscillations up to 10 • developed during maneuvers for given profiles using these techniques.Parker et al. [4] Operator Console     presented another controller based on filtering the input signal commanded by the operator.The controller used a notch filter to eliminate the components of the slew and travel inputs that happen to be at the natural frequency of the payload pendulum.Even though experimental results showed reduced load pendulations throughout the travel, a delay of up to 2.5 seconds occurred between the operator input and the actual input from the filter to the cranes.This delay produces incon-venience to the operator.It can also cause confusion in case of accidental inputs.Moreover, because the notch filter is dependent on the length of the hoisting cable, the roll off factor of the filter must be computed each time the cable length is changed.Furthermore, the input shaping and the notch filter controllers are open-loop controllers, which make them inefficient in the presence of external disturbances.

FIE I Tracking
As an example of closed-loop controllers, Golaf-  shani et al. [5] generated time optimal trajectories of the jib, the trolley, and the cable length.A bang-bang controller was then used to track these optimal trajectories.Computer simulations showed uncontrolled load pendulations.To attain better results, they relaxed the constraint on time to 110% of the optimal value and obtained reduction in the payload pendulations.Even with this modification, significant pendulations persisted throughout the maneuver.
Although the following discussion is directed at oth-   er types of cranes, it is useful and relevant to the design of controllers.Henry [6], Henry et al. [7], and Masoud et al. [8] developed a time-delayed position feedback controller.The controller targeted boom cranes with base excitations.The controller forces the suspension point of the payload to follow an operator commanded motion to which a correction is added.The correction consists of a time-delayed percentage of the payload motion relative to the suspension point.The controller showed fast maneuvering time and low load oscillations throughout and at the end of the maneuvers.Nally and Trabia [9] applied a distributed fuzzy logic controller to a bidirectional gantry crane.They introduced the idea of using two separate fuzzy controllers each of which has two fuzzy inference engines: one to track the desired position commanded by the operator and another to correct for payload oscillations.After performing all of the required calculations, the outputs of the two   engines are combined to obtain the final control signal.The controller was used to drive the crane along a path generated by an input-shaping strategy.They obtained good results for damping the oscillations and at the same time reducing the payload travel time.In this paper, we extend this work to rotary cranes in which both the trolley and jib are allowed to move.

Mathematical modeling
To derive the equations of motion, one needs to define clearly the system parameters.As shown in Fig. 1, a right-handed Cartesian coordinate system xyz is centered at a reference point that lies in the plane of the jib at the center of the crane tower, with its positive z-axis being along the tower upward axis.The xand y-axes are in the plane of the jib, with the x-axis being along the jib.The xyz coordinate system is attached to the moving jib.The jib rotates and traces an angle γ(t).The trolley moves on the jib with its position r(t) being the distance measured from the reference point of the xyz coordinate system to the suspension point of the payload cable on the trolley.The angle γ(t) and the radial distance r(t) are the inputs to the system.They are used to control the system behavior.We model the load as a point mass.The interaction between the load and crane dynamics is neglected because the mass of the crane is very large compared to that of the load.Moreover, the damping in the system is very small and hence we neglect it in the model.Including this damping would slightly improve the performance of the controller.
We start by defining the velocity and acceleration of the trolley in the jib-fixed coordinate system as The angular velocity and acceleration of the jib are The load pendulations are characterized by the two angles φ and θ, as shown in Fig. 2. The angle φ is the angle which the cable makes with the z−axis in the xz−plane.The out-of-plane angle θ is the angle which the cable makes with the xz−plane.So it is clear now that the objective of the controller is to move the payload while keeping φ and θ as small as possible.
The first step in deriving the equation of motion using the Lagrangian approach is to find the position P (t) of the load with respect to the reference point O.In the jib-fixed coordinate system, the load position is To determine the kinetic energy of the load, we need to determine the velocity Ṗ (t) of the load.Since the jib is moving, The kinetic and potential energies of the load are given by ) Finally, the Euler Lagrange equation corresponding to the Lagrangian L  where x 1 = θ and x 2 = φ.With the assumption that the cable length is constant, this yields the following two nonlinear equations of motion:

Controller design
As shown in Fig. 3, we start with the input signals from the operator.These signals represent the desired radial position r d (t) and rotational angle γ d (t).These two signals can be read from the operator's handle (joy stick).The fuzzy controller receives four other inputs from the feedback loop: the actual radial distance r a (t), the actual rotational angle γ a (t), the in-plane angle φ(t), and the out-of-plane angle θ(t).The fuzzy logic controller (FLC) generates the radial and rotational accelerations, which are input to the system dynamics block.Two separate controllers are employed.One is radial, which takes care of the transverse motion of the trolley over the jib; and the other is rotational, which handles the rotational motion of the jib.
Two fuzzy inference engines (FIE) are used inside each controller, Fig. 4. The first is a tracking FIE, which has the desired and actual radial distances as inputs for the radial controller and the desired and actual rotational angles as input for the rotational controller.The second is an oscillation damping FIE, which has the in-plane angle φ as an input for the radial controller and the out-of-plane angle θ as input for the rotational   Fig. 18.In-plane angle φ(t) for the gantry case using the fuzzy controller.]Uncontrolledvs controlled in-plane oscillation angle φ(t) for the gantry case using the fuzzy controller.
controller.The outputs of the two FIEs are input to a variable-share mixing block, where the output from the tracking FIE is multiplied by a factor K and the oscillation damping FIE output is multiplied by 1 − K.Then, the scaled outputs are added to obtain the controller output (acceleration).The gain K is assigned a fixed value by trial and error.However, it can be varied or it can be changed by the operator according to the current conditions of transportation.Care must be exercised in the choice of K because some values might lead to instability.The output of the radial controller is rReference (t), and the output of the rotational controller is γReference (t).

Radial (Gantry) Mode of Operation
This controller determines the radial acceleration of the trolley, which is fed to the system dynamics block to find the response.The outputs of the following FIEs are mixed with a gain K Radial = 0.8.

Tracking FIE:
This FIE has the actual radial distance r a (t) and the desired radial distance r d (t) and their derivatives ṙa (t) and ṙd (t).Its output is rTrack .Before applying the fuzzy rules, we calculate two variables, the radial distance error E r (t) and its derivative as follows: (10) Then, they are fuzzified using the fuzzy sets shown in Figs. 5 and 6, and subsequently the rules in Table 1 are applied in order to find rTrack .The rules in Table 1 are generic fuzzy PD controller rules, which are similar to those used by Nally and Trabia [9].As a result of applying the previous rules, we have a fuzzy notion of the output variable rTrack , which is transformed into a crisp value using the centroid method.Figure 7 shows the fuzzy sets of rTrack .

Oscillation Damping FIE:
In this FIE, the input variables are φ(t) and φ(t).The rules here are based on imitating a quarter-period delay controller [6][7][8].It tries to position the trolley over the load in order to any oscillations.The inputs to the FIE are fuzzified using the fuzzy sets shown in Fig. 8 and 9. Similarly, the fuzzy rules in Table 2 are now applied to find rCorrection .After applying the rules, again we defuzzify the output in order to find rCorrection .Figure 10 shows the fuzzy sets of rCorrection .Now, the output of this controller can be found by rReference (t) = (11) 0.8 × rTrack + 0.2 × rCorrection

Rotary Mode of Operation
Similar to the radial controller, the rotary controller also consists of two FIEs.It was found that a good value for the mixing gain K Rotational = 0.6 .This lower value shows that it takes more control action to damp the out-of-plane angle θ(t) than the in-plane angle φ(t), which is expected because any attempt to reduce any out-of-plane oscillations induces in-plane ones, thus causing more problems.

Tracking FIE:
Here the FIE has the actual rotational angle γ a (t), the desired rotational angle γ d (t), and their derivatives γa (t) and γd (t).The FIE output is γTrack .Before applying the fuzzy rules, we calculate two other variables, the rotational angle error E γ (t) and its derivative as follows: E γ (t) = γ d (t) − γ a (t) and ( 12) These are fuzzified using the fuzzy sets shown in Figs 11 and 12.The rules in Table 3 are applied to calculate γTrack .After applying the rules, we obtain the output variable γTrack in a fuzzy format, which is transformed into a crisp value using the centroid method.Figure 13 shows the fuzzy sets of γTrack .Now, the output of this controller can be found according to γReference (t) (13) = 0.6 × γTrack + 0.4 × γCorrection

Oscillation Damping FIE:
For the oscillation damping FIE, the input variables are θ(t) and θ(t).The rules here are based on the same concept used for the radial controller.The inputs to the FIE are fuzzified using the fuzzy sets shown in Figs. 14  and 15.Again the fuzzy rules in Table 4 are now applied to find γCorrection .Finally, after applying the rules, we defuzzify the output in order to find γ T rack .Figure 16 shows the fuzzy sets of γCorrection .

Simulation results
To test the performance of the designed controller, we used the MATLAB software and its Fuzzy Logic Toolbox (V1.0).The toolbox provided a user friendly Graphical User Interface (GUI), which made the testing faster and more efficient.

Radial (gantry) case
In this case, the cable length is set equal to 1.0 m, and the trolley is moved radially 0.75 m from r = 0.25 m to r = 1.0 m.The trolley accelerates for 3/8th of the payload period 0.75 s, moves at a constant velocity of 0.23078 m/s for 2.5 s, and decelerates for another 0.75 s, Fig. 17.The whole operation is executed within 4.0 s.The acceleration amplitude is 0.3077 m/s 2 .In Fig. 18, we compare the controlled and uncontrolled inplane oscillation angle associated with this movement.
In the uncontrolled response, the oscillations continue with an amplitude of 6 • without any damping.In fact, the uncontrolled payload oscillates with an amplitude of 3 • after the acceleration period.When the deceleration occurs, it adds more energy to the payload oscillations, thereby raising the amplitude of oscillations to 6 • .Closing the loop, we note that the initial kick of the in-plane angle is less than 2 • during the acceleration phase and about −2 • during the deceleration phase.We also note that the oscillations are damped within approximately 5 s.The controller has no effect on the rotational angle γ(t) and the out-of-plane oscillation angle θ(t).We also note that it takes about 15 s for the trolley to reach the end position, even though the oscillations are damped within 5 s.sition is somewhat large, about 7 cm.The trolley lags the operator command at the beginning, then catches up with it with an under-damped response.We note that the steady-state error is zero.So we conclude that the performance of the controller is good.

Rotary case
In this case, a combination of the radial and rotational motions is applied.The jib is accelerated for 0.75 s, is rotated at 0.38 rad/s for 3.5 s, and then is decelerated for 0.75 s.The trolley is moved on the jib a distance of 0.75 m and the jib is rotated 90 • around the tower.We compare in Figs 21 and 22 the controlled and uncontrolled in-plane and out-of-plane angles.In the uncontrolled case, energy is being continuously exchanged between the two modes of oscillation due to the one-to-one internal resonance between them.The in-plane angle grows to more than 7 • in 40 s, whereas the out-of-plane angle reaches more than 9 • in 5 s.Figures 21 and 22 show that the oscillation period of the payload is 2 s.
Closing the loop results in a significant reduction in both angles.The in-plane angle grows to about 2.5 • in the deceleration phase, but it then decreases to almost zero within 10 s.On the other hand, the out-of-plane angle increases initially to almost 5 • before it decays to almost zero in 25 s.This settling time is considered long for such a small model.
Figure 23 shows the radial distance of the trolley on the jib.A problem that is clear here is that the overshoot is large, about 20 cm.With this large overshoot, the trolley takes more than 15 s to reach its end position, which is a long time for such a small model.As for the rotational angle of the jib, its overshoot is reasonable, about 8 • .But Fig. 24 shows that it also takes a long time to settle like the trolley, about 12 s.

Influence of Initial Disturbances
In this case, we investigate the effectiveness of the controller to damp initial disturbances.We start with an initial disturbance of 75 • for each of the oscillation angles θ(t) and φ(t).The trolley is placed at a distance of 1.0 m on the jib to magnify the oscillation effect.In Figs. 25 and 26, we compare the controlled and uncontrolled in-plane and out-of-plane motions.Because the model does not include damping, the uncontrolled angles continue to oscillate with an amplitude of 75 • forever.On the other hand, applying the controller, we find that the in-plane motion decays below 10 • after 8 s and to almost zero within 20 s.In contrast, the damping of the out-of-plane motion is much slower.It takes about 18 s for this motion to decay below 10 • and it takes about 25 s for it to decay to almost zero.
In Figs.27 and 28, we show the deviations of the trolley position and the rotational angle of the jib from their desired values.The maximum deviation of the trolley from the desired distance (1.0 m) is about 10 cm, which is small.Moreover, the maximum swing of the rotational angle of the jib to damp the oscillations is less than 10 • , which is also considered to be small.Even though the time taken to damp these large initial disturbances is somewhat long, the trolley and jib deviations needed to damp these oscillations are considered to be small.

Conclusion
Computer simulations show that the fuzzy logic controller is capable of controlling the operations of both gantry and rotary cranes.The controller is also capable of maintaining the oscillations angles very small throughout the maneuvers.Even though the controller damps the initial kicks in the in-plane and out-of-plane angles quickly, it takes more time for the trolley to reach its end position.In addition, the controller is also effective in damping disturbances with small deviations for the trolley and the jib from their rest positions.
Further investigations can consider the use of different membership functions, such as the Gaussian function, and the modification of the rules and the structure of the rotational FIE to account for the coupling between the radial and rotational motions.Also, since the error in the radial position turned out to be small, a reduction in the range of the radial error membership functions can be considered.
Position, In-Plane & Out-of-Plane Angles

Fig. 19 .Fig. 20 .
Fig.19.Radial distance for the gantry case using the fuzzy controller.]Desired and actual radial distances for the gantry case using the fuzzy controller.

Fig. 23 .Fig. 24 .
Fig. 23.Desired and actual radial distances for the compound case using the fuzzy controller.

Fig. 27 .Fig. 28 .
Fig. 27.Desired and actual radial distances for the damping case using the fuzzy controller.
Nomenclature r d (t) Radial distance desired by the operator.r a (t) Actual radial distance.E r (t) Radial distance error.r(t) Radial acceleration.γ d (t) Rotational angle desired by the operator.γ a (t) Actual rotational angle.E γ (t) Rotational angle error.