Module 4/5 · Weeks 10–12 · 27 h

Intelligent control

UAT 314 Automation, Robotics and Intelligent Control Systems

About 90 minDraft, awaiting reviewLast updated 24 October 2026

Lesson

By the end of this module you will be able to

  1. Explain the perceive, understand, plan and control loop of autonomous systems
  2. Explain levels of automation and the role of human oversight
  3. Compare the Dijkstra, A* and RRT path-planning algorithms
  4. Calculate the output of a simple fuzzy controller
  5. Explain the principles of MPC and reinforcement learning and their safety limits

Prerequisites: UAT 314 modules 2–3

Why this matters

The PID controller of module 3 keeps a drone where it is told to be, but who decides where it should go? What if a tree is in the way, the target moves, or the data are uncertain? Advanced automated systems must perceive their environment, plan and decide for themselves. Together this is called intelligent control and autonomy.

Think of a driver. PID is the skill of steering within the lane; intelligent control is reading signs, choosing a route and deciding to brake when someone steps into the road.

The autonomy loop

A four-step loop: perceive with sensors and AI, understand with a map and localisation, plan the path and behaviour, control and act, then back to perceive; human oversight sits in the centre
Figure 1 The autonomy loop
  1. Perceive: read sensors and use AI to detect objects
  2. Understand: build a map and localise
  3. Plan: choose a path and behaviour
  4. Control: command low-level controllers such as PID to follow the plan

Every step carries uncertainty, and a perception error propagates through every later step. A good system therefore has human oversight at a level appropriate to the risk.

Levels of automation

Autonomy is not just “piloted” versus “flies itself”; there are many levels. Useful reference frameworks include:

  • NIST ALFUS (Autonomy Levels for Unmanned Systems, SP 1011), which characterises unmanned-system autonomy by mission complexity, environmental difficulty and the degree of reliance on humans
  • SAE J3016, which divides road-vehicle driving automation into levels 0–5, from no automation to full automation. It is a helpful analogy, though not designed for drones

The key questions at each level are who is accountable when the system decides wrongly, and does the human know in time when to intervene (linking to ethics in UAT 313 module 5).

Path planning

A grid map divides space into cells; obstacle cells cannot be entered. Search algorithms find a path from start S to goal G.

  • Dijkstra (1959) expands nodes in order of accumulated cost from the start, . It guarantees the shortest path but searches in every direction
  • A* (Hart, Nilsson & Raphael, 1968) uses , where estimates the remaining distance to the goal. If never overestimates, A* still finds the shortest path while expanding far fewer nodes
  • RRT (LaValle, 1998) randomly grows a tree of paths through the space. It suits continuous, high-dimensional spaces such as a drone in 3D, but its paths are usually not shortest and need smoothing afterwards
An eight by eight grid with a vertical wall of four obstacle cells; start S on the left and goal G on the right; yellow cells were expanded by A*, green cells were not; a pink line shows the 11-step shortest path going around below the wall
Figure 2 A* path search on a grid

Example 1 A* versus Dijkstra

An 8×8 grid, 4-connected, 1 unit per step, with a vertical wall of 4 cells between S and G, using Manhattan distance as the heuristic.

  1. At the start , but the wall blocks the straight route, so the real path must detour
  2. Results from a Python program: both methods find a path of 11 steps (one cell per step, so the path passes through 12 cells including S and G)
  3. Dijkstra expands 59 nodes; A* expands only 18

A good heuristic greatly reduces computation, which matters on a drone’s limited onboard computer that must replan whenever it finds a new obstacle.

Example 1 (continued) An overestimating heuristic can return a path that is not shortest

Use the same 8×8 grid with S at (row 4, column 0) and G at (4, 7), but change the obstacles to three cells: (3, 1), (4, 1) and (4, 6). Search three ways: Dijkstra (), A* with the Manhattan distance , and A* with , which overestimates.

import heapq

def search(walls, w):
    # w = 0 is Dijkstra, w = 1 is A* with h, w = 2 is A* with 2h
    S, G = (4, 0), (4, 7)
    h = lambda p: abs(p[0] - G[0]) + abs(p[1] - G[1])    # Manhattan distance to G
    g, frontier, done = {S: 0}, [(w * h(S), 0, S)], set()
    while frontier:
        _, _, p = heapq.heappop(frontier)                 # take the node with the smallest f
        if p in done:
            continue
        done.add(p)
        if p == G:
            return g[G], len(done)                        # path length, nodes expanded
        for dr, dc in ((1, 0), (-1, 0), (0, 1), (0, -1)):
            q = (p[0] + dr, p[1] + dc)
            if 0 <= q[0] < 8 and 0 <= q[1] < 8 and q not in walls and g[p] + 1 < g.get(q, 99):
                g[q] = g[p] + 1
                heapq.heappush(frontier, (g[q] + w * h(q), -g[q], q))   # equal f: larger g first

walls = {(3, 1), (4, 1), (4, 6)}
for name, w in (("Dijkstra", 0), ("A* with h", 1), ("A* with 2h", 2)):
    steps, nodes = search(walls, w)
    print(f"{name:10s} path {steps:2d} steps, {nodes:2d} nodes expanded")
Dijkstra   path  9 steps, 54 nodes expanded
A* with h  path  9 steps, 15 nodes expanded
A* with 2h path 11 steps, 13 nodes expanded
  1. Dijkstra and A* with find the same shortest path, 9 steps (down to row 5, straight along that row, then up to G), but A* expands only 15 nodes against 54 for Dijkstra.
  2. A* with expands the fewest, 13 nodes, yet returns a path of 11 steps, 2 steps longer than the shortest.
  3. Why: at the start the true remaining cost is 9 steps. does not exceed 9, so it is safe, but does. Doubling pulls the search toward G too hard, so the path climbs back up to row 4 at column 2 because that looks closer to G, walks to (4, 5), hits the wall at (4, 6), and must detour up to row 3 and back down. That costs 2 extra steps.

Caution: when overestimates, the result also depends on how ties in are broken (the code above prefers the larger ). On this same grid another tie-breaking rule can make happen to return 9 steps. What is lost is the guarantee of a shortest path, not correctness every time, so never conclude that is safe just because it was right on some grids.

Fuzzy control

Zadeh’s (1965) fuzzy logic gives set membership values between 0 and 1 instead of yes or no. Mamdani and Assilian (1975) used it to build controllers from human-language rules such as “if far from the target, fly fast”.

Example 2 A simple fuzzy speed controller

Rules: if the distance is near, fly at 2 m/s; if far, fly at 8 m/s. Over 0–10 m, let and . The drone is now m from the target.

  1. and
  2. m/s

The speed changes smoothly with distance instead of jumping from 2 to 8 m/s at a single boundary.

MPC and reinforcement learning

  • Model predictive control (MPC) uses a model to predict the system over a horizon and finds the best commands subject to constraints, such as maximum speed or area boundaries. It applies the first command and recomputes every cycle. Its strength is handling constraints directly; its cost is heavy computation
  • Reinforcement learning (RL) lets an agent learn a policy by trial and error to maximise reward (Sutton & Barto, 2018). A landmark example: Kaufmann et al. (2023) trained a racing drone with deep RL that beat human champions on a test course, training mostly in simulation

Learning systems carry a particular risk: they work well in conditions they were trained on but are hard to predict in unfamiliar ones. Real deployment needs verifiable protection layers, such as geofences and non-AI failsafes (UAT 312 module 2), SITL testing first, and human oversight.

State estimation and sensor fusion

An automated system decides only as well as it knows its own state, yet no sensor measures that state completely and accurately all the time. An IMU responds quickly but its integrated values drift; a barometer does not drift but is noisy. Sensor fusion lets each sensor’s strengths cover the other’s weaknesses.

The Kalman filter of Kalman (1960) repeats two steps. It predicts the next state from a model and the inputs, growing the uncertainty , then corrects with the measurement weighted by the Kalman gain : the more trustworthy the sensor relative to the prediction, the larger . Welch and Bishop wrote a readable introduction. The EKF in an autopilot is an extended version of the same idea.

Example 3 Fusing a barometer with an IMU using a Kalman filter

import numpy as np
rng = np.random.default_rng(7)
DT, N = 0.1, 200
F = np.array([[1, DT], [0, 1]])               # state x = [altitude, vertical speed]
B = np.array([0.5 * DT ** 2, DT])             # IMU acceleration as the input
H = np.array([[1.0, 0.0]])                    # the barometer measures altitude only
Q = np.diag([1e-4, 1e-3])                     # prediction uncertainty
R = np.array([[0.5 ** 2]])                    # barometer variance (m²)

x_true = np.zeros(2); x = np.zeros(2); P = np.eye(2)
err_baro, err_kf = [], []
for k in range(N):
    acc = 0.3 if k < 100 else -0.3            # climb, then slow down
    x_true = F @ x_true + B * acc
    acc_meas = acc + rng.normal(0, 0.05)      # IMU
    z = x_true[0] + rng.normal(0, 0.5)        # barometer
    x = F @ x + B * acc_meas                  # predict
    P = F @ P @ F.T + Q
    K = P @ H.T @ np.linalg.inv(H @ P @ H.T + R)   # Kalman gain
    x = x + (K @ (z - H @ x)).ravel()         # correct with the measurement
    P = (np.eye(2) - K @ H) @ P
    err_baro.append(z - x_true[0]); err_kf.append(x[0] - x_true[0])
rms = lambda e: float(np.sqrt(np.mean(np.square(e))))
print(f"RMS altitude error: barometer alone {rms(err_baro):.2f} m, Kalman fused {rms(err_kf):.2f} m")
print(f"final gain on altitude {K[0, 0]:.3f}, final velocity estimate {x[1]:+.2f} m/s (true {x_true[1]:+.2f})")
RMS altitude error: barometer alone 0.47 m, Kalman fused 0.13 m
final gain on altitude 0.108, final velocity estimate -0.07 m/s (true +0.00)

The fused altitude error is about three times smaller than the barometer’s alone, and the filter also estimates vertical speed even though no sensor measures speed directly.

The estimated state feeds automated decisions. Simple systems often use a state machine: if position uncertainty exceeds a threshold, switch from mission mode to hold or return-to-launch. Decisions should therefore use both the estimate and how confident it is (), not the number alone.

Class activity

Activity: Planning a path and testing in simulation

  1. Implement A* on a grid in Python, move the obstacles, and compare the nodes expanded with Dijkstra.
  2. Try an overestimating heuristic such as and check whether the path is still shortest, on the layout of Example 1 (continued) and on layouts of your own.
  3. Design fuzzy rules to slow down when approaching an obstacle.
  4. Discuss which protection layers an AI avoidance system needs before real flight, drawing on the SITL knowledge unit in the drone knowledge hub.

Common mistakes

Watch out

  • Using an overestimating heuristic and assuming the path is still shortest
  • Planning on an old map without replanning when obstacles appear
  • Trusting AI output without verifiable protection layers
  • Misreading levels of automation as meaning an autonomous system needs no accountable person
  • Deploying an RL policy trained in simulation directly without testing the sim-to-real gap

Summary

  • Autonomous systems run a loop of perceive → understand → plan → control, with human oversight
  • Autonomy has many levels; NIST ALFUS and SAE J3016 are reference frameworks
  • A* uses , finds the same shortest path as Dijkstra while expanding fewer nodes; RRT suits continuous high-dimensional spaces
  • Fuzzy control uses human-language rules with membership 0–1; MPC handles constraints directly
  • RL can achieve remarkable results but needs verifiable protection before real use
  • A Kalman filter predicts and then corrects with measurements, fusing sensors’ strengths; automated decisions should use both the estimate and its uncertainty

Check your understanding

  1. In A*, what do and mean?
  2. What is the Manhattan distance from to the goal on a grid?
  3. In the fuzzy example, what speed is commanded at 3 m?
  4. What is the main advantage of MPC over PID?
  5. Why does an AI avoidance system still need a geofence and non-AI failsafes?
Answers
  1. is the actual cost from the start to node ; estimates the remaining cost from to the goal
  2. , , so m/s
  3. MPC predicts the future with a model and handles constraints directly
  4. AI may fail in conditions it was not trained on, so verifiable, predictable protection layers are required

Key formulas

A* evaluation function
Manhattan distance (4-connected grid heuristic)
Weighted average (simple defuzzification)
Kalman gain

Key references

  1. Huang, H.-M. (Ed.). (2008). Autonomy levels for unmanned systems (ALFUS) framework, Volume I: Terminology, Version 2.0 (NIST SP 1011-I-2.0). NIST. link
  2. SAE International. (2026). Taxonomy and definitions for terms related to driving automation systems for on-road motor vehicles (J3016_202609). link
  3. Dijkstra, E. W. (1959). A note on two problems in connexion with graphs. Numerische Mathematik, 1, 269–271. link
  4. Hart, P. E., Nilsson, N. J., & Raphael, B. (1968). A formal basis for the heuristic determination of minimum cost paths. IEEE Transactions on Systems Science and Cybernetics, 4(2), 100–107. link
  5. LaValle, S. M. (1998). Rapidly-exploring random trees: A new tool for path planning (TR 98-11). Iowa State University. link
  6. Zadeh, L. A. (1965). Fuzzy sets. Information and Control, 8(3), 338–353. link
  7. Mamdani, E. H., & Assilian, S. (1975). An experiment in linguistic synthesis with a fuzzy logic controller. International Journal of Man-Machine Studies, 7(1), 1–13. link
  8. Rawlings, J. B., Mayne, D. Q., & Diehl, M. M. (2017). Model predictive control: Theory, computation, and design (2nd ed.). Nob Hill Publishing. link
  9. Sutton, R. S., & Barto, A. G. (2018). Reinforcement learning: An introduction (2nd ed.). MIT Press. link
  10. Kaufmann, E., Bauersfeld, L., Loquercio, A., Müller, M., Koltun, V., & Scaramuzza, D. (2023). Champion-level drone racing using deep reinforcement learning. Nature, 620, 982–987. link
  11. Siegwart, R., Nourbakhsh, I. R., & Scaramuzza, D. (2011). Introduction to autonomous mobile robots (2nd ed.). MIT Press. link
  12. Thrun, S., Burgard, W., & Fox, D. (2005). Probabilistic robotics. MIT Press. link
  13. Kalman, R. E. (1960). A new approach to linear filtering and prediction problems. Journal of Basic Engineering, 82(1), 35–45. link
  14. Welch, G., & Bishop, G. (2004). An introduction to the Kalman filter (Tech. Rep. TR 95-041). Department of Computer Science, University of North Carolina at Chapel Hill. link

Further reading

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

In class / field

Lecture, case discussion and in-class problem solving

Learning evidence: Quiz results and submitted exercises

Module quiz

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

Knowledge domain: Control, autopilot and navigation · Automation, robotics and swarms · Artificial intelligence and computer vision · Programming and digital technology · Surveying, mapping and geoinformatics · Mission planning, flight and simulation