Application of Firefly Algorithm for Parameter Estimation of Damped Compound Pendulum

This paper presents an investigation into the parameter estimation of the damped compound pendulum using Firefly algorithm method. In estimating the damped compound pendulum, the system necessarily needs a good model. Therefore, the aim of the work described in this paper is to obtain a dynamic model of the damped compound pendulum. By considering a discrete time form for the system, an autoregressive with exogenous input (ARX) model structures was selected. In order to collect input-output data from the experiment, the PRBS signal is used to be input signal to regulate the motor speed. Where, the output signal is taken from position sensor. Firefly algorithm (FA) algorithm is used to estimate the model parameters based on model 2nd orders. The model validation was done by comparing the measured output against the predicted output in terms of the closeness of both outputs via mean square error (MSE) value. The performance of FA is measured in terms of mean square error (MSE).


Introduction
In order to design a good control system, such as controlling the position of compound pendulum system, a suitable model always required to from the input and output of the system. System identification technique is the best choise to deals with the problem of developing a model of the real physical system based on the measured input output data. At first, when the structure of the model is identified, the parameter estimation is employed to the model's parameters. In classical approach, one needs to have a priory knowledge about the system in order to obtain the governing equations. However this method is tedious when modeling a complex dynamic system. Therefore, the black box modelling approach is an altenative technique which can be adopted for system identification. System identification is only concerned the system that has signal input and output from the real experimental data. Furthermore, it may takes less time than from physical modeling [1]. System identification methods aim to find appropriate models for the real physical systems. Over the years, many algorithms and methodologies have been developed for this purpose, ranging from conventional method, i.e. least squares regression algorithm up to intelligent method i.e. nature-inspired algorithms.
Nature-inspired algorithms is an algorithms that developed from imitating process in nature or in other way it is inspired from the nature. These algorithms provide an efficient way to solve engineering problem especially in optimization process [2]. In the fields of system identification, many researcher applied Nature-inspired algorithms for parameter estimation in system identification. Hanim et. al [3], studied about developing self-tuning PID controller optimized for vibration suppression structure flexible manipulator using particle swarm optimization (PSO). The PSO is applied for estimating the model parameter of a flexble manipulator. Comparative study showed that PSO is outperformed the conventional method with minimum mean square error (MSE). The authors also employed PSO for PID controllers tuning for better vibration suppression. Rahimi et. al [4] estimated the parameter of chaotic behaviour in permanent magnet synchronous motor using Self-Adaptive Learning Bat-inspired algorithm (SLBA). Simulation study showed that the parameter can be estimated effectively via offline or online modes. Furthermore, it able to maintain its performance in the presence of noise. Nasir et. [5] proposed an improved version of spiral dynamic algorithm (SDA) becoming linear adaptive spiral dynamic algorithm (LASDA). This new approach employed a novel mathematical equation based on linear function. The performance of the LASDA is tested in parameter optimization for autoregressive model with exogenous input (ARX) structure for flexible manipulator. Results depicted that LASDA give better convergence speed and minimum mean square error between the actual output and predicted output.Furthermore, Ali [6] proposed proportional integral (PI) controller tuning using Firefly Algorithm (FA) for speed control of DC series motor. The results have been compared with Genetic Algorithm (GA) and Ziegler Nichols (ZN) under various operating conditions and disturbances. It is found that FA tuning PI controller produces an excellent performance due to the change in load torque, radiation, and temperature compared with GA and conventional techniques.
In this study, the Firefly algorithm has been chosen to estimate the parameter of the damped pendulum. The model validation was done by comparing the measured output against the predicted output in terms of the closeness of both outputs via mean square error (MSE) value. The performance of FA is measured in terms of mean square error (MSE). The organization of this paper is as follows. Section 2 gives the fundamental background of the system identification. Section 3 describes briefly the theory of FA. Section 4 explains the experimental setup of the compound pendulum system. Section 5 presents the parameter optimization process and the obtained results. Section 6 concludes the study.

System identification
System identification is modeling of a damped compound pendulum using input-output data from the experiment. Generally, the step involved in system identification is experimental data collection, model structure selection, parameter estimation and model validation. The model is developed based on auto-regressive with exogenous inputs (ARX) structure and model parameters are estimated by Firefly algorithm and least square algorithm.

Model structure
The model structure represented the mathematical model of the system to be modeled. The beam is modeled based on second order transfer function. Equations 1 below are the transfer function of damped compound pendulum bonded with actuator and sensor in continuous time and discrete time for second order system respectively: where y(t) is the output signal, u(t) is the input signal, ܾ ଵ and ܾ ଶ are locations of zeros of the transfer function. For this study, the model is built by considering a 2 nd model order for estimation method. Therefore, a model built under the assumption that the structure of the system is unknown [3]. So that the black box is used in this experiment. The input-output dataset from unknown model parameter to be used for system identification which is achieve from data experiment. Figure 1 shows the process of system identification. Initially, data collection is adopted. The input of the system was analog output to the motor and the output was the input voltage from the position sensor. Based on the acquired input-output data, the model parameter is estimated until minimum error, e(t) is reached. The parameter of estimated model is determined using firefly algorithm [9]. The performance of the estimated model is measured using mean square error (MSE).

Firefly algorithm
The Firefly Algorithm (FA) have been inspired by the flashing of fireflies in nature and has been proposed by Yang [7]. Each species of firefly produces its own pattern of flashes, and even complete function flashes is not known, the main goal for them is to flash to attract mates. These fireflies belongs to the family of insects that are can produce natural light to attract prey or mates. This light is found in a unique pattern and generate an amazing sight in tropical regions during the summer. The light intensity decreases as the distance increases and thus the most fireflies can communicate only up to a several hundred meters. For the implementation of the Firefly algorithm, with the objective function to be optimized the flashing light was formulated in such way that it will be associated. For simplicity, several rules are used to extend the structure of FA: a) All fireflies are unisex and are attracted to other fireflies regardless of their sex. b) The degree of the attractiveness of a firefly is proportional to its brightness. Their attractiveness is proportional to their light intensity. Thus for any two flashing fireflies, less bright firefly moves toward the brighter one. As brightness is proportional to distance, more brightness means less distance between two fireflies. If any two flashing fireflies have the same brightness, then they move randomly. c) The brightness of a firefly is determined by the objective function to be optimized

The formulation
In the Firefly Algorithm has the two important information to be determine there are the light intensity variation (I) and the attractiveness (β) formulation. For simplicity, the attractiveness of fireflies is determined by the brightness with respect to the objective function [16]. For a simple case, the brightness (I) in a particular location is a function of its position x as follows:

Light intensity and attractiveness
The β is an attractiveness factor which it ought to be reviewed or saw by different fireflies. The β is normally in the range from 0 to 1 where its determined how attracted fireflies are to others, if bringing down the level of β it will lowers the yearning for a firefly to move towards the brighter fireflies. The value of β and a random component will influent the firefly to move towards a brighter firefly. Hence, the β is depend on the distance ‫ݎ‬ between firefly i attracted with the brightness of firefly j. In addition, the attractiveness varies with the degree of adsorbption where the light intensity decreases with increasing distance from its source and depends on the propagation medium. It follows that the light intensity as indicated from equation (3) is varies depending to the inverse square distance r, where ‫ܫ‬ ௦ is the light intensity at the source. As the light intensity varies with r when the medium provided with fixed light absorption coefficient γ shown in equation (4).
where ‫ܫ‬ is the original light intensity.
In order to evade the singularity at r = 0 occur in equation (4), the Gaussian form is developed by combining the effect of both the inverse square law and absorption as in equation (5).
The adjacent fireflies later on will compute for the attractiveness is proportional to the light intensity.
where ߚ is the attractiveness at r = 0. This function approximated by: The movement of a firefly towards a brighter firefly is resolved by ‫)ݎ(ߚ‬ and its random component. The random component is key for all metaheuristic algorithms, it allows the algorithm to escape from local optimums.

Distance
The distance between any two fireflies i and j at x i and x j , respectively, is the Cartesian distance as in equation (8).

Position Update
Position of fireflies is updated when the attractive of firefly i to one another is more than attractive firefly j. Where x i,k is the k -th component of the spatial coordinate x i of i -th firefly. The movement of a firefly i attracted to another more attractive (brighter) firefly j in a given time step (t) is determined by equation (9).
where α is the parameter controlling the amount of randomness. The randomness parameter, α is typically in the range from 0 to1, where 0 is referred to no randomness and 1 to highly random.

Experimental setup
The pendulum is classical control problems which have been used until today to apply in the real life most easy and stabilize the basic machine with pendulum system. By modelling and controller design, the pendulum characteristic can be easy to understand, view and design. The compound pendulum are one of a basic topic in physics because it is included some physical subjects such as the period of oscillation, center of mass, simple harmonic motion, the acceleration of gravity, moments of inertia, momentum and so on. For this project, the pendulum that used is the compound pendulum with motorized-propeller. An experimental of a damped compound pendulum is developed in Figure 3 is for the significance test and input-output data collection. This compound pendulum consists Motorized propellers that are attached at the end of an aluminium pendulum arm. At the end of the pendulum there has motorized propeller so it can lift the pendulum if given actuator of the voltage which is able to provide thrust in a single direction. The sensor used for sensing the swing of aluminium pendulum arm when it has been applied a disturbance and signals are transmitted to computer control system via data acquisition system (DAQ).
The following Table 1

Data collection
In this experiment, the PRBS signal with the maximum length sequence of 30 with the time period of 41 sec was used during data collection of the damped compound pendulum at the (0.3v to 0.4v) and shown in Figures 4 and 5. A set of real time data were collected from the damped compound pendulum that are consist of 477 data. The set will divided to two part. The first part was used for training while second part of data used for identification activities for FA. Figure show the PRBS signal injected to actuator from computer.

Results and discussions
In this study, the parameter estimation of compound pendulum is estimated using firefly algorithm in order to achieve the best value of MSE.

Analysis of results Firefly Algorithm
By using the best settings of n=18, α=0.4, β=0.3, γ=0.9 and G=100. Figures 6 and 7 show parameters a 1 and a 2 start convergence at the 55 generation while the parameter of b 1 and b 2 start convergence at the 53 generation. Both of parameters a and b converge almost at the same generation. The convergence profile during optimization process in shown in Figure 8. It is observed that the minimum fitness functions achieved at MSE value of 3.7835e-05. It can be seen that FA obtained the optimal solution after 38 generations. This shows FA produced a good convergence capability.

Model validation
After obtaining the value of a 1 , a 2 , b 1 , b 2 from the predicted output, then these value will be validated with the measure output show as in Figure 9. It can be observed that the measured output and the model predicted output are in a good agreement during the model validate procedure. The MSE between measured output and the model predicted output is about 4.3759e-05. Thus the using firefly algorithm in the parameter estimation of pendulum compound is acceptable.  The optimal parameter can be achieved using FA algorithm is a 1 = -1.9843, while the value of a 2 = 0.9994 beside b 1 = 0.0008 and b 2 = 0.0027. The MSE obtained during training is about 3.7835e-05 while the MSE obtained during test shows the lowest value at 4.16523e-05. The overall results of FA show in Table 1. Finally, the optimal parameters obtained from optimization process are substituted into the model structure a damped compound pendulum. The model is shown in the transfer function below: () = −1.9843ࢠ ି + 0.9994ࢠ ି 1 + 0.0008ࢠ ି + 0.0027ࢠ ି ()

Conclusion
As a conclusion, firefly algorithm firefly algorithm is performed well in terms of mean square error (MSE) with a very low value of 4.3759e-05. The error of model predicted output also show that the FA had the lowest error range that are ±0.015. It appears that the FA is the superior algorithm when it comes to problems with many local optima. Furthermore, FA produce fast convergence speed to reach the optimal solution. For future work, the identified model will be useful to study the controller performance.