Module 5/5 · Weeks 13–15 · 27 h

Power and thermal management, and deployment in service

UAT 462 Edge Artificial Intelligence for UAS

About 100 minDraft, awaiting reviewLast updated 21 October 2026

Lesson

By the end of this module you will be able to

  1. Compute the energy per inference and per real frame of the on-board computer, and assess the effect on flight time including the added mass
  2. Choose the clock frequency or power mode that uses the least energy per image under a time limit
  3. Estimate thermal resistance and the time constant from a temperature log, and predict when throttling begins
  4. Design a verifiable release (file manifest with hashes, a signature, an A/B update with rollback)
  5. Design monitoring, staged roll-out and a safe fallback ladder, and summarise it as an acceptance report
  6. Plan the levels of system testing, write a test card, and compute the samples and flights needed to support a claim at a stated confidence

Prerequisites: UAT 462 modules 1 to 4 · UAT 102 Applied Physics for Aircraft Technology (module 4) · UAT 203 Electrical and Electronic Systems for Unmanned Aircraft (module 1)

Why this matters

The earlier modules made WasteNet-S fast enough on the lab bench, but in the field there are three things the bench lacks: a battery with limited energy, heat in an equipment bay under the sun, and the need to update and look after devices spread over several aircraft without breaking them. This module has two halves. The first keeps the system within its power and heat budgets (requirements R4 and R5). The second is about delivering, monitoring and rolling back safely (R2, R3 and R6). It ends with a mini-project that draws the whole course together.

Energy of the on-board computer

An on-board computer costs energy in two ways: directly, as electrical power, and indirectly, as added mass that makes the motors draw more power to stay aloft. MAVBench, which studied complete small-aircraft applications, found an unexpected relationship between computing and the total energy of the system and reported that an efficient system design improves battery consumption by up to 1.8 times (Boroujerdian et al., 2018). Measuring the energy of inference also has a standard: MLPerf Tiny measures the accuracy, latency and energy of inference so that systems can be compared fairly (Banbury et al., 2021).

Three measures must not be confused. Energy per inference is the energy of the busy period. Average power is , where is the frame rate, and energy per real frame is , which includes idle energy. At a low frame rate (such as the 1 fps of patrol mode) the board is idle almost all the time, so idle energy dominates. For mass, the power needed to hold a multirotor aloft rises as (see UAT 102 module 4), so .

Example 1 What do three computers cost in flight time?

A multirotor of 5.2 kg (without the computer) with a 6S 16 Ah battery, 80% usable, and cruise power of 560 W. A 20.8-minute sortie must be flyable with 1.3 times margin (R4). Three candidates (all values assumed): an SBC using only its CPU (0.145 s per frame, matching the all-on-CPU plan of module 2 plus surrounding work); an SBC with an NPU accelerator (0.025 s, close to the prefix-only plan of module 2 plus surrounding work); and a GPU module in its 15 W mode (0.015 s). Evidence mode must work at 10 fps.

# the energy cost of the on-board computer: energy per inference, energy per real frame, and lost flight time (all values assumed)
BATTERY_WH, USABLE = 6 * 3.7 * 16, 0.80                           # 6S 16 Ah, 80 % usable
AIRCRAFT_KG, CRUISE_W = 5.2, 560.0                                # aircraft mass without the computer, and cruise power
SORTIE_MIN, MARGIN = 10_000 / 8 / 60, 1.3                         # a 10 km sortie at 8 m/s must be flyable with 1.3x margin
PATROL_FPS, EVIDENCE_FPS = 1.0, 10.0
usable_wh = BATTERY_WH * USABLE
print(f"usable energy {usable_wh:.0f} Wh, baseline endurance {usable_wh / CRUISE_W * 60:.1f} min, needed {SORTIE_MIN * MARGIN:.1f} min")

candidates = {  # (added mass kg, idle W, active W, time per frame s)
    "SBC, CPU only": (0.12, 3.0, 8.0, 0.145),
    "SBC + NPU module": (0.16, 4.5, 11.0, 0.025),
    "GPU module, 15 W mode": (0.25, 5.0, 14.0, 0.015)}
print(f"{'candidate':23s} {'J/inference':>11s} {'patrol J/frame':>15s} {'mass cost W':>12s} {'endurance':>10s} {'evidence 10 fps':>16s}")
for name, (dm, idle, active, t_frame) in candidates.items():
    mass_w = CRUISE_W * (((AIRCRAFT_KG + dm) / AIRCRAFT_KG) ** 1.5 - 1)   # extra power from added mass, proportional to m^1.5
    avg_w = idle + (active - idle) * t_frame * PATROL_FPS                 # average power = idle + difference x busy share of time
    endurance = usable_wh / (CRUISE_W + mass_w + avg_w) * 60
    busy10 = t_frame * EVIDENCE_FPS
    evidence = "cannot keep up" if busy10 > 1 else f"{(idle + (active - idle) * busy10) / EVIDENCE_FPS:.2f} J/frame"
    print(f"{name:23s} {active * t_frame:11.2f} {avg_w / PATROL_FPS:15.2f} {mass_w:12.1f} {endurance:8.1f} min {evidence:>16s}")
usable energy 284 Wh, baseline endurance 30.4 min, needed 27.1 min
candidate               J/inference  patrol J/frame  mass cost W  endurance  evidence 10 fps
SBC, CPU only                  1.16            3.73         19.5     29.2 min   cannot keep up
SBC + NPU module               0.28            4.66         26.0     28.9 min     0.61 J/frame
GPU module, 15 W mode          0.21            5.13         40.9     28.1 min     0.64 J/frame

The GPU module has the lowest energy per inference (0.21 J) but the highest energy per real frame at 1 fps (5.13 J), because its 5 W idle power occupies nearly all the time. Its 250 g costs 40.9 W of extra power, about eight times its own average electrical power, leaving 28.1 minutes against 29.2 minutes for the CPU-only SBC. All three still meet the 27.1-minute requirement, but the CPU-only SBC cannot do evidence mode, because 0.145 s per frame caps it at 6.9 fps, below the 10 fps that R2 needs. The SBC with NPU meets both R2 and R4, with 28.9 minutes of flight and 0.61 J per frame in evidence mode, so it is the best choice on these assumed figures. The conclusion is that mass matters as much as electricity, and the right measure is energy per real frame at the job’s frame rate, not TOPS per watt or energy per inference alone.

Stacked horizontal bars of the power added by three candidates, split into mass (orange) and average electrical power (blue). SBC with CPU only 19.5 plus 3.7 watts, 29.2 minutes of flight. SBC plus NPU 26.0 plus 4.7 watts, 28.9 minutes. GPU module at 15 watts 40.9 plus 5.1 watts, 28.1 minutes
Figure 1 Added power of each candidate split into mass and electrical parts, with the remaining endurance

Power modes and clock frequency

Most boards can change frequency and voltage (DVFS). The Raspberry Pi 5 uses DVFS for thermal efficiency, and Jetson has selectable power modes: NVIDIA lists 7, 15 and 25 W modes (and an unconstrained MAXN SUPER mode) for the Orin Nano Super developer kit, each fixing a different number of CPU cores and maximum CPU and GPU clocks. The current mode is read with nvpmodel -q and changed with nvpmodel -m (Jetson Linux documentation). Choosing a mode is therefore choosing a point on a curve. Electrical power has two parts: a static part independent of frequency () and the dynamic part of CMOS circuits that grows as , which, when the voltage follows the frequency, grows roughly as . The time per image has a compute part that falls as and a memory-wait part that does not change.

Example 2 Which clock uses the least energy per image?

An assumed model: power (W, with in GHz) and time per image seconds. Look at the energy per image against frequency, then choose a frequency when evidence mode limits the time per image to 45 ms.

import numpy as np

# the clock with the lowest energy per image: power = static part + k f^3, time = compute part / f + a memory-wait part (assumed)
P_STATIC, K = 2.5, 3.2                                            # W and W/GHz^3
T_COMPUTE, T_MEMORY = 0.030, 0.012                                # s at 1 GHz, and s that does not scale with the clock
f = np.arange(0.4, 1.81, 0.1)
power = P_STATIC + K * f ** 3
t = T_COMPUTE / f + T_MEMORY
energy = power * t
print(" f GHz | power W | time ms | energy mJ/image")
for fi, p, ti, e in zip(f[::2], power[::2], t[::2], energy[::2]):
    print(f"{fi:6.1f} | {p:7.2f} | {ti * 1e3:7.1f} | {e * 1e3:8.0f}")
best = f[np.argmin(energy)]
print(f"lowest energy at {best:.1f} GHz: {energy.min() * 1e3:.0f} mJ/image ({t[np.argmin(energy)] * 1e3:.1f} ms); at the top clock {energy[-1] * 1e3:.0f} mJ ({t[-1] * 1e3:.1f} ms)")
budget = 0.045                                                     # time allowed per image in evidence mode, 45 ms (assumed)
ok = t <= budget
pick = f[ok][np.argmin(energy[ok])]
print(f"slowest clock that meets {budget * 1e3:.0f} ms: {f[ok].min():.1f} GHz; lowest-energy choice meeting it: {pick:.1f} GHz at {energy[ok].min() * 1e3:.0f} mJ")
 f GHz | power W | time ms | energy mJ/image
   0.4 |    2.70 |    87.0 |      235
   0.6 |    3.19 |    62.0 |      198
   0.8 |    4.14 |    49.5 |      205
   1.0 |    5.70 |    42.0 |      239
   1.2 |    8.03 |    37.0 |      297
   1.4 |   11.28 |    33.4 |      377
   1.6 |   15.61 |    30.8 |      480
   1.8 |   21.16 |    28.7 |      607
lowest energy at 0.7 GHz: 197 mJ/image (54.9 ms); at the top clock 607 mJ (28.7 ms)
slowest clock that meets 45 ms: 1.0 GHz; lowest-energy choice meeting it: 1.0 GHz at 239 mJ

Energy per image is not lowest at the slowest or the fastest clock. At low frequency the 2.5 W static part runs for longer and wastes energy. At high frequency dynamic power grows faster than the time falls. The minimum is at 0.7 GHz with 197 mJ per image (54.9 ms); at the top clock it is 607 mJ, more than three times as much. But with a 45 ms deadline the minimum cannot be used: the choice is 1.0 GHz at 239 mJ, 21% above the minimum but still 2.5 times less than the top clock. In practice, set the mode by mission: patrol mode, with relaxed timing, uses the economical mode, and evidence mode uses the mode fast enough for p95 under 100 ms, not the fastest mode all the time.

Heat and throttling

A chip dissipating power warms toward the steady state , where is the thermal resistance from chip to air (°C per watt), approaching it exponentially with time constant , where is the heat capacity (a first-order model). Boards have throttling thresholds to protect themselves. Raspberry Pi states that the Arm cores are progressively throttled between 80 and 85 °C, and at 85 °C both the Arm cores and the GPU are throttled; temperature is read with vcgencmd measure_temp. The Jetson Linux documentation (releases 36.4 and 36.5 give the same values) states that software throttling begins at 99.0 °C, hardware throttling at 103.0 °C and shutdown at 104.5 °C, with hardware clock throttling when module power exceeds the configured limit. Accelerators have limits too: the Raspberry Pi AI HAT+ product page gives an ambient operating range of 0 to 50 °C, which in an equipment bay that reaches 45 °C (R5) leaves a margin of only 5 °C.

The in a datasheet cannot predict temperature in our system. Texas Instruments explains that is a value for a package on a particular test board, meant only for comparing packages; using it to compute in a real system is a misuse, because also depends on the board and the environment (Texas Instruments, 2024). and must be measured in the real system, in real airflow.

Example 3 A sealed bay against a bay with propwash, and measuring R from a temperature log

A full load of 9 W (3 W when idle), 45 °C air in the equipment bay, a heat capacity of 25 J/°C (assumed) and a throttling threshold of 80 °C. Compare a sealed bay with no airflow () with a vented bay that propwash flows through (). Then simulate a real measurement: the load is held constant and temperature logged every 5 seconds with 0.4 °C of noise, and curve_fit recovers and .

import numpy as np
from scipy.optimize import curve_fit

# first-order thermal model: T(t) = T_amb + P R (1 - exp(-t / tau)); R and tau assumed
T_AMB, P_ACTIVE, P_IDLE, T_THROTTLE, C_TH = 45.0, 9.0, 3.0, 80.0, 25.0       # °C, W, W, °C, J/°C
cases = {"sealed bay, no airflow": 7.0, "vented bay with propwash": 3.5}       # thermal resistance (°C/W)
for name, R in cases.items():
    tau = R * C_TH
    t_ss = T_AMB + P_ACTIVE * R
    if t_ss <= T_THROTTLE:
        print(f"{name:26s} R {R:3.1f} C/W, tau {tau:5.1f} s, steady state {t_ss:5.1f} C: never reaches {T_THROTTLE:.0f} C")
        continue
    t_hit = -tau * np.log(1 - (T_THROTTLE - T_AMB) / (P_ACTIVE * R))
    p_sustain = (T_THROTTLE - T_AMB) / R                                    # the power that can be held forever at 80 C
    share = (p_sustain - P_IDLE) / (P_ACTIVE - P_IDLE) * 100
    print(f"{name:26s} R {R:3.1f} C/W, tau {tau:5.1f} s, steady state {t_ss:5.1f} C: reaches {T_THROTTLE:.0f} C after {t_hit:5.0f} s, then only {p_sustain:.1f} W = {share:.0f} % of the full work rate")

# measure R and tau from a temperature log at constant load (simulated data with 0.4 C noise)
rng = np.random.default_rng(6)
t = np.arange(0, 600, 5.0)
true_R, true_tau = 7.0, 175.0
log = T_AMB + P_ACTIVE * true_R * (1 - np.exp(-t / true_tau)) + rng.normal(0, 0.4, t.size)
model = lambda t, R, tau: T_AMB + P_ACTIVE * R * (1 - np.exp(-t / tau))
(R_fit, tau_fit), _ = curve_fit(model, t, log, p0=(5.0, 100.0))
print(f"fitted R {R_fit:.2f} C/W (true {true_R}), tau {tau_fit:.0f} s (true {true_tau:.0f}); C = tau / R = {tau_fit / R_fit:.1f} J/C")
sealed bay, no airflow     R 7.0 C/W, tau 175.0 s, steady state 108.0 C: reaches 80 C after   142 s, then only 5.0 W = 33 % of the full work rate
vented bay with propwash   R 3.5 C/W, tau  87.5 s, steady state  76.5 C: never reaches 80 C
fitted R 6.97 C/W (true 7.0), tau 174 s (true 175); C = tau / R = 24.9 J/C

The sealed bay has a steady state of 108 °C, far over the threshold. It reaches 80 °C in 142 seconds and then can sustain only 5.0 W, about 33% of the full work rate (taking the work as proportional to power above idle). The vented bay has a steady state of 76.5 °C and never reaches the threshold. This is the caution for ground tests: with the propellers still there is no airflow, so full-load testing on the ground must be kept below 142 seconds. For the real measurement, the fit gives and s, close to the true 7.0 and 175 s, and a heat capacity of 24.9 J/°C. Log temperature for several times to get a good fit.

Graph of temperature against time from 0 to 600 seconds. The pink line for the sealed bay with no airflow at R equal to 7 crosses the dashed gold line at 80 degrees Celsius at 142 seconds and approaches 108. The green line for the vented bay with propwash at R equal to 3.5 approaches 76.5 and never reaches 80
Figure 2 On-board computer temperature under full load in two bay designs

A verifiable release

A deployed system is more than a model file. It needs the class labels, the runtime version and the settings. Combining all of these into one release gives a manifest that records the SHA-256 hash of every file and the time budget that must be met, and signs the manifest with a private key kept off the device. The installer on the aircraft checks the signature and the hashes before use. This matches the software-update capability in NIST’s baseline for IoT devices, which requires updates by remote or local means, verification and authentication of an update before installing it, the ability to roll back to a previous version, and updates restricted to authorised entities (Fagan et al., 2020). Containers help pin the environment: Docker describes an image as a read-only template for creating a container and a container as a runnable instance that is fairly well isolated from other containers and from the host, so every aircraft gets the same environment. A model card states the intended use, the data and the limits (Mitchell et al., 2019) and should always ship with the release.

Example 4 The installer rejects a modified file

Build a manifest for release 2026.10.1 with the SHA-256 hash of the model file, the labels and the runtime file, and sign it with Ed25519 (the key is generated for the demonstration only). Test the installer on three cases: intact files, one bit of the model file flipped, and a manifest edited after signing.

import hashlib
import json

from cryptography.exceptions import InvalidSignature
from cryptography.hazmat.primitives.asymmetric.ed25519 import Ed25519PrivateKey

# a model release: a manifest records the hash of every file and is then signed; the installer checks signature and hashes before use
files = {"wastenet_s_int8.onnx": b"model-bytes-" * 1000, "labels.json": b'["waste pile", "truck"]', "runtime.txt": b"onnxruntime 1.30.0"}
manifest = {"release": "2026.10.1", "files": {n: hashlib.sha256(b).hexdigest() for n, b in files.items()}, "budget_p95_ms": 100}
manifest_bytes = json.dumps(manifest, sort_keys=True).encode()
signing_key = Ed25519PrivateKey.generate()                          # demonstration only: the real key stays off the device
signature = signing_key.sign(manifest_bytes)
public_key = signing_key.public_key()

def install_ok(manifest_bytes, signature, received):
    try:
        public_key.verify(signature, manifest_bytes)                # check the manifest comes from the signer and is unchanged
    except InvalidSignature:
        return "reject: bad signature"
    for name, digest in json.loads(manifest_bytes)["files"].items():
        if hashlib.sha256(received[name]).hexdigest() != digest:
            return f"reject: {name} does not match its hash"
    return "accept"

print("intact release:", install_ok(manifest_bytes, signature, files))
flipped = dict(files)
flipped["wastenet_s_int8.onnx"] = bytes([files["wastenet_s_int8.onnx"][0] ^ 1]) + files["wastenet_s_int8.onnx"][1:]
print("one bit flipped in the model:", install_ok(manifest_bytes, signature, flipped))
tampered = manifest_bytes.replace(b"2026.10.1", b"2026.10.9")
print("manifest edited after signing:", install_ok(tampered, signature, files))
intact release: accept
one bit flipped in the model: reject: wastenet_s_int8.onnx does not match its hash
manifest edited after signing: reject: bad signature

The intact files pass. Flipping one bit in the model makes the hash differ and the installer rejects it, naming the damaged file. Editing the version number in the manifest after signing makes the signature fail to verify. The private key must never be on the device, and every release must be kept with its manifest for rollback and later audit.

A/B update and rollback

A good update must not brick the device if power fails halfway or the new release is unusable. RAUC, an update client for embedded devices, uses symmetric redundant slots (A and B) so that an update can be interrupted at any point without breaking the running system, verifies the signature of the update bundle (x.509), and marks boots as successful or failed. The principle is to write the new release into the idle slot, try to boot into it up to a set number of times, run a health check (it boots and p95 meets the time budget), and only then confirm. If it does not pass, go back to the old slot, which was never touched.

Example 5 Three updates: one passes and two roll back

Start with v1.0 in slot A and push three releases in turn. v1.1 is healthy. v1.2 does not start because of a bad configuration file. v1.3 starts but exceeds the time budget because the accelerator was left off (p95 134 ms against a 100 ms budget). At most 3 boot tries are allowed.

# an A/B update with rollback: write into the idle slot, try at most 3 times, confirm only if the health check passes
BUDGET_P95_MS, MAX_TRIES = 100, 3
releases = {"v1.1": dict(boots=True, p95_ms=71),                    # healthy
            "v1.2": dict(boots=False, p95_ms=None),                 # does not start (bad configuration file)
            "v1.3": dict(boots=True, p95_ms=134)}                   # starts but exceeds the budget (accelerator left off)
slots, active = {"A": "v1.0", "B": None}, "A"
for version, behaviour in releases.items():
    idle = "B" if active == "A" else "A"
    slots[idle] = version                                           # write only the idle slot; the running slot is untouched
    healthy = behaviour["boots"] and behaviour["p95_ms"] <= BUDGET_P95_MS
    tries = 1 if healthy else MAX_TRIES                             # a healthy release is confirmed at once; a failing one is retried, then rolled back
    if healthy:
        active = idle
        print(f"{version}: confirmed after {tries} boot; now running {slots[active]} from slot {active}")
    else:
        why = "does not boot" if not behaviour["boots"] else f"p95 {behaviour['p95_ms']} ms > {BUDGET_P95_MS} ms"
        print(f"{version}: {why} on {tries} of {MAX_TRIES} tries -> rolled back; still running {slots[active]} from slot {active}")
v1.1: confirmed after 1 boot; now running v1.1 from slot B
v1.2: does not boot on 3 of 3 tries -> rolled back; still running v1.1 from slot B
v1.3: p95 134 ms > 100 ms on 3 of 3 tries -> rolled back; still running v1.1 from slot B

v1.1 passes the check and becomes the running release (slot B). v1.2 failed to boot on three tries and was rolled back, and v1.3, which was too slow, was rolled back too. Both times the aircraft could still run v1.1 without being recovered by hand. Note that v1.3 boots normally: if the health criterion were only that it boots, this release would pass and make R2 fail. The health criterion must therefore include the time budget and the job’s other metrics.

Diagram of the sequence of an A/B update. Slot A runs release v1.1, then the new release is written into slot B, then the system boots into slot B with at most 3 tries, then a health check (it boots and p95 is at most 100 milliseconds). If it passes, slot B is confirmed as active. If it fails all 3 tries, the system returns to slot A, which was never touched
Figure 3 Sequence of an A/B update with rollback

Monitoring and staged roll-out

Sculley et al. (2015) warn that real-world machine-learning systems often incur massive ongoing maintenance costs, which means delivery is not the end of the work. Conditions change (dust on a lens, a new camera, the season) and the model’s results change though nobody edits the code. Monitoring that works without storing images tracks the distribution of the detector’s confidence against the validation set, using the two-sample Kolmogorov-Smirnov test, whose null hypothesis is that the two samples come from the same distribution (SciPy documentation). What a device logs should be metrics (latency, temperature, confidence distribution, number of alerts) and not images, which keeps requirement R6 and the Personal Data Protection Act B.E. 2562 easier to satisfy.

Example 6 Confidence shifts over time. When do we raise an alarm?

The detector’s confidence at validation averages about 0.8 (1,500 values). Three field periods (simulated, 800 values each): week 1 under the same conditions, week 4 with dust on the lens, and week 8 with a new camera and wrong exposure. Compute the KS statistic () and raise an alarm when (assumed, tune per job).

import numpy as np
from scipy import stats

# watch for drift: compare the detector's field confidence distribution with the validation set using a two-sample Kolmogorov-Smirnov test (simulated)
rng = np.random.default_rng(14)
baseline = rng.beta(8, 2, 1500)                                     # confidence at validation, mean about 0.8
weeks = {"week 1, same conditions": rng.beta(8, 2, 800), "week 4, dust on the lens": rng.beta(6.5, 2.5, 800), "week 8, new camera, wrong exposure": rng.beta(4, 3, 800)}
ALARM_D = 0.10                                                      # alarm when D > 0.10 (assumed, tune per job)
print(f"baseline mean confidence {baseline.mean():.3f}")
for name, sample in weeks.items():
    res = stats.ks_2samp(baseline, sample)
    print(f"{name:36s} mean {sample.mean():.3f}, D = {res.statistic:.3f}, p < 0.01: {res.pvalue < 0.01!s:5s} -> {'ALARM: review images, consider rollback' if res.statistic > ALARM_D else 'ok'}")
baseline mean confidence 0.803
week 1, same conditions              mean 0.803, D = 0.017, p < 0.01: False -> ok
week 4, dust on the lens             mean 0.721, D = 0.260, p < 0.01: True  -> ALARM: review images, consider rollback
week 8, new camera, wrong exposure   mean 0.568, D = 0.571, p < 0.01: True  -> ALARM: review images, consider rollback

In week 1, , no significant difference, so it passes. In week 4 the mean confidence falls to 0.721 and raises an alarm: inspect sample images and clean the lens. In week 8 the mean is 0.568 and is a severe alarm: stop using the system and check the camera settings. With several aircraft, use a staged roll-out. Put the new release on one canary aircraft first, watch the metrics against agreed criteria, and then widen group by group. The canary must fly enough to expose a problem: if a faulty release makes one flight in ten fail, 20 canary flights will see at least one failure with probability .

Fallbacks and safety

The safety principle of this system is that the on-board computer assists decisions and is not part of flight control. The flight controller must keep flying safely even if the on-board computer hangs or restarts. The link uses MAVLink. The MAVLink documentation says that components typically publish a heartbeat at 1 Hz on radio links and consider another system disconnected when four or five messages are not received, which is practice and not a MAVLink requirement. The on-board computer therefore uses the flight controller’s heartbeat to decide whether it can publish (one per second; a loss is detected within 4 to 5 seconds). If the on-board computer also commands flight (offboard mode), PX4 requires a 2 Hz proof-of-life signal; if it stops for longer than the set timeout, PX4 triggers the offboard-loss failsafe action and leaves offboard mode. PX4 has several failsafe types (low battery, data-link loss, position loss, offboard loss and others) and actions such as Hold, Return and Land, which the pilot and operator must configure explicitly.

EASA arranges guidance for machine learning in aviation by level: Level 1 is AI that assists human capabilities, and Level 2 is human-AI teaming in which the AI takes some decisions itself under human oversight (EASA, 2024). A proposed Issue 3, published for consultation in June 2026, adds Level 3 and further AI techniques, so check which issue is current (EASA, 2026). The case study alerts and lets an officer decide, so it is close to Level 1 in that sense. NIST’s AI risk management framework (2023) is a tool for managing the risks of trustworthy systems. For the detector’s own fallbacks, use a fallback ladder that sheds load when temperature is high or timing is missed, and tells the operator. It needs hysteresis between the step down and the step up, or the system switches levels rapidly.

Example 7 A fallback ladder, with and without hysteresis

Four levels: full 10 fps (9 W), reduced 5 fps (6 W), small input at 1 fps (4 W) and record only (3 W), stepping down when temperature reaches 72, 77 and 82 °C respectively. Use the sealed-bay thermal model of Example 3 (, s), starting at 55 °C, and simulate 30 minutes. Compare 0 °C and 4 °C of hysteresis (stepping up only when the temperature is below the step-down threshold minus the margin).

import numpy as np

# a fallback ladder driven by temperature: shed load step by step, with hysteresis to prevent rapid switching (simulated)
levels = [("full: 10 fps", 9.0), ("reduced: 5 fps", 6.0), ("small input, 1 fps", 4.0), ("record only", 3.0)]   # (name, power in W) assumed
UP_AT = [None, 72.0, 77.0, 82.0]                                    # temperature at which we step down to this level (C)
T_AMB, R, TAU = 45.0, 7.0, 175.0                                    # from Example 3

def run(hysteresis, seconds=1800, dt=1.0, seed=3):
    rng = np.random.default_rng(seed)
    T, level, switches, spent = T_AMB + 10, 0, 0, np.zeros(len(levels))
    for _ in range(int(seconds / dt)):
        T += dt / TAU * (T_AMB + levels[level][1] * R - T) + rng.normal(0, 0.15)    # temperature relaxes toward the steady state of the current power
        new = level
        while new + 1 < len(levels) and T >= UP_AT[new + 1]:
            new += 1                                                # above the threshold: step down again
        if new == level and level > 0 and T < UP_AT[level] - hysteresis:
            new = level - 1                                         # cooler than the threshold minus the margin: step up once
        switches += new != level
        level = new
        spent[level] += dt
    return T, level, switches, spent / spent.sum() * 100

for h in (0.0, 4.0):
    T, level, switches, share = run(h)
    print(f"hysteresis {h:.0f} C: ends at {T:.1f} C on level '{levels[level][0]}', {switches} level changes in 30 min; time on levels (%): {np.round(share).astype(int).tolist()}")
hysteresis 0 C: ends at 77.1 C on level 'small input, 1 fps', 246 level changes in 30 min; time on levels (%): [4, 24, 72, 0]
hysteresis 4 C: ends at 74.4 C on level 'small input, 1 fps', 6 level changes in 30 min; time on levels (%): [4, 10, 86, 0]

Both settle mostly at the “small input, 1 fps” level (4 W gives a steady state of 73 °C, below the 77 °C threshold). But with no hysteresis the system changes level 246 times in 30 minutes: after stepping down the temperature falls below 77 °C and it steps straight back up, then heats and steps down again. Such rapid switching disturbs results and makes frames drop in bursts. With 4 °C of hysteresis there are only 6 changes and 86% of the time is spent at a sustainable level. One more caution: the “record only” level must alert the operator and not be silent, because detection is no longer running.

Two panels showing the service level of the fallback ladder over 30 minutes. The top panel has no hysteresis and 246 level changes, with a pink line switching very rapidly between reduced 5 fps and small input 1 fps. The bottom panel has 4 degrees Celsius of hysteresis and 6 level changes, with a green line staying at small input 1 fps almost throughout
Figure 4 Service level of the fallback ladder without and with hysteresis

System testing: test levels and how many samples are enough

Each part has been measured on its own (model, pipeline, power, heat, update), but the system must also be tested together, in levels, from the cheapest and safest to the most expensive and risky. That way a defect is caught at the lowest level that can catch it, and real flights are kept for what no other level can check.

LevelWhat is testedEnvironmentEvidence in the case study
1 Model on a test setrecall and precision of the quantised modelimages never used for trainingrecall against the municipality’s criterion (R1)
2 Pipeline on the benchlatency p50 p95 p99, dropped frames, energy, temperaturethe real board, replaying recorded videoR2 R4 R5
3 Simulation with the flight controllerthe MAVLink conversation, and the action when the companion computer disappears or sends wrong dataSITL or HITLthe fallback ladder and failsafes
4 Whole aircraft on the groundboot, update, temperature in the real bay (no propeller airflow)the real aircraft, propellers removedthe delivered release, and R5
5 Flight testthe whole chain from image to alerta permitted siteR3 and the whole-system result

SITL runs the flight controller code as a program on a computer with no hardware, and ArduPilot generates sensor data from a built-in physics model (ArduPilot Dev Team). PX4’s HITL runs the normal firmware on a real flight controller while a simulator feeds it sensor data, so it tests more of the real flight code, but the PX4 documentation says it is community maintained and may not work with current versions, so check before planning on it (PX4 Autopilot). At level 3, inject faults, for example stop the heartbeat or send setpoints more slowly, and check that the failsafe action matches what was configured. These are too dangerous and too hard to try in the air.

A test card for each requirement always records the same items: the requirement ID, the level, the procedure and environment, the version tested (the hash of the delivered release), the metric and how it is measured, the pass criterion with its confidence, the sample size fixed in advance, the result, and the signatory. The criterion and the sample size are written before testing, not after seeing the result.

How many samples? A test result is only a sample of all operating conditions, so it is uncertain. To claim that recall is at least at one-sided confidence , use the Clopper-Pearson lower bound (Clopper & Pearson, 1934), which SciPy computes with binomtest(...).proportion_ci(method="exact") (SciPy documentation). A two-sided 90% interval has the same lower end as a one-sided 95% bound. With no misses, the lower bound is the for which , so samples are needed. And if a bad event has never occurred in trials, the upper bound on its rate is , approximated by the rule of three, , for above 30 (Eypasch et al., 1995; Hanley & Lippman-Hand, 1983). The key caution is that samples must be independent units: 100 waste piles at different places and in different light count as 100 samples, but 100 frames of one pile count as one.

Example 8 How many waste piles and how many flights are needed to support a claim

The municipality requires (assumed) a recall of at least 0.90 at one-sided 95% confidence. The team must fix the number of test piles in advance and check how much the test flights can prove about the on-board computer’s reliability.

import math
from scipy.stats import binomtest

ALPHA, TARGET = 0.05, 0.90                      # one-sided 95% confidence and the municipality's recall target (assumed)

def recall_lower(hits, n):
    """One-sided 95% lower bound of recall, Clopper-Pearson (a two-sided 90% interval has the same lower end)"""
    return binomtest(hits, n).proportion_ci(confidence_level=1 - 2 * ALPHA, method="exact").low

print(f"no misses: at least {math.ceil(math.log(ALPHA) / math.log(TARGET))} separate piles")
for misses in (0, 3, 6, 10):
    n = next(n for n in range(misses + 1, 2000) if recall_lower(n - misses, n) >= TARGET)
    print(f"{misses:2d} misses allowed: at least {n:3d} piles, observed recall {1 - misses / n:.3f}")
n_plan = 150
allowed = max(k for k in range(n_plan) if recall_lower(n_plan - k, n_plan) >= TARGET)
print(f"plan of {n_plan} piles: pass with at most {allowed} misses, bound {recall_lower(n_plan - allowed, n_plan):.3f}")

print(f"0 failures in 20 flights: per-flight failure rate below {1 - ALPHA ** (1 / 20):.3f} (rule of three {3 / 20:.3f})")
for p in (0.05, 0.01):
    print(f"to show below {p:.0%} per flight with no failure: {math.ceil(math.log(ALPHA) / math.log(1 - p))} flights")
no misses: at least 29 separate piles
 0 misses allowed: at least  29 piles, observed recall 1.000
 3 misses allowed: at least  76 piles, observed recall 0.961
 6 misses allowed: at least 116 piles, observed recall 0.948
10 misses allowed: at least 167 piles, observed recall 0.940
plan of 150 piles: pass with at most 8 misses, bound 0.906
0 failures in 20 flights: per-flight failure rate below 0.139 (rule of three 0.150)
to show below 5% per flight with no failure: 59 flights
to show below 1% per flight with no failure: 299 flights

With no misses, at least 29 independent piles are needed. Allowing 3 misses needs 76 piles (73 found, 96.1%), 6 misses needs 116, and 10 misses needs 167. The observed rate always has to be above the 0.90 criterion; the excess is the price of uncertainty. A plan of 150 piles passes with at most 8 misses (lower bound 0.906), and 9 misses (94.0% observed) still fails the 0.90 criterion at this confidence.

On the flight side, 20 flights with no failure say only that the per-flight failure rate is below 0.139 at 95% confidence (the rule of three gives 0.150). Compare Example 6, where 20 pilot flights see a 10% failure rate with probability 88% but do not prove failures are rare. Proving less than 5% per flight needs 59 flights with no failure, and less than 1% needs 299. The conclusion is that flight tests cannot practically prove that infrequent failures are rare. Hard-to-find failures must be sought by fault injection at levels 2 and 3, and the design must keep the on-board computer an auxiliary system that flight does not depend on (the previous section). Flight tests are used to confirm that the whole chain works together in real conditions.

Module lab and mini-project

Lab and mini-project: evaluate and deliver the whole on-board detection system

  1. Measure the board’s power with a power meter while idle and while running the model after warm-up. Compute the energy per inference and the energy per real frame at the frame rates of patrol mode and evidence mode.
  2. Compute the effect on the flight time of the department’s aircraft, including the added mass (Example 1), and compare with the 1.3-times criterion.
  3. Log the SoC temperature (vcgencmd measure_temp or tegrastats) under full load for 10 minutes in a closed equipment enclosure and in airflow. Fit and as in Example 3 and predict when throttling starts.
  4. Write the release manifest, sign it and test the installer with a file that has one bit flipped (Example 4).
  5. Simulate two failing A/B updates (does not boot, and over the time budget) as in Example 5.
  6. Design a fallback ladder with hysteresis and test it with the real temperature log (Example 7).
  7. Write at least one test card each for requirements R2, R3 and R5, and compute the number of samples and flights needed in advance as in Example 8.
  8. Mini-project: write an acceptance report and deployment plan of at most 4 pages that checks the group’s requirements one by one, with measured tables (p50 and p95 of latency, energy per frame, temperature, flight time), the model card, the staged roll-out and rollback plan, and the limits not yet tested; then present it.

Any real flying (if done) follows CAAT conditions in visual line of sight with people kept clear. Check the lithium batteries and propellers before every flight. Always test installation and updates on the bench first, and never test an update on an aircraft with propellers fitted and the battery connected. A board under full load is hot, so do not touch the heat sink. Log only metrics and do not store images of people.

Common mistakes

Watch out

  • Choosing a board by energy per inference alone, forgetting idle energy and the added mass
  • Computing flight time without the power added by mass, which is often larger than the computer’s own electrical power
  • Using the datasheet’s to predict temperature instead of measuring in the real system and real airflow
  • Testing full load on the ground for too long without propwash, and wrongly concluding the system overheats in the air, or the reverse
  • Delivering only a model file, with no manifest, hashes, signature and runtime version
  • Updating by overwriting, with no spare slot and no rollback
  • Using “it boots” as the only health criterion, without checking the time budget and the job’s metrics
  • Leaving hysteresis out of the fallback ladder, so the system switches levels rapidly
  • Storing images of people for monitoring when metrics can be stored instead

Summary

  • Energy per real frame includes idle energy, and added mass raises flight power as , often more than the computer’s electrical power; the best choice is measured at the job’s frame rate, not by TOPS
  • Energy per image is lowest at a moderate clock because there is both static and dynamic power, and a job deadline may force a higher clock
  • Temperature approaches exponentially; measure and in the real system and real airflow; a sealed bay on the ground reaches the throttling threshold sooner than in the air
  • A release carries a manifest, hashes and a signature, and an A/B update can roll back when the new release does not boot or misses its time budget
  • Monitor with metrics (confidence distribution, latency, temperature) and roll out in stages; the on-board computer is an assisting system that flight does not depend on, with a fallback ladder that has hysteresis and tells the operator
  • Test the system in levels, from the model on a test set, the bench pipeline, simulation and the whole aircraft on the ground to flight; write the criterion and sample size on the test card before testing, samples must be independent units, and flight tests cannot practically prove that infrequent failures are rare

Check your understanding

  1. A computer draws 12 W while processing and 4 W when idle. At 5 fps it spends 20 ms per frame. What are the average power and the energy per real frame?
  2. A 5.0 kg multirotor draws 500 W in flight. A 200 g computer is added. How much extra power does the mass need (with )?
  3. Ambient temperature 40 °C, power 8 W, °C/W, s. What is the steady-state temperature, and how many seconds to reach 80 °C?
  4. A fallback ladder steps down at 77 °C and uses 4 °C of hysteresis. At what temperature does it step up, and what does the hysteresis do?
  5. A canary aircraft flies a new release for 20 flights. If a faulty release makes 10% of flights fail, what is the probability of seeing at least one failure?
Answers
  1. Average power W; energy per real frame J
  2. , so the extra power is W
  3. Steady state °C; 80 °C is reached at s
  4. It steps up when the temperature is below °C. The hysteresis prevents rapid up and down switching near the threshold
  5. , about 88%

Key formulas

Energy per inference and average power
Power added by mass
First-order temperature
Samples needed with no misses
Upper bound on a rate never observed

Key references

  1. NVIDIA. (2024). NVIDIA Jetson Orin Nano developer kit gets a "super" boost. NVIDIA Technical Blog. link
  2. NVIDIA. Jetson Orin Nano series, Jetson Orin NX series and Jetson AGX Orin series: Power and performance. Jetson Linux developer guide (release 36.4). link
  3. Raspberry Pi Ltd. Raspberry Pi hardware: Temperature management. Raspberry Pi documentation. link
  4. Raspberry Pi Ltd. Raspberry Pi AI HAT+. Raspberry Pi products. link
  5. Raspberry Pi Ltd. AI HATs (AI HAT+ and AI HAT+ 2). Raspberry Pi documentation. link
  6. Texas Instruments. (2024). Semiconductor and IC package thermal metrics (SPRA953D). Application report. link
  7. Boroujerdian, B., Genc, H., Krishnan, S., Cui, W., Faust, A., & Reddi, V. J. (2018). MAVBench: Micro aerial vehicle benchmarking. In Proceedings of the 51st Annual IEEE/ACM International Symposium on Microarchitecture (MICRO 2018) (arXiv:1905.06388). link
  8. Banbury, C., Reddi, V. J., Torelli, P., Holleman, J., Jeffries, N., Kiraly, C., Montino, P., Kanter, D., Ahmed, S., Pau, D., Thakker, U., Torrini, A., Warden, P., Cordaro, J., Di Guglielmo, G., Duarte, J., Gibellini, S., Parekh, V., Tran, H., . . . Xuesong, X. (2021). MLPerf Tiny benchmark. arXiv:2106.07597. link
  9. Sze, V., Chen, Y.-H., Yang, T.-J., & Emer, J. S. (2017). Efficient processing of deep neural networks: A tutorial and survey. Proceedings of the IEEE, 105(12), 2295–2329 (arXiv:1703.09039). link
  10. RAUC project. RAUC: A lightweight update client for embedded Linux devices. RAUC documentation. link
  11. Fagan, M., Megas, K. N., Scarfone, K., & Smith, M. (2020). IoT device cybersecurity capability core baseline (NISTIR 8259A). National Institute of Standards and Technology. link
  12. Docker Inc. Docker overview. Docker documentation. link
  13. Mitchell, M., Wu, S., Zaldivar, A., Barnes, P., Vasserman, L., Hutchinson, B., Spitzer, E., Raji, I. D., & Gebru, T. (2019). Model cards for model reporting. In Proceedings of the Conference on Fairness, Accountability, and Transparency (pp. 220–229). ACM. link
  14. Sculley, D., Holt, G., Golovin, D., Davydov, E., Phillips, T., Ebner, D., Chaudhary, V., Young, M., Crespo, J.-F., & Dennison, D. (2015). Hidden technical debt in machine learning systems. In Advances in Neural Information Processing Systems 28. link
  15. SciPy developers. scipy.stats.ks_2samp (two-sample Kolmogorov-Smirnov test). SciPy reference guide. link
  16. MAVLink Development Team. Heartbeat/connection protocol. MAVLink developer guide. link
  17. PX4 Autopilot. Offboard mode (multicopter). PX4 user guide (main). link
  18. PX4 Autopilot. Safety (failsafe) configuration. PX4 user guide (main). link
  19. European Union Aviation Safety Agency. (2024). EASA artificial intelligence concept paper issue 2: Guidance for Level 1 & 2 machine learning applications. link
  20. พระราชบัญญัติคุ้มครองข้อมูลส่วนบุคคล พ.ศ. 2562. ราชกิจจานุเบกษา, 136(69 ก), 52–95. link
  21. National Institute of Standards and Technology. (2023). Artificial intelligence risk management framework (AI RMF 1.0) (NIST AI 100-1). link
  22. European Union Aviation Safety Agency. (2026). EASA artificial intelligence concept paper proposed issue 3 [Consultation draft]. link
  23. ArduPilot Dev Team. SITL simulator (software in the loop). link
  24. PX4 Autopilot. Hardware in the loop simulation (HITL). PX4 user guide (main). link
  25. Clopper, C. J., & Pearson, E. S. (1934). The use of confidence or fiducial limits illustrated in the case of the binomial. Biometrika, 26(4), 404–413. link
  26. Hanley, J. A., & Lippman-Hand, A. (1983). If nothing goes wrong, is everything all right? Interpreting zero numerators. JAMA, 249(13), 1743–1745. link
  27. Eypasch, E., Lefering, R., Kum, C. K., & Troidl, H. (1995). Probability of adverse events that have not yet occurred: A statistical reminder. BMJ, 311(7005), 619. link
  28. SciPy developers. scipy.stats._result_classes.BinomTestResult.proportion_ci (exact Clopper-Pearson interval). SciPy reference guide. link

Further reading

Study the assigned knowledge units in advance, review media and take the module quiz

In class / field

Lab or field practice from worksheets with a safety checklist

Learning evidence: Checked worksheets and quiz results

Module quiz

This is a formative self-check, not a graded exam

Knowledge domain: Artificial intelligence and computer vision · Mathematics, physics and statistics · Electrical, electronics and power systems