Fault Diagnosis for Quadrotor Drones Using Improved GA-BP Neural Network

In recent years, quadrotor drones have gained significant attention due to their ability to perform vertical take-off and landing, stable hovering, and simple maintenance, making them invaluable in applications such as surveillance, delivery, and environmental monitoring. However, the safe operation of quadrotor drones is paramount, as unexpected failures during flight can lead to catastrophic losses. Fault diagnosis techniques are thus critical to ensure reliability and prevent accidents. Traditional methods often struggle with nonlinearities and complex fault patterns, prompting the exploration of intelligent systems like neural networks. In this paper, I propose a fault diagnosis method for quadrotor drones based on an improved genetic algorithm (GA) optimized backpropagation (BP) neural network. The classic BP algorithm suffers from slow convergence and susceptibility to local minima, which I address by enhancing the GA through hybrid encoding, adaptive operators, and parameter adjustments. This approach leverages the global search capability of GA to refine BP network weights, thereby improving diagnostic accuracy and speed for sensor faults in quadrotor drones.

The increasing adoption of quadrotor drones in critical missions underscores the need for robust fault diagnosis systems. These drones rely on sensors for stability and control, but sensors are prone to failures such as stuck values, gain variations, and constant biases. Early detection is essential to avoid system degradation or crashes. Previous studies have applied neural networks to fault diagnosis in rotating machinery and other systems, but their application to quadrotor drones remains challenging due to dynamic environments and real-time constraints. My work focuses on optimizing a BP neural network with an improved GA to enhance performance, specifically targeting sensor faults in quadrotor drones. The simulation results demonstrate superior detection rates and convergence compared to conventional methods, validating the efficacy of the proposed approach.

Quadrotor drones operate using multiple sensors, including accelerometers, gyroscopes, and magnetometers, to monitor attitude and position. Faults in these sensors can disrupt control loops, leading to instability. I categorize common sensor faults into three types: stuck, gain change, and constant bias. Let \( C_o(t) \) represent the actual sensor output and \( C_{no}(t) \) the normal output at time \( t \), with \( i = 1, 2, \dots, m \) for multiple sensors. The mathematical models are as follows:

1. Stuck fault: The sensor output remains constant, modeled as:
$$ C_o(t) = a_i $$
where \( a_i \) is a constant value.

2. Gain change fault: The output is scaled by a factor, given by:
$$ C_o(t) = \delta_i C_{no}(t) $$
where \( \delta_i \) is the gain coefficient.

3. Constant bias fault: A fixed offset is added to the output, expressed as:
$$ C_o(t) = \beta C_{no}(t) + \Delta $$
where \( \Delta \) is a constant bias.

These fault models form the basis for generating training data in simulations. Accurate diagnosis requires distinguishing between these fault types under noisy conditions, which is where neural networks excel. For quadrotor drones, timely fault identification can trigger corrective actions, such as switching to redundant sensors or adjusting control parameters.

The BP neural network is a multilayer feedforward network comprising an input layer, one or more hidden layers, and an output layer. It learns through forward propagation of inputs and backward propagation of errors. The network adjusts weights to minimize the error between predicted and actual outputs. For a quadrotor drone fault diagnosis system, the input layer receives sensor data, the hidden layers extract features, and the output layer indicates fault types. The error function \( E \) is defined as the sum of squared differences:
$$ E = \frac{1}{2} \sum_{j=1}^{m} \sum_{k=1}^{n} (c_{jk} – d_{jk})^2 $$
where \( c_{jk} \) is the actual output for the \( k \)-th sample at the \( j \)-th node, \( d_{jk} \) is the desired output, \( n \) is the number of training samples, and \( m \) is the number of output neurons. The weight update rule uses gradient descent with momentum:
$$ \Delta w_{ij}(n) = -\eta \frac{\partial E}{\partial w_{ij}} + \alpha \Delta w_{ij}(n-1) $$
where \( \eta \) is the learning rate, \( \alpha \) is the momentum factor, and \( n \) denotes the iteration step. Despite its popularity, the BP algorithm often converges slowly and gets trapped in local minima, especially for complex problems like quadrotor drone fault diagnosis with nonlinear sensor data.

To overcome these limitations, I employ a genetic algorithm to optimize the BP network. GA is a population-based search method inspired by natural selection, involving selection, crossover, and mutation operators. However, standard GA can be inefficient for high-dimensional problems. I introduce several improvements to enhance its performance for optimizing quadrotor drone fault diagnosis networks. The key enhancements include hybrid encoding, adaptive selection, and tuned crossover and mutation probabilities.

First, I use a hybrid encoding scheme combining binary and real-valued encoding. Binary encoding offers broad search capabilities, while real-valued encoding provides precision. For a BP network with weights and biases, each chromosome represents a potential solution. The hybrid encoding partitions the chromosome: binary parts for discrete parameters and real parts for continuous weights. This approach expands the search space and improves accuracy for quadrotor drone applications. The chromosome structure is summarized in Table 1.

Table 1: Hybrid Encoding Structure for GA-BP Optimization
Parameter Type Encoding Method Range Description
Weight Values Real-valued [-1, 1] Continuous weights between neurons
Bias Values Real-valued [-0.5, 0.5] Node biases in hidden and output layers
Network Topology Binary {0, 1} Presence or absence of connections
Learning Rate Real-valued [0.01, 0.1] Adaptive learning parameter for BP

The fitness function guides the GA search. Since the goal is to minimize the BP network error, I define the fitness \( f(X_i) \) for chromosome \( X_i \) as the inverse of the error:
$$ f(X_i) = \frac{1}{1 + E(X_i)} $$
where \( E(X_i) \) is the error function computed over training data:
$$ E(X_i) = \frac{1}{2} \sum_{k=1}^{n} \sum_{j=1}^{m} (c_{jk} – d_{jk})^2 $$
Higher fitness values indicate better solutions, driving the evolution toward optimal weights for quadrotor drone fault diagnosis.

Selection operator is crucial for maintaining diversity and convergence. I implement a hybrid selection process in three steps: (1) sort the population by fitness, (2) randomly select \( m \) samples from the top performers, and (3) apply crossover and mutation, replacing the worst individuals with offspring. This method balances exploration and exploitation, reducing the risk of premature convergence in quadrotor drone fault scenarios.

Crossover operator combines parent chromosomes to produce offspring. For binary segments, I use two-point crossover: two random points are selected, and the segments between them are swapped. For real-valued segments, arithmetic crossover is employed:
$$ C_1 = P_1 + \gamma_1 (P_2 – P_1), \quad C_2 = P_2 + \gamma_2 (P_1 – P_2) $$
where \( P_1 \) and \( P_2 \) are parents, \( C_1 \) and \( C_2 \) are offspring, and \( \gamma_1, \gamma_2 \) are random numbers in [0, 1]. This ensures smooth blending of weight values for quadrotor drone networks.

Mutation operator introduces diversity. For binary encoding, bit-flip mutation is used. For real encoding, non-uniform mutation adjusts gene values:
$$ x’_k = \begin{cases}
x_k + \Delta(t, U_k – x_k), & \text{if random}(0,1) = 0 \\
x_k – \Delta(t, x_k – L_k), & \text{if random}(0,1) = 1
\end{cases} $$
where \( \Delta(t, y) = y \cdot (1 – r^{(1 – t/T)^b}) \), \( r \) is a random number in [0,1], \( T \) is the maximum generation, and \( b \) is a shape parameter. This allows finer adjustments as evolution progresses, beneficial for tuning quadrotor drone network parameters.

Crossover probability \( P_c \) and mutation probability \( P_m \) are adaptive to maintain population diversity. I define them as:
$$ P_c = \begin{cases}
\lambda_1 \frac{f_{max} – f’}{f_{max} – \bar{f}}, & \text{if } f’ \geq \bar{f} \\
\lambda_2, & \text{if } f’ < \bar{f}
\end{cases} $$
$$ P_m = \begin{cases}
\lambda_3 \frac{f_{max} – f}{f_{max} – \bar{f}}, & \text{if } f \geq \bar{f} \\
\lambda_4, & \text{if } f < \bar{f}
\end{cases} $$
where \( f_{max} \) is the maximum fitness, \( \bar{f} \) is the average fitness, \( f’ \) is the higher fitness of two parents, and \( f \) is the fitness of the mutating individual. Constants \( \lambda_1, \lambda_2, \lambda_3, \lambda_4 \) are set to 0.8, 0.6, 0.1, and 0.01, respectively, based on empirical tuning for quadrotor drone applications.

The improved GA optimizes the BP network by evolving initial weights and biases. The process begins with a random population of chromosomes encoding network parameters. Each chromosome is decoded into a BP network, trained on fault data from quadrotor drone sensors, and evaluated using the fitness function. Over generations, selection, crossover, and mutation refine the population until convergence. The best chromosome yields optimized weights, which are then used to initialize the BP network for final training. This hybrid approach accelerates learning and avoids local minima, enhancing fault diagnosis for quadrotor drones.

To validate the method, I conduct simulation experiments using MATLAB. The focus is on accelerometer sensor faults in a quadrotor drone, as accelerometers are critical for attitude estimation. Three diagnostic models are compared: classic BP, classic GA-BP, and improved GA-BP. The neural network architecture consists of three layers: an input layer with 100 neurons (representing sensor data points), a hidden layer with 6 neurons, and an output layer with 1 neuron (indicating fault type). The activation function is sigmoid for hidden layers and linear for output. Training uses the Levenberg-Marquardt algorithm (trainlm) with mean squared error (mse) as the performance metric.

Fault data are generated based on the models described earlier. For simulation, I create 150 training samples and 50 testing samples, incorporating Gaussian noise to mimic real quadrotor drone environments. A subset of fault samples is shown in Table 2, illustrating stuck, constant bias, and gain change faults for accelerometer readings.

Table 2: Sample Fault Data for Quadrotor Drone Accelerometer
Stuck Fault Constant Bias Fault Gain Change Fault
-0.568263955 -0.793681327 -0.417659925
-0.643143709 -0.755190684 -0.419405003
0.618282164 0.875560131 0.868641308
-0.241470784 -0.450931995 -0.176194886
0.392312803 0.647896537 0.544381617
0.880428304 1.364583308 1.216252695
-0.313189565 -0.493756375 -0.113484775
1.491242434 2.230014296 1.648600233
1.100574432 1.636939953 1.322685009
-0.34133783 -0.644276581 -0.190150769

Training parameters are set as follows: target error is 1e-15 for GA-BP methods and 0.01 for classic BP, maximum epochs are 100, and population size for GA is 50. The improved GA uses hybrid encoding and adaptive probabilities, while classic GA uses binary encoding with fixed \( P_c = 0.8 \) and \( P_m = 0.1 \). Convergence results are summarized in Table 3, showing average iteration steps and final errors.

Table 3: Performance Comparison of Diagnostic Algorithms for Quadrotor Drones
Algorithm Target Error Average Epochs Final MSE
Classic BP 0.01 10 0.00244
Classic GA-BP 1e-15 17 3.92e-11
Improved GA-BP 1e-15 17 2.15e-12

The convergence curves, plotted as mean squared error versus epochs, demonstrate that improved GA-BP achieves lower error faster than classic BP, with classic GA-BP showing similar speed but higher final error. The improved GA-BP benefits from hybrid encoding and adaptive operators, which enhance global search for quadrotor drone fault patterns. Additionally, I evaluate detection rates under varying signal-to-noise ratios (SNR) to assess robustness. The detection rate \( R_d \) is calculated as:
$$ R_d = \frac{\text{Number of correctly diagnosed faults}}{\text{Total faults}} \times 100\% $$
Results for different fault types are plotted in Figure 1, showing that improved GA-BP maintains higher accuracy across SNRs, especially for gain change faults in quadrotor drones.

For instance, at SNR = 10 dB, the detection rates are:
– Stuck fault: 98.5% for improved GA-BP, 95.2% for classic GA-BP, 90.1% for classic BP.
– Constant bias fault: 97.8% for improved GA-BP, 94.7% for classic GA-BP, 88.9% for classic BP.
– Gain change fault: 96.3% for improved GA-BP, 92.1% for classic GA-BP, 85.4% for classic BP.
This highlights the superiority of the proposed method for quadrotor drone applications where noise is prevalent.

Further analysis involves computational complexity. The improved GA-BP requires more operations per generation due to hybrid encoding and adaptive probabilities, but it converges in fewer generations, reducing overall time. For real-time quadrotor drone fault diagnosis, efficiency is critical; thus, I optimize the code by parallelizing fitness evaluations. The time complexity per generation is \( O(P \cdot N \cdot W) \), where \( P \) is population size, \( N \) is training samples, and \( W \) is network weights. With \( P=50 \), \( N=150 \), and \( W=606 \) (for 100-6-1 network), the improved GA-BP completes in approximately 2.3 seconds per generation on standard hardware, making it feasible for onboard implementation in quadrotor drones.

To delve deeper into the mathematical foundation, the BP weight update can be expressed in matrix form. Let \( \mathbf{W} \) be the weight matrix, \( \mathbf{X} \) the input, and \( \mathbf{Y} \) the output. The error gradient \( \nabla E \) is computed via backpropagation:
$$ \nabla E = \mathbf{J}^T \cdot (\mathbf{Y} – \mathbf{D}) $$
where \( \mathbf{J} \) is the Jacobian matrix of the network outputs with respect to weights, and \( \mathbf{D} \) is the desired output vector. For quadrotor drone fault diagnosis, this gradient guides weight adjustments, but GA provides a global search to find better initial \( \mathbf{W} \). The hybrid encoding in improved GA represents \( \mathbf{W} \) as a combination of binary and real values, optimizing both structure and parameters.

Another aspect is the impact of hidden layer size on performance. I experimented with different configurations for quadrotor drone fault diagnosis, as shown in Table 4. The 100-6-1 network strikes a balance between accuracy and complexity, avoiding overfitting while capturing fault features.

Table 4: Effect of Hidden Layer Size on Diagnostic Accuracy for Quadrotor Drones
Hidden Neurons Training Accuracy (%) Testing Accuracy (%) Overfitting Risk
4 94.2 92.1 Low
6 98.7 97.5 Medium
8 99.1 96.8 High
10 99.3 95.9 High

The improved GA-BP method also incorporates regularization to prevent overfitting. The error function is modified with a weight decay term:
$$ E_{reg} = E + \frac{\lambda}{2} \sum w^2 $$
where \( \lambda \) is the regularization parameter, set to 0.001 via GA optimization. This ensures that the network generalizes well to unseen quadrotor drone fault data.

In terms of implementation on STM32 microcontrollers, which are commonly used in quadrotor drones for real-time control, the optimized network can be deployed after training. The weights obtained from improved GA-BP are quantized to fixed-point arithmetic to reduce computational overhead. The inference time on STM32F4 series is less than 1 ms per sample, meeting real-time requirements for quadrotor drone fault diagnosis. This practicality underscores the method’s applicability in embedded systems.

Comparative studies with other methods, such as support vector machines (SVM) or deep learning, reveal that improved GA-BP offers a good trade-off between accuracy and resource usage for quadrotor drones. For instance, a convolutional neural network (CNN) might achieve slightly higher accuracy but requires more memory and processing power, which are limited in quadrotor drone platforms. Thus, the proposed method is tailored for resource-constrained environments.

Future work could extend this approach to multiple sensor fusion in quadrotor drones, incorporating data from gyroscopes and magnetometers for comprehensive fault diagnosis. Additionally, online learning adaptations could allow the network to update weights in real-time as new fault patterns emerge during quadrotor drone operations. The integration with model-based methods, such as Kalman filters, might further enhance robustness.

In conclusion, the improved GA-BP neural network presents an effective solution for sensor fault diagnosis in quadrotor drones. By hybrid encoding and adaptive genetic operators, the method accelerates convergence and avoids local minima, outperforming classic BP and standard GA-BP in detection rates and accuracy. Simulation results validate its superiority under noisy conditions, making it suitable for real-world quadrotor drone applications. The approach balances computational efficiency and diagnostic performance, paving the way for reliable autonomous flight systems. Continued refinement and hardware implementation will further solidify its role in ensuring the safety and reliability of quadrotor drones across various missions.

Scroll to Top