Hybrid Fuzzy Logic Control with Input Shaping for Input Tracking and Sway Suppression of a Gantry Crane System 1

Problem statement: Most of the common gantry crane results in a sway motion when transporting the load as fast as possible. In addition, precise cart position control of gantry crane must required a zero or near zero residual sway. Approach: In this study, the development of hybrid control schemes for input tracking and anti-sway control of a gantry crane system was investigated. To study the effectiveness of the controllers, a Proportional-Derivative (PD)-type fuzzy logic control was developed for cart position control of a gantry crane. It was then extended to incorporate input shaper control schemes for anti-sway control of the system. The positive and new modified Specified Negative Amplitude (SNA) input shapers were designed based on the properties of the system for control of system sway. The new SNA was proposed to improve the robustness capability while increasing the speed of the system response. Results: Simulation results of the response of the gantry crane with the controllers were presented in time and frequency domains. The performances of the of the hybrid control schemes were examined in terms of input tracking capability, level of sway reduction and robustness to parameters uncertainty. Conclusion: A significant reduction in the system sways had been achieved with the hybrid controllers regardless of the polarities of the shapers.


INTRODUCTION
The main purpose of controlling a gantry crane is transporting the load as fast as possible without causing any excessive sway at the final position. However, most of the common gantry crane results in a sway motion when payload is suddenly stopped after a fast motion. The sway motion can be reduced but will be time consuming. Moreover, the gantry crane needs a skilful operator to control manually based on his or her experiences to stop the sway immediately at the right position. The failure of controlling crane also might cause accident and may harm people and the surrounding.
The requirement of precise cart position control of gantry crane implies that residual sway of the system should be zero or near zero. Over the years, investigations have been carried out to devise efficient approaches to reduce the sway of gantry crane. The considered sway control schemes can be divided into two main categories: Feed-forward control and feedback control techniques. Feed-forward techniques for sway suppression involve developing the control input through consideration of the physical and swaying properties of the system, so that system sways at dominant response modes are reduced. This method does not require additional sensors or actuators and does not account for changes in the system once the input is developed. On the other hand, feedback-control techniques use measurement and estimations of the system states to reduce sways. Feedback controllers can be designed to be robust to parameter uncertainty. For gantry crane, feed-forward and feedback control techniques are used for sway suppression and cart position control respectively. An acceptable system performance without sway that accounts for system changes can be achieved by developing a hybrid controller consisting of both control techniques. Thus, with a properly designed feed-forward controller, the complexity of the required feedback controller can be reduced.
Various attempts in controlling gantry cranes system based on feed-forward control schemes were proposed. For example, open loop time optimal strategies were applied to the crane by many researchers such as discussed in [1] . They came out with poor results because feed-forward strategy is sensitive to the system parameters (e.g., rope length) and could not compensate for wind disturbances. Another feedforward control strategy is input shaping [2][3][4] . Input shaping is implemented in real time by convolving the command signal with an impulse sequence. The process has the effect of placing zeros at the locations of the flexible poles of the original system. An IIR filtering technique related to input shaping has been proposed for controlling suspended payloads [5] . Input shaping has been shown to be effective for controlling oscillation of gantry cranes when the load does not undergo hoisting [6,7] . Experimental results also indicate that shaped commands can be of benefit when the load is hoisted during the motion [8] .
Investigations have shown that with the input shaping technique, a system response with delay is obtained. To reduce the delay and thus increase the speed of the response, negative amplitude input shapers have been introduced and investigated in vibration control. By allowing the shaper to contain negative impulses, the shaper duration can be shortened, while satisfying the same robustness constraint. A significant number of negative shapers for vibration control have also been proposed. These include negative Unity-Magnitude (UM) shaper, Specified-Negative-Amplitude (SNA) shaper, negative Zero-Vibration (ZV) shaper, negative Zero-Vibration-Derivative (ZVD) shaper and negative Zero-Vibration-Derivative-Derivative (ZVDD) shaper [9][10][11] . Comparisons of positive and negative input shapers for vibration control of a single-link flexible manipulator have also been reported [11] .
On the other hand, feedback control which is well known to be less sensitive to disturbances and parameter variations [12] is also adopted for controlling the gantry crane system. Recent research on gantry crane control system was presented by [13] . The author had proposed proportional-derivative PD controllers for both position and anti-sway controls. Furthermore, a fuzzy-based intelligent gantry crane system has been proposed [14] . The proposed fuzzy logic controllers consist of position as well as anti-sway controllers. However, most of the feedback control system proposed needs sensors for measuring the cart position as well as the load sway angle. In addition, designing the sway angle measurement of the real gantry crane system, in particular, is not an easy task since there is a hoisting mechanism.
This study presents investigations into the development of hybrid control schemes for input tracking and anti-sway control of a gantry crane system. A nonlinear overhead gantry crane system is considered and the dynamic model of the system is derived using the Euler-Lagrange formulation. Hybrid control schemes based on feed-forward with collocated feedback controllers are investigated. In this study, feed-forward control based on input shaping with positive Zero-Sway-Derivative-Derivative (ZSDD) input shapers and new modified SNA Zero-Sway-Derivative-Derivative (ZSDD) input shapers are considered. A new modified shaper from the previous SNA input shapers [11] is proposed where more negative impulses are added to improve the robustness of the controller while increasing the speed of the system response. To demonstrate the effectiveness of the proposed control schemes, a PD-type Fuzzy Logic controller is developed for control of cart motion of the gantry crane. This is then extended to incorporate the proposed input shapers for control of sway of hoisting rope. Simulation exercises are performed within the gantry crane simulation environment. Performances of the developed controllers are examined in terms of input tracking capability, level of sway reduction and robustness to errors in sway frequency. In this case, the robustness of the hybrid control schemes is assessed with up to 30% error tolerance in sway frequencies. Simulation results in time and frequency domains of the response of the gantry crane to the unshaped input and shaped inputs with positive and modified SNA input shapers are presented. Moreover, a comparative assessment of the effectiveness of the hybrid controllers with positive and negative input shapers in suppressing sway and maintaining the input tracking capability of the gantry crane is discussed. The gantry crane system: The two-dimensional gantry crane system with its payload considered in this study is shown in Fig. 1, where x is the horizontal position of the cart, l is the length of the rope, θ is the sway angle of the rope, M and m is the mass of the cart and payload respectively. In this simulation, the cart and payload can be considered as point masses and are assumed to move in two-dimensional, x-y plane. The tension force that may cause the hoisting rope elongate is also ignored. In this study the length of the cart, l = 1.00 m, M = 2.49 kg, m = 1.00 kg and g = 9.81 m s −2 is considered.
Modeling of the gantry crane: In this research, the mathematical modeling of the gantry crane system is considered as a basis of a simulation environment for development and assessment of the input shaping control techniques. The Euler-Lagrange formulation is considered in characterizing the dynamic behavior of the crane system incorporating payload. Considering the motion of the gantry crane system on a two-dimensional plane, the kinetic energy of the system can thus be formulated as: The potential energy of the beam can be formulated as: To obtain a closed-form dynamic model of the gantry crane, the energy expressions in (1) and (2)  . Using Lagrangian's equation: the equation of motion is obtained as: 2ml cos ml sin F (M m)x ml( cos sin ) 2ml cos ml sin l 2l x cos g sin 0 In order to eliminate the nonlinearity equation in the system, a linear model of gantry crane system is obtained. The linear model of the uncontrolled system can be represented in a state-space form as shown in Eq. 6 by assuming the change of rope and sway angle are very small: x Ax Bu and the matrices A and B are given by:

MATERIALS AND METHODS
PD-type fuzzy logic control scheme: Fuzzy control can be viewed as a way of converting expert knowledge into an automatic control strategy without a detailed knowledge of the plant. The input is first fuzzified and then processed by the fuzzy inference engine using heuristic decision rules. FLC uses rules in the form of ''IF [condition] THEN [action]'' to linguistically describe the input/output relationship. The membership functions convert linguistic terms into precise numeric values. The output of the fuzzy controller is obtained by a defuzzification process that converts the fuzzy quantities representing the control signal into a signal that can be used as the control input to the plant. A PD-type fuzzy logic controller utilizing hub angle and hub velocity feedback is developed to control the rigid body motion of the system [15] . The hybrid fuzzy control system proposed in this study is shown in Fig. 2, where R f is the reference horizontal position, x and x & represent horizontal position and velocity of the cart, respectively, θ and θ & represent swing angle and swing velocity, respectively, whereas k 1 , k 2 and k 3 are scaling factors for two inputs and one output of the fuzzy logic controller used with the normalized universe of discourse for the fuzzy membership functions. In this study, the triangular membership functions are chosen for inputs and output. Normalized universes of discourse are used for both hub angle and velocity and output torque. Scaling factors k 1 and k 2 are chosen in such a way as to convert the two inputs within the universe of discourse and activate the rule base effectively, whereas k 3 is selected such that it activates the system to generate the desired output. Initially all these scaling factors are chosen based on trial and error. To construct a rule base, the cart position error, cart position error derivative and force input are partitioned into five primary fuzzy sets as [15] : where E, V and U are the universes of discourse cart position, cart velocity and force input, respectively. The nth rule of the rule base for the FLC, with cart position error and derivative of cart position error as inputs, is given by: where, R n , n = 1, 2,…N max is the nth fuzzy rule, E i , V j and U k , for i, j, k = 1,2,…,5 are the primary fuzzy sets.
A PD-type fuzzy logic controller was designed with 11 rules as a closed loop component of the control strategy for maintaining the cart position of gantry crane system while suppressing the swaying effect. The rule base was extracted based on underdamped system response and is shown in Table 1. The three scaling factors, k 1 , k 2 and k 3 were chosen heuristically to achieve a satisfactory set of time domain parameters. These values were recorded as, k 1 = 0.05, k 2 = 0.001 and k 3 = -350.
INPUT shaping control schemes: Input shaping technique is a feed-forward control technique that involves convolving a desired command with a sequence of impulses known as input shaper.  The shaped command that results from the convolution is then used to drive the system. Design objectives are to determine the amplitude and time locations of the impulses, so that the shaped command reduces the detrimental effects of system flexibility. These parameters are obtained from the natural frequencies and damping ratios of the system. Thus, sway reduction of a gantry crane system can be achieved with the input shaping technique. Figure 3 shows the input shaping process. Several techniques have been investigated to obtain an efficient input shaper for a particular system. A brief description and derivation of the control technique is presented in this study. Generally, a vibratory system of any order can be modeled as a superposition of second order systems each with a transfer function: Where: ω = The natural frequency of the vibratory system ζ = The damping ratio of the system Thus, the response of the system in time domain can be obtained as: where, A and t 0 are the amplitude and the time location of the impulse respectively. The response to a sequence of impulses can be obtained by superposition of the impulse responses. Thus, for N impulses, with ( ) Where:

A i and t i = The amplitudes and time locations of the impulses
The residual single mode sway amplitude of the impulse response is obtained at the time of the last impulse, t N as: Where: To achieve zero sway after the last impulse, it is required that both V 1 and V 2 in Eq. 11 are independently zero. This is known as the zero residual sway constraints. In order to ensure that the shaped command input produces the same rigid body motion as the unshaped reference command, it is required that the sum of amplitudes of the impulses is unity. This yields the unity amplitude summation constraint as: In order to avoid response delay, time optimality constraint is utilized. The first impulse is selected at time t 1 = 0 and the last impulse must be at the minimum, i.e., min (t N ). The robustness of the input shaper to errors in natural frequencies of the system can be increased by taking the derivatives of V 1 and V 2 to zero. Setting the derivatives to zero is equivalent to producing small changes in sway corresponding to the frequency changes. The level of robustness can further be increased by increasing the order of derivatives of V 1 and V 2 and set them to zero. Thus, the robustness constraints can be obtained as: Both the positive and modified SNA input shapers are designed by considering the constraints Eq.s. The design of the positive and modified SNA input shapers is further discussed in this investigation.

Positive input shaper:
The positive input shapers have been used in most input shaping schemes. The requirement of positive amplitude for the impulses is to avoid the problem of large amplitude impulses. In this case, each individual impulse must be less than one to satisfy the unity magnitude constraint. In order to increase the robustness of the input shaper to errors in natural frequencies, the positive ZSDD input shaper is designed by setting the second derivatives of V 1 and V 2 in Eq. 11 to zero. Simplifying The positive ZSDD input shaper, i.e., four-impulse sequence is obtained by setting Eq. 11 and 14 to zero and solving with the other constraint Eq.s. Hence, a four-impulse sequence can be obtained with the parameters as: Where: 2 1 K e −ζπ −ζ = 2 d n 1 ω = ω − ζ ω n and ζ representing the natural frequency and damping ratio respectively. For the impulses, t j and A j are the time location and amplitude of impulse j respectively.
Modified SNA input shapers: Input shaping techniques based on positive input shaper have been proved to be able to reduce sway of a system. In order to achieve higher robustness, the duration of the shaper is increased and thus, increases the delay in the system response. By allowing the shaper to contain negative impulses, the shaper duration can be shortened, while satisfying the same robustness constraint.
To include negative impulses in a shaper requires the impulse amplitudes to switch between 1 and -1 as: The constraint in Eq. 16 yields useful shapers as they can be used with a wide variety of inputs. For a UM negative ZS shaper, i.e. the magnitude of each impulse is |1|, the shaper duration is one-third of the vibration period of an undamped system, while the shaper duration for the positive shaper is half of the vibration period. However, the increase in the speed of system response achieved using the SNA input shapers is at the expense of some tradeoffs and penalties. The shapers containing negative impulses have tendency to excite unmodeled high modes and they are slightly less robust as compared to the positive shapers. Besides, negative input shapers require more actuator effort than the positive shapers due to high changes in the set-point command at each new impulse time location.
To overcome the disadvantages, a modified SNA input shaper is introduced, whose negative amplitudes can be set to any value at the centre between each normal impulse sequences. In this study, the previous SNA input shaper [11] is modified by locating the negative amplitudes at the centre between each positive impulse sequences with even number of total impulses. This will result the shaper duration as one-fourth of the sway period of an undamped system as shown in Fig. 4. The modified SNA-ZSDD shaper is proposed and applied in this study to enhance the robustness capability of the controller while increasing the speed of the system response. By considering the form of modified SNA-ZSDD shaper shown in Fig. 4, the amplitude summation constraints Eq. can be obtained as: The values of a, b, c and d can be set to any value that satisfy the constraint in (17). However, the suggested values of a, b, c and d are less than |1| to avoid the increase of the actuator effort.

RESULTS
In this study, the proposed control schemes are implemented and tested within the simulation environment of the gantry crane and the corresponding results are presented. In this study, positive ZSDD and modified SNA-ZSDD are investigated as the input shaping control schemes. The cart position of the gantry crane is required to follow a trajectory within the range of 4 ± m as shown in Fig. 5. System responses namely the cart position, cart velocity and sway angle of the hoisting rope are observed. To investigate the sway of the system in the frequency domain, Power Spectral Density (PSD) of the response at the sway angle is obtained. The performances of the hybrid controllers are assessed in terms of input tracking and sway suppression in comparison to the PD-type Fuzzy logic control. Moreover, robustness of the controllers to variations in sway frequencies is also investigated. In this case, 30% error tolerance in sway frequencies is considered.

PD-type Fuzzy Logic control:
In this investigation, the responses of the gantry crane system to the unshaped trajectory reference input were analyzed in time-domain and frequency domain (spectral density) as shown in Fig. 6. These results were considered as the system response to the unshaped input under tracking capability and will be used to evaluate the performance of the input shaping techniques. The steady-state cart position trajectory of +4 m for the gantry crane was achieved within the rise and settling times and overshoot of 1.169 s, 2.506 s and 12.4 % respectively. It is noted that the cart reaches the required position from +4 m to -4 m within 2 s, with high overshoot. However, a noticeable amount of swing angle occurs during movement of the cart. It is noted from the swing angle response with a maximum residual of ±1.3 rad. Moreover, from the PSD of the swing angle response the swaying frequencies are dominated by the first three modes, which are obtained as 0.3925, 1.177 and 1.962 Hz with magnitude of 27.27, -10.73 and -29.55 dB respectively. The closed loop parameters with the PD-type Fuzzy Logic control will subsequently be used to design and evaluate the performance of hybrid controllers with positive ZSDD and SNA-ZSDD shapers.
Hybrid control: Figure 7 shows a block diagram of the proposed hybrid control scheme where the PDtype FLC is combined with the input shaping control schemes. The positive ZSDD and modified SNA-ZSDD shapers were designed based on the dynamic behavior of the closed-loop system obtained using only the PD-type FLC. As demonstrated in PSD result, the natural frequencies of the sway angle were 0.3925, 1.177 and 1.962 Hz for the first three sway modes. With exact natural frequencies, the time locations and amplitudes of the impulses for positive ZSDD shaper were obtained by solving Eq. 15. For digital implementation of the input shaper, locations of the impulses were selected at the nearest sampling time. The developed input shaper was then used to pre-process the input reference shown in Fig. 5. Figure 8 shows the shaped inputs using both the positive and modified SNA-ZSDD shapers with exact natural frequencies. It is noted that the shaped input with the modified SNA shaper is not as smooth as compared to the positive shaper. This is due to higher number of switching of the actuator. Figure 9 shows the system responses of the gantry crane using the hybrid controllers with exact natural frequencies. Table 2 shows the levels of sway reduction of the system responses at the first three modes in comparison to the PD-type Fuzzy Logic control. It is noted that the proposed hybrid controllers are capable of reducing the system sway while maintaining the input tracking performance of the cart position. Similar cart position and cart velocity responses were observed as compared to the PD-type FLC. Moreover, a significant amount of sway reduction was demonstrated at the sway angle of the hoisting rope with both control schemes. With the positive ZSDD and modified SNA-ZSDD shapers, the maximum sway angles were obtained at ±0.20 and ±0.16 rad respectively. These are seven-fold and eight-fold improvements as compared to PD-type FLC. This is also evidenced in the PSD of the sway angle residual that shows lower magnitudes at the resonance modes.  To examine the robustness of the hybrid controllers, the shapers with 30% error in sway frequencies were designed and implemented to the gantry crane system. Figure 10 shows the response of the gantry crane with the hybrid controllers with erroneous natural frequencies. Table 2 shows the levels of sway reduction with erroneous natural frequencies in comparison to the PD-type FLC. The time response specifications of the cart position with error in natural frequencies are also shown in Table 2. Similar to the case with exact frequencies, the proposed hybrid controllers are capable of reducing the system sway while maintaining the input tracking performance of the cart position. Moreover, the sways of the system were considerable reduced as compared to the response with PD-type FLC. However, the level of sway reduction is slightly less than the case with exact natural frequencies.

DISCUSSION
The simulation results show that performance of the hybrid controller with positive ZSDD control scheme is better than SNA-ZSDD scheme in sway suppression of the gantry crane. This is further evidenced in Fig. 11 that demonstrates the level of sway reduction of the gantry crane with the hybrid controllers as compared to the PD-type FLC. It is noted that higher sway reduction is achieved with positive ZSDD at the first, second and third resonance modes, which are the most dominant modes. Almost less than two-fold improvement in the sway reduction was observed as compared to SNA-ZSDD. Comparisons of the cart position responses show that the hybrid controller with SNA-ZSDD shaper is faster than the case using the positive ZSDD shaper. The result reveals that the speed of the system responses can be improved by using negative impulses input shaper.
Comparison of the results shown in Fig. 11 reveals that both hybrid controllers with the positive and SNA input shapers can successfully handle errors in natural frequencies. Moreover, almost similar performance in sway reduction of the gantry crane was achieved with both control schemes. As positive ZSDD performs better than SNA-ZSDD with exact frequencies, the results demonstrate that, the modified SNA-ZSDD is capable of improving the robustness of the controller to uncertainty in sway frequencies. Comparisons of the cart position response with the hybrid controllers show a similar pattern as the case with exact natural frequencies. With the new proposed SNA shaper, it is shown that the robustness of the controller can be improved while increasing the speed of the response. The research thus developed and reported in this study forms the basis of design and development of hybrid control schemes for input tracking and sway suppression of boom and 3-D gantry crane systems and can be extended to and adopted in practical applications.

CONCLUSION
The development of hybrid control schemes based on PD-type Fuzzy Logic control with positive and negative input shapers for input tracking and sway suppression of a gantry crane has been presented. The proposed control schemes have been implemented and tested within simulation environment of an overhead gantry crane derived using the Euler-Lagrange formulation. The performances of the control schemes have been evaluated in terms of input tracking capability, level of sway reduction and robustness. Acceptable performance in input tracking control and sway suppression has been achieved with both control strategies. Moreover, a significant reduction in the system sways has been achieved with the hybrid controllers regardless of the polarities of the shapers. A comparative assessment of the hybrid control schemes has shown that the PD-type FLC with positive ZSDD shaper provides higher level of sway reduction of the gantry crane as compared to the PD-type FLC with SNA-ZSDD shaper. By using the PD-type FLC with modified SNA-ZSDD, robustness of the controller can be improved as similar level of robustness as positive ZSDD is achieved. Moreover, with SNA -ZSDD, the speed of the response is slightly increased at the expenses of decrease in the level of sway reduction.