Optimal fault resilient autonomous quadcopter control based on dynamic partial reconfigurable FPGA

Abstract Quadcopters are in enormous demand in mission-critical applications where there is a large risk to human life, such as border patrolling, emergency rescue, and production monitoring in chemical industries. Autonomously flying quadcopters can ensure higher levels of safety than remotely controlled quadcopters. Due to the complexity of autonomous quadcopters, there is a risk of failure, posing an enormous challenge to successful mission completion. Additionally, due to space constraints and the need for extended operation, the controller area and propulsion power are to be lower along with higher speeds of tracking for reaching the destination as early as possible. With these conflicting requirements, these metrics can be optimized in stages by reconfiguring the controllers on FPGA-based systems. Different controllers and suitable references are chosen and brought into action based on the metric that is lagging once they are found suitable to operate safely. This combination of control and reference reconfiguration and switching of main/auxiliary controllers is expected to ensure speed, area, and power optimization with improved fault resilience, ensuring better mission completion possibilities. This has been verified with Simulink-based algorithms of both continuous systems and fixed point-based digital systems and FPGA-based system co-simulation with the Simulink-based quadcopter model. Finally, the synthesis and implementation of the FPGA-based system is also taken up on Zynq Ultrascale±based devices with Vivado v2018.3-based IDE.


Introduction
Quadcopters are a kind of multirotor unmanned aerial vehicle with four rotors, with which it can take off vertically, hover, and move in all three directions.These movements and their compact structure make them ideal for surveying even complex terrains, saving considerable human effort.With features of autonomous operation, human efforts can be brought down further, although, with increased complexity, higher chances of failure and falling of the sensitive data into the hands of the enemy arise.For the successful completion of the target mission, there is a need for higher speeds of tracking with better power demands.For speed/power optimization, complex controllers with larger controller areas may even introduce reliability issues.Hence, it is challenging to optimize speed/power along with controller area/reliability.Santoso et al. (2021) covered a combination of PD with a parallel PD fuzzy-type controller for quadcopter positions that are observed to have better dynamics, error performance, and robustness to various types of disturbances and parameters.The results indicated that on the above metrics, although the hybrid controller has improved performance, there is scope for large improvements still possible.Sridhar et al. (2017) covered a nonlinear sliding mode controller for a quadcopter with a tiltrotor where the controller gains are tuned using the nonlinear model of the quadcopter.The controller is observed to meet all the constraints even during both internal and external disturbances.Due to the PDbased tilt angle control, a limited tracking speed is observed.Jelle et al. (2022) covered model predictive control on the bang approach, where different directions are divided into critical/noncritical.Only critical directions are optimized for tracking; others are tracked using simple control approaches minimizing the computations.Altitude is not changed due to computation limitations on board, and most of the limits are set conservatively.Roy et al. (2021) compared simple linear controllers to track quadcopter positions with complex nonlinear controllers.Also considered are learning-based controllers where the parameters of the model are not needed.A combination of controllers or controller hybridization techniques is stated to be the best choice for multidimensional optimization.Peiyun et al. (2022) covered trajectory tracking and attitude tracking based on event-triggered control based on error magnitude, where the controller is activated if the error is more than a threshold.Although there is a reduction in tracking times without compromising performance, because of a fixed controller with only on/off control multidimensional optimization is not possible.Strunz et al. (1995) cover fault models in digital circuits and approaches to detect them.The built-in self-test is a reasonable approach to cover moderately complex digital systems and hence is considered in the present design.Martínez-Cruz et al. (2018) covered the functional verification of digital systems using metaheuristic approaches such as genetic algorithms, particle swarm optimization, and binary particle swarm optimization with reinitialization (BPSOr).Although BPSOr is observed to be the best, exact tuning of the parameters is challenging.Drechsler (2021) used binary decision diagrams (BDD) to functionally test logic gates using the if-then-else concept, which is ideal for single output gates with polynomial time and space.For circuits with larger fanout, the structure becomes large.Ubar et al. (2006) covers structurally synthesizable BDDs.This structure can also be adapted where the variables are real numbers and the graph can be for any high-level operations, resulting in faster testing at a high level.Biswas and Karfa cover various testing and verification approaches for digital VLSI systems with minimum cases to cover a variety of faults.Even though complete testing is not possible, minimum test time can be taken to test a large portion of the complex system.Barker et al. (2007) have a bioinspired reconfiguration with fault detection for a system known as POEtic, which detects the fault, shifts the function to a healthier portion, and recovers from the failed state.Delay may increase if a large portion is faulty, limiting the stability of the system.Takanami (2001) developed a neural network algorithm in which a faulty processing element is replaced by a spare element, resulting in an embedded reconfiguration system.The proposed system has applications to improve the run-time reliability of the system, but the reconfigured neural network system is very basic for limiting the overhead in spare systems.Zhou et al. (2010) have a feedback linearization-based control for inner loop attitude control, whereas the PID-based approach is for outer loop trajectory control.Fixed point reconfigurable controller allocation ensures stable tracking while there are individual actuator faults.There is no fault tolerance provided for the portion of the tracking system other than actuators.Ram et al. (2020) compared the design flow for FPGA realization of conventional systems with that using dynamic partial reconfiguration.The obtained results indicate that DPR has considerable area/power/ clock cycle savings, resulting in improved throughput.It is also stated that the best use of DPR is in designing safe operating systems due to redundancy being natural in such systems.Deepanjali and Noor Mohammad (2022) have a fault tolerance scheme, where training data for detecting faults are stored in FlashROM, and using comparison, faults are detected.If there is a fault, an evolvable hardware approach is used to mitigate the fault.Intrinsic evolution has been found to be faster than hybrid evolution.Offline testing and standby system activation in the case of faults can drastically improve performance.Gugan and Haque (2023) reviewed various kinds of path-planning approaches with reference to computations, energy efficiency, and fault tolerance for aerial vehicles, both online and offline.Path planning for the autonomous operation of drones with optimal performance with reference to speed, controller area, and energy at high reliability is a need that is lacking.Jones et al. (2023) reviewed various path planning approaches, such as sample-based, bioinspired, artificial potential field, rapidly exploring random tree-based, fusion, and learning-based.Environmental models are static known, dynamic known, static unknown, and dynamic unknown in increasing order of autonomy.Ensuring safety is concluded to be the key metric along with onboard computation for all path planning schemes.Sabetghadam et al. (2019), performed autonomous drone trajectory tracking for aerial cinematography applications by decoupling gimble positioning problems.Due to space constraints, on-chip computation is not performed, limiting the tracking speed.Balasubramanian et al. (2022) have two types of path planning algorithms: the modified ant colony optimization A* algorithm and the MACO memory efficient A* algorithm.MACO MEA* is observed to have a shorter path, less tracking time, and efficient energy consumption.Other performance metrics, such as reliability and controller area, are not considered.Seth et al. (2017) developed a practical path planning strategy for robots using a 3rd-order polynomial for path planning with acceleration, velocity, and position constraints.Flying robots are not considered.Various powers involved in quadcopter tracking were summarized by Chan and Kam (2020).
As observed in these approaches, an autonomous quadcopter with reduced computations for optimizing the controller area with higher reliability without compromising tracking speed and energy simultaneously is lacking.Hence, there is a need for an approach in which, over a wider duration, cumulatively, these metrics can be optimized.Reliability, which is most relevant in complex autonomous quadcopters, needs to be ensured based on built-in self-test-based schemes.With DPR-based reconfiguration, area savings can be ensured, aiding the realization of auxiliary controllers, which can ensure optimization even in the case of faults.As considered by Jeromy Jeremy et al. (2012), Marinova and Tchobanova (2018) and Gaurav et al. (2017), the controller power can be optimized using pipelined approach on FPGA based on Zynq Ultrascale+, because of which realization is done on this FPGA.In the following sections, [II] presents the structure of the complete proposed system; [III], control activation for optimization presented previously; [IV], a built-in self-test for fault resilience; [V], a path planning algorithm for autonomous operation; [VI], simulation/implementation results; and [VII], concluding and providing directions for future scope.

Evolvable hardware-based optimal autonomous quadcopter position control system
Quadcopters are conventionally controlled by either PD/SMC/MPC (Jelle et al., 2022;Santoso et al., 2021;Sridhar et al., 2017) based stand-alone controllers.The FPGA with its reconfigurable architecture can be used to realize each of these controllers as per the need at a single block known as partition based on a concept of dynamic partial reconfiguration.For each of the directions depending on the metric to be optimized, the intelligent controller using the control activation module activates either of these controllers and ensures optimal tracking of the references generated by the path planning/guidance module.This process is followed only if either of the main or auxiliary controllers satisfies the testing undertaken by the fault-resilient module.If both main/auxiliary controllers fail the test, the path planning module is deactivated, resulting in no initiation of path planning and no tracking.Figure 1 is the proposed system.

Control activation for optimal tracking
Proportional derivative, sliding mode and model predictive controllers are widely used stand-alone controllers for quadcopter position tracking.PD is an easy-to-realize controller that can optimize the controller area, also resulting in optimal reliability.MPC is a complex controller occupying a large area, although it can optimize propulsion energy and speed of tracking.Due to the larger devices used for realization, it has compromised reliability.SMC is a controller that has area and reliability better than MPC but speed and energy better than PD, by which it stands moderately balanced compared to PD and MPC.For continuous quadcopter position tracking divided into equal durations by switching between these three controllers for each duration, within three consecutive intervals, each of the cumulative performance metrics of speed, reliability, area and power can be optimized.Although SMC stands in between PD and MPC, for a diversified approach, it can also be given equal priority as PD and MPC.This activation ( [Roy et al., 2021;Peiyun et al., 2022]) as per intervals is either for a single direction or any combination of directions, as demanded by the path planning/guidance algorithm.This activation is covered in detail in our previous work, which for clarity is summarized in the flowchart in Figure 2.

Built-in self-test algorithm for fault resilience
The controller structure shown in Figure 1 is a part of the complete system.The system presented has dynamic blocks, as only either PD/SMC/MPC for each of the X/Y/Z directions functions as per the metric to be optimized.The activation logic is as presented in the previous section.The angle generator, angle controller, and rotor speed estimator in series are fixed static parts, as they are always functioning.These combined dynamic and static blocks are the main dynamic/static controllers.To ensure fault resilience, there is an auxiliary controller that is both dynamic and static.Hence, the complete system has four subsystems.Main/auxiliary, dynamic/static blocks.The built-in self-test module has to test all four subsystems along with the quadcopter.Dynamic blocks have three partitions, one for each of the directions, shared between three controllers, PD/SMC/MPC, resulting in a total of 9 controllers (main dynamic).Hence, nine main dynamic, one main static, nine auxiliary dynamic, one auxiliary static, and one quadcopter model, resulting in twenty-one blocks, must be tested by the BIST module, with the quadcopter in loop.The BIST module does it by applying a reference X/Y/Z of 1.5 m to be tracked in 2 seconds, waiting for 3 seconds, then in the next 2 seconds, reverse reference is given bringing the quadcopter back to the origin, again waits for 3 seconds, taking a total 10 seconds.The same sequence is repeated for SMC in the second tracking interval and in the 3rd for MPC, taking a total of 30 seconds for the main.The same sequences of testing for the auxiliary dynamic are also followed.Two intervals of 10 seconds with the same references with the main PD activated for X/Y/Z are also taken to test each of the main/auxiliary static.In the first interval, the quadcopter model is also tested, and the complete test period to test all 21 blocks is 80 seconds.The test setup is shown in Figure 3.In Figure 3, ts is the settling time in sec., ca. is the control activation, ax/ay are acceleration x/y (m, for main, a, for auxiliary), ω 1-4 are rotor speeds, and sel.x/y/z/st are select lines for x/y/z (main/ auxiliary) and static (main/auxiliary).Static modules are tested initially with any of the PD/SMC/ MPC controllers (dynamic) activated, applying accelerations and thrust.However, as PD is most reliable due to its simple structure, all the static modules (main/auxiliary) are tested with PD activated as a dynamic module, ensuring reliable inputs to the static modules.Even the quadcopter is tested with the PD activated for the same reason and with either the main or auxiliary static module activated (in the present case, the main module is activated).

Quadcopter test process
The quadcopter is composed of sensors/actuators and controllers.Controllers are tested separately in successive stages.Hence, sensors and actuators must be ensured for satisfactory operation.When sensors/actuators malfunction during position tracking for known references at predefined rates, errors (difference between reference and feedback) go out of bound.Hence, if errors computed by the BIST module after passing to it, feedback signals from the quadcopter are within acceptable bounds, ensuring that sensor/actuator functioning leads to quadcopter functioning.Initially, the yaw reference is given, and then X/Y/Z references are applied simultaneously.The quadcopter test sequence is shown in the flowchart in Figure 4.

Static module testing process
For the same X/Y/Z/Yaw references, the activated PD for X/Y/Z computes accelerations X/Y and thrust for Z and applies it to the main static module in the first interval of the test and to the auxiliary static module in the second interval.The four rotor speeds are computed by these static modules and are fed back to the BIST module of the intelligent controller.The BIST module compares these four rotor speeds and computes the average rotor speed for ensuring proper Z tracking, ω 3 -ω 1 for proper pitching leading to X tracking, ω 4 -ω 2 for proper rolling leading to Y tracking, and ω 4 +ω 2 -ω 3 -ω 1 for proper yawing and for proper duration from the application of the references.If these values are consistently within the expected bounds, for both testing intervals, both the main and auxiliary static modules are functioning.All three constraints need to be satisfied for the test to produce Ok.Proper range, proper time from reference application and consistently.The process is summarized in the following flowchart.

Dynamic module testing process
During the 3rd and 4th intervals of 10 seconds, each main and auxiliary PD controller for X/Y/Z is tested, the 5th and 6th intervals, main and auxiliary SMC for X/Y/Z are tested, and the 7th and 8th intervals, main and auxiliary MPC for X/Y/Z are tested.For each of these controllers, acceleration x/y and thrust z are monitored by the BIST module.During each of these intervals for the main/auxiliary controllers for all the X/Y/Z directions, if the variables monitored are consistently within acceptable bounds at proper durations, as tested for static modules, these dynamic controllers are tested for functioning.With only the change in variables monitored, the testing process covered in the flowchart in Figure 5 remains the same for dynamic modules as well.As dynamic modules share the resources in a partition when realized on the FPGA, the PD/SMC/MPC controller's test results are combined to produce the main x/y/z controller ok/faulty and auxiliary x/y/z controller ok/faulty, as shown in (1) below.
Hence, if any of the PD/SMC/MPC main fails, control shifts to the corresponding auxiliary for x/y/z.In all the symbols above m, stands for main, a stands for auxiliary, and of stands for Ok/Faulty.With msof being the test result of the main static, as of being that of the auxiliary, and qof being for the quadcopter, the final test result for the initiation of position tracking by activating the path planning module to be covered in the next section is If Tst = 1, the system as a whole is healthy; otherwise, it is unable to track.

Path planning algorithm for autonomous tracking
Path planning provides acceptable references X/Y/Z to the respective controllers towards a target/ known destination.Acceptable references are those which are, • At acceptable rates, the controllers can ensure timely completion.
• Of proper type, such as ramp/step, the controllers under consideration are optimal for particular types of references (PD can track slow references such as ramp, whereas SMC/MPC are optimal for step/sudden references).
• No collision with obstacles (known prior and static as autonomy considered is Level 1, Jones et al. ( 2023)).
For proper performance comparison, PD/SMC/MPC are expected to track at a 0.75 m/s rate for each of the X/Y/Z directions simultaneously until the target in each direction is reached.With 2.25 m considered the largest distance through which the sensors can sense any obstacle for the specified rate of tracking, 3 seconds is chosen as the desired settling time for SMC/MPC, and a step of size 2.25 m is the reference for them, whereas for PD, a ramp at 0.75/s covering the same distance of 2.25 m in 3 seconds is considered.The flowchart for the path planning is shown in Figure 6.

Simulation/Implementation results
The results of balanced tracking for optimal speed/reliability/area/power were presented in previous work; here, the results are presented for the same with faults in some of the controllers.Despite all these faults, if balanced tracking with reference to speed/reliability/area/power is observed, avoiding the obstacle, the controller is a candidate to be inferred as a fault-tolerant, optimal, autonomous controller, system diagram of which is shown in Figure 7.

Simulink algorithm simulation of tracking towards the destination and back with no faults
Simulink algorithm simulation of tracking towards the destination and back with four faults specified as in Table 1 are shown in Figure 8(a-d).

Sys Gen simulation of tracking towards the destination and back with no faults
System generator simulation of tracking towards the destination and back with four faults specified as in Table 1, results are shown in Figure 8(e-h).

Summary of Simulation Results
As has been shown in the Table 2, for a total 120 m traversal, 85 sec.taken (approx.average of 1.4 m/s), propulsion energy drawn of approximately 117 KJ, without compromising reliability/controller area as shown in the cumulative ranks column where all four metrics of speed, reliability, area, and power are of equal rank 108 (best is 60 if all controllers are having 1st rank, worst is 180 if all are having the worst rank of 3), the novelty being no faults or 4 faults in the system, with no change in performance, indicates the controller is having optimal tracking even in case of faults.Avoiding (9.5, 9.5, 9.5) to (10.5, 10.5, 10.5), as has been observed in all 4 cases of X/Y/Z tracking, can also avoid obstacles, proving autonomous operation.No tracking if both main and auxiliary controllers failed can also be tested similarly.The BIST setup does not need any additional pins, which is a common requirement in test setups.
Note: The total energy drawn in kJ is the propulsion energy, estimated by the integral in (3).
l is the quadcopter arm length, T ad is the adaptive thrust, which is the control input that ensures proper linear motion, and ω i 's are the rotor speeds of individual rotors of the quadcopter (Chan and Kam, 2020).
Choose the directions of motion avoiding obstacle.

Stop
Compute the next reference as in eqn.

FPGA implementation based on vivado v2018.3 IDE
Implementation is carried out on FPGA using Vivado v2018.3 for two cases.
• For the same controller time sharing of the resources based on dynamic partial reconfiguration on Zynq Ultrascale+ device, xczu2cg-sfvc784-2e.
The detailed steps were presented in previous work for both cases, and only the results are summarized here (Table 3).
As observed in the implementation results of Table 3, considerable improvements in resources and power leading to cost savings have been attained with DPR-based realization on Zynq Ultrascale+ device.Power in W is the computation power of the FPGA-based controller, which is compared for the two Zynq Ultrascale+ devices, for each of the controller without DPR and that with DPR, along with two of the older versions of FPGA devices of 7 series (Kintex, xc7k160tfbg484-3) and Ultrascale (Virtex, xcvu065-ffvc1517-2e). Though Kintex 7 series device consumes least power, it is the slowest device out of the considered ones.Virtex Ultrascale device considered is most power consumed device.For DPR-based implementation, PD has the least power, as it is a simple control with very few computations.Although SMC and MPC have nearer power drawn, SMC with computation for only a small portion of the tracking period and for the rest of the tracking, the same control input is retained, net power/energy drawn by SMC is less than that of MPC.DPR-based realization has improved power consumption by atleast 3.5% compared with controller without DPR on the same device family of Zynq Ultrascale+.All the powers obtained are for IO standards of LVCMOS of 1.8 V for the FPGA devices chosen with a clock at 2 MHz.

Conclusion and future scope
Simulation results based on both the algorithm and system generator lead to the inference that a fault-resilient, optimal, autonomous quadcopter position controller based on dynamic partial reconfiguration can be realized on a Zynq Ultrascale+ FPGA, which has considerable area, power and cost savings compared to the same controller without DPR, and all other FPGA devices considered.
SMC/MPC controllers can be improved for performance, which in the present approach considered is basic.Activation based on true live metric values can be considered instead of ranks considered in the present work, which has discreteness leading to approximations in optimality being reached.Hardware realization may also be considered, and autonomy/testing algorithms may be improved for real-time tracking of quadcopter position.

Figure
Figure 7. Optimal fault resilient autonomous position controller for quadcopter.