Teaching pack · UAT 314

A 15-week teaching plan, 5 worksheets, a scoring rubric and a map from the course description to the lessons, for instructors to evaluate and adapt before teaching.

Last updated: · 3(3-0-6) · Per week: lecture 3 h, lab 0 h, self-study 6 h; 45 contact hours per term

Coverage of the course description

The lessons fully teach 10 of 10 description topics. Each topic lists the modules and lesson sections that teach it, and incomplete topics say what is missing.

Description topicModulesWhere it is taughtStatus
Modeling of automation and robotic systemsM1M3Module 1: elements of an automation system and the ISA-95 hierarchy · Module 3: Modelling a system: differential equations and transfer functions (Example 1, a motor model from a step test) and State-space models and state feedbackCovered
Kinematics and dynamicsM2Module 2: Kinematics of a two-link arm, Differential-drive robots and Dynamics: forces, torques and inertia (Example 3, thrust, roll torque and joint torque)Covered
Modern control principlesM3M4Module 3: Open loop versus closed loop, The PID controller, Cascaded control in multirotors and State-space models and state feedback (Example 4, altitude hold by pole placement) · Module 4: MPC and reinforcement learningCovered
State estimationM4Module 4: state estimation and sensor fusion, Example 3 with a Kalman filterCovered
Sensor fusionM4Module 4: Example 3, fusing a barometer with an IMU using a Kalman filterCovered
Motion planningM2M4Module 2: paths for a differential-drive robot · Module 4: path planning, A* versus DijkstraCovered
Intelligent controlM4Module 4: fuzzy control in Example 2, and MPC and reinforcement learningCovered
Autonomous decision makingM4Module 4: the autonomy loop and levels of automationCovered
Robotic system architecturesM1M5Module 1: PLCs, the scan cycle, IoT and communication protocols · Module 5: core ROS 2 concepts and the integration architectureCovered
Integration of multiple platformsM5Module 5: connecting ROS 2 to the flight controller, different coordinate frames, latency budget and the drone-robot integration architectureCovered

Weekly teaching plan

WeekTopicPre-classLectureLabEvidence
1 M1Elements of automation and ISA-95Read module 1 to the ISA-95 sectionSensors, controllers, actuators and system levels in a plant and a drone dockActivity part A: list the sensors and actuators of a drone dockGroup device list
2 M1PLCs, the scan cycle and IEC 61131-3 languagesRead the PLC and scan-cycle section; work through Examples 1–2Start/stop logic and response time from the scan cycleActivity part B: write ST or ladder logic for opening the lid, stopping at once on a hazard signalWritten logic and exercises
3 M1IoT and communication protocolsRead the IoT section; work Example 3; take the module 1 quizMQTT QoS, OPC UA and telemetry bandwidth for a drone fleetActivity part C: place devices in ISA-95 and choose MQTT QoS for three message typesHierarchy diagram, quiz result and discussion
4 M2What a robot is; forward kinematicsRead module 2 to the forward kinematics sectionDegrees of freedom, joints and end position from joint anglesActivity: compute the end position of a two-link arm for several angle setsForward kinematics exercises
5 M2Inverse kinematicsRead the inverse kinematics section; work Example 1Elbow-up and elbow-down solutions and the workspaceActivity part A: compute joint angles to the drone's battery bay; check the workspaceJoint angles and chosen solution
6 M2Differential-drive robots, dynamics and robot safetyRead the differential-drive, dynamics and safety sections; work Examples 2–3; take the module 2 quizWheel speeds in turns; thrust, torque and moment of inertia; measures when people enter the cellActivity part B: plan the battery-collecting robot's path and the cell's safety measuresBattery-swap cell design and quiz result
7 M3System models, open and closed loop, and the PID controllerRead module 3 to the PID section; work Examples 1–2Differential equations and transfer functions of first-order and double-integrator systems; roles of P, I and D; steady-state error with P aloneActivity part A: Python simulation of a discrete first-order system with P, PI and PIDThree response plots
8 M3Ziegler–Nichols tuning and state-space controlRead the Ziegler–Nichols and state-space sections; work Examples 3–4Ultimate gain and the starting-value table; state-space models, controllability and pole placementActivity part B: compare rise time, overshoot and steady-state error; add actuator limits and anti-windupComparison table and windup plot
9 M3Cascaded multirotor control; midtermReview modules 1–3; take the module 3 quizMidterm examination (modules 1–3)Activity part C: read a PX4 SITL tuning log (if available) and identify which loop is tuned firstMidterm score and activity notes
10 M4The autonomy loop, levels of automation and path planningRead module 4 to the path planning section; work Example 1Sense, plan, decide; A* and DijkstraActivity part A: grid A* in Python; compare expanded nodes with Dijkstra; try a 2h heuristicComparison table and heuristic conclusion
11 M4Fuzzy control, MPC and reinforcement learningRead the fuzzy and MPC sections; work Example 2Membership degrees, rules and weighted-average defuzzification; safety limits of RLActivity part B: design fuzzy rules to slow down near obstaclesRule set and sample calculation
12 M4State estimation and sensor fusionRead the state estimation section; work Example 3; take the module 4 quizPredict and update in the Kalman filter; weighting sensor trustActivity part C: discuss the safeguards an AI avoidance system needs before real flightDiscussion summary and quiz result
13 M5Core ROS 2 concepts and connecting to the flight controllerRead the knowledge unit on embedded systems to AI robots and ROS, then module 5 to the coordinate frames section; work Example 1Nodes, topics, services and actions; NED to ENU conversionActivity part A: draw the ROS 2 graph of the warehouse system and mark frame conversionsGroup ROS 2 graph
14 M5Latency budgetRead the latency budget section; work Example 2; take the module 5 quizLatency of each stage in the detection chain and distance travelled before the command arrivesActivity part B: compute the latency budget of the obstacle-detection chainLatency budget table and quiz result
15 M5Integration architecture and final reviewRead the integration architecture section; review modules 1–5Behaviour when the network fails; whole-course reviewActivity part C: present the drone and robot warehouse design and each part's behaviour when the network failsGroup presentation scored with the rubric; final examination (all modules) after week 15

Worksheets and instructor guide

One worksheet per module. Students open it on the web, print it or download the .docx. The instructor guide under each worksheet gives the class timing, expected results, discussion questions and notes for students with different backgrounds.

1Worksheet 1 Designing the logic of an automated drone dock
Analysis activity · About 4 h of class time · CLO1, CLO3

Objective: Identify the elements of a drone dock, write IEC 61131-3 control logic, place it in ISA-95 and choose MQTT QoS

Equipment

  • Paper or whiteboard for diagrams
  • Computer (optional, for a PLC simulator)

Safety

  • Classroom work only; no flying or real equipment

Steps

  1. List the sensors and actuators of a dock that opens its lid, receives the drone and charges the battery
  2. Write ST or ladder logic for opening the lid that stops at once on a hazard signal
  3. Estimate the response time from the scan cycle
  4. Place all devices and software in the ISA-95 hierarchy
  5. Choose MQTT QoS for telemetry, battery status and the launch command, with reasons

Deliverables

  • Device list
  • ST or ladder logic
  • ISA-95 diagram
  • QoS table with reasons

Checklist

  • Table 1 has sensors, controller, actuators and communication in at least 8 rows, each with an ISA-95 level (Accuracy of calculations and analysis)
  • The logic in Box 1 wires Stop and Fault as AND NOT, so it stops even while Start is held (Safety of the design)
  • The response-time working shows 2t_scan + t_I/O with units in ms and the lid travel in mm (Accuracy of calculations and analysis)
  • Every row of Table 2 gives a reason tied to the effect of a lost or duplicated message, not just a QoS number (Linking principles to UAS applications)
  • The group has its ISA-95 diagram ready for a 3-minute presentation and every member can answer questions (Participation and communication)

Instructor guide

Class timing 240 min

  1. Review automation elements, the scan cycle and QoS from the lesson30 min
  2. Groups list the devices in Table 140 min
  3. Write the ST or ladder lid logic, try it in a PLC simulator if available, and compute the response time60 min
  4. Draw the ISA-95 diagram and fill in Table 250 min
  5. 3-minute group presentations and discussion40 min
  6. Answer the questions and run the hand-in checklist20 min

Expected results

  1. Record: Table 1 Devices of the drone dockTable 1 has at least 8 rows, for example sensors: lid open and closed limit switches, an obstacle or hand sensor in the lid gap, a drone-on-pad sensor, a battery temperature sensor, an emergency stop button; controller: the dock PLC; actuators: lid motor, charging relay; communication: an MQTT gateway to the control centre. Field devices are level 0, the PLC level 1, monitoring screens and mission software level 2, the job or fleet management system level 3. At most one row wrong.
  2. Record: Box 1 ST or ladder logic for opening the lid, and the response-time workingLogic in the same pattern as the lesson's Example 1, for example LidOpen := (Start OR LidOpen) AND NOT Stop AND NOT Fault AND NOT LimitOpen; where Fault combines the hand-in-gap sensor and the emergency stop. For the response time, with the lesson's Example 2 values (10 ms scan, 4 ms I/O) it is 2 × 10 + 4 = 24 ms; other values must use the same formula.
  3. Record: Table 2 Choosing MQTT QoSTable 2: frequent position and status telemetry uses QoS 0 (new data quickly replaces old, losing one message does no harm); battery status or a low-battery event uses QoS 1 (must not be lost, duplicates can be handled); the drone-release command uses QoS 2 (must not repeat), or QoS 1 with a command number that detects duplicates, which is accepted if the reason is about duplication. Command channels must mention encryption and authentication.
  4. Question 1: In your group's logic, if someone holds Start while the sensor detects a hand in the lid gap, what does the lid motor do? Explain with the AND NOT order in your logic.The motor stops and does not restart, because Fault is true so AND NOT Fault is false and the whole expression is false whatever Start is. Stopping has priority over running. A strong answer adds that after the hand is removed, Start must be pressed again, so the lid does not restart by itself.
  5. Question 2: If the dock PLC has a 10 ms scan time and 4 ms total I/O delay, and the lid edge moves at 0.1 m/s, how far does the lid travel before it stops? What happens if the scan time grows to 50 ms, and how would your group fix it?Worst-case response 2 × 10 + 4 = 24 ms, so the lid travels 0.1 × 0.024 = 0.0024 m, or 2.4 mm. With a 50 ms scan it is 104 ms and 10.4 mm (the 0.1 m/s lid speed is assumed; use the real dock's value if known). Fixes: shorten the scan time, use an interrupt input, or slow the lid near closing, and also wire the emergency stop to cut motor power directly.
  6. Question 3: Why did your group not use QoS 2 for every telemetry message, and which QoS should the drone-release command use, and why?QoS 2 needs several handshakes, slowing and loading the network needlessly, while a lost telemetry message is replaced within a fraction of a second. The release command must never repeat, so it uses QoS 2 (or QoS 1 with a duplicate-checking command number), and it must be encrypted and authenticated.
  7. Question 4: Should the lid hazard-stop logic live in the dock PLC (level 1) or in the cloud control-centre software? Use your ISA-95 diagram to explain.In the level 1 PLC next to the equipment, because it must respond within tens of milliseconds and must work even if the network or cloud fails. The cloud or control centre (levels 2-3) only monitors, logs and assigns missions. A strong answer links this to separating safety functions from mission functions in module 5.

Discussion questions

  • If dozens of docks send telemetry to one centre, which data needs the most bandwidth, and how would you reduce it?
  • Who should make the final decision that the lid may open: the dock PLC, the operator at the centre, or the drone itself?
  • Why is it dangerous to assume a PLC responds instantly when people work near the machine?

Adapting to student background

Upper secondary (M.6)
Have them write a truth table of the seal-in expression for every case of Start, Stop and Fault before writing the logic, and show photos or videos of a real dock so they can picture devices they have never handled.
Vocational certificate
Start from ladder, which they know from electrical work, then translate it to ST; give a fill-in table for 2 × scan + I/O.
Diploma
Extension: add a charging step that opens the charging relay when battery temperature exceeds a set limit, and compute the telemetry bandwidth of 10 docks at 1 message per second of 200 bytes (16 kbit/s excluding headers).

Common student mistakes: Common mistakes in the module 1 lesson

2Worksheet 2 An automated battery-swap cell
Analysis activity · About 4 h of class time · CLO1, CLO3

Objective: Use arm inverse kinematics and differential-drive kinematics to design a safe battery-swap cell

Equipment

  • Calculator or computer with Python
  • Sketch of the cell layout

Safety

  • Classroom work only; no real robots

Steps

  1. Set the battery bay position relative to the arm base; compute joint angles by inverse kinematics
  2. Check that all points are in the workspace; choose the elbow-up or elbow-down solution that avoids the structure
  3. Plan the path of a differential-drive robot taking old batteries to charge
  4. Compute left and right wheel speeds in the turns
  5. State safety measures for when a person enters the cell

Deliverables

  • Joint-angle calculations
  • Cell layout with workspace
  • Path and wheel speeds
  • Safety measures list

Checklist

  • Every point in Table 1 is checked against the 0.10 to 0.70 m range before solving, and has a forward-kinematics check (Accuracy of calculations and analysis)
  • The code or working uses atan2 and converts degrees to radians before calling trig functions (Accuracy of calculations and analysis)
  • Table 2 includes a straight segment, a turn and a spin on the spot, with units in every cell (Accuracy of calculations and analysis)
  • Box 1 covers separation or presence sensing, slowing or stopping, emergency stops and a whole-cell risk assessment (Safety of the design)
  • You can explain how the cell helps real drone work, such as shorter turnaround between flights (Linking principles to UAS applications)

Instructor guide

Class timing 240 min

  1. Review forward and inverse kinematics and differential drive from the lesson's examples30 min
  2. Draw the cell layout, set the target points and work out Table 170 min
  3. Plan the robot path and work out Table 260 min
  4. Write the safety measures in Box 130 min
  5. Present the cell layouts and discuss30 min
  6. Answer the questions and run the hand-in checklist20 min

Expected results

  1. Record: Table 1 Arm inverse kinematics (L1 = 0.40 m, L2 = 0.30 m)With the lesson's Example 1 point and the extra points set by the instructor: (0.50, 0.30) distance 0.583 m, cos θ2 = 0.375, elbow up θ1 = 2.48°, θ2 = 67.98° and elbow down θ1 = 59.45°, θ2 = -67.98°; (0.20, 0.45) distance 0.492 m, cos θ2 = -0.031, elbow up θ1 = 28.53°, θ2 = 91.79° and elbow down θ1 = 103.55°, θ2 = -91.79°; (0.75, 0) cos θ2 = 1.302, unreachable; (0.05, 0.05) distance 0.071 m, below 0.10 m, cos θ2 = -1.021, unreachable. The forward check must return the same point within ±0.001 m; accept rounding of ±0.05° in angles.
  2. Record: Table 2 Path and wheel speeds of the differential-drive robot (r = 0.05 m, d = 0.20 m)With the lesson's Example 2 values: straight u_L = u_R = 8 rad/s gives v = 0.40 m/s, ω = 0; left turn u_L = 8, u_R = 10 gives v = 0.45 m/s, ω = 0.25 rad/s, R = 1.8 m; right turn u_L = 10, u_R = 8 gives ω = -0.25 rad/s; spin u_L = -5, u_R = 5 gives v = 0, ω = 1.25 rad/s counter-clockwise. If the group sets a 1.0 m radius turn at 0.40 m/s, it needs ω = 0.40 rad/s, u_L = 6.40 and u_R = 9.60 rad/s.
  3. Record: Box 1 Safety measures when a person walks into the cellA strong answer includes at least: a fence or presence sensors around the cell; slowing when a person enters a warning zone and stopping in the danger zone; emergency stops reachable from several points; logic where stopping has priority over running (module 1); force and power limits if the arm works near people; and a risk assessment of the whole cell, including a drone that may spin its propellers, not just the arm.
  4. Question 1: Did your group choose elbow up or elbow down for the battery bay at (0.50, 0.30) m, and why? How does your forward-kinematics check confirm it?A strong answer picks the elbow that clears the dock structure or the drone, for example if the drone sits below shoulder height, elbow up (θ1 = 2.48°, θ2 = 67.98°) lifts the elbow clear, and putting the angles back into forward kinematics gives (0.500, 0.300) m. Both solutions reach the same point, so the choice rests on obstacles.
  5. Question 2: If the battery bay were placed 0.75 m from the base, what would the value of cos θ2 tell you, and how must the cell layout change?cos θ2 = (0.5625 - 0.16 - 0.09)/0.24 = 1.302, which is above 1, so the point is outside the workspace (maximum reach 0.70 m). Move the bay closer to the base, within 0.70 m with a margin, or choose a longer arm.
  6. Question 3: A differential-drive robot cannot slide sideways into the charger. How does your group's path deal with this constraint?The robot must line up with the charger first, for example spin on the spot to face it and then drive straight in, or plan the turn so it ends aligned with the charger. A strong answer says the path must be one the robot can actually follow, not straight lines with sharp corners or sideways moves.
  7. Question 4: With a 0.8 kg battery, what is the gravity torque at the shoulder with the arm held horizontal (use the arm masses of the lesson's Example 3)? How does that affect motor selection?τ = 9.81 × (1.0 × 0.20 + 0.6 × 0.55 + 0.8 × 0.70) = 9.81 × 1.09 = 10.69 N·m, about 24% more than the 8.63 N·m for the 0.5 kg battery. The shoulder motor and gearbox must supply at least 10.69 N·m continuously plus a margin for accelerating the arm; the horizontal pose is the worst case.
  8. Question 5: Which of your group's safety measures still work if the cell control computer stops?Measures that do not depend on the computer still work: fences, emergency stops that cut power directly, safety sensors wired into the stop circuit, and motor brakes. A strong answer clearly separates the measures that depend on software.

Discussion questions

  • If the drone lands 5 cm off its set position, how would the arm know, and what would the cell need?
  • Why does a drone flying its own mission count as a robot under ISO 8373, and how does that view help design the cell?
  • What risks does a person changing propellers inside the cell face besides the arm?

Adapting to student background

Upper secondary (M.6)
Have them derive the cos θ2 formula from the law of cosines first, then draw the cell to scale on graph paper so they see the ring-shaped workspace.
Vocational certificate
Use a two-piece cardboard arm on a pin and measure real angles with a protractor against the calculation; give a Python template where they only fill in values.
Diploma
Extension: write code that plots the workspace and both arm poses, and compute the shoulder torque at θ1 = 30° (7.48 N·m for the 0.5 kg battery) to confirm the horizontal pose is the worst case.

Common student mistakes: Common mistakes in the module 2 lesson

3Worksheet 3 Simulating an altitude controller
Analysis activity · About 4 h of class time · CLO2, CLO1

Objective: Simulate and compare P, PI and PID controllers on a first-order system and understand integrator windup and anti-windup

Equipment

  • Computer with Python and matplotlib
  • PX4 SITL tuning log (if available)

Safety

  • Desk and simulation work only; no flying

Steps

  1. Write a Python simulation of a discrete first-order system with P, PI and PID
  2. Compare rise time, overshoot and steady-state error
  3. Add actuator limits and observe integrator windup
  4. Add anti-windup and compare
  5. Read a PX4 SITL tuning log (if available) and identify which loop is tuned first

Deliverables

  • Simulation code
  • Plots and comparison table for three controllers
  • Plots before and after anti-windup
  • Conclusion on cascaded tuning order

Checklist

  • Table 1 has P, PI and PID with units or percentages in every cell, and a plot of all three responses on one axis is attached (Accuracy of calculations and analysis)
  • The P steady-state error is compared with 1/(1 + KpK) and the comparison is written down (Accuracy of calculations and analysis)
  • Table 2 has no limit, a limit, and a limit with anti-windup, with before-and-after plots (Accuracy of calculations and analysis)
  • Box 1 states the order rate, attitude, velocity, position loop with reasons linked to real flight (Linking principles to UAS applications)
  • It states clearly that finding Ku is done only on a test rig or in simulation, never on a flying drone (Safety of the design)

Instructor guide

Class timing 240 min

  1. Review the first-order plant, PID and windup from the lesson; hand out the code template30 min
  2. Write and run the P, PI and PID simulation; fill in Table 170 min
  3. Add actuator limits and anti-windup; fill in Table 260 min
  4. Read the PX4 SITL log or the lesson's cascade figure; write Box 140 min
  5. Answer the questions, discuss and run the hand-in checklist40 min

Expected results

  1. Record: Table 1 Controller comparison (first-order plant K = 2, τ = 0.5 s, dt = 0.01 s, setpoint r = 1)With the stated values (K = 2 from the lesson's Example 2, τ = 0.5 s, dt = 0.01 s, forward Euler, sample gains P: Kp = 3; PI: Kp = 3, Ki = 6; PID: Kp = 3, Ki = 6, Kd = 0.05): P rise time 0.15 s, overshoot 0%, steady-state error 0.143 (y settles at 0.857 and never enters the 2% band); PI rise time 0.18 s, overshoot 0%, error 0; PID rise time 0.20 s, overshoot about 1.4%, error 0. Other gains give other numbers; check the trend that adding I removes the steady-state error. Accept rise times within ±0.02 s.
  2. Record: Table 2 Effect of actuator limits and anti-windup (PI)PI with |u| ≤ 0.6 (the setpoint needs u = 0.5 at steady state): no limit, overshoot 0% and into the 2% band at 0.30 s; limit without anti-windup, peak about 1.18, overshoot about 17.9%, into the 2% band at about 3.2 s; limit with clamping anti-windup (stop integrating while saturated), overshoot 0% and into the band at about 1.6 s. Numbers depend on the anti-windup method, but anti-windup must clearly cut overshoot and settling time.
  3. Record: Box 1 Cascaded tuning order from the PX4 SITL log or from the lessonCorrect order: the angular-rate loop (MC_ROLLRATE_P/I/D and so on) first, then attitude (MC_ROLL_P and so on), then velocity and position (MPC_XY_VEL_*, MPC_XY_P). If the log shows gain changes, they should rise by 20-30% per step and then 5-10% for fine tuning, as PX4 recommends. Without a log, answer from the lesson's Figure 2.
  4. Question 1: Does the steady-state error of P control in your simulation match 1/(1 + KpK)? If not, why might that be?They should match: 1/(1 + 3 × 2) = 1/7 = 0.143 and the simulation gives 0.143. The closed-loop time constant 0.5/7 = 0.071 s gives a rise time of about 2.2 × 0.071 = 0.157 s, close to 0.15 s. A mismatch usually means the run was too short to settle, dt was too large compared with τ, or the error sign was wrong.
  5. Question 2: From Table 1, what does the I term fix, and what does your group trade for it in rise time or overshoot?The I term removes the steady-state error, because it accumulates error until u reaches the value needed (0.5) with no error left. The cost is a slightly slower rise (0.15 to 0.18 s here), and too much Ki starts overshoot and oscillation. D adds little on a first-order plant and is sensitive to noise.
  6. Question 3: From the plots for Table 2, what is the integral doing while u is at its limit, and why does that make y overshoot the setpoint?While u is at its limit the error is still positive, so the integral keeps growing even though the actuator cannot give more. When y reaches the setpoint the stored integral still commands a high u, so y overshoots until the error has been negative long enough to unwind it. Anti-windup stops or limits accumulation during saturation, as PX4 does by clamping in its velocity loop.
  7. Question 4: If a real test rig gives Ku = 2.0 and Tu = 0.5 s, what are Kp, Ki and Kd by Ziegler-Nichols, and why must you never find Ku by making a real drone oscillate?Kp = 0.6 × 2.0 = 1.2; Ti = 0.5/2 = 0.25 s so Ki = 1.2/0.25 = 4.8; Td = 0.5/8 = 0.0625 s so Kd = 1.2 × 0.0625 = 0.075. Never on a real drone, because it drives the system to its stability limit, oscillating until control is lost and it can crash, and these values are only a starting point that still needs a robustness check.
  8. Question 5: Why must the angular-rate loop be tuned before the attitude and position loops? Use what you see in the log or the lesson's Figure 2.Every outer loop acts through the rate loop. If the rate loop is slow or oscillates, no tuning of attitude or position loops will be good, and the rate loop affects all flight modes. Inner loops also run faster than outer loops. A strong answer cites the order seen in the log or in Figure 2.

Discussion questions

  • If a drone's motors are close to saturation throughout a flight in strong wind, what will windup cause when the wind suddenly drops?
  • Why does raising D without filtering make motors vibrate and heat up?
  • Is today's first-order model good enough for a real drone's altitude loop, and how would you check it against measured data?

Adapting to student background

Upper secondary (M.6)
Have them solve the closed-loop y(t) for P control by hand before simulating and compare it with the code, focusing on reading the plots rather than coding from scratch.
Vocational certificate
Give a working code template where students change only Kp, Ki, Kd and the limit and read values off the plot, relating it to real experience of motor speed or air-conditioner control.
Diploma
Extension: add measurement noise and compare unfiltered D with low-pass-filtered D, or simulate the state-space altitude loop of Example 4 and confirm the 4.6% overshoot.

Common student mistakes: Common mistakes in the module 3 lesson

4Worksheet 4 Planning a path and testing in simulation
Analysis activity · About 4 h of class time · CLO2, CLO3

Objective: Implement and compare A* with Dijkstra, design fuzzy rules and analyse the safeguards of an AI avoidance system

Equipment

  • Computer with Python
  • The SITL knowledge unit in the drone knowledge base

Safety

  • Desk and simulation work only; no flying

Steps

  1. Implement grid A* in Python and move the obstacles
  2. Compare expanded nodes with Dijkstra
  3. Use an overestimating heuristic such as 2h and check whether the path is still shortest
  4. Design fuzzy rules to slow down near obstacles
  5. Discuss the safeguards an AI avoidance system needs before real flight, citing the SITL unit

Deliverables

  • A* code and comparison table
  • Heuristic conclusion
  • Fuzzy rule set
  • Safeguard summary

Checklist

  • Table 1 has at least 3 layouts with 3 methods each, and every row gives path length and nodes expanded (Accuracy of calculations and analysis)
  • At least one layout shows 2h giving a path that is not shortest, or a reason is written why none was found (Accuracy of calculations and analysis)
  • Table 2 has μ near, μ far and u for 5 distances, and the two μ values sum to 1 in every row (Accuracy of calculations and analysis)
  • Box 1 lists at least 3 non-AI protection layers, such as geofences, non-AI failsafes, SITL testing first and human oversight (Safety of the design)
  • You can explain why fewer expanded nodes matter for an onboard computer that must replan (Linking principles to UAS applications)

Instructor guide

Class timing 240 min

  1. Review Dijkstra, A*, heuristics and fuzzy control from the lesson's examples; hand out starter code30 min
  2. Write or adapt the A* code, run it on several layouts, fill in Table 180 min
  3. Try the 2h heuristic and look for a layout where the path is not shortest40 min
  4. Design the fuzzy rules and fill in Table 240 min
  5. Read the SITL knowledge unit and discuss protection layers; write Box 130 min
  6. Answer the questions and run the hand-in checklist20 min

Expected results

  1. Record: Table 1 Comparing Dijkstra, A* and A* with 2h (8×8 grid, S = (4, 0), G = (4, 7))With a 4-connected grid, unit steps, the Manhattan heuristic and ties broken by larger g first (as in the code that draws Figure 2): lesson layout (wall in column 3, rows 2-5) Dijkstra 11 steps 59 nodes, A* 11 steps 18 nodes, 2h 11 steps 18 nodes; wall in column 4, rows 2-6: Dijkstra 13 steps 59 nodes, A* 13 steps 28 nodes, 2h 13 steps 26 nodes; obstacles at cells (3, 1), (4, 1), (4, 6) (the same layout as Example 1 continued in module 4): Dijkstra 9 steps 54 nodes, A* 9 steps 15 nodes, 2h 11 steps 13 nodes, not shortest. Dijkstra and A* path lengths must match exactly; node counts can differ with tie-breaking, but A* must be clearly below Dijkstra. On layout 3, 2h gives 11 steps when ties are broken by larger g first; if a student breaks ties another way and gets 9, that is not an error. Point out that an overestimating heuristic loses the guarantee, and invite them to look for another layout where 2h fails.
  2. Record: Table 2 Fuzzy controller slowing near obstaclesWith the lesson's Example 2 rules (near 2 m/s, far 8 m/s over 0-10 m, μ near = (10 - e)/10, μ far = e/10): e = 0 gives 2.0 m/s; e = 2 gives 0.8/0.2 and 3.2 m/s; e = 3 gives 0.7/0.3 and 3.8 m/s; e = 6 gives 0.4/0.6 and 5.6 m/s; e = 10 gives 8.0 m/s (in short, u = 2 + 0.6e). If the group sets other speeds or ranges, check that u lies between the two rule speeds and rises with distance.
  3. Record: Box 1 Protection layers for an AI avoidance system before real flightA strong answer includes: geofences and non-AI failsafes (UAT 312 module 2), such as hold or return to launch on data loss; SITL testing before real hardware, including conditions never trained on; a maximum speed limit whatever the AI commands; human oversight that can stop the drone at once, with a clearly accountable person; and checking the sim-to-real gap before using an RL policy.
  4. Question 1: Why does A* expand far fewer nodes than Dijkstra yet find a path of the same length? Explain with f(n) = g(n) + h(n) and the numbers in Table 1.A* orders nodes by f = g + h, so it expands only nodes likely to lie on the way to the goal, while Dijkstra uses only g and spreads in every direction. When h never overestimates (Manhattan on a 4-connected grid), A* still guarantees the shortest path. On the lesson layout both find 11 steps, but A* expands 18 nodes against 59, about a third.
  5. Question 2: Was your A* with 2h shortest on every layout? If it was on some layouts, can you conclude that 2h is safe to use?Not on every layout. On the layout with cells (3, 1), (4, 1), (4, 6), 2h gives 11 steps while the shortest is 9. Being shortest on some layouts is just luck of those layouts; an overestimating heuristic does not guarantee the shortest path, so you cannot conclude it is safe. It only buys fewer expanded nodes.
  6. Question 3: Compare your fuzzy rules with a single-threshold rule, such as 2 m/s closer than 5 m and 8 m/s beyond. Which suits a camera drone doing survey work better, and why?Fuzzy rules change speed smoothly with distance, for example from 5.6 m/s at 6 m down to 3.8 m/s at 3 m, while the threshold rule jumps from 8 to 2 m/s the moment it crosses 5 m, making the drone jerk, blurring images and loading the battery in bursts. A survey camera drone suits fuzzy control better. A strong answer adds that a maximum speed limit and a stopping distance that do not rely on the fuzzy rules are still needed.
  7. Question 4: From Box 1, which protection layers do not depend on AI at all, and why does a system trained in simulation need such layers before real flight?Layers that do not depend on AI include geofences, failsafes on link loss or low battery, speed limits and an operator who can stop the drone. A system trained in simulation works well in conditions it has seen but is hard to predict in unfamiliar ones (the sim-to-real gap), so it needs verifiable, predictable layers behind it.

Discussion questions

  • If the drone finds a new obstacle every few seconds, which algorithm suits the onboard computer, and how often should it replan?
  • When is RRT better than grid A*, and what must be done to the path it returns?
  • When an AI avoidance system decides wrongly and causes an incident, who should be accountable?

Adapting to student background

Upper secondary (M.6)
Have them trace A* by hand on a 5×5 grid first, writing f for each node on paper, before comparing with the code.
Vocational certificate
Use a printed grid with coins for expanded nodes, starter code where only the obstacle layout is edited, and a fill-in table for the fuzzy calculation.
Diploma
Extension: add diagonal moves with cost √2 and a Euclidean heuristic, then compare node counts and path lengths with the 4-connected version.

Common student mistakes: Common mistakes in the module 4 lesson

5Worksheet 5 Designing a warehouse system with drones and robots
Analysis activity · About 4 h of class time · CLO3, CLO1

Objective: Design a ROS 2 architecture linking drones, robots and automation, compute the latency budget and define safe behaviour when the network fails

Equipment

  • The deep-dive unit on embedded systems to AI robots and ROS
  • Paper or a diagramming tool

Safety

  • Classroom work only; no flying or real equipment

Steps

  1. Read the deep-dive unit first
  2. Draw the system's ROS 2 graph with nodes, topics, services and actions
  3. Choose how to connect to the flight controller and mark where frames must be converted
  4. Compute the latency budget of the obstacle-detection chain and the distance the drone moves
  5. Place all parts in the Figure 2 architecture and state what each does to stay safe if the network fails

Deliverables

  • ROS 2 graph
  • Frame-conversion table
  • Latency budget
  • Architecture diagram with network-failure behaviour

Checklist

  • Table 1 has at least one node, topic, service and action, each with a reason for the kind chosen (Linking principles to UAS applications)
  • Box 1 converts at least 2 points with (E, N, -D) and marks where in the system conversion happens (Accuracy of calculations and analysis)
  • The latency budget sums every stage in ms and gives the distance moved in m using d = v t (Accuracy of calculations and analysis)
  • Every component in Table 2 has a network-failure behaviour, and the flight controller and PLC stay safe on their own (Safety of the design)
  • Every channel that can command real equipment states encryption and authentication (Safety of the design)

Instructor guide

Class timing 240 min

  1. Read the deep-dive unit and review ROS 2 concepts, frames and latency budgets40 min
  2. Draw the warehouse ROS 2 graph and fill in Table 160 min
  3. Choose the flight-controller link, convert frames and compute the latency budget in Box 150 min
  4. Place the components in the Figure 2 architecture and fill in Table 240 min
  5. 4-minute architecture presentations and discussion30 min
  6. Answer the questions and run the hand-in checklist20 min

Expected results

  1. Record: Table 1 Elements of the ROS 2 graphTable 1 has at least 10 rows, for example nodes: camera, AI object detection, barcode reader, mission planner, a bridge to the MQTT or OPC UA gateway; topics: camera images, drone position, detection results (sensor-data QoS); service: request a flight-mode change; action: fly to a shelf position with progress reports and cancellation. Accept any choice where the kind fits the data (continuous, one-off, or a long task with progress).
  2. Record: Box 1 NED and ENU frame conversion, and the latency budget of the obstacle-detection chainLink: PX4 through uXRCE-DDS (agent on the mission computer, over serial or UDP), or MAVROS for a MAVLink flight controller. Conversion happens between the ROS 2 nodes and PX4. Lesson examples: NED (10, 5, -3) becomes ENU (5, 10, 3) m and NED (20, -4, -15) becomes ENU (-4, 20, 15) m. The latency budget from the lesson's Example 2 is 5 + 12 + 3 + 8 = 28 ms; at 10 m/s the drone moves 10 × 0.028 = 0.28 m. Other values must show the sum of every stage and d = v t.
  3. Record: Table 2 Architecture and behaviour when the network failsTable 2: control centre and cloud (top layer, MQTT or OPC UA) stop sending new missions and raise an alert; mission computer (ROS 2, DDS) stops issuing new commands and leaves decisions to the flight controller; flight controller (MAVLink or uXRCE-DDS) uses its own failsafes, such as hold or return to launch on data loss; conveyor and charger PLCs stop in a safe state; ground robots stop when contact is lost. Every command channel must be encrypted and authenticated.
  4. Question 1: For commanding a drone to fly to a shelf and report progress, did your group use a topic, a service or an action, and why?An action, because it is a long task that reports progress along the way and can be cancelled. A topic suits continuous data with no reply, and a service suits a one-off request answered at once, with no progress.
  5. Question 2: If your node sends ENU position (5, 10, 3) m to PX4 without converting, what does PX4 understand, and how does your group prevent this mistake?PX4 reads N = 5, E = 10, D = 3, which is 3 m below the take-off point: the horizontal axes are swapped and the vertical direction reversed, so the drone tries to fly into the ground. Prevent it by converting (E, N, -D) at every interface, using the px4_ros_com frame-transform library, and always testing in SITL first.
  6. Question 3: If you switch to a slower AI model, from 12 ms to 60 ms, with the drone at 10 m/s, how far does the drone now move before the command arrives, and how must the avoidance margin change?Total t = 5 + 60 + 3 + 8 = 76 ms, so the distance is 10 × 0.076 = 0.76 m, up from 0.28 m (with the lesson's Example 2 values). The avoidance margin must grow by at least 0.48 m, or the drone must fly slower or use a faster model, and backed-up message queues can make data older than calculated.
  7. Question 4: Why should the mission computer not be the primary safety authority? Use the network-failure behaviour in Table 2 to explain.The mission computer runs complex software that may hang or crash and depends on the network. If it were the primary safety authority, a network failure would leave nothing keeping the drone safe. The flight controller and PLCs must stay safe with their own failsafes, as in Table 2, which is the principle of separating safety functions from mission functions.

Discussion questions

  • If this project must run for 5 years, which ROS 2 distribution should it use, and what must you check in the flight stack's documentation first?
  • Which warehouse data should go up to the warehouse management system (ISA-95 level 3), and which should stay inside the robots?
  • If an outsider could reach the warehouse network, which channel would be the most dangerous?

Adapting to student background

Upper secondary (M.6)
Have them write the NED to ENU conversion as a matrix and show it is its own inverse, then watch a video or SITL run of a drone with ROS 2 to see the real system.
Vocational certificate
Use cards for nodes and string for topics to build the graph on the desk before drawing it, and give fill-in tables for the latency sum and the frame conversion.
Diploma
Extension: run ROS 2 with PX4 SITL following the PX4 guide, measure the real latency of the position topic with ROS 2 tools, and compare it with the calculated budget.

Common student mistakes: Common mistakes in the module 5 lesson

Scoring rubric

For worksheets and the mini-project. Each criterion scores level (1–4) ÷ 4 × weight.

CriterionWeightExcellent (4)Good (3)Fair (2)Needs work (1)
Accuracy of calculations and analysis30%Kinematics, control and latency calculations all correct with full methodNearly all correctSome errors or missing stepsMany errors or no method
Linking principles to UAS applications25%Chooses principles that fit real drone and robot problems, with clear reasonsGood links, some reasons incompletePartial linksNo link between principles and applications
Safety of the design20%Hazard signals, emergency stops and failure behaviour fully specifiedNearly completeSome key cases missingSafety not considered
Participation and communication25%Reasoned contributions, clear presentation, answers questions wellGood participation and presentation with minor flawsLimited participation or unclear presentationNo participation

Assessment map: CLOs and how they are assessed Draft

The CLOs are a web-team draft; the course owner sets the final ones (curriculum book, part 4). This table is built from the worksheet and module-quiz data, so it follows any change to the CLOs.

CLOWorksheetsModule quizzes
CLO1 Explain automation, robotics and controlW 1W 2W 3W 5M1M2M3M5
CLO2 Analyse intelligent control for aircraftW 3W 4M3M4
CLO3 Relate robotics to UAS applicationsW 1W 2W 4W 5M2M4M5