**1. Introduction**

In the last decade, the permeant magnet synchronous generator (PMSG) has been used in many industries, especially, for renewable energy applications [1–3], aircraft [4,5], and propulsion systems [6]. Consequently, this has generated growing concern about the operation reliability of the PMSG, especially in safety critical applications like the shaft generators (SG) in marine applications.

The PMSG faults inexorably decrease the reliability of the system, which may lead to malfunction or a failure in the system. Moreover, most PMSG applications are safety-critical, which makes the presence of fault an unwanted option. Mechanical, magnetic, and electrical faults are the major types of faults that may occur in a PMSG [7]. Extensive research has examined the detection of mechanical faults, which is the most usual fault in the PMSG; these faults can be divided into eccentricity faults [8–10], and bearing faults [11–14], based on [15], the bearing faults represent from 40 to 50% of the total faults while the eccentricity fault represents from 5 to 10% in the machines. Further research has considered the detection of demagnetization faults [16–18]. Both types of faults cause torque to unbalance; followed by an increase in the overall temperature of the machine. The high temperature may cause the deterioration of the stator winding insulation, which may lead to the presence of a stator

inter-turn fault [19–22], based on [21], the stator electrical faults represent 38% of the total faults in the machines. All these papers have focused on the stator winding inter-turn fault in any phase, which is a particular case fault that, if not addressed, affects the machine's voltage magnitude and balance, and may lead to other catastrophic failures.

Fault diagnosis (FD) techniques were used to detect the place and severity of the fault, followed by isolation with minimal losses. This can be divided into three main approaches: signal-based, artificial intelligence-based, and model-based techniques [7,23]. First are the signal-based techniques; they emphasize the analysis of the measured signal to detect the presence of specific frequency components relating to the fault. Moreover, it requires knowledge of the fault signatures, this knowledge can be acquired from the stator voltage and current, torque signal, and similar variables [7]. The advantages of these methods are the non-dependency on a specific model [24]. However, if the signal contains many harmonics, it may give an erratic estimation for fault. Furthermore, it needs a batch set of samples to analyze the signal; this causes a delay in time in determining a fault estimation. Wavelet transform (WT) is one of these methods that is presented in [25] and [26]. Additionally, Hilbert Hang transform (HHT) and Wigner–Ville have been shown to produce considerable results [17,27]. Also, the vibroacoustic techniques are used in condition monitoring for the machines in [28] and [29].

Secondly, artificial intelligence (AI) methods have been extensively studied in the fault diagnosis of electrical machines. These techniques require a deep understanding of fault signatures under several faulty conditions. However, it needs a set of logged data for the definite fault, which may be undetermined. In addition, some of these techniques do not cope with the online monitoring required for inter-turn short circuit detection due to the computational burden taking time for these techniques to fulfill the FD. Neural networks (NN) [30,31], particle swarm optimization [32], and fuzzy logic [33,34] are AI methods that have been used in stator windings FD of PMSG. A lot of researchers have used a combination of them, such as using the neuro-fuzzy technique [35] or using the AI technique with the signal base technique, such as using the wavelet transform (WT) with the adaptive neuro-fuzzy inference system (ANFIS) in [25].

The third choice is model-based FD techniques, which require the use of a system model. These techniques give the precise estimation of the fault if the mathematical model used is accurate, so they can estimate parameters that are hard to measure [36,37]. Moreover, these techniques offer online parameter identification with the required fast response for taking action. However, these techniques require an accurate model for the system to make a robust estimation in all operating conditions, which is so rare to find, this means that the model-based technique is not used in a lot of complex systems. In [38], the recursive least square (RLS) method is used to estimate the stator inter-turn faults, and the technique provides good response and early detection for the fault. The extended Kalman filter (EKF) has been used in [20,39–41], for the detection of the fault in PMSG and the induction motor (IM). Other researches take into account the use of unscented Kalman filter (UKF) in parameters estimation of PMSG, as an enhancement tool for the control system [42]. The model-based technique is also used in the industrial process control fault diagnoses in [37,43]. In [44], the research presented uses the graph of the process to find an accurate model for the system.

In this contribution, a comparison between the use of the EKF and the UKF is presented in the fault diagnosis of the stator inter-turn faults for PMSG, which has not been addressed before in any other research work. The mathematical model and the equivalent circuit in both healthy and faulty states were implemented based on the model in [21,40]. The procedures of fault percentage and location estimation using EKF and UKF are presented, and the simulation results of parameter estimation in both healthy and faulty conditions, showing the response of both techniques in the case of inter-turn short circuits through several operating conditions and scenarios, are discussed. Moreover, two scenarios were proposed for the decision-making process based on the severity of the fault. The results were validated by applying a practical emulation for the fault in a laboratory prototype machine and discussed.

#### **2. The Faulty PMSG Model**

The model was implemented in the direct and quadrature (dq-frame) in [39], in both states, healthy and faulty.

#### *2.1. PMSG Healthy State Model*

The healthy state represents the machine in the case of no fault; in this case, the internal current outgoing from the machine is the same current consumed from the load. Figure 1 shows the equivalent circuit of the machine in the abc-frame, *Rs* and *Ls* are the stator resistance and inductance. *Ea*,*Eb*,*Ec*, are the induced voltages, and the output current from the generator is represented by *Ia*, *Ib*,*Ic*.

To simplify the model, the equations of the machine should be converted to the dq-frame. Figure 2 shows the equivalent circuit of the machine in the dq-frame. *Ld* and *Lq* are the direct and quadrature inductance, *I sd* and *I sq* is the internal direct and quadrature current of the generator respectively, *Isd* and *Isq* are the terminal direct and quadrature current of the generator respectively, the *Vsd* and *Vsq* are the direct and quadrature stator terminal voltages, and ω*<sup>e</sup>* is the electrical angular speed that can be related to rotor mechanical angular speed ω*m*. All the equations representing the machine on the dq-frame are given in [39].

**Figure 1.** The equivalent circuit of healthy permeant magnet synchronous generator (PMSG) in the abc-frame.

**Figure 2.** The equivalent circuit of healthy PMSG in the dq-frame.

#### *2.2. PMSG Faulty State Model*

In the case of a PMSG stator winding fault, the number of turns in a certain phase is reduced due to the deterioration in the stator winding insulation, which causes a short circuit in this phase. Most stator winding insulation failures are caused by high temperatures and overloading. When a stator winding short circuit happens, the value of generator impedance changes, consequently the amplitude of stator current harmonics will increase, the torque will drag, and potential overheating will appear, and so on, this symptom may lead to complete failure if the fault was not addressed.

The short circuit current [*Is*/*c*]dq is generated inside the machine as shown in Figure 3 due to the presence of the short circuit impedance *Zs*/*<sup>c</sup>* in any phase; this impedance value changes according to the ratio between the number of inter-turn short-circuit windings and the total number of turns in one healthy phase. Figure 4 shows the equivalent circuit of the faulty machine in the dq-frame. The mathematical equations representing the faulty state model of the PMSG in dq-frame are given in [39].

**Figure 3.** The short circuit turns ratio representation.

**Figure 4.** The equivalent circuit of the faulty state PMSG in the dq-frame.

#### **3. Parameter Estimation Procedures**

The general faulty PMSG state-space model and EKF algorithm are presented in this section.

#### *3.1. General PMSG State-Space Model*

To use the EKF and UKF techniques to estimate the presence of the fault, the precise state-space model of the machine should be highlighted. Based on [39], the state-space model equation of the faulty machine can be written as:

$$\begin{cases}
\dot{\mathbf{x}}\_m(t) = A\_m \cdot \mathbf{x}\_m(t) + B\_m \cdot \boldsymbol{u}\_m(t) + \mathcal{W}\_m(t) \\
\boldsymbol{y}\_m(t) = \mathcal{C}\_m \cdot \mathbf{x}\_m(t) + D\_m \cdot \boldsymbol{u}\_m(t) + \mathcal{V}\_m(t)
\end{cases} \tag{1}$$

where:

$$\mathbf{x}\_m(t) = \begin{bmatrix} I\_{sd}' & I\_{sq}' \end{bmatrix}^T u\_m(t) = \begin{bmatrix} V\_{sd} & V\_{sq} & q\_f \end{bmatrix}^T A\_m = \begin{bmatrix} -\frac{R\_s}{L\_d} & \alpha\_{\mathcal{E}} \frac{I\_{sq}}{L\_d} \\ -\alpha\_{\mathcal{E}} \frac{I\_d}{L\_q} & -\frac{R\_s}{L\_q} \end{bmatrix}$$

$$B\_m = \begin{bmatrix} -\frac{1}{L\_d} & 0 & 0 \\ 0 & -\frac{1}{L\_q} & \frac{\omega\_{\mathcal{E}}}{L\_q} \end{bmatrix} \quad \mathbb{C}\_m = \begin{bmatrix} 1 & 0 \\ 0 & 1 \end{bmatrix}$$

$$D\_{\text{ff}} = \begin{bmatrix} \begin{bmatrix} D\_1 & 0 \end{bmatrix}^T D\_1 \ 1 \end{bmatrix} = -\sum\_{k=1}^3 \frac{2 \cdot n\_{\mathcal{E}/c,k}}{(3 - 2 \cdot n\_{\mathcal{E}/c,k}) \cdot \mathbf{R}\_s} \cdot \mathbf{P}(\theta)^T \cdot \mathbf{Q}(\theta\_{\mathcal{E}/c} \ \_k) \cdot \mathbf{P}(\theta)$$

where

$$P(\theta) = \begin{bmatrix} \cos \theta & -\sin \theta \\ \sin \theta & \cos \theta \end{bmatrix} \tag{2}$$

$$Q(\theta\_{\mathcal{S}/\mathcal{C}}) = \begin{bmatrix} \cos^2 \theta\_{\mathcal{S}/\mathcal{C}} & \sin \theta\_{\mathcal{S}/\mathcal{C}} \cos \theta\_{\mathcal{S}/\mathcal{C}} \\ \sin \theta\_{\mathcal{S}/\mathcal{C}} \cos \theta\_{\mathcal{S}/\mathcal{C}} & \sin^2 \theta\_{\mathcal{S}/\mathcal{C}} \end{bmatrix} \tag{3}$$

The extension of the model states to estimate the presence of a fault in any phase is compulsory for the estimation process of EKF and UKF, the new states of the model become as follows:

$$
\begin{bmatrix} \tilde{X}\_t(t) \end{bmatrix} = \begin{bmatrix} X(t) \\ \lambda(t) \end{bmatrix} = \begin{bmatrix} I'\_{sd} & I'\_{sq} & n\_{A \text{ s}/\text{c}} & n\_{B \text{ s}/\text{c}} & n\_{\text{C} \text{ s}/\text{c}} \end{bmatrix}^T \tag{4}
$$

where *Xe*(*t*) is the estimated state; After that, the model equations are linearized around a definite operating point followed by discretization at a sampling time *Ts*, the model expressed as:

$$
\begin{bmatrix} \dot{I}\_{sd}' \\ \dot{I}\_{sq}' \\ \dot{n}\_{A\ s/\varepsilon} \\ \dot{n}\_{B\ s/\varepsilon} \\ \dot{n}\_{C\ s/\varepsilon} \end{bmatrix} = \begin{bmatrix} 1 - T\_s \frac{R\_d}{L\_q} & T\_s w\_\varepsilon \frac{I\_d}{L\_d} & 0 & 0 & 0 \\ -T\_s w\_\varepsilon \frac{I\_d}{L\_q} & 1 - T\_s \frac{R\_d}{L\_q} & 0 & 0 & 0 \\ 0 & 0 & 1 & 0 & 0 \\ 0 & 0 & 0 & 1 & 0 \\ 0 & 0 & 0 & 0 & 1 \end{bmatrix} \begin{bmatrix} I\_{sd}' \\ I\_{sq}' \\ n\_{A\ s/\varepsilon} \\ n\_{B\ s/\varepsilon} \\ n\_{C\ s/\varepsilon} \end{bmatrix} + \begin{bmatrix} -\frac{T\_s}{L\_d} & 0 & 0 \\ 0 & -\frac{T\_s}{L\_q} & \frac{\omega\_0}{L\_q} \\ 0 & 0 & 0 \\ 0 & 0 & 0 \\ 0 & 0 & 0 \end{bmatrix} \begin{bmatrix} V\_{sd} \\ V\_{sq} \\ \varphi\_f \end{bmatrix} \tag{5}
$$

## *3.2. Extended Kalman Filter Algorithm*

The EKF gives an approximation of the optimal estimate. The non-linearity of the system's dynamics is approximated by a linearized version of the non-linear system model around the last state estimate. As in many cases, if the nonlinear system is approximately linearized, the EKF may not perform well [20]. If there is a bad initial guess regarding the underlying system's state, then this may cause a bad estimation. The first step in the EKF algorithm is the prediction step equations, which consist of state prediction and error covariance matrix update, and the second step is the correction step which corrects the predicted state estimate and it's covariance matrix as in Figure 5. Consider applying EKF to estimate the parameter λ*<sup>k</sup>* in the PMSG system, the discrete linearized state-space model of PMSG is expressed as:

$$\begin{cases} \begin{array}{c} \widetilde{X}\_{\mathfrak{c}\_{k+1}} =} = \widetilde{F}\_{k}\,\widetilde{X}\_{\mathfrak{c}\_{k}} + \mathcal{W}\_{k} \\ \widetilde{Y}\_{k} = \widetilde{H}\_{k}\,\,\widetilde{X}\_{\mathfrak{c}\_{k}} + V\_{k} \end{array} \tag{6}$$

where

$$\begin{cases} \begin{aligned} \widetilde{F}\_{\mathcal{K}} &= \begin{bmatrix} 1 + T\_s A(\lambda\_k) & T\_s \left( \frac{\partial A(\lambda\_k)}{\partial \lambda\_k} X\_k + \frac{\partial B(\lambda\_k)}{\partial \lambda\_k} lI\_k \right) \\ 0 & I \end{bmatrix} \\ \widetilde{H}\_{\mathcal{K}} &= \begin{bmatrix} \mathbb{C}(\lambda\_k) \left( \frac{\partial \mathbb{C}(\lambda\_k)}{\partial \lambda\_k} X\_k + \frac{\partial D(\lambda\_k)}{\partial \lambda\_k} lI\_k \right) \end{bmatrix} \end{aligned} \tag{7}$$

*FK* and *H<sup>K</sup>* represent the state and output equations of the discrete linearized model. By substituting matrix A and B in (4) into (6), *FK* and *H<sup>K</sup>* in case of, *nA s*/*<sup>c</sup>* , *nB s*/*<sup>c</sup>* , *nC s*/*<sup>c</sup>* , as an estimated parameter will be:

$$
\widetilde{F}\_K = \begin{bmatrix}
1 - T\_s \frac{R\_s}{L\_d} & T\_s \cdot \omega\_c \frac{L\_d}{L\_d} & 0 & 0 & 0 \\
0 & 0 & 1 & 0 & 0 \\
0 & 0 & 0 & 1 & 0 \\
0 & 0 & 0 & 0 & 1
\end{bmatrix}
\widetilde{H}\_K = \begin{bmatrix}
1 & 0 & S\_A \times q\_1 & S\_B \times q\_1 & S\_C \times q\_1 \\
0 & 1 & S\_A \times q\_2 & S\_B \times q\_2 & S\_C \times q\_2
\end{bmatrix}
\tag{8}
$$

where

$$\mathbf{S}\_A = -6 / \left( \left( 3 - 2n\_{A \text{ s/c}} \right)^2 \times \mathbf{R}\_s \right) \\ \mathbf{S}\_B = -6 / \left( \left( 3 - 2n\_{B \text{ s/c}} \right)^2 \times \mathbf{R}\_s \right)$$

$$\mathbf{S}\_C = -6 / \left( \left( 3 - 2n\_{C \text{ s/c}} \right)^2 \times \mathbf{R}\_s \right) \\ \begin{bmatrix} q\_1 \\ q\_2 \end{bmatrix} = \left[ P(\theta)^T \cdot Q \begin{pmatrix} \theta\_{\frac{1}{2}} \end{pmatrix} P(\theta) \right]\_{2 \times 2} \cdot \begin{bmatrix} V\_{sd} \\ V\_{sq} \end{bmatrix}$$

**Figure 5.** Extended Kalman filter (EKF) algorithm equations.

#### *3.3. Unscented Kalman Filter Algorithm*

Instead of using linearized equations using the Jacobin matrix to approximate the nonlinear model as the EKF approach, the UKF generates a finite set of sigma points to compute the predicted states and measurements and the associated covariance matrices [45]. Mathematically, the UKF process can be described as in Figure 6.

**Figure 6.** Unscented Kalman filter (UKF) algorithm equations.

Where *W<sup>m</sup> <sup>i</sup>* and *<sup>W</sup><sup>c</sup> <sup>i</sup>* are weighting factors and they are equal to.

$$\mathcal{W}\_i^m = \mathcal{W}\_i^\mathbb{C} = 1/2(L+\lambda) \tag{9}$$

where *L* is the state dimension and <sup>λ</sup> = <sup>α</sup>2((*<sup>L</sup>* + *<sup>k</sup>*) <sup>−</sup> *<sup>L</sup>*), <sup>α</sup> can be tuned from 10−<sup>4</sup> to 1 and *<sup>k</sup>* usually was chosen to be 0.

Figure 7 shows the block diagram of the fault diagnosis online monitoring for the PMSG.

**Figure 7.** PMSG fault diagnosis on-line monitoring block diagram.

#### *3.4. The Covariance Matrices Tuning*

The noises covariance matrices are diagonals, *Q* can be divided into two matrices: *q*x (for measured states) and *q*λ (for the estimated parameters). Thus, *Q* and *R* can be expressed as:

$$\begin{cases} \begin{array}{c} Q \ = \ \end{array} q\_{\rm x} \cdot \begin{bmatrix} I\_m & 0 \\ 0 & \frac{q\_{\rm x}}{q\_{\rm x}} \cdot I\_n \end{bmatrix} \\\ R \ = \ \boldsymbol{r} \cdot \boldsymbol{I}\_{\rm H} \end{cases} \tag{10}$$

where *m* is the state's *x* numbers and *n* is estimated parameters λ numbers, *qx* and *r* could be determined by measuring the variance of noises on input σ<sup>2</sup> *<sup>u</sup>* and output signals σ<sup>2</sup> *<sup>y</sup>* [20], they are expressed as Equation (9) and the ratio *q*<sup>λ</sup> /*q*<sup>x</sup> is set by the evolution time constant of the estimated parameters (τ) as expressed in Equation (10).

$$\begin{cases} \begin{array}{rcl} q\_{\rm x} &=& \left(\frac{\partial f\_{k}}{\partial u\_{k}}\right)^{2} \cdot \sigma\_{\rm u}^{2} \\ r &=& \left(\frac{\partial H\_{k}}{\partial X\_{k}}\right)^{2} \cdot \sigma\_{\rm y}^{2} \end{array} \end{cases} \tag{11}$$

$$\sqrt{\frac{q\_{\lambda}}{q\_{\chi}}} \approx \frac{T\_s}{\pi \cdot \sqrt{\sum\_{i}^{n} - 1 \left( \left| \frac{\partial f\_{k\_i}}{\partial u\_k} \right| \cdot \left| \frac{\partial u\_{k\_i}}{\partial X\_k} \right| \right)^2}}\tag{12}$$

#### **4. Simulation Results**

The machine parameters were taken from the nameplate of the generator, as shown in Table 1, the equations of the generator were used to simulate the output of the machine with different operating points, and the simulation run at sampling time *Ts* = 100 us.


**Table 1.** The PMSG parameters used.

#### *4.1. EKF VS. UKF Response*

Figure 8 shows the instantaneous internal current of phase A of the machine at RMS load current of 0.75 A and frequency of 30 Hz; a simulated inter-turn fault was implemented at *t* = 0.5 s, this fault caused an increase in the current inside the machine, respectively, the voltage in the faulty phase decreased by a small amount and the machine started to become hotter. The current reached an RMS value of 1.63 in the case of *nA s*/*<sup>c</sup>* = 4%, which is more than double the used load current. Also, the current reached an RMS value of 4.6 A in the case of *nA s*/*<sup>c</sup>* = 16%, which is more than 6 times the load current (0.75 A). This implies the importance of taking fast action to save the machine from damage.

Figure 9 shows the estimation response of EKF and UKF in either a healthy or faulty state; it was noticed that the UKF technique gives more precise values for the fault estimation than the EKF. As the PMSG model used is a linearized and discretized model around a specified operating point in the case of EKF, the error in the estimation varies non-linearly with the value of the short circuit turns ratio. Besides, the covariance matrices (*Q* and *R*) were chosen, which play an important role in the quality of the estimation. Also, the presence of sensor errors and the use of a phased locked loop (PLL) in the estimation of the angular position θ cause error in the estimated parameters. Figure 10 shows the error-index, which indicates the values of the inter-turn short circuit that the EKF and UKF techniques will estimate varies the percentage of error. It was noticed that the UKF had much less error than the EKF, especially for short circuit turns ratios greater than 20%, the highest error detected in case of using UKF was at *nA s*/*<sup>c</sup>* = 4% and reached 0.3%, however, the EKF estimation error reach 23.72% at *nA s*/*<sup>c</sup>* = 100%, the lowest estimation error detected by EKF was at *n <sup>s</sup>*/*<sup>c</sup>* = 16%.

The dynamic time response of detecting the fault was 0.02 s, which is very fast (approximately equal to 1.5 periodic cycles related to the used frequency). The covariance matrix *Q*, in this case, was tuned by time constant τ = 5 ms, which increased the dynamic response; however, it increased the presence of noise in the estimation action. Figure 11 illustrates the effect of τ on the estimation time, and it was noticed that when the τ = 10 ms, the estimation response reached a steady-state after 0.02 s with the presence of noise, however, when the τ = 80 ms, the estimation response reached a steady-state after 0.2 s but with filtering action. Figure 12 shows the dynamic estimation responses versus the parameter estimation evolution time constant (τ); the detection time increased linearly with the increase of the τ value.

**Figure 8.** The instantaneous currents of phase A in case of inter-turn fault at 0.72 A load and 30 Hz frequency.

**Figure 9.** EKF estimation response in phase A at a load of 0.72 A and a frequency of 30 Hz.

**Figure 10.** Error Index of the estimated parameter *ns*/*c*.

**Figure 11.** Estimation of 16% short circuit turn ratio in phase B in case of different τ.

**Figure 12.** Index of the estimated parameters *ns*/*c*.

#### *4.2. Robustness Tests*

The technique was tested in different operating conditions and showed a robust response; the same tests are done in cases of practical implementation, and are listed as the following:

Test 1: Variation of load current variation from 0.75 A to 3 A by 0.75 A step at a constant frequency of 30 Hz.

Test 2: Variation of frequency from 20 Hz to 50 Hz, with a 10 Hz step.

#### *4.3. Load Variation Test*

Figure 13 shows the estimated internal instantaneous currents in the presence of a 16% stator inter-turn short circuit in phase A in case of load variation from 0.75 to 3 A with a rate of 1 Hz. In the case of a 16% stator inter-turn fault, the current reached an RMS value of 5.3 A when ILoad = 1.5 A, and it reached an RMS value of 6 A when the ILoad = 2.25 A. This confirms the increase of fault severity as load current increases; this form of the fault requires fast action.

Figures 14 and 15 show the estimation response of EKF and UKF in load current variation from ILoad = 0.75 A to 3 A condition in the presence of 4%, 8%, 12%, and 16% stator inter-turn short circuit by a rate of 1 Hz. The time constant of the estimated parameters (τ) was chosen to be 10 ms based on the measured value of the input signal noises variance (*óx*). The estimation for both techniques show a constant response with the load variation with different short circuit values.

**Figure 13.** The instantaneous currents of phase A in case of fault at constant frequency of 30 Hz and current variation from 0.75 A to 3 A with step of 0.75 A.

**Figure 14.** Estimation response in phase A at a frequency of 50 Hz with load variation from 0.75 to 3 A and 7.5 A step.

**Figure 15.** Estimation response in phase A at a frequency of 50 Hz with load variation from 0.75 to 3 A and 7.5 A step.

## *4.4. Frequency Variation Test*

Figure 16 shows the estimated internal instantaneous currents in the case of faults in various frequencies, ranging from 20 Hz to 50 Hz with 10Hz step frequency and rate of change of 1 Hz. Figures 17 and 18 show the EKF the UKF estimation response in the presence of 4%, 8%, 12%, and 16% stator inter-turn short circuit in phase A at constant ILoad = 0.75 A and frequencies of 20 Hz, 30 Hz, 40 Hz and 50 Hz. The results show a constant response for both techniques with the frequency variation condition.

**Figure 16.** The instantaneous currents of phase A in case of fault at 0.75 A load and 50 Hz frequency.

**Figure 17.** Estimation response in phase A at a load of 0.75 A with frequency variation from 20 to 50 Hz and 10 Hz step.

**Figure 18.** Estimation response in phase A at a load of 0.75 A with frequency variation from 20 to 50 Hz and 10 Hz step.

#### **5. Experimental Results**

#### *5.1. Test Bench*

For safety conditions, to prevent the used PMSG from being damaged, it is not possible to make an actual stator inter-turn fault. However, it is possible to validate this detection method by adding a shunt resistance *RS*/*<sup>C</sup>* between the needed phase and the neutral, to increase the current in this phase and make the machine unbalanced by a percentage equal to that of an inter-turn fault.

The generator used rotates by means of a separately excited DC motor as a prime mover; the shaft of the motor is coupled directly to the shaft of the PMSG. The power pack supplies the DC motor field with a constant DC supply, and the armature is supplied with a variable DC supply to control the speed of the generator. The load used is a three-phase variable load with a maximum RMS value of 5 A; the shunt resistance *RS*/*<sup>C</sup>* is variable resistance, which will be added to any phase of the three phases using a circuit breaker. Figure 19 shows all the power components of the test bench.

The three-phase voltages were measured by three voltage transformers. The transformers used were typical 220 v/12 v single-phase transformers. Hence, the voltages measured were connected to analog signal conditioning boards to manipulate the voltage to be level with the digital signal processor (DSP) voltage (from 0 to 3.3 v).

On the other hand, the currents were measured using three CTs at a ratio of 10000:5. The current signals measured were connected to the signal conditioning circuit board to convert the current into a manipulated voltage which was compatible with a DSP analog to digital (A/D) input. The DSP used (Texas Instrument TMS320F280) had all measured signals connected to the A/D port in the DSP. The EKF algorithm was implemented online with a sampling period of *Ts* = 200 μs. The relay board was used to take the action of disconnection of the faulty phase to prevent fault propagation leading to severe failure. Figure 20 shows the connection diagram for the whole circuit.

**Figure 19.** Test bench.

**Figure 20.** Connection diagram.

#### *5.2. PMSG Test Output*

The next step was to compare the measured output voltages and currents of the PMSG used in a simulation of a healthy state. The value of the measured currents and voltages was found to be approximately the same as that in simulation, but with more measurement noise around a mean of 0.4; this will affect the dynamic response of EKF estimation in case of a fault. The output was measured in different load and frequency operating conditions and showed the same output as the simulation. Figure 21a,b show the instantaneous three-phase currents and voltages in the case of a healthy state of PMSG with a load current 0.72 A and frequency of 30 Hz.

Figure 22 shows the difference between the three-phase instantaneous currents and voltages in simulation and practical implementations. It can be seen that the experimental results appear noisier than that of the simulation. Accordingly, the parameter estimation responses will require more filtering action, which will cause a delay in the dynamic response.

**Figure 21.** Instantaneous 3phase currents and voltages.

**Figure 22.** Simulation vs. Practical implementation 3phase currents and voltages.

#### *5.3. EKF Response*

The model of a faulty machine and the EKF model were implemented in the DSP, the input to the machine state-space model are the measured stator voltages in the dq-frame. The short circuit current was calculated from the measured dq stator load currents and is presented in the model as the feed-forward matrix *Dm*. Therefore, the measured three-phase voltages and currents must be converted in dq-frame to make the EKF estimator work probably.

Indeed, the detection of electrical angular position θ is essential to use it in the abc to dq0 transformation. There are two suitable solutions for the detection of electrical angular position θ; the first is to use an encoder sensor coupled directly to the machine shaft and uses its counts to calculate the mechanical angular position, and then calculates the electrical angular position. Nevertheless, this solution requires the addition of new hardware to the system. The second solution is to generate the electrical angular position θ from voltage signals through the three phases of the phased locked loop (PLL), this solution is more economical as extra sensing devices are not needed. Nevertheless, the angular position generated will be dependent on the nature of the measured voltage.

The machine works at a load current of 0.72 and a frequency of 30 Hz in a healthy state. The practical experiments tested the EKF estimation responses in different values of short circuit inter-turn to turn the ratio in all phases (*nA s*/*c*, *nB s*/*<sup>c</sup>* & *nC s*/*c*) and in different operating points. The *Q* and *R* were tuned at τ = 20 ms to achieve the required fast response with a good filtering action.

Figure 23 display the response of EKF to estimate *nA s*/*<sup>c</sup>* = 4% using these conditions. The parameter estimation showed an excellent response to this case when compared to the results of the simulation. Figure 24 display the estimated internal instantaneous currents in the presence of 4%, stator inter-turn short circuit in phase A at *t* = 0.5 s, respectively. The same response was noticed on the estimation of *nA s*/*<sup>c</sup>* = 8% in Figure 25 followed by the estimated internal instantaneous

currents in phase A in Figure 26, respectively. Also, The same response was noticed on the estimation of *nA s*/*<sup>c</sup>* = 12% in Figure 27 followed by the estimated internal instantaneous currents in phase A in Figure 28, respectively. In addition, the estimation of the fault in *nA s*/*<sup>c</sup>* = 16% casein Figure 29 and it's etimated internal current in Figure 30. It was noted that the current reached higher values when compared to the rated current of 0.72 A.

**Figure 23.** Current in phase A at *nA s*/*<sup>c</sup>* = 4%.

**Figure 24.** Estimation of 4% short circuit turns ratio in phase A.

**Figure 25.** Current in phase A at *nA s*/*<sup>c</sup>* = 8%.

**Figure 26.** Estimation of 8% short circuit turns ratio in phase A.

**Figure 27.** Current in phase A at *nA s*/*<sup>c</sup>* = 12%.

**Figure 28.** Estimation of 12% short circuit turns ratio in phase A.

**Figure 29.** Current in phase A at *nA s*/*<sup>c</sup>* = 16%.

**Figure 30.** Estimation of 16% short circuit turns ratio in phase A.

#### *5.4. Tuning of Covariance Matrices*

Figure 31 shows the dynamic estimation response with different values of evolution time constant of the estimated parameter (τ) in the presence of a 16% fault in phase A. The weighting matrices (*Q* and *R*) were chosen based on measuring the variance of input noise and the variance of output noise to achieve the required fast dynamic response for the estimation of the parameters at different operating conditions. However, the change in the weighting matrices caused changes in the nature of the estimation response.

**Figure 31.** Estimation response with different τ at a constant frequency of 30 Hz.
