## 3 Automatic Demagnetization Fault Diagnosis System Based on Three PNNs
### Database Creation  
The PNNs have to learn the relationship between the DFISs presented as their inputs and corresponding demagnetization fault modes as their outputs. Thus, three specific and meaningful databases should be carefully prepared, which contain all possible demagnetization fault occurrences and even the healthy modes. The training data are obtained by simulation, using the demagnetization fault model proposed in Section 2 of this study as it is not possible to collect large faulty modes on a real machine. Figure 11: Architecture of the PNN. The first database for training and testing the first PNN is composed of 132 examples of healthy modes and 924 examples of demagnetization faults of the employed PMSM, as shown in Table A1. A total of 1056 examples from the first database (\(1\times 22\times 6+7\times 22\times 3\times 2\)) includes one healthy mode (Mode 1) and 22 electrical periods (1 st-22 nd) as well as 6 operating conditions (rated speed and no load, 25% rated speed and 25% rated load, 50% rated speed and 50% rated load, 75% rated speed and 75% rated load, rated speed and rated load, and 125% rated speed and 125% rated load), along with and seven demagnetization fault modes (Mode 2-Mode 8), 22 electrical periods (1 st-22 nd), 3 demagnetization severities (10%, 50%, 100%), and 2 operating conditions (rated speed and rated load, 50% rated speed, and 50% rated load). A total of 100 samples is randomly selected from the samples of each mode as training samples and the other 32 samples are selected as testing samples. Hence, the training database for the first PNN has 800 examples (8\(\times\)100). To assess the generalization capacity of the adopted PNN, the testing data set should be different from the training data set. The testing database for the first PNN has 304 examples, including 256 examples (8 \(\times\) 32) from the above 1056 examples and 48 examples with a different demagnetization severity from the training examples. The 48 examples (1 \(\times\) 3 \(\times\) 2 + 7 \(\times\) 3 \(\times\) 2) are composed of 6 examples of healthy mode (Mode 1) including 3 electrical periods and 2 operating conditions (50% rated speed and 25% rated load, and 75% rated speed and 50% rated load), along with seven demagnetization fault modes (Mode 2-Mode 8) including 3 electrical periods and 2 demagnetization severities (25% demagnetized (50% rated speed and rated load), and 75% demagnetized (rated speed and 50% rated load)). The second database for training and testing the second PNN is composed of 840 examples, as shown in Table A2. A total of 792 examples of the second database (6 \(\times\) 22 \(\times\) 3 \(\times\) 2) includes 6 demagnetization fault modes (Mode 6H, Mode 7H, Mode 8H, Mode 6D, Mode 7D, and Mode 8D), 22 electrical periods (1 st-22 nd), and 3 demagnetization severities (10%, 50%, 100%) as well as 2 operating conditions (rated speed and rated load, 50% rated speed and 50% rated load). A total of 100 samples from each fault mode are randomly selected as training samples and the rest are selected as test samples. Hence, the training database for the second PNN has 600 examples. The testing database for the second PNN has 240 examples, including 192 examples from the above 792 examples and 48 examples with different demagnetization severities from the training examples. The 48 examples (6 \(\times\) 4 \(\times\) 2) are composed of 8 examples for each fault mode including 4 electrical periods and 2 demagnetization severities (25% demagnetized (50% rated speed and rated load), and 75% demagnetized (rated speed and 50% rated load)). The third database for training and testing the third PNN is composed of 308 examples, as shown in Table A3. A total of 264 examples of the third database (2 \(\times\) 22 \(\times\) 3 \(\times\) 2) includes 2 demagnetization fault modes (Mode 7D and Mode 8H), 22 electrical periods (1 st-22 nd), and 3 demagnetization severities (10%, 50%, 100%) as well as 2 operating conditions (rated speed and rated load, and 50% rated speed and 50% rated load).