1 Introduction

Modern speed control techniques for variable speed drives have been changed drastically as compared to their conventional counterparts. Before evolution of power electronics, conventional (e.g. field and armature flux) control methods were being used in DC motor drives. Then power electronics-based drives gained popularity. For industrial drive applications, closed loop control techniques were introduced and PI, PID controllers were used along with power electronic converters [1]. Now-a-days for more sophisticated applications such as space craft and aeronautical engineering, biomedical instrumentation, robotic application etc.; the performance of these conventional DC motors is not up to the mark. In this work BLDC motor is selected because of their advantages [1, 2] over the other type of motors for these sophisticated applications. As a BLDC motor, does not require a commutator-brush segment so it is compact, more efficient, and generate very less noise when in operation [3, 4]. It exhibits excellent dynamic characteristics on load variation. One can note that in industrial applications more than 90% of variable speed drives use PID controllers only. Even some advanced hybrid control techniques such as Fuzzy-Neural Networks, Fuzzy-Ants Colony, Fuzzy-Genetic Algorithm, Fuzzy-Swarm, etc give better performance [5] still PID is preferred because it is cheap and has simple structure [6, 7]. For a particular application, the performance of a PID controller depends upon its parameters (KP, KI, KD). Generally, the values of these parameters are evaluated by tuning methods like Ziegler-Nichol optimization method or Cohen-Coon method, but these methods have some restrictions [8]. Advanced optimization algorithms like PSO, Genetic Algorithm etc. are more efficient and exhibit better steady state characteristics [9]. In this article, Grey Wolf Algorithm is applied to the PID controller, and the results are compared with PSO algorithm; which is a popular optimization algorithm [10]. In the later sections of this article mathematical modeling of BLDC motor and PID controller have been discussed. Third and fourth sections are describing PSO and GWO algorithms respectively. The subsequent section deals with the selection of fitness functions. In the last section authors, have given the comparative study in case of transient and steady state response in speed variations through simulated results.

2 Mathematical Modelling

2.1 BLDC Motor Modelling

Assuming the resistances of all the phase windings of a BLDC motor are equal, the phase voltages can be represented by equation-1 [11].

$$\left[ {\begin{array}{*{20}c} {V_{as} } \\ {V_{bs} } \\ {V_{cs} } \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} {R_{s} } & 0 & 0 \\ 0 & {R_{s} } & 0 \\ 0 & 0 & {R_{s} } \\ \end{array} } \right]\left[ {\begin{array}{*{20}c} {i_{a} } \\ {i_{b} } \\ {i_{c} } \\ \end{array} } \right] + \frac{d}{dt}\left[ {\begin{array}{*{20}c} {L_{aa} } & {L_{ab} } & {L_{ac} } \\ {L_{ba} } & {L_{bb} } & {L_{bc} } \\ {L_{ca} } & {L_{cb} } & {L_{cc} } \\ \end{array} } \right]\left[ {\begin{array}{*{20}c} {i_{a} } \\ {i_{b} } \\ {i_{c} } \\ \end{array} } \right] + \left[ {\begin{array}{*{20}c} {e_{a} } \\ {e_{b} } \\ {e_{c} } \\ \end{array} } \right]$$
(1)

Assume that all the self-inductance of each phase windings are equal. Similarly, all the mutual inductances are equal.

$$L_{aa} = L_{bb} = L_{cc} = L$$
(2)
$$L_{ab} = L_{ba} = L_{cb} = L_{bc} = L_{ca} = L_{ac} = M$$
(3)

Substituting (2) and (3) in (1):

$$\left[ {\begin{array}{*{20}c} {V_{as} } \\ {V_{bs} } \\ {V_{cs} } \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} {R_{s} } & 0 & 0 \\ 0 & {R_{s} } & 0 \\ 0 & 0 & {R_{s} } \\ \end{array} } \right]\left[ {\begin{array}{*{20}c} {i_{a} } \\ {i_{b} } \\ {i_{c} } \\ \end{array} } \right] + \frac{d}{dt}\left[ {\begin{array}{*{20}c} M & L & L \\ L & M & L \\ L & L & M \\ \end{array} } \right]\left[ {\begin{array}{*{20}c} {i_{a} } \\ {i_{b} } \\ {i_{c} } \\ \end{array} } \right] + \left[ {\begin{array}{*{20}c} {e_{a} } \\ {e_{b} } \\ {e_{c} } \\ \end{array} } \right]$$
(4)

For a balanced three phase stator winding, at any instant summation of all the phase currents is zero [13].

$$i_{a} + i_{b} + i_{c} = 0$$

So,

$$Mi_{b} + Mi_{c} = - Mi_{a}$$
(5)

Substituting (5) in (4) the state space form of BLDC motor is obtained as-

$$\left[ {\begin{array}{*{20}c} {V_{as} } \\ {V_{bs} } \\ {V_{cs} } \\ \end{array} } \right] = \left[ {\begin{array}{*{20}c} {R_{s} } & 0 & 0 \\ 0 & {R_{s} } & 0 \\ 0 & 0 & {R_{s} } \\ \end{array} } \right]\left[ {\begin{array}{*{20}c} {i_{a} } \\ {i_{b} } \\ {i_{c} } \\ \end{array} } \right] + \frac{d}{dt}\left[ {\begin{array}{*{20}c} {L - M} & 0 & 0 \\ 0 & {L - M} & 0 \\ 0 & 0 & {L - M} \\ \end{array} } \right]\left[ {\begin{array}{*{20}c} {i_{a} } \\ {i_{b} } \\ {i_{c} } \\ \end{array} } \right] + \left[ {\begin{array}{*{20}c} {e_{a} } \\ {e_{b} } \\ {e_{c} } \\ \end{array} } \right]$$
(6)

2.2 PID Controller Design

A PID controller having a parallel structure is shown in Fig. 1.

$$PID = K_{p} + \frac{{K_{I} }}{S} + K_{d} S$$
(7)
Fig. 1
figure 1

Closed loop control of a BLDC motor using PID controller

The controller processes the error signal directly. The error signal is obtained from the difference of reference speed and actual speed. When in design stage, the controller parameters Kp, Ki and Kd depend upon the closed loop feedback system which are to be chosen from a long range of values. Practically realizing an ideal PID controller is not possible. An LPF may be used to reduce noise to some extent [12]. So, by using advanced optimization algorithms, response closer to ideal can be achieved (Fig. 2).

Fig. 2
figure 2

Overall block diagram of a PID controlled BLDC motor drive

3 Particle Swarm Optimization

Inspired by some natural phenomena and animal behavior, many meta-heuristic optimization concepts like Genetic Algorithm, PSO, Ant colony algorithm etc. have been developed and proved their efficiency in solving complex optimization problems. Among those PSO is one of the most popular algorithms which was developed by Kennedy, J. and Eberhart, R.C (1995) [13]. Its structure and approach to a problem follows the behavior of birds at the time of searching food, escaping from hunters or searching of mates [14, 15].

Particles are conceptual entities similar to birds which fly through the search space [6]. Each particle has two state variables, i.e. current velocity (Vi+1) and current position (Xi+1). At the beginning the population of particles (also referred as swarm) are initialized. Similarly, the position and velocity of each particle are initialized randomly. After each iteration, the velocity and position of each particle are updated using the following equations. The position of a particle gives a trial solution for the search problem [16, 17].

$$v_{i} \left( {t + 1} \right) = w.v_{i} \left( t \right) + C_{1} .\phi_{1} \left( {p_{i} (t) - x_{i} (t)} \right) + C_{2} .\phi_{2} \left( {g_{i} (t) - x_{i} (t)} \right)$$
(8)
$$x_{i} \left( {t + 1} \right) = x_{i} \left( t \right) + v_{i} \left( {t + 1} \right)$$
(9)
$$i = 1,\;2....n$$

Where ‘w’ is the weighted inertia which represents the degree of change of direction. C1 and C2 are positive constants. Similarly, ‘\(\phi_{1}\)’ and ‘\(\phi_{2}\)’ are two random numbers selected from a range of [0, 1]. ‘pi’ is the best position of ith particle and ‘gi’ is the best particle among the swarm [18,19,20]. The velocity of a particle is updated by using their previous velocity, distance of their current position from own best position and best position of neighbors given by (8). The new position is given by (9).

4 Grey Wolf Optimization

Grey wolf optimization is a new meta-heuristic optimization technique which is purposed by Seyedali Mirjalili, Seyed Mohammad Mirjalili, and Andrew Lewis (2014) [21]. This method follows the social hierarchy and hunting behavior of grey wolves. Their hunting strategy is followed by this algorithm to search and hunt a prey (solution). There are three main steps in hunting.

  1. 1.

    Tracking, chasing and approaching the prey.

  2. 2.

    Encircling and harassing the prey until it stops moving.

  3. 3.

    Attacking the prey.

Just like the social hierarchy of grey wolves (to live in groups), in this algorithm, four groups are defined; namely Alpha (α), Beta (β), Delta (δ), and Omega (ω). During the designing stage the social hierarchy of wolves is modeled. Alpha is the fittest solution; following Beta and Delta as the second and third best solutions. The rest of the solutions are least important and considered as Omega.

4.1 Searching for Prey

According to the position of the α, β and δ, grey wolves search for prey. They diverge from each other to search the prey.

$$\left| A \right| > 1$$
(10)

4.2 Encircling the Prey

To model the encircling behavior mathematically, following equations are proposed.

$$\vec{D} = \left| {\vec{C}.\vec{X}_{P} \left( t \right) - \vec{X}\left( t \right)} \right|$$
(11)
$$\vec{X}\left( {t + 1} \right) = \vec{X}_{P} \left( t \right) - \vec{A}.\vec{D}$$
(12)

Where,

$$\vec{A} = 2\vec{a}.\vec{r}_{1} - \vec{a}$$
(13)
$$\vec{C} = 2.\vec{r}_{2}$$
(14)

\(t\)= Current iteration.

\(\vec{A},\vec{C} \to\) Coefficient Vectors.

\(\vec{X}_{P} \to\) Position Vector of the prey.

\(\vec{X} \to\) Position vector of wolf.

The parameter ‘a’ is decreased from 2 to 0 in order to emphasize exploration and exploitation, respectively. The position of a grey wolf changes with respect to the position of prey. In this algorithm, the optimum solution (prey) is achieved with the help of the till known three best solutions (α, β, δ). To update their positions at next iteration, the following formulae are used.

$$\begin{gathered} \vec{D}_{\alpha } = \left| {\vec{C}_{1} .\vec{X}_{\alpha } - \vec{X}} \right| \hfill \\ \vec{D}_{\beta } = \left| {\vec{C}_{2} .\vec{X}_{\beta } - \vec{X}} \right| \hfill \\ \vec{D}_{\delta } = \left| {\vec{C}_{3} .\vec{X}_{\delta } - \vec{X}} \right| \hfill \\ \end{gathered}$$
(15)
$$\begin{gathered} \vec{X}_{1} = \vec{X}_{\alpha } - \vec{A}_{1} .\left( {\vec{D}_{\alpha } } \right) \hfill \\ \vec{X}_{2} = \vec{X}_{\beta } - \vec{A}_{2} .\left( {\vec{D}_{\beta } } \right) \hfill \\ \vec{X}_{3} = \vec{X}_{\delta } - \vec{A}_{3} .\left( {\vec{D}_{\delta } } \right) \hfill \\ \end{gathered}$$
(16)
$$\vec{X}\left( {t + 1} \right) = \frac{{\vec{X}_{1} + \vec{X}_{2} + \vec{X}_{3} }}{3}$$
(17)

4.3 Attacking the Prey

The wolves converge towards the prey, i.e. the position of prey is the final position of Alpha.

$$\left| A \right| < 1$$
(18)

After each iteration, the GWO algorithm allows its search agents to update their position based on the location of α, β, δ and attack towards the prey.

Before starting the main objective of any meta-heuristic population-based algorithm; two basic parameters are required to be initialized. The first and foremost parameter is the “maximum number of search agents”. In GWO algorithm we recognize the search agents as “grey wolfs”. In case of PSO the search agents are called as “swarm”. The number of search agents may vary according to the application. In this application, this value is taken as 30. The second important parameter is the “number of iterations”. This also depends upon the type of application and varies in a broad range. The less the number of iterations; less the evaluation time. The maximum number of iterations indicate, that the program stops here whether the optimal solution is achieved or not. In this program this value is taken as 50. The pseudo code of this algorithm is shown below.

figure a

Before designing a optimization technique based PID controller the objective function (also called fitness function) is first defined by taking the desired specifications and constraints into consideration [22, 23]. A proper objective function is chosen to tune the controller parameters by considering entire closed loop response. There are many time domain functions which can act as objective function for different systems. These are broadly classified into two groups. (a) Criteria based on a few points in the response, (b) Criteria based on the entire response or integral criteria. The integral criteria are generally chosen because of its good performance. An extra advantage of using the integral function is that it can be easily extended to a multi-loop system. The objective function proposed for this system “integral of product between time and absolute velocity error (ITAE) of the motor” [24] is defined in (19).

$$ITAE = \int\limits_{0}^{\infty } {t\left| {e(t)} \right|dt}$$
(19)

GWO algorithm is implemented for optimizing the objective function and after that performance of PSO and GWO is compared.

5 Implementation and Simulation Results

The simulation model for the purposed PID controlled BLDC motor drive is shown in Fig. 3. A reference speed is set as per the requirement. The measured speed is fed to the comparator via the feedback path. The error signal is processed by the PID controller.

Fig. 3.
figure 3

Simulation model of (a) BLDC motor, (b) PID controlled system.

The different parameters of the motor are given in Table 1. The parameters (KP, KI, KD) of the PID controller are evaluated by using different algorithms. Here we use GWO algorithm to evaluate the PID controller parameters and the output response is compared with the PSO based method. For both the algorithms the numbers of search agents and iterations are shown in Table2. Similarly, the values of KP, KI and KD for both the methods are shown in Table 3.

Table 1 BLDC Motor parameters
Table 2 Basic parameter values of the algorithm
Table 3 PID controller parameters for different algorithms

By using the controller parameters as shown in the Table 3 the output responses are obtained for both the cases as shown in Fig. 4.

Fig. 4
figure 4

Output response of PSO and GWO based systems

From the Fig. 4 it is clear that the peak overshoot and settling time is less in case of GWO based PID controlled system than the PSO based system. The performance of both the systems is compared in Table 4 when the motor runs at 1500 rpm. Figure 5 shows how the solution was searched in the search space using GWO (Table 5).

Table 4 Performance of PSO and GWO based PID controllers
Fig. 5
figure 5

GWO search space and pattern of search

Table 5 Performance of PSO and GWO based PID controllers

6 Conclusion

PID controller is a cost-effective choice for a BLDC motor drive [25]. To improve the performance of the PID controller many advanced techniques are evolving. Some techniques like PSO already proven its effectiveness in determining the parameters of the PID controller. In this article a new optimization technique (GWO) is applied which shows better results in controlling the speed of a BLDC motor than PSO technique. From results it is seen that the machine is settled down faster compared to PSO based technique. Also, the suggested method shows lesser damping. The stability analysis performance criterion viz ISE, IAE, ITAE, ITSE values are much improved in this suggested technique. Though the rise time is slightly higher than PSO technique but the other improvements in the time domain performance encourage the usage of GWO technique to tune the PID controller parameters of BLDC motor. The proposed method may give a new dimension towards the controller design field for a BLDC motor drive system.