You can build the most sophisticated perception system, the most elegant consensus algorithm, and the most capable controller โ and still kill someone if the systems engineering is wrong. This final module covers the disciplined frameworks that turn capable individual subsystems into a trustworthy, certifiable, deployable military UAV: requirements engineering, FMEA, reliability mathematics, DO-178C software assurance, MIL-STD-882 system safety, and formal safety cases.
๐ REFERENCES: Sadraey ยง10โ12 ยท MDPI Autonomous Control Ch.8 ยท MIL-STD-882E ยท DO-178C ยท Intelligent Coordination Ch.6
Systems engineering is the discipline of designing complex systems so that all their parts work correctly together. It is not about designing individual components โ that is the job of the component engineer. It is about making sure the EKF integrates correctly with the IMU, the autonomy stack handles edge cases the control system creates, and the communication link doesn't saturate when all sensors report simultaneously. Most UAV failures in the field are not component failures โ they are integration failures that systems engineering is specifically designed to prevent.
A hospital has excellent surgeons, excellent nurses, excellent pharmacists โ but if the operating theatre has no backup power supply and a blackout occurs mid-surgery, people die. That failure is not the surgeon's fault, or the pharmacist's fault. It is a systems engineering failure: someone was responsible for identifying "what happens if power fails during a critical procedure?" and designing a mitigation. Military UAV systems engineering asks exactly that question โ about every subsystem, every interface, every operating mode, including the modes the designers never intended to use.
The V-model is the standard development process for safety-critical UAV systems. The left branch defines and decomposes requirements; the right branch integrates and verifies them: Sadraey ยง10.1
Each left-branch phase generates test criteria for its corresponding right-branch phase. Requirements flow down; verification evidence flows up. Every arrow represents a formal review gate โ changes cannot proceed without sign-off. For military UAVs: system requirements review (SRR), preliminary design review (PDR), critical design review (CDR), and test readiness review (TRR) are contractually mandated.
Traditional systems engineering uses documents โ Word files, spreadsheets, PDFs. MBSE replaces documents with a living model of the system in a formal modelling language (SysML): Sadraey ยง10.2
| SysML Diagram Type | What It Models | UAV Use Case |
|---|---|---|
| Block Definition Diagram (BDD) | System hierarchy โ parts and their types | UAV system decomposed into avionics, propulsion, payload, comms |
| Internal Block Diagram (IBD) | Interfaces between blocks (data, power, mechanical) | IMU โ EKF data interface (rate, format, latency) |
| Requirements Diagram | Requirements and their allocation to blocks | Navigation accuracy req. allocated to EKF + IMU + GPS blocks |
| Activity Diagram | Operational flows and behaviours | Mission execution flow: takeoff โ transit โ loiter โ RTB |
| Sequence Diagram | Time-ordered message exchanges | EKF predict โ update โ control output sequence |
| State Machine | System modes and transitions | Flight modes: armed โ takeoff โ fly โ land โ disarmed |
A requirement is a statement of what a system must do or must not do. "The UAV shall navigate accurately" is not a requirement โ it is a wish. "The UAV shall maintain position within 2 metres (CEP) of a commanded waypoint in GNSS-denied conditions, with 95% probability, in winds up to 15 m/s" โ that is a requirement. Every word in that sentence carries engineering weight: it determines what sensors you need, what algorithms you run, and how you test whether the system actually meets the standard. Bad requirements are the single largest cause of programme failure in defence procurement.
| Property | Definition | Bad Example | Good Example |
|---|---|---|---|
| Specific | Unambiguous โ only one interpretation | "Good navigation" | "Position error โค 2 m CEP" |
| Measurable | Can be tested with defined pass/fail criteria | "Reliable communication" | "Link availability โฅ 99.5% over 4h mission" |
| Achievable | Technically and physically possible | "Zero collision probability" | "Collision probability โค 10โปโท per flight hour" |
| Relevant | Directly linked to operational need | "Detect all aircraft within 100 km" | "Detect threats within 10 km with P_D โฅ 0.95" |
| Traceable | Derives from a higher-level requirement | Requirements appear from nowhere | Each req. tagged with parent req. ID |
Requirements cascade from mission level down to component level. Each level adds specificity while remaining fully consistent with the level above: Sadraey ยง10.3
Each level is verifiable at its own testing stage. The IMU is tested on a vibration table (component verification). The EKF is tested in simulation with recorded flight data (subsystem verification). The full system is tested in flight test in a jammed environment (system verification). Every requirement must be traceable upward to a mission need โ orphaned requirements (with no parent) indicate scope creep and are a red flag in any review.
FMEA asks a systematic question about every component in the system: "What happens to the mission โ and to anyone on the ground โ if this component fails?" It forces engineers to think about failure before it happens, rather than after an accident. For every component, you identify all the ways it could fail, how likely each failure mode is, how severe the consequences are, and how easy it is to detect before it causes harm. Components whose failures are both likely and catastrophic get the most engineering attention โ redundancy, monitoring, fail-safe mechanisms.
FMEA quantifies risk through the Risk Priority Number (RPN): Sadraey ยง11.1
$S$: Severity (1โ10, consequence of the failure reaching the user/environment). $O$: Occurrence (1โ10, likelihood of the failure mode occurring). $D$: Detectability (1=easily detected before harm, 10=completely undetectable). $\text{RPN}_{\max} = 1000$. Mitigation required when RPN $> 100$ (typical threshold). MIL-STD-882E uses a categorical risk matrix instead of RPN โ but the logic is identical.
Perform FMEA on the navigation subsystem of a Group 3 military UAV. Four failure modes are analysed. Ratings 1โ10 per FMEA convention.
| Component | Failure Mode | Effect on Mission | S | O | D | RPN | Mitigation |
|---|---|---|---|---|---|---|---|
| GPS Receiver | Signal loss (jamming) | Navigation reverts to IMU โ position drift begins | 7 | 6 | 2 | 84 | EKF fuses baro + VIO; terrain nav backup |
| GPS Receiver | Spoofed position fix | UAV navigates to wrong location confidently | 9 | 4 | 8 | 288 | Chi-square RAIM; IMU consistency check; M-code |
| IMU (MEMS) | Accelerometer bias spike | EKF position estimate corrupted; divergence | 7 | 3 | 5 | 105 | Innovation monitoring; dual-IMU cross-check |
| EKF Software | Numerical divergence (matrix not PD) | Navigation solution invalid; autopilot loses reference | 9 | 2 | 6 | 108 | Joseph form update; covariance health monitor; RTB trigger |
| VIO Camera | Motion blur / feature dropout | Visual update lost; IMU drift begins | 5 | 5 | 3 | 75 | High-shutter camera; IMU-aided feature predict; fallback to baro |
| Barometer | Propwash pressure shock | Altitude estimate spike โ incorrect altitude hold | 6 | 4 | 3 | 72 | Vented enclosure; low-pass filter; dual baro |
Priority actions: GPS spoofing has the highest RPN (288) โ driven by high severity (9) and very poor detectability (8). This single entry justifies the entire chi-square RAIM system (Module 05), M-code GPS receiver, and IMU cross-check โ each targeting detectability $D$ directly. Bringing $D$ from 8 to 3 drops RPN from 288 to 108. Sadraey ยง11.1
FMEA works bottom-up (component โ system effect). FTA works top-down: start with an undesired top-level event ("UAV crashes in civilian area") and decompose it into combinations of contributing causes using Boolean logic gates: Sadraey ยง11.2
A crash requires: navigation failure AND control failure (AND gate). Navigation failure can be caused by: GPS failure OR IMU failure OR EKF software crash (OR gate). If $P(\text{GPS fail}) = 10^{-4}$, $P(\text{IMU fail}) = 10^{-5}$, $P(\text{EKF crash}) = 10^{-6}$: $P(\text{nav fail}) \approx 10^{-4} + 10^{-5} + 10^{-6} \approx 1.11\times10^{-4}$. If $P(\text{control fail}) = 10^{-4}$: $P(\text{crash}) = 1.11\times10^{-4} \times 10^{-4} = 1.11\times10^{-8}$ per flight hour. MIL-STD-882E catastrophic hazard target: $< 10^{-7}$ per flight hour. This analysis passes โ but only just. Reducing EKF software failure rate with more rigorous DO-178C compliance (section 10.6) could give a 10ร additional margin.
Reliability is the probability that a system performs its required function for a specified time under specified conditions. It is expressed as a number between 0 and 1, derived from the failure rate of components, their arrangement (series, parallel), and the operating environment. Understanding reliability mathematics lets you answer questions like: "If we use two GPS receivers instead of one, how much does the navigation system reliability improve?" or "How many flight hours can we expect before the first avionics failure?" These are not academic questions โ they determine maintenance schedules, mission planning, and procurement decisions.
For electronic components in steady-state operation, the failure rate $\lambda$ (failures per hour) is approximately constant, giving the exponential reliability model: Sadraey ยง11.3
$R(t)$: probability of surviving to time $t$ with no failure. MTBF: Mean Time Between Failures. At $t = \text{MTBF}$: $R = e^{-1} \approx 0.368$ โ only 37% of units survive to their rated MTBF. This surprises many engineers. MTBF is not a "safe operating life" โ it is the mean of an exponential distribution. 63% of units will have failed by their MTBF. For a 27-hour mission with MTBF = 500 h: $R(27) = e^{-27/500} = 0.947$ โ 94.7% probability of completing the mission without avionics failure.
Series: All components must work โ system reliability is product of individual. Adding components always decreases reliability. Each added sensor in a navigation fusion pipeline adds a series failure mode. Parallel (redundancy): System fails only if all redundant units fail simultaneously. Adding redundancy always increases reliability โ but at cost, weight, and complexity. The trade-off between series reliability penalty and redundancy benefit is the central reliability engineering decision in UAV avionics design.
An FCC (Flight Control Computer) has MTBF = 2,000 flight hours ($\lambda = 5\times10^{-4}$/hr). Mission duration: 8 hours. Compare reliability of: single FCC, dual redundant, triple redundant. Assume perfect voting logic (2-of-3 majority vote for triple).
Single unit: $R_1(8) = e^{-5\times10^{-4}\times8} = e^{-0.004} = \mathbf{0.9960}$ (99.60%)
Dual (active-standby): $R_{dual}(8) = 1-(1-R_1)^2 = 1-(0.004)^2 \approx \mathbf{0.999984}$ (99.9984%)
Triple (2-of-3 vote): System survives if $\geq 2$ of 3 units work. $$R_{triple}(8) = \binom{3}{3}R_1^3 + \binom{3}{2}R_1^2(1-R_1) = R_1^3 + 3R_1^2(1-R_1)$$ $$= 0.9960^3 + 3\times0.9960^2\times0.0040 = 0.9881 + 0.0119 = \mathbf{0.99999}$$ (99.999%)
Summary table:
| Configuration | $R(8h)$ | Failure prob. | Weight penalty | Certification level |
|---|---|---|---|---|
| Single FCC | 0.9960 | 0.40% | 1ร | DAL B achievable |
| Dual FCC | 0.999984 | 0.0016% | 2ร | DAL A achievable |
| Triple FCC | 0.99999 | 0.001% | 3ร | DAL A (highest integrity) |
Triple redundancy achieves 400ร reliability improvement over single FCC โ but at 3ร weight and the additional complexity of implementing and certifying correct voting logic. For a Group 5 HALE platform, the weight is acceptable. For a Group 1 micro-UAV, it is not. Platform class dictates the feasible redundancy architecture. Sadraey ยง11.3
Reliability tells you how often components fail. Fault tolerance is what happens when they do. A fault-tolerant system detects failures, isolates them from spreading, and continues operating in a degraded but safe mode. The goal is graceful degradation: losing one sensor reduces capability but does not cause the mission to catastrophically fail or the vehicle to crash. This requires thinking about failure at design time โ not debugging it in the field after an accident.
The FDIR framework defines the full response cycle to a detected fault: MDPI Autonomous Control Ch.8
| Phase | What Happens | UAV Implementation | Timing |
|---|---|---|---|
| Detect | Identify that a fault has occurred | Chi-square RAIM (sensor), watchdog timer (software), current monitor (hardware) | <10 ms |
| Isolate | Identify which component failed and prevent propagation | FDIE algorithm (Module 05); sensor bus isolation; software module quarantine | 10โ100 ms |
| Reconfigure | Switch to backup system or degraded mode | Activate redundant FCC; switch from GPS to VIO; raise MTBF-aware alert to GCS | 100โ500 ms |
| Recover | Return to full operational capability if possible | Re-integrate repaired sensor (online); clear watchdog; re-sync EKF | 0.5โ60 s |
For any reachable system state $s \in \mathcal{S}$, there must exist a sequence of actions $a_1, a_2, \ldots, a_k$ that transitions the system to a safe state $s_{safe}$ (typically: controlled landing or orbit hold) within maximum response time $T_{safe}$:
$$\forall s \in \mathcal{S}_{\text{reachable}}: \exists \{a_i\}_{i=1}^k \text{ s.t. } s_k = s_{safe}, \quad \sum_{i=1}^k \Delta t_i \leq T_{safe}$$This requirement is not automatically satisfied. Classic unsafe scenario: the primary FCC fails, the backup FCC starts, but its initialisation takes 3 seconds during which the aircraft is in an uncontrolled state. If $T_{safe} = 1$ s (fast-moving aircraft near terrain), the 3 s transition time violates safety reachability โ the aircraft may crash before the backup takes control. Solution: cold standby startup must be precomputed and cached; or warm standby (backup runs continuously, takes over in <50 ms). MDPI Autonomous Control Ch.8
DO-178C is the standard that governs how software in aircraft is developed, verified, and certified. It does not specify what algorithms to use โ it specifies the process by which software is created and how rigorously it must be tested. The standard assigns a Development Assurance Level (DAL) from A to E based on how catastrophic a software failure would be. A DAL A failure causes a catastrophic accident; DAL E has no safety effect. Higher DAL requires more rigorous process, more testing, and more documentation โ and therefore costs more and takes longer. For military UAVs operating in controlled airspace, DO-178C compliance is increasingly a legal and contractual requirement, not just a best practice.
DAL A software must achieve MC/DC (Modified Condition/Decision Coverage) โ the most rigorous structural coverage criterion required by DO-178C: MDPI Autonomous Control Ch.8
For a navigation fault condition: if (GPS_valid AND altitude_valid AND nav_healthy):
MC/DC requires test cases that individually toggle each condition while holding others fixed,
verifying each independently affects the branch outcome.
Minimum: $N+1$ test cases for $N$ conditions (vs $2^N$ for full branch coverage).
For an EKF health monitor with 8 boolean conditions: MC/DC requires 9 tests vs 256 for full coverage.
Still extremely expensive โ DAL A software costs $\sim$\$1,000โ\$10,000 per source line
when fully certified. This is why flight-critical ML models cannot currently be
DAL A certified: their decision boundaries are not expressible as finite boolean conditions
testable with MC/DC.
MIL-STD-882E is the US military standard for system safety โ the disciplined approach to identifying, evaluating, and controlling hazards throughout a system's lifecycle. Where DO-178C focuses specifically on software, MIL-STD-882 covers the entire system: hardware, software, human factors, procedures, and the interaction between all of them. For military UAVs, it is the primary safety standard โ compliance is a contract requirement for any DoD-funded UAV programme. The standard does not prescribe specific technical solutions; it requires a documented, disciplined process of hazard identification and control.
The standard defines risk as the combination of Severity and Probability in a risk matrix: MIL-STD-882E ยง3.3
| Severity โ / Probability โ | A Frequent | B Probable | C Occasional | D Remote | E Improbable |
|---|---|---|---|---|---|
| I Catastrophic (death, system loss) | 1A HIGH | 1B HIGH | 2C HIGH | 3D MED | 4E LOW |
| II Critical (severe injury, major loss) | 2A HIGH | 2B MED | 3C MED | 4D LOW | 5E LOW |
| III Marginal (minor injury, partial loss) | 3A MED | 4B LOW | 5C LOW | 5D LOW | 6E LOW |
| IV Negligible (no injury, no loss) | 4A LOW | 5B LOW | 6C LOW | 6D LOW | 6E LOW |
HIGH risk: unacceptable โ must reduce risk before fielding (redesign, add controls). MEDIUM risk: undesirable โ requires programme manager acceptance with justification. LOW risk: acceptable with review. All residual risks must be formally accepted by the Authorised Accepting Official (AAO) โ typically the programme manager. "Residual risk" is risk remaining after all planned mitigations have been applied.
For every HIGH and MEDIUM hazard identified in the Preliminary Hazard Analysis (PHA), MIL-STD-882 requires formal safety requirements with measurable acceptance criteria: MIL-STD-882E ยง4.2
This flow-down arithmetic allocates failure probability budgets to each subsystem. If the total catastrophic hazard budget is $10^{-7}/\text{fh}$ and the FTA has three AND-gated contributors, each can have $\sqrt[3]{10^{-7}} \approx 4.6\times10^{-3}/\text{fh}$ (for equal budget split). This FCC failure probability requirement then flows into the reliability analysis (section 10.4) and ultimately into hardware MTBF specifications and DO-178C DAL assignments. The entire process is mathematically consistent.
A safety case is a structured, documented argument that a system is safe enough for a specific operational use. It is not enough to say "we followed the process" or "the tests passed." A safety case makes an explicit claim โ "This UAV is acceptably safe to fly in controlled airspace below 500 ft AGL" โ and then provides an argument supported by evidence that the claim is true. If the argument has logical gaps, or the evidence does not support the argument, the safety case fails. Safety cases are now required for civilian UAV BVLOS operations in most jurisdictions, and for military programmes under DoD Directive 3000.09 (Module 08).
GSN is the standard language for expressing safety arguments. It has six element types: MDPI Autonomous Control Ch.8
| GSN Element | Symbol | Meaning | Example |
|---|---|---|---|
| Goal (G) | Rectangle | A claim to be argued | G1: UAV is acceptably safe in operational area X |
| Strategy (S) | Parallelogram | How the goal will be argued | S1: Argue over each identified hazard class |
| Solution (Sn) | Circle | Leaf evidence supporting a goal | Sn1: FMEA report Rev C, Section 3.4 |
| Context (C) | Rounded rect | Conditions under which goal applies | C1: Day VMC, winds <15 m/s, away from populated areas |
| Assumption (A) | Ellipse, dashed | Assumptions required for argument validity | A1: Maintenance per schedule has been performed |
| Justification (J) | Ellipse | Rationale for a strategy or claim | J1: Exponential distribution is appropriate for electronic components |
Construct a safety case argument fragment for the claim: "The navigation system provides position accuracy within 5 m CEP in GNSS-denied conditions sufficient for safe obstacle avoidance." This is a real sub-argument that would appear in a BVLOS safety case under the UK CAA / FAA BVLOS framework.
Why this structure matters: The assumption A1 makes the safety case conditional โ it is only valid when the camera is operational and the scene has texture. A regulator reviewing this safety case would immediately ask: "What happens when A1 is violated?" The answer must appear elsewhere in the full safety case โ the FMEA entry for VIO failure (Worked Example 10.1) must have a mitigated RPN that is acceptable, and there must be a detectability mechanism for VIO failure. Every assumption is a gap that must be closed by additional argument or evidence.
pip install numpy
# systems_engineering.py # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ # Part 1: FMEA calculator โ Sadraey ยง11.1 # Part 2: Reliability models (series/parallel/k-of-n) โ Sadraey ยง11.3 # Part 3: Fault Tree Analysis engine โ Sadraey ยง11.2 # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ import numpy as np from dataclasses import dataclass, field from typing import List # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ # PART 1 โ FMEA Calculator # Sadraey ยง11.1, MIL-STD-882E # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ @dataclass class FailureMode: """Single FMEA entry.""" component: str failure_mode: str effect: str severity: int # S: 1 (negligible) โ 10 (catastrophic) occurrence: int # O: 1 (rare) โ 10 (frequent) detectability: int # D: 1 (easy to detect) โ 10 (undetectable) mitigation: str = "" @property def rpn(self) -> int: return self.severity * self.occurrence * self.detectability @property def risk_level(self) -> str: if self.rpn >= 200 or self.severity >= 9: return "HIGH" elif self.rpn >= 100: return "MEDIUM" else: return "LOW" def run_fmea(failure_modes: List[FailureMode]): """ Run FMEA analysis, rank by RPN, flag items needing mitigation. Sadraey ยง11.1 """ ranked = sorted(failure_modes, key=lambda fm: fm.rpn, reverse=True) print(f"\n{'='*72}") print(f" FAILURE MODE AND EFFECTS ANALYSIS (FMEA)") print(f" Sadraey ยง11.1 | MIL-STD-882E Risk Matrix") print(f"{'='*72}") print(f"\n {'Component':<18} {'Failure Mode':<22} {'S':>2} {'O':>2} {'D':>2} {'RPN':>4} {'Risk':<7} {'Action'}") print(f" {'-'*70}") for fm in ranked: action = "โฒ MITIGATE" if fm.risk_level == "HIGH" else \ "โ REVIEW" if fm.risk_level == "MEDIUM" else "โ ACCEPT" print(f" {fm.component:<18} {fm.failure_mode:<22} " f"{fm.severity:>2} {fm.occurrence:>2} {fm.detectability:>2} " f"{fm.rpn:>4} {fm.risk_level:<7} {action}") if fm.mitigation and fm.risk_level in ("HIGH", "MEDIUM"): print(f"{'':>50} Mitigation: {fm.mitigation}") high = [fm for fm in ranked if fm.risk_level == "HIGH"] med = [fm for fm in ranked if fm.risk_level == "MEDIUM"] print(f"\n Summary: {len(high)} HIGH risk items (must mitigate before fielding)") print(f" {len(med)} MEDIUM risk items (require programme manager acceptance)") # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ # PART 2 โ Reliability Models # Sadraey ยง11.3 # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ class ReliabilityAnalyser: """ Compute system reliability for common configurations. All input failure rates ฮป in [failures/hour]. Sadraey ยง11.3 """ @staticmethod def single(lam: float, t: float) -> float: """Single component: R(t) = exp(-ฮปt)""" return np.exp(-lam * t) @staticmethod def series(lambdas: List[float], t: float) -> float: """Series system: all must work. R = prod(exp(-ฮปi*t)) = exp(-ฮฃฮปi*t)""" return np.exp(-np.sum(lambdas) * t) @staticmethod def parallel(lambdas: List[float], t: float) -> float: """Active parallel: system fails only if all units fail.""" Rs = [np.exp(-lam * t) for lam in lambdas] return 1 - np.prod([1 - R for R in Rs]) @staticmethod def k_of_n(lam: float, t: float, k: int, n: int) -> float: """ k-of-n redundancy: system works if at least k of n identical units work. Binomial reliability model. """ R1 = np.exp(-lam * t) F1 = 1 - R1 R_total = 0 for m in range(k, n+1): # sum over m=k to n working units binom = np.math.comb(n, m) R_total += binom * (R1**m) * (F1**(n-m)) return R_total @staticmethod def mtbf(lam: float) -> float: return 1.0 / lam def demo_reliability(): print(f"\n{'='*58}") print(f" RELIABILITY ANALYSIS โ Sadraey ยง11.3") print(f"{'='*58}") ra = ReliabilityAnalyser() t = 8.0 # mission duration [hours] lam = 5e-4 # FCC failure rate: MTBF = 2000 h print(f"\n FCC MTBF = {ra.mtbf(lam):.0f} h | Mission = {t} h") print(f"\n Configuration Reliability Failure Prob") print(f" {'-'*48}") configs = [ ("Single FCC", ra.single(lam, t)), ("Dual FCC (parallel)", ra.parallel([lam,lam], t)), ("Triple (2-of-3)", ra.k_of_n(lam, t, k=2, n=3)), ("Quad (3-of-4)", ra.k_of_n(lam, t, k=3, n=4)), ] for name, R in configs: print(f" {name:<24} {R:.8f} {(1-R)*100:.6f}%") # Navigation system series chain example print(f"\n NAVIGATION SYSTEM (Series Chain)") nav_components = { 'IMU': 1e-4, # MTBF = 10,000 h 'EKF Software': 5e-5, # MTBF = 20,000 h 'VIO Camera': 2e-4, # MTBF = 5,000 h 'Barometer': 5e-5, # MTBF = 20,000 h } R_nav = ra.series(list(nav_components.values()), t) print(f" {'Component':<18} {'MTBF':>8} {'R(8h)':>10}") for name, lam_c in nav_components.items(): R_c = ra.single(lam_c, t) print(f" {name:<18} {1/lam_c:>8.0f}h {R_c:>10.6f}") print(f" {'SYSTEM (series)':<18} {'โ':>8} {R_nav:>10.6f}") print(f" System failure probability: {(1-R_nav)*100:.4f}%") # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ # PART 3 โ Fault Tree Analysis Engine # Sadraey ยง11.2 # โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโ class FTANode: """Base class for FTA nodes.""" def probability(self) -> float: raise NotImplementedError @dataclass class BasicEvent(FTANode): """Leaf node โ basic failure event with known probability.""" name: str prob: float # probability per flight hour def probability(self) -> float: return self.prob @dataclass class ANDGate(FTANode): """AND gate: all children must fail for this gate to fail.""" name: str children: List[FTANode] def probability(self) -> float: return np.prod([c.probability() for c in self.children]) @dataclass class ORGate(FTANode): """OR gate: any child failure causes this gate to fail.""" name: str children: List[FTANode] def probability(self) -> float: return 1 - np.prod([1 - c.probability() for c in self.children]) def print_fta(node: FTANode, indent: int = 0): """Recursively print fault tree with probabilities.""" prefix = " " * indent kind = node.__class__.__name__ p = node.probability() if isinstance(node, BasicEvent): print(f"{prefix}โ {node.name:<30} P = {p:.2e}") else: gate = "AND" if isinstance(node, ANDGate) else "OR" print(f"{prefix}[{gate}] {node.name:<28} P = {p:.2e}") for child in node.children: print_fta(child, indent+1) def demo_fta(): """ FTA for 'UAV navigation-induced crash' top-level event. Sadraey ยง11.2 """ # Basic failure events (per flight hour probabilities) gps_jam = BasicEvent("GPS jamming", 1e-3) gps_spoof = BasicEvent("GPS spoofing", 5e-4) imu_fail = BasicEvent("IMU hardware failure", 1e-5) ekf_crash = BasicEvent("EKF software crash", 1e-6) vio_fail = BasicEvent("VIO camera failure", 2e-4) raim_fail = BasicEvent("RAIM detection failure", 5e-2) # probability RAIM misses spoof fcc_fail = BasicEvent("FCC control failure", 5e-4) # Navigation failure tree # GPS loss path: jamming OR (spoofing AND RAIM misses it) gps_loss = ORGate("GPS position loss", [ gps_jam, ANDGate("Undetected spoof", [gps_spoof, raim_fail]), ]) # Navigation failure: GPS lost AND IMU fails AND VIO fails AND EKF crashes # (need multiple failures simultaneously for nav loss) nav_fail = ANDGate("Navigation system failure", [ ORGate("Position sensor loss", [gps_loss, vio_fail]), ORGate("INS failure", [imu_fail, ekf_crash]), ]) # Top event: crash = navigation failure AND flight control failure top_event = ANDGate("UAV navigation-induced crash", [nav_fail, fcc_fail]) print(f"\n{'='*62}") print(f" FAULT TREE ANALYSIS โ Sadraey ยง11.2") print(f" Top Event: UAV Navigation-Induced Crash") print(f"{'='*62}\n") print_fta(top_event) p_top = top_event.probability() mil_threshold = 1e-7 # MIL-STD-882E Category I threshold status = "โ PASS" if p_top <= mil_threshold else "โ FAIL" print(f"\n Top event probability: {p_top:.2e} /flight-hour") print(f" MIL-STD-882E CAT I threshold: {mil_threshold:.0e} /flight-hour") print(f" Compliance: {status}") if p_top > mil_threshold: print(f"\n โ RAIM detection probability (P={raim_fail.prob}) is the dominant risk driver.") print(f" โ Improving RAIM from P_miss=0.05 to P_miss=0.001 reduces top event by 50ร.") if __name__ == "__main__": # Part 1: FMEA failures = [ FailureMode("GPS Receiver", "Signal loss (jamming)", "Nav reverts to IMU", 7, 6, 2, "EKF+VIO+TAN backup"), FailureMode("GPS Receiver", "Spoofed position fix", "Wrong navigation", 9, 4, 8, "Chi-sq RAIM; M-code"), FailureMode("IMU (MEMS)", "Accelerometer bias spike", "EKF divergence", 7, 3, 5, "Dual-IMU cross-check"), FailureMode("EKF Software", "Numerical divergence", "Nav invalid; RTB trigger", 9, 2, 6, "Joseph form; health mon."), FailureMode("VIO Camera", "Motion blur/feature dropout", "Visual update lost", 5, 5, 3, "High-shutter cam; baro fb"), FailureMode("Barometer", "Propwash pressure shock", "Alt spike", 6, 4, 3, "Vented enclosure; LPF"), FailureMode("FCC Software", "Watchdog timeout", "Control loss; backup FCC", 8, 2, 4, "Warm standby FCC"), FailureMode("Power Supply", "Primary bus failure", "All avionics lose power", 10, 1, 3, "Dual bus + UPS"), ] run_fmea(failures) # Part 2: Reliability demo_reliability() # Part 3: FTA demo_fta()