1 Introduction

DC series motors are widely used in traction and application that required high starting torque [1, 2]. Due to the inherent characteristic possessed by the DC motor system, such as the complexity of the nonlinear system, unavailability of an accurate and precise mathematical model and the use of conventional PI controller become a suitable solution due to small steady-state error and low costs. However, searching the parameters of PI controller is not an easy task, particularly under varying load conditions, parameter changes, and abnormal modes of operation [3, 4].

Photovoltaic (PV) system refers to an array of cells containing a solar photovoltaic material that converts solar radiation into direct current electricity. Solar PV systems work by converting light into electrical power. This is achieved using a thin layer of semi-conducting material, most commonly silicon, enclosed in a glass or plastic casing. When exposed to sunlight, the semi-conducting material causes electrons in the materials’ atoms to be knocked loose. The electrons that are knocked loose then flow through the material to produce an electric current known as a DC. The DC is carried through wiring to an inverter which converts the current to AC so it can be connected to main electricity distribution board which either used within the home or fed back into the national grid [57]. PV is used in this paper to power DC series motor.

Artificial Intelligence (AI) has been discussed in literatures to solve problems related to speed control of DC motor. Artificial Neural Network (ANN) is addressed in [811]. The ANN approach has its own advantages and disadvantages. The performance of the system is improved by ANN-based controller, but the main problem of this controller is the long training time, the selecting number of layers, and the number of neurons in each layer. Another AI approach such as Fuzzy Logic Control (FLC) has received much attention in control applications. In contrast with the conventional techniques, FLC formulates the control action of a plant in terms of linguistic rules drawn from the behavior of a human operator rather than in terms of an algorithm synthesized from a model of the plant [12, 13]. It offers the following merits: It does not require an accurate model of the plant; it can be designed on the basis of linguistic information obtained from the previous knowledge of the control system and gives better performance results than the conventional controllers. However, a hard work is inevitable to get the effective signals when designing FLC. Also, it requires finer tuning and simulation before operations.

Recently, global optimization techniques have attracted the attention in the field of controller parameter optimization and enhancing speed tracking system. Tabu Search (TS) is discussed in [14] to design a robust controller for induction motor. However, it appears to be effective for the design problem, the efficiency is reduced by the use of highly epistatic objective functions and the large number of parameters to be optimized. Furthermore, it is time-consuming method. Another heuristic technique like genetic algorithm (GA) is illustrated in [15] for optimal design of speed control of switched reluctance motor (SRM). Despite this, optimization technique requires a very long run time that may be several minutes or even several hours depending on the size of the system under study. Swarming strategies in fish schooling and bird flocking are used in the particle swarm optimization (PSO) and presented in [16] for optimal design of speed control of different motors [1719]. However, PSO suffers from the partial optimism, which causes the less exact at the regulation of its speed and the direction. In addition, the algorithm cannot work out the problems of scattering and optimization [20, 21]. A relatively newer evolutionary computation algorithm, called bacteria foraging (BF) scheme, has been presented by [2224] and further established recently by [2529], but the BF algorithm depends on random search directions which may lead to delay in reaching the global solution. A new metaheuristic nature-inspired algorithm, called firefly algorithm (FA), which was developed by Yang [3032] to describe a solution for many optimization problems. First, some artificial firefly is randomly distributed in the problem space, and then any firefly emits light, the intensity of which is in conformity to the optimization rate of the point the firefly stands on. Then the light intensity of any firefly is compared to the light intensity of the fireflies, and the low-light firefly goes toward the intense lighted one. Also the most intense firefly moves around the problem for finding the global optimized answer randomly. So, in FA the fireflies get in relationship with each other via the light. The combination of these operations leads to the movement of the all fireflies toward the more optimized points [33, 34]. Recent works have been carried out via FA in several fields which are shown in [3538].

This paper proposes FA for speed control of DC series motor supplied by PV system. FA is used for tuning the PI controller parameters to control the duty cycle of DC/DC converter and therefore speed control of DC series motor. The design problem of the proposed controller is formulated as an optimization problem, and FA is employed to search for optimal controller parameters. By minimizing the time domain objective, function representing the error between reference speed and actual one is optimized. The effectiveness of the proposed controller is tested under different operating conditions in comparison with the GA-based PI controller and conventional one through time domain simulation and some performance indices. Simulation results show that the proposed algorithm achieves good robust performance for speed tracking system under different operating conditions and disturbances.

2 System under study

The system under study consists of PV system acts as a voltage source for a connected DC series motor. The input of PV system is the ambient temperature and radiation, while the output is the DC voltage. The proposed controller based on FA is used to control the duty cycle of DC/DC converter and consequently the voltage and speed of motor. The schematic block diagram is shown in Fig. 1.

Fig. 1
figure 1

Block diagram of overall system

2.1 DC series motor construction

The proposed system can be simulated with proper mathematic modeling. The DC series motor can be written in terms of equations as follows [3944]. The parameters of DC series motor are shown in “Appendix.”

$$ \frac{{{\text{d}}i_{\text{a}} (t)}}{{{\text{d}}t}} = \frac{{V_{\text{t}} (t)}}{{L_{\text{a}} + L_{\text{f}} }} - \frac{{R_{\text{a}} + R_{\text{f}} }}{{L_{\text{a}} + L_{\text{f}} }}i_{\text{a}} (t) - \frac{{M_{\text{af}} }}{{L_{\text{a}} + L_{\text{f}} }}i_{\text{a}} (t)\omega_{r} (t) $$
(1)
$$ \frac{{{\text{d}}\omega_{r} (t)}}{{{\text{d}}t}} = \frac{{M_{\text{af}} }}{{J_{\text{m}} }}i_{\text{a}}^{2} (t) - \frac{f}{{J_{\text{m}} }}\omega_{r} (t) - \frac{{T_{\text{L}} }}{{J_{\text{m}} }} $$
(2)

where i a the armature current, V t the motor terminal voltage, R a and L a the armature resistance and inductance, R f and L f the field resistance and inductance, ω r the motor angular speed, J m the moment of inertia, T L the load torque, f the friction coefficient, and M af the mutual inductance between the armature and field.

2.2 Photovoltaic modeling

The PV cell model is composed of photovoltaic current source that has directly proportional with the sunlight intensity parallel with a diode and a small series contact resistance as shown in Fig. 2. The output current and voltage from the cell is dependent on the load operating point. The solar cell mathematical modeling is given by the following equations [6, 7].

$$ I_{c} = I_{ph} - I_{o} \left\{ {e^{{\left[ {\frac{{q_{o} }}{AKT}\left( {V_{c} + I_{c} R_{s} } \right)} \right]}} - 1} \right\} $$
(3)
$$ V_{\text{c}} = \frac{\text{AKT}}{{q_{\text{o}} }}\ln \left( {\frac{{I_{\text{ph}} + I_{\text{o}} - I_{\text{c}} }}{{I_{\text{o}} }}} \right) - I_{\text{c}} R_{\text{s}} $$
(4)
$$ I = I_{\text{ph}} - I_{\text{o}} \left\{ {e^{{\left[ {\frac{{q_{\text{o}} }}{{n_{\text{s}} {\text{AKT}}}}\left( {V + n_{\text{s}} IR_{\text{s}} } \right)} \right]}} - 1} \right\} $$
(5)
$$ V = \frac{{n_{\text{s}} {\text{AKT}}}}{{q_{\text{o}} }}\ln \left( {\frac{{I_{\text{ph}} + I_{\text{o}} - I}}{{I_{\text{o}} }}} \right) - n_{\text{s}} IR_{\text{s}} $$
(6)

where

$$ I_{\text{ph}} = \frac{G}{1000}\left[ {I_{\text{sc}} + k_{i} \left( {T - T_{\text{r}} } \right)} \right] $$
(7)
$$ I_{\text{o}} = I_{\text{or}} \left( {\frac{T}{{T_{\text{r}} }}} \right)^{3} e^{{\left[ {\frac{{q_{\text{o}} E_{\text{g}} }}{\text{AK}}\left( {\frac{1}{{T_{\text{r}} }} - \frac{1}{T}} \right)} \right]}} $$
(8)
Fig. 2
figure 2

Solar cell equivalent circuit

The module output power can be determined simply from the following equation.

$$ P = V \cdot I $$
(9)

where I and V module output current and voltage, I c and V c cell output current and voltage, I ph and V ph the light generation current and voltage, I s cell reverse saturation current, I sc the short circuit current, I o the reverse saturation current, R s the module series resistance, T cell temperature, K Boltzmann’s constant, q o electronic charge, KT (0.0017 A/°C) short circuit current temperature coefficient, G solar illumination in W/m2, E g band gap energy for silicon, A ideality factor, T r reference temperature, I or cell rating saturation current at T r, n s series connected solar cells, and k i cell temperature coefficient.

Thus, if the module parameters such as module series resistance (R s), reverse saturation current (I o), and ideality factor (A) are known, the IV characteristics of the PV module can be simulated by using (5) and (6).

2.3 DC–DC converter

In this paper, a hybrid (buck and boost) DC/DC converter is used [41]. The equations for this converter type in continuous conduction mode are:

$$ V_{B} = \frac{ - k}{1 - k}V_{\text{ph}} $$
(10)
$$ I_{B} = \frac{k - 1}{k}I_{\text{ph}} $$
(11)

where k is the duty cycle of the pulse width modulation (PWM). V B and I B are the output converter voltage and current, respectively.

3 Objective function

A performance index can be defined by the integral of time multiply square error (ITSE) [45, 46]. Accordingly, the objective function J is set to be:

$$ J = \int\limits_{0}^{\infty } {te^{2} {\text{d}}t} $$
(12)

where \( e = w_{\text{reference}} - w_{\text{actual}} \)

Based on this objective function J, optimization problem can be stated as: minimize J subjected to:

$$ K_{p}^{\hbox{min} } \le K_{P} \le K_{p}^{\hbox{max} } ,\,\,K_{I}^{\hbox{min} } \le K_{I} \le K_{I}^{\hbox{max} } $$
(13)

Typical ranges of the optimized parameters are [0.001–10] for K P and K I . Conventional setting of PI controller using ZN can be seen in “Appendix.”

4 Overview of firefly algorithm

FA is a metaheuristic algorithm which has been presented by Yang [3032]. This algorithm is inspired by the mating or flashing behavior of fireflies. These fireflies belong to a family of insects that are capable to produce natural light to attract a mate or prey. This light appears to be in a unique pattern and produce an amazing sight in the tropical areas during summer. The intensity (L) of light decreases as the distance (r) increases, and thus, most fireflies can communicate only up to several hundred meters. In the implementation of the algorithm, the flashing light is formulated in such a way that it gets associated with the objective function to be optimized.

FA is simple, flexible, and versatile, which is very efficient in solving a wide range of diverse real-world problems [47]. Moreover, it can divide its population into subgroups, due to the fact that local attraction is stronger than long distance attraction. Hence, FA can deal with highly nonlinear, multi-modal optimization problems naturally and efficiently. Also, it does not use past individual best, and there is no explicit global best either. This avoids any potential drawbacks of premature convergence as those reported in PSO. In addition, it has an ability to control its modality and adapt to problem landscape by controlling its scaling parameter. Thus, FA has been used to solve many optimization problems [48, 49]. Recent research shows that FA is a very efficient and could outperform other algorithms. The superiority of FA over other algorithms has also been reported in the literature [5052].

For simplicity, some rules are used to extend the structure of FA.

  1. 1.

    A firefly will be attracted by other fireflies regardless of their sex.

  2. 2.

    Attractiveness is proportional to their brightness and decreases as the distance among them increases.

  3. 3.

    The value of the objective function determines the brightness of a firefly [3234].

FA depends on two important factors: the variation of the light intensity and the formulation of the attractiveness.

  • Light intensity and attractiveness

    The attractiveness β of a firefly is given by its light intensity L, which is proportional to the value of objective function. As the light intensity decreases with the distance from its source, the attractiveness changes with the distance r ij between firefly i and firefly j. Light is also absorbed by the media. When the medium is known, the light intensity of one firefly can be specified by the following equation.

    $$ L(r) = L_{0} e^{{ - \gamma r^{2} }} $$
    (14)

    where γ is the absorption coefficient, and L 0 is its initial brightness, namely its brightness at r = 0.

    The attractiveness of a firefly is determined by (15) where β 0 is the attractiveness at r = 0.

    $$ \beta = \beta_{ 0} e^{{ - \gamma r^{m} }} ,\,\,(m \ge 1) $$
    (15)
  • Distance

    The distance between any two fireflies i and j at x i and x j , respectively, the Cartesian distance is determined by (16) where x i,k is the kth component of the spatial coordinate x i of the ith firefly and d is the number of dimensions.

    $$ r_{ij} = \sqrt {\sum\limits_{k = 1}^{d} {\left( {x_{i,k} - x_{j,k} } \right)^{2} } } $$
    (16)
  • Position update

    Position update when firefly i is attracted to another more attractive firefly j, which is determined by the following equation.

    $$ x_{i} = x_{i} + \beta_{0} e^{{ - \gamma r_{ij}^{2} }} (x_{j} - x_{i} ) + \alpha \in $$
    (17)

    where the second term is due to the attraction, while the third term is randomization with α being the randomization parameter and \( \in \) being the vector of random numbers drawn from a Gaussian distribution. The parameter γ characterizes the contrast of the attractiveness, and its value varies from 0.1 to 10 determining the convergence speed of the FA. It is worth pointing out that FA achieves the global optimization by fireflies’ continuous updating position based on the brightness and attraction.

  • Convergence of algorithm

    For any large number of fireflies (n), if n ≫ m, where m is the number of local optima of an optimization problem, the convergence of the algorithm can be reached. Here, the initial location of n fireflies is distributed uniformly in the entire search space, and as the iterations of the algorithm continue fireflies converge into all the local optimum. By comparing the best solutions among all these optima, the global optima are reached. The flow chart of FA is shown in Fig. 3. The parameters of FA are shown in “Appendix.”

    Fig. 3
    figure 3

    Flow chart of FA

5 Results and discussion

In this section, different comparative cases are examined to show the effectiveness of the proposed FA controller compared with GA [5355] and ZN under change of load torque, ambient temperature, and radiation variations. The designed parameters of PI controller with the proposed FA, conventional approach and GA are given in Table 1. Also, Fig. 4 shows the minimum fitness functions evaluating process using the FA method. Moreover, FA converges at a faster rate (45 generations) compared to that for GA (61 generations). Moreover, computational time (CPU) of both algorithms is compared based on the average CPU time taken to converge the solution. The average CPU for FA is 39.8 s, while it is 50.3 s for GA. The proposed FA methodology and GA are programed in MATLAB 7.1 and run on an Intel(R) Core(TM) I5 CPU 2.53 GHz and 4.00 GB of RAM. The mentioned CPU time is the average of 10 executions of the computer code.

Table 1 Comparison between various controllers
Fig. 4
figure 4

Change of objective function for both algorithms

5.1 Response under step change of temperature

Figures 5 and 6 show the step change of load torque, the current, voltage, and power of PV system for one cell. The speed response under variation of the load torque is shown in Fig. 7, respectively. The actual speed tracks the reference speed with minimum overshoot and settling time. The settling time is approximately 0.03 s. Moreover, the speed response is faster with the proposed controller than GA and ZN for the step variation of load torque. In additional, the designed controller is robust in its operation and gives a superb performance compared with conventional PI controller and GA tuning PI controller.

Fig. 5
figure 5

Step change of load torque

Fig. 6
figure 6

PV current, voltage, and power

Fig. 7
figure 7

Change in speed for different algorithms

5.2 Response under step change of radiation

In this case, the system responses under variation of radiation are obtained. Figures 8 and 9 show the change of radiation as an input disturbance and the current, voltage, and power of PV cell system, respectively. Moreover, the system response based on different algorithms is shown in Fig. 10. It is clear from these figures that the proposed FA-based controller improves the speed control of DC series motor effectively. Moreover, the proposed method outperforms and outlasts GA in designing speed controller and reducing settling time. Hence, PI-based FA greatly enhances the performance characteristics of DC series motor compared with those based GA and conventional technique.

Fig. 8
figure 8

Step change for PV system radiation

Fig. 9
figure 9

PV current, voltage, and power

Fig. 10
figure 10

Change in speed for different controllers

5.3 Response under step change of load torque, radiation, and temperature

The effect of applying step change of load torque, radiation, and temperature of PV system is shown in this case. Figures 11 and 12 illustrate the variation of load torque, radiation, temperature, and the output of PV cell. A comparison between the actual and reference speed is shown in Fig. 13. From these figures, the steady-state and dynamic operation of DC series motor in terms of over shoot and settling time has been enhanced. Also, the proposed controller using time domain objective functions achieves good robust performance and provides superior speed controller in comparison with the conventional technique and GA.

Fig. 11
figure 11

Step change of load torque, PV system radiation, and temperature

Fig. 12
figure 12

PV current, voltage, and power

Fig. 13
figure 13

Change of speed for different controllers

5.4 Response under change of load torque, radiation, and temperature

In this case, the system response under large change of load torque, radiation, and temperature is obtained. Figures 14 and 15 show the change of load torque and parameters of PV cell, respectively. Moreover, the effect of the proposed FA controller on speed response is illustrated in Fig. 16. It is clear from this Fig that the proposed FA controller is robust in tracking reference speed. Also, the proposed controller has a small settling time, and system response is quickly driven with the reference speed. Hence, the potential and superiority of the proposed algorithm over the classical approach and GA are demonstrated.

Fig. 14
figure 14

Change of load torque, PV radiation, and temperature

Fig. 15
figure 15

PV current, voltage, and power

Fig. 16
figure 16

Change in speed with different controllers

5.5 Robustness and performance indices

To demonstrate the robustness of the proposed controller, some performance indices: The Integral of Absolute value of the Error (IAE), the Integral of the Time multiplied Absolute value of the Error (ITAE), the Integral of Square Error (ISE), and the Integral of the Time multiplied of Square Error (ITSE) are being used as:

$$ {\text{IAE}} = \int\limits_{0}^{{t_{\text{sim}} }} {\left( {\left| e \right|} \right){\text{d}}t} $$
(18)
$$ {\text{ITAE}} = \int\limits_{0}^{{t_{\text{sim}} }} {t\left( {\left| e \right|} \right){\text{d}}t} $$
(19)
$$ {\text{ISE}} = \int\limits_{0}^{{t_{\text{sim}} }} {e^{2} {\text{d}}t} $$
(20)
$$ {\text{ITSE}} = \int\limits_{0}^{{t_{\text{sim}} }} {te^{2} {\text{d}}t} $$
(21)

where t sim is the time of simulation and equals to 35 s. It is noteworthy that the lower the value of these indices, the better the system response in terms of time domain characteristics [56]. Numerical results of performance robustness for all controllers are listed in Table 2 under large change of load torque, and parameters of PV system. It can be seen that the values of these system performance with the FA are smaller compared with those of GA and ZN. This demonstrates that the overshoot, settling time, and speed deviations of all units are greatly decreased by applying the proposed FA-based tuned PI. Eventually, values of these indices are smaller than those obtained by BF in [29].

Table 2 Values of performance indices

6 Conclusions

In this paper, a novel method for speed control of DC series motor is proposed via FA. The design problem of the proposed controller is formulated as an optimization problem, and FA is employed to search for optimal parameters of PI controller. By minimizing the time domain objective function, in which the difference between the reference and actual speed are involved, speed control of DC series motor is enhanced. Simulation results emphasize that the designed FA tuning PI controller is robust in its operation and gives a superb performance for the change in load torque, radiation, and temperature compared with GA and conventional technique. Moreover, the system performance characteristics in terms of various performance indices reveals that the proposed controller confirms its effectiveness than GA, BF, and conventional one. The implementation of this work is the future work of this research.