**6. Simulink implementation and results for a BLDC motor drive based on WNN-PID controller**

#### **6.1 Speed control based on feedforward WNN-PID controller**

The feedforward WNN with PID controller (FWNN-PID) is utilized to control the speed of the BLDC motor as shown in the Simulink model in **Figure 7**. The inputs of the WNN are the speed error and the change of this error, while the hidden layer has four neurons and one output in the output layer. The translation and dilation factors, weights connection for WNN, and PID parameters are learning on-line in PSO algorithm. The output of WNN is given by Eq. (2).

The PSO parameters are given in **Table 1**. These parameters are chosen to get optimal parameters for the PID controller and the wavelet neural network; when it is tuned on-line in PSO algorithm and BLDC motor drive, the optimal values for the PID controller parameters and the WNN parameters (a's, b's, w's) are given in **Tables 2** and **3**, respectively.

The BLDC motor drive is implemented in Simulink/Matlab program as shown in **Figure 6** with the optimal values of PID controller parameters and the optimal
