Teaching pack · UAT 305

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
Flight dynamicsM2Module 2: Flight dynamics: forces and moments (rigid-body translation and rotation equations, thrust and horizontal acceleration when tilted, moments from thrust differences, thrust headroom), with Example 3 and step 5 of the labCovered
State estimationM3Module 3: the two steps of a Kalman filter, and testing innovations before using dataCovered
Control loopsM1M2Module 1: from sensors to motors (main loop and scheduler) and delay eats phase · Module 2: nested angle and rate loopsCovered
StabilizationM2Module 2: ArduPilot's attitude controller and limiting angular accelerationCovered
Position and path controlM5Module 5: The position loop and path following (position P, velocity PID, acceleration to lean angle, feedforward and AC_WPNav, cross-track error), with Example 3 on a crosswind and the I termCovered
PID and related control algorithmsM2M4Module 2: angle P, rate PID and feedforward · Module 4: notch, harmonic notch, and low-pass filters and phaseCovered
Autopilot hardware and software architecturesM1Module 1: From sensors to motors (ArduPilot's main loop and PX4's uORB) and Autopilot hardware (FMU processor, three redundant IMUs with several EKF3 cores, UART, CAN, I2C and DroneCAN buses, ESCs with PWM and DShot), with Example 3 and step 6 of the labCovered
TuningM2M4Module 2: effect of outer-loop gain · Module 4: the log-based tuning processCovered
SimulationM1M2M3M5SITL labs in modules 1, 2, 3 and 5, such as simulated GPS glitches and GCS link lossCovered
Performance testingM1M5Module 1: performance (PM) messages and scheduler load · Module 5: The test plan and Flight performance testing (position-tracking accuracy from PSCN/PSCE, RMS and maximum, error to target versus cross-track error, limits of EKF positions), with Example 4 and step 5 of the labCovered

Weekly teaching plan

WeekTopicPre-classLectureLabEvidence
1 M1From sensors to motors: the main loop and uORBRead module 1 up to 'From sensors to motors'SCHED_LOOP_RATE, fast tasks and PX4 publish/subscribeIn class: read the scheduler_tasks table in ArduCopter/Copter.cpp together and pick 10 tasks · Self-study: Worksheet 1 part A, build the table of the 10 tasks with rates and expected timesTable of tasks, rates and expected times
2 M1Scheduler loadRun Example 1Load when the loop rate rises, and deferring low-priority tasksIn class: compute load with Example 1 and read PM messages in a SITL log · Self-study: Worksheet 1 part B, change SCHED_LOOP_RATE in SITL, observe, restore it and compare computed load with real loop timeComputed load against real loop time
3 M1Delay eats phase; autopilot hardwareRead the delay and autopilot-hardware sections; run Examples 2–3; take the module 1 quizPhase lag ωτ · the FMU board, redundant IMUs, buses and ESC protocols versus delayIn class: estimate total delay and compute the phase lost with Example 2 and compare with PX4's structure, with the lecturer showing the lab board (unpowered, no propellers) · Self-study: Worksheet 1 part C, draw the board hardware diagram from the manufacturer documents and compute output delay with Example 3Worksheet 1 short report and quiz result
4 M2ArduPilot's attitude controllerRead module 2 up to the attitude controllerAngle P, rate PID and feedforwardIn class: log step tilt commands in SITL and compare desired and actual values in RATE and ATT · Self-study: Worksheet 2 part A, plot both loops from the logPlots of both loops from the log
5 M2Too much outer-loop gainRun Example 1An outer loop faster than the inner loop, overshoot and oscillationIn class: try three values of ATC_ANG_RLL_P within the allowed range in SITL and compare with Example 1 · Self-study: Worksheet 2 part B, make the table of results for three values, restore defaults and explain the overshoot or oscillationResults for three values
6 M2Limiting angular acceleration; flight dynamicsRead the angular-acceleration and flight-dynamics sections; run Examples 2–3; take the module 2 quizTime to tilt 20° at different accelerations · equations of motion, forces and moments, thrust headroomIn class: try the documented ATC_ACC_R_MAX presets in SITL, compare rotation times, then restore defaults · Self-study: Worksheet 2 part C, compute the training drone's thrust headroom with Example 3 from its mass, arm length and the maximum-thrust data in the manufacturer documentsRecommended values for the training drone, and quiz result
7 M3The two steps of a Kalman filterRead module 3 up to the Kalman filter section; run Example 1Predict and update; height from an accelerometer and a barometerIn class: change Q and R in Example 1 and see which sensor the filter trusts more · Self-study: Worksheet 3 part A, plot at least three Q and R settingsPlots comparing Q and R settings
8 M3Testing innovations before using dataRead the innovation test section; run Example 2Innovation gates, variances and rejected GNSS positionsIn class: open a SITL log and track the SV, SP, SH and SM fields of XKF4 through the flight · Self-study: Worksheet 3 part B, plot the XKF4 test ratios and compute the largest accepted innovation with Example 2XKF4 test ratio plots
9 M3GPS glitches; midtermReview modules 1–3; take the module 3 quizMidterm examination (modules 1–3)The midterm takes the class period, so there is no in-class practice · Self-study: Worksheet 3 part C, simulate a GPS glitch in SITL, see when SP exceeds 1 and write an EKF health guideWorksheet 3 report and midterm score
10 M4Notch and harmonic notchRead module 4 up to the notch section; run Example 1Motor frequency with throttle and the attenuation of an 80 Hz notchIn class: open the hover log prepared by the lecturer (with detailed IMU data), view the spectrum in FilterReview and find the motors' fundamental · Self-study: Worksheet 4 part A, compute notch attenuation with Example 1 and keep the spectrum imageSpectrum image and fundamental frequency
11 M4Low-pass filters and phaseRead the low-pass filter section; run Example 2Cutoff frequency and phase at an 8 Hz crossoverIn class: choose INS_HNTCH_* values from the spectrum and simulate the notch on the raw log data with Python · Self-study: Worksheet 4 part B, compare the spectra before and after filtering (also against a post-notch log if the lecturer has one)Spectra before and after the notch
12 M4The log-based tuning processRead the tuning process section; take the module 4 quizFix vibration before tuning PID, and change one value at a timeIn class: try low-pass cutoffs in SITL, compute the phase and log every change in the configuration register · Self-study: Worksheet 4 part C, finish the configuration register so every change can be traced and restoredConfiguration register and quiz result
13 M5Types of geofence in ArduPilotRead module 5 up to the geofence types; run Example 1Inclusion and exclusion fences, FENCE_TYPE and FENCE_ACTIONIn class: draw inclusion and exclusion fences in the GCS, upload to SITL and check points with Example 1 · Self-study: Worksheet 5 part A, fly towards the fence in SITL and record the stopping distance and actionPoint check results and observed stopping distance
14 M5Proving the GCS failsafe from a log; the position loopRead the failsafe and position-loop sections; run Examples 2–3; take the module 5 quizMissing heartbeats and when the failsafe must act · position loop, velocity loop and path followingIn class: cut the GCS link in SITL and collect heartbeat and mode-change times from the log · Self-study: Worksheet 5 part B, check the event times with Example 2 and make the event timing tableEvent timing table and quiz result
15 M5The test plan and flight performance testing; mini-project presentationsRead the test-plan and performance-testing sections; run Example 4; prepare the test reportCourse wrap-up and project criteriaThe class period is used to present the failsafe, geofence and performance test report with firmware version and parameters · Self-study: Worksheet 5 part C, test position-tracking accuracy in SITL with Example 4 before submitting the reportMini-project report and presentation, scored with the rubric

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 Exploring timing in the autopilot
Lab · About 3 h of class time · CLO1

Objective: Assess scheduler load and loop delay and link them to the phase lost

Equipment

  • ArduCopter source for the version in use
  • ArduPilot SITL and a log viewer
  • Python and the module 1 example code
  • PX4 uORB documentation
  • Manufacturer documents of the lab's flight controller board (and the board itself, shown in class by the lecturer)

Safety

  • Simulation and desk work only; no real flights
  • A board shown in class must be unpowered and have no propellers fitted

Steps

  1. In class: read scheduler_tasks and pick 10 tasks
  2. Self-study: compute the load of the 10 tasks with Example 1 and build the table of tasks, rates and expected times
  3. In class: run SITL and compare PM messages in the log with the expected loop time
  4. Self-study: change SCHED_LOOP_RATE in SITL, observe, then restore
  5. In class: estimate total delay from Figure 1 and compute the phase lost with Example 2
  6. In class: compare with PX4's structure from the uORB documentation
  7. Self-study: draw how the board connects IMUs, GPS, ESCs and buses from the manufacturer documents, check MOT_PWM_TYPE and EK3_IMU_MASK, and compute output delay with Example 3

Deliverables

  • Task load table
  • Loop timing comparison from the log
  • Phase calculation
  • ArduPilot versus PX4 comparison
  • Board hardware diagram and output-delay table

Checklist

  • Table 1 lists all 10 tasks, each with rate, expected time and share in %, with a total, and names the firmware version of the source read (Accuracy of calculations and log analysis)
  • Table 2 computes phase with 360 f τ after converting ms to s, and shows the remaining margin in every row (Accuracy of calculations and log analysis)
  • The original SCHED_LOOP_RATE, the value tried, and confirmation that the original was restored in SITL are recorded (Systematic tuning and configuration control)
  • The hardware diagram cites the manufacturer documents used and gives the MOT_PWM_TYPE and EK3_IMU_MASK values actually read (Safety and reporting)

Instructor guide

Class timing 180 min

  1. Review of the main loop, SCHED_LOOP_RATE and uORB20 min
  2. Read scheduler_tasks and fill in Table 145 min
  3. Run SITL, read PM messages, try a loop rate and restore it40 min
  4. Estimate total delay, compute phase and compare with PX435 min
  5. View the real board (unpowered, no propellers) and start the hardware diagram30 min
  6. Wrap-up and hand-in checklist10 min

Expected results

  1. Record: Table 1 Load of 10 tasks from the scheduler_tasks tableTable 1: numbers depend on the tasks chosen and the source version. With the lesson's Example 1 values (Copter 4.7.1): fast loop 400 Hz × 700 µs = 28.0%, rc_loop 250 Hz × 130 µs = 3.25%, fence_check 25 Hz × 100 µs = 0.25%, ekf_check 10 Hz × 75 µs = 0.075%; these four total 31.6% of the 2,500 µs loop period. Ten chosen tasks should total about 30-40% if they include the assumed 700 µs fast loop (the real value depends on the board). Accept ±0.1 point from rounding.
  2. Record: Table 2 Total delay and phase lost at an 8 Hz crossoverTable 2: using the delays in Figure 1 (IMU ~1 ms, filtering ~5 ms, EKF ~2.5 ms, controller to ESC ~3 ms), the total is 11.5 ms, which at an 8 Hz crossover costs 33.1° and leaves 26.9° of the 60° margin. From Example 2: 8 ms costs 23.0° (37.0° left), 12 ms costs 34.6° (25.4° left), 20 ms costs 57.6° (2.4° left), and the margin is gone at 20.8 ms. Accept a different delay estimate if 360 f τ is applied correctly.
  3. Record: Table 3 Board hardware and output delayTable 3: values read from the board depend on the lab's board (the lesson's example is the Pixhawk 6X: STM32H753 FMU at 480 MHz, 3 IMUs, 4 UARTs, 2 CAN buses, 1 I2C port). Output delays from Example 3: 50 Hz PWM 12.00 ms (34.6°), 490 Hz PWM 3.02 ms (8.7°), DShot150 at 400 Hz 1.36 ms (3.9°), DShot600 at 400 Hz 1.28 ms (3.7°). A 100-byte GPS message at 10 Hz uses about 8.7% of a 115200 bit/s UART.
  4. Question 1: From Table 1, which task uses the most processing time and why? If SCHED_LOOP_RATE were doubled, what would that task's load become?The fast loop (rate controller and motors) uses the most because it runs every cycle at 400 Hz with the largest time per run. At 800 Hz it would need 800 × 700 µs = 56% of all time and the loop period drops to 1,250 µs, so other tasks get deferred, which shows in the PM messages. A strong answer notes that the documentation calls values above 400 Hz experimental.
  5. Question 2: How much phase margin is left with the total delay your group estimated from Figure 1, and how much delay would remove it entirely? What does this say about lowering filter cutoffs?With 11.5 ms, 26.9° remains, and the margin is gone at 20.8 ms. A strong answer points out that a low filter cutoff adds delay and so cuts the margin directly, and the loop can oscillate even with unchanged PID values.
  6. Question 3: If the board sent ESC commands as 50 Hz PWM instead of DShot, how different would the phase lost be? Why is the difference between DShot150 and DShot600 so small?50 Hz PWM costs 34.6° against 3.7° for DShot600, a difference of about 31°, more than half the 60° margin. DShot150 and DShot600 differ by only 0.08 ms (0.2°) because sending a 16-bit frame (106.7 µs or 26.7 µs) is tiny compared with the average half-period wait of 1.25 ms. The difference comes mostly from the update rate, not the bit rate, so DShot150 suits long leads at little cost in time.
  7. Question 4: How does a board with three IMUs and EK3_IMU_MASK set to use all of them tolerate faults? How do ArduPilot and PX4 differ in passing data between parts of the software?EKF3 runs one core per IMU selected; all cores run in parallel, the healthiest core's output is used, and the vehicle can switch cores (lane switching) when one IMU fails or vibrates badly. On software, ArduPilot uses a main loop and a task table with rates, times and priorities, while PX4 splits into modules that publish and subscribe to messages through uORB, with the rate loop running at the IMU_GYRO_RATEMAX rate (default 400 Hz).

Discussion questions

  • If a drone oscillates after moving to a new board with the same PID values, what timing checks come before retuning?
  • What does raising the loop rate trade against what, and when is it worth it?
  • Why can low-priority tasks such as logging be deferred while the rate controller cannot?

Adapting to student background

Upper secondary (M.6)
Have them write U = Σ f t and φ = 360 f τ with units before substituting and predict results before running code; pair them with a SITL-confident peer when opening logs.
Vocational certificate
Start by handling the real board and pointing out the ports, then give a fill-in table that converts µs and ms to s step by step; let them check with a calculator alongside the code.
Diploma
Extension: compare the output delay of 490 Hz PWM and DShot, then propose a protocol and ports for the lab's large drone with long ESC leads, with reasons.

Common student mistakes: Common mistakes in the module 1 lesson

2Worksheet 2 Nested loops in SITL
Lab · About 3 h of class time · CLO1, CLO3

Objective: Observe the angle and rate loops in logs and the effect of gain and acceleration limits

Equipment

  • ArduPilot SITL and a GCS
  • Log viewer
  • Python and the module 2 example code
  • The training drone's mass, arm length and maximum-thrust data from the manufacturer or supplied by the lecturer

Safety

  • Simulation only; no real flights
  • Never use trial values on a real drone without review

Steps

  1. In class: log step tilt commands in Stabilize or AltHold
  2. Self-study: compare desired and actual values of both loops in RATE and ATT and plot them
  3. In class: try three ATC_ANG_RLL_P values in range and compare with Example 1
  4. In class: try the documented ATC_ACC_R_MAX presets and compare rotation times with Example 2
  5. Self-study: take the mass, arm length and maximum thrust from motor and propeller data and compute headroom and angular acceleration with Example 3
  6. Self-study: restore all defaults and record conclusions

Deliverables

  • Plots of both loops
  • Table of gain and acceleration results
  • Recommended values for the training drone
  • Table of the training drone's thrust headroom and accelerations

Checklist

  • Table 1 has all three values, each within 3-12, and names the log message (RATE or ATT) used to measure them (Accuracy of calculations and log analysis)
  • Parameters were changed one at a time, with the original value, the value tried and confirmation of every restore recorded (Systematic tuning and configuration control)
  • Every value in Table 3 has a unit and a source for mass, arm length and maximum thrust, and uses the L/√2 arm for an X frame (Accuracy of calculations and log analysis)
  • The recommended values for the training drone are clearly marked as SITL results not to be used on a real drone before review (Safety and reporting)

Instructor guide

Class timing 180 min

  1. Review the angle and rate loops and the safety rule for trial values20 min
  2. Step tilt commands in SITL and plot RATE and ATT45 min
  3. Try three ATC_ANG_RLL_P values, compare with Example 1, restore40 min
  4. Try the documented ATC_ACC_R_MAX presets, compare with Example 2, restore30 min
  5. Compute the training drone's thrust headroom with Example 330 min
  6. Summarise suitable values and hand-in checklist15 min

Expected results

  1. Record: Table 1 Effect of ATC_ANG_RLL_P from SITL logs compared with the Example 1 modelTable 1: SITL values differ from the model, so look mainly at the trend. The Example 1 model gives: P 3 rise 0.53 s, overshoot 1.8%, settle 0.64 s; P 4.5 rise 0.37 s, 12.3%, 1.25 s; P 9 rise 0.23 s, 40.0%, 1.55 s; P 12 rise 0.20 s, 54.4%, 1.96 s. An acceptable result shows rise time falling and overshoot growing as P rises.
  2. Record: Table 2 Time to tilt 20° by ATC_ACC_R_MAXTable 2 (Example 2): 1100 deg/s² takes 0.27 s with a 148.3 deg/s peak rate; 1080 takes 0.27 s, 147.0 deg/s; 720 takes 0.33 s, 120.0 deg/s; 300 takes 0.52 s, 77.5 deg/s. Times measured from the log should be slightly longer than computed because of command smoothing with ATC_INPUT_TC (0.10 s in 4.7.1) and the loop's own response time.
  3. Record: Table 3 Thrust headroom and accelerations of the training droneTable 3: depends on the real training drone. With the Example 3 values (1.6 kg, 0.25 m arm, J 0.015 kg·m², 8 N maximum thrust per motor): hover 3.92 N per motor (49%), headroom 3.92 N, maximum roll torque 2.77 N·m, angular acceleration about 10,599 deg/s², of which the 1100 deg/s² default uses about 10%. Tilts of 10°, 20° and 30° need total thrust of 15.94 N (50%), 16.70 N (52%) and 18.12 N (57%) and give horizontal accelerations of 1.73, 3.57 and 5.66 m/s².
  4. Question 1: From Table 1, explain why raising ATC_ANG_RLL_P makes the rise faster but the overshoot larger, and how the SITL results match or differ from the model.A stronger outer loop commands rotation rates faster than the inner loop can follow, so the angle shoots past the target and swings back. SITL numbers differ from the model because the model is not in ArduPilot units (except the angle gain) and ArduPilot adds feedforward and a square-root controller that reduce overshoot. A strong answer concludes that the inner loop is tuned first and the outer loop raised afterwards.
  5. Question 2: If a drone responds slowly, should you raise the gain or check ATC_ACC_R_MAX first? Use Table 2 to explain.Check ATC_ACC_R_MAX first. At a low value such as 300 deg/s², tilting 20° takes 0.52 s, almost twice the 0.27 s at 1100 deg/s², regardless of gain. Raising the gain fixes the wrong thing and adds overshoot, matching the lesson's common mistakes.
  6. Question 3: At what percentage of maximum thrust does your training drone hover? If payload made it hover at 80%, how would the maximum angular acceleration change?The example value is 49%. Hovering at 80% (6.4 N per motor, total mass about 2.61 kg) leaves 1.60 N of headroom, 41% of before, a torque of 1.13 N·m and about 4,322 deg/s² (assuming J unchanged; in reality J rises and lowers it further). The rate loop then has far less authority against gusts.
  7. Question 4: From Table 3, what horizontal acceleration does a 30° tilt (the ATC_ANGLE_MAX default) give, and why does this matter to the position loop?a = g tan 30° = 5.66 m/s² using 57% of total thrust. It is the acceleration ceiling the position loop in Module 5 can command; if wind or turns need more, the acceleration is limited and the position error grows.

Discussion questions

  • How should ATC_ACC_R_MAX differ between a camera drone and a racing drone, and why?
  • What can model or SITL results tell you about a real drone, and what can they not?
  • Before flying with a heavier payload, what would you check to know there is still enough thrust headroom?

Adapting to student background

Upper secondary (M.6)
Have them write T = mg/cos θ and a = g tan θ and check against practice question 2 (2 kg at 20° gives 20.9 N and 3.57 m/s²) before using the training drone data; give extra time with the GCS and SITL.
Vocational certificate
Let them weigh the training drone and measure its arm length themselves (propellers and battery removed), then fill Table 3 line by line with a template that already converts degrees to radians.
Diploma
Extension: use the Example 1 model to find an inner-loop gain that keeps overshoot at P 4.5 below 10%, and explain why a faster inner loop helps.

Common student mistakes: Common mistakes in the module 2 lesson

3Worksheet 3 Reading EKF health
Lab · About 3 h of class time · CLO2

Objective: Understand the effect of Q and R and read EKF test ratios from logs to judge readiness to fly

Equipment

  • Python and the module 3 example code
  • ArduPilot SITL
  • Log viewer

Safety

  • Simulation only; no real flights

Steps

  1. In class: change Q and R in Example 1 and see which sensor the filter trusts more
  2. Self-study: plot at least three Q and R settings
  3. In class: open a SITL log and track SV, SP, SH and SM of XKF4
  4. Self-study: simulate a GPS glitch in SITL and see when SP exceeds 1 and what the EKF does
  5. Self-study: compute the largest accepted innovation with Example 2 from the log variances
  6. Self-study: write an EKF health guide for the field team

Deliverables

  • Q and R comparison plots
  • XKF4 plots for normal and glitch periods
  • One-page EKF health guide

Checklist

  • Table 1 has at least three Q and R sets, including the Example 1 default, with a plot for each (Accuracy of calculations and log analysis)
  • Table 2 separates normal and glitch periods, gives the time SP exceeds 1, and reads SV, SP, SH and SM as square-root test ratios, not variances (Accuracy of calculations and log analysis)
  • The glitch method and the SITL parameters changed are recorded, with confirmation they were restored (Systematic tuning and configuration control)
  • The EKF health guide gives clear criteria (for example above 1 means rejected) and what the team must do before flight, in one page or less (Test design and proof)

Instructor guide

Class timing 180 min

  1. Review the predict and update steps and what an innovation is20 min
  2. Change Q and R in Example 1 and fill in Table 145 min
  3. Open a SITL log and read XKF4 in normal flight30 min
  4. Simulate a GPS glitch and fill in Table 240 min
  5. Compute the largest accepted innovation with Example 2 and draft the EKF health guide35 min
  6. Wrap-up and hand-in checklist10 min

Expected results

  1. Record: Table 1 Effect of Q and R on height error (Example 1)Table 1 (simulated data of Example 1, seed 3, true final height 3.98 m): Q = diag(1e-5, 1e-3), R = 0.25 m² gives RMS 0.08 m (barometer alone 0.50 m, accelerometer alone 26.7 m off at 30 s); R = 0.0025 m² gives 0.15 m (trusts the barometer, chases noise); R = 25 m² gives 0.09 m (trusts the accelerometer, follows slowly); Q = diag(1e-3, 1e-1) gives 0.15 m (trusts the barometer more); Q = diag(1e-7, 1e-5) gives 0.09 m. With another seed numbers may differ by about ±0.02 m but the trend must be the same.
  2. Record: Table 2 XKF4 test ratios in normal and GPS-glitch periods in SITLTable 2: in normal flight SV, SP, SH and SM should stay clearly below 1 (usually no more than about 0.3-0.5 in SITL). During the glitch SP jumps above 1 as soon as the GNSS position jumps; the exact value depends on the glitch size the lecturer sets. The EKF rejects positions while SP > 1 and may reset to the new GNSS position if rejection lasts long.
  3. Record: Part 3 Largest accepted innovation calculation and EKF health guide for the field teamPart 3: largest accepted innovation = (gate/100) × √S. With S = 4 m² as in Example 2 it is 10.0 m (innovations of 0.8, 1.5, 3.9 and 9.2 m are used, logged as 0.08, 0.15, 0.39 and 0.92; 12.0 m is rejected, logged as 1.20). With another S from the log, for example 1 m², it is 5.0 m. A good guide says an XKF4 value above 1 means rejected and a value near 1 means find the cause before flying.
  4. Question 1: From Table 1, how does the error change when the barometer's R is made much smaller, and why is setting R smaller than reality a bad idea?A very small R (0.0025 m²) makes the RMS worse, from 0.08 to 0.15 m, because the filter trusts a barometer with 0.5 m noise and chases the noise (the height Kalman gain rises from about 0.036 to 0.121). A strong answer says R should reflect the sensor's real variance (0.5² = 0.25 m²).
  5. Question 2: In the GPS-glitch part of the log, when does SP exceed 1? Does the EKF use or reject the position data then, and what happens if it rejects it for long?SP exceeds 1 from the moment the glitch starts. The EKF rejects position data then and relies on accelerometer prediction; if rejection lasts long, the estimate drifts and the EKF may reset to the new GNSS position, making the position jump.
  6. Question 3: If the position innovation variance in the log is 2.25 m² and the gate is 500, what is the largest accepted innovation, and what does SP = 0.6 mean?5 × √2.25 = 7.5 m. SP = 0.6 means the innovation is at 60% of the gate boundary, so the data is used (test ratio 0.36 < 1).
  7. Question 4: Why is widening EK3_POS_I_GATE to make warnings disappear not a fix?Widening the gate lets wrong data in, such as positions jumping from multipath, which corrupts the estimate. The warning says the sensors disagree, so the cause must be found, such as vibration, GNSS signal or compass. A strong answer cites the lesson's common mistakes.

Discussion questions

  • If prop wash hits the barometer, should you raise R or fix the mounting, and why?
  • What should the field team check before every flight, and when should they decide not to fly?
  • Why can airframe vibration corrupt the EKF even when GNSS is fine?

Adapting to student background

Upper secondary (M.6)
Use school statistics (mean, variance, standard deviation) to explain R and a 5-standard-deviation gate before the lab, and pair them with a SITL-confident peer.
Vocational certificate
Focus on reading plots and the working rule (below 1 used, above 1 rejected); give a code template where only Q and R can be edited, and have them compute (gate/100) × √S on a calculator.
Diploma
Extension: simulate two glitch sizes, compare which one the EKF rejects and resets on and which it accepts, then write a pre-flight check for the lab drone.

Common student mistakes: Common mistakes in the module 3 lesson

4Worksheet 4 Setting the harmonic notch from a recorded log
Lab · About 3 h of class time · CLO3

Objective: Find vibration frequencies in logs, set the harmonic notch and understand the phase cost of low-pass filters

Equipment

  • A hover log with detailed IMU data from the ArduPilot training drone, prepared by the lecturer
  • FilterReview tool
  • ArduPilot SITL
  • Python and the module 4 example code

Safety

  • Desk and simulation work; students do not fly in this course
  • The lecturer's log must come from a flight made within CAAT conditions by an authorised pilot outside class time
  • Remove propellers whenever editing parameters on a real drone, and never apply values that have not been reviewed

Steps

  1. In class: open the hover log, view the spectrum in FilterReview and find the motors' fundamental
  2. Self-study: compute notch attenuation with Example 1
  3. In class: choose INS_HNTCH_* for the supported mode and simulate the notch on the raw log data with Python
  4. Self-study: compare the spectra before and after filtering
  5. In class: try low-pass cutoffs in SITL and compute the phase with Example 2
  6. Self-study: record every change in the configuration register

Deliverables

  • Spectra before and after the notch
  • Attenuation and phase calculations
  • Configuration register

Checklist

  • Table 1 gives the fundamental and harmonics with spectrum images before and after filtering, and names the log they came from (Accuracy of calculations and log analysis)
  • Table 2 computes the phase with the second-order Butterworth formula for all three cutoffs and shows the remaining margin (Accuracy of calculations and log analysis)
  • The configuration register lists every change, one value at a time, and every row says whether it was restored (Systematic tuning and configuration control)
  • The proposed INS_HNTCH_* values are clearly marked as unreviewed and not to be set on a real drone before the lecturer checks them (Safety and reporting)

Instructor guide

Class timing 180 min

  1. Review notch and low-pass filters and the log-based tuning order20 min
  2. Open the log in FilterReview and find the fundamental and harmonics40 min
  3. Compute attenuation with Example 1 and choose INS_HNTCH_*35 min
  4. Simulate the notch on raw data with Python and compare spectra35 min
  5. Try low-pass cutoffs in SITL and compute phase with Example 235 min
  6. Finish the configuration register and hand-in checklist15 min

Expected results

  1. Record: Table 1 Vibration frequencies from the spectrum and notch attenuationTable 1: frequencies depend on the lecturer's log. A motor at 5,400 rpm has a 5400/60 = 90 Hz fundamental (4,800 rpm = 80 Hz), with harmonics at two and three times. Attenuation of the prototype notch at f0 80 Hz, BW 40 Hz (Q = 2) from Example 1: 60 Hz -2.4 dB, 80 Hz very deep (limited in practice by INS_HNTCH_ATT 40 dB), 83 Hz -16.7 dB, 90 Hz -7.4 dB, 100 Hz -3.5 dB, 160 Hz -0.5 dB. The filtered peak must be clearly lower at the set frequency.
  2. Record: Table 2 Low-pass cutoff and phase at 8 HzTable 2 (Example 2, second-order Butterworth, 8 Hz crossover): 40 Hz cutoff gives -16.4°, leaving 43.6°; 20 Hz (the INS_GYRO_FILTER default) -34.0°, leaving 26.0°; 10 Hz -72.3°, a margin of minus 12.3°, so unstable. In SITL more oscillation should appear as the cutoff falls.
  3. Record: Table 3 Configuration registerTable 3: every row has old and new values, for example INS_HNTCH_ENABLE 0 to 1, INS_HNTCH_FREQ at the fundamental found, INS_HNTCH_BW about half the fundamental, INS_HNTCH_MODE to suit the hardware, and the INS_GYRO_FILTER values tried in SITL. Every row cites the log file name and is restored.
  4. Question 1: Does the fundamental your group found in the log match the motor speed in hover? If the notch is set at 80 Hz but the motors turn at 83 Hz or 90 Hz, how much attenuation is left?If the fundamental in the log moves with throttle, it comes from the motors. A notch at 80 Hz removes only 16.7 dB at 83 Hz and 7.4 dB at 90 Hz compared with a very deep cut at the centre, so the notch must track the real frequency.
  5. Question 2: From this, which INS_HNTCH_MODE should the training drone use, and why?If the ESCs report motor speed (bi-directional DShot or ESC telemetry), use MODE 3, which the documentation calls generally the best; otherwise MODE 1 (throttle) or 4 (in-flight FFT). A strong answer links this to the ESC hardware surveyed in Worksheet 1.
  6. Question 3: From Table 2, if the cutoff is lowered from 20 Hz to 10 Hz to reduce noise, what happens to a loop with a 60° margin, and why is a notch better?At 10 Hz the phase lag is 72.3°, more than the 60° margin, so the loop becomes unstable and oscillates. The 80 Hz notch adds only 2.9° at 8 Hz because it acts on a narrow band around the motor frequency, far from crossover.
  7. Question 4: Could someone else trace from your configuration register which change caused which result? What goes wrong if several values are changed at once?A strong answer says a register with old value, new value, reason and before-and-after logs makes changes traceable; changing several at once hides which one helped or hurt and makes restoring hard, matching the lesson's common mistakes.

Discussion questions

  • Why fix mechanical vibration before setting filters and tuning PID?
  • Without a log flown after setting the notch, how far can a Python simulation confirm the result?
  • Who should approve parameter values before they go on a real drone, and what evidence is needed?

Adapting to student background

Upper secondary (M.6)
Review frequency, decibels and phase with familiar sound waves first, then have them substitute one frequency by hand before running the code.
Vocational certificate
Focus on reading spectrum images, finding peaks and noting frequencies; give a complete configuration-register template and start with converting rpm to Hz by dividing by 60.
Diploma
Extension: compare spectra at two throttle levels in the same log and argue for a fixed or tracking notch with attenuation figures.

Common student mistakes: Common mistakes in the module 4 lesson

5Worksheet 5 Testing failsafes and geofences in SITL
Lab · About 3 h of class time · CLO3

Objective: Check missions against fences before flight, prove from logs that failsafes act on time, and measure position-tracking accuracy

Equipment

  • ArduPilot SITL and a GCS
  • Log viewer
  • Python and the module 5 example code

Safety

  • Simulation only; no real flights

Steps

  1. In class: draw inclusion and exclusion fences in the GCS, upload to SITL and set FENCE_TYPE and FENCE_ACTION
  2. In class: export fence and mission points and check them with Example 1
  3. Self-study: fly towards the fence in SITL and observe stopping distance and action
  4. In class: cut the GCS link in SITL and collect heartbeat and mode-change times from the log
  5. Self-study: check the event times with Example 2 and make the failsafe event timing table
  6. Self-study: fly a 200 m line out and back in SITL with a simulated crosswind, extract PSCN and PSCE and assess error with Example 4 before and after changing PSC_NE_VEL_I
  7. Self-study: write a test report with firmware version and parameters
  8. In class (week 15): present the report

Deliverables

  • Fence point check results
  • Failsafe event timing table
  • Test report
  • RMS and maximum error table before and after the change

Checklist

  • Table 1 checks every fence and mission point with the program and records the FENCE_TYPE, FENCE_ACTION and FENCE_MARGIN actually set (Accuracy of calculations and log analysis)
  • The test plan states pass criteria before testing (for example within 0.5 s of the expected time, RMS and maximum error limits) and every result is proven with log messages (Test design and proof)
  • Table 3 names the error type, flight speed and simulated wind, and only PSC_NE_VEL_I was changed and then restored (Systematic tuning and configuration control)
  • The test report gives the firmware version, the parameter file and the limits of SITL results (Safety and reporting)

Instructor guide

Class timing 180 min

  1. Review fence types, the GCS failsafe and pass criteria in the test plan20 min
  2. Draw fences, upload to SITL and check points with Example 135 min
  3. Fly towards the fence in SITL and record the action25 min
  4. Cut the GCS link and check event times with Example 235 min
  5. Fly the 200 m line in a simulated crosswind and assess error with Example 450 min
  6. Summarise the report and hand-in checklist15 min

Expected results

  1. Record: Table 1 Mission points checked against fences, and flying towards the fence in SITLTable 1: with the Example 1 fences (400 × 300 m inclusion, exclusion around a building at 250-320 × 120-200 m, FENCE_MARGIN 2 m): (100, 100) ok, 100 m from an edge; (398.5, 150) within the margin, 1.5 m away; (300, 150) breach, inside the exclusion zone; (410, 50) breach, outside the inclusion fence. The SITL stopping distance depends on speed and FENCE_ACTION (default 1 = RTL or land); the lesson's pass criterion is a breach of no more than 2 m.
  2. Record: Table 2 GCS failsafe event timingTable 2 (Example 2, FS_GCS_TIMEOUT 5 s): the last heartbeat before the link loss is at 10 s with a 6.4 s gap, so the failsafe should act at 15.0 s; the log records RTL at 15.2 s, +0.2 s, within the ±0.5 s criterion. The largest gap that did not trigger it is 1.1 s. Real SITL numbers will differ, but the action must come about 5 s after the last heartbeat.
  3. Record: Table 3 RMS and maximum error before and after changing PSC_NE_VEL_ITable 3 (simulated data of Example 4, 200 m line at 8 m/s, criteria RMS ≤ 0.8 m and maximum ≤ 1.5 m): error to target RMS 1.35 m, maximum 1.63 m, FAIL; cross-track error RMS 0.65 m, maximum 1.20 m, PASS. Before and after PSC_NE_VEL_I in SITL depends on the wind set; the Example 3 model (4 m/s wind) gives, without I: maximum 0.60 m, RMS 0.57 m, steady 0.60 m; with I = 1.0: maximum 0.40 m, RMS 0.14 m, steady 0.00 m.
  4. Question 1: Is a point closer to the fence edge than FENCE_MARGIN a breach? Why check points with a program before uploading a mission?It is not a breach; the point is still inside the fence but within the margin, which ArduPilot uses to keep missions from getting too close to the edge. Checking with a program before upload catches misplaced points, such as one inside an exclusion zone, before flight.
  5. Question 2: From Table 2, did the failsafe act as configured? If the time differed a lot from the expected time, what would you check?It acted as configured if the difference is within 0.5 s (the example is +0.2 s). If it differs a lot, check that FS_GCS_ENABLE is set correctly and whether another GCS is still sending heartbeats, and beware of confusing log time with GCS screen time.
  6. Question 3: From Table 3, how do the error to the moving target and the cross-track error differ, and which should your test plan use, and why?Error to the target includes lag along the path (about 1.1-1.3 m throughout in the example), so it fails, while cross-track error measures how far the aircraft leaves the line, so it passes. Corridor surveys and staying inside fences call for cross-track error. A strong answer says the test plan must name the error type in advance.
  7. Question 4: How did changing PSC_NE_VEL_I change the error in a crosswind, and why is the logged position still not external truth?The I term accumulates error until the aircraft leans about 7° into the wind with no steady error, so the steady error disappears and the peak is smaller (model: 0.60 to 0.40 m). The logged position is the EKF's estimate; if GNSS is 2 m off, both log and controller see a straight flight while the whole aircraft is in the wrong place, so an external measurement such as RTK GNSS is needed.

Discussion questions

  • Which SITL tests still need a real test in a safe area, and which should come first?
  • If the wind needs more lean than ATC_ANGLE_MAX, what happens to the error and to stopping before the fence?
  • Why is drawing an exclusion fence over the take-off point dangerous?

Adapting to student background

Upper secondary (M.6)
Have them compute RMS by hand from practice question 2 (0.2, 0.4, 0.4, 0.8 m gives 0.5 m) and explain the FENCE_TYPE bitmask in binary before working in SITL.
Vocational certificate
Focus on step-by-step GCS work with an illustrated step sheet; get them drawing fences and reading log times first, then use example code where only the inputs are edited.
Diploma
Extension: design a test plan covering every failsafe and fence type set, with pass criteria, and propose the first real test at low altitude in a safe area.

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 log analysis30%All numbers and log readings correct, citing the right log messagesNearly all correctSome errors or missing log evidenceMany errors or no log used
Systematic tuning and configuration control25%One change at a time, full configuration register, always restorableMostly systematicIncomplete records or several changes at onceNot traceable
Test design and proof25%Test plan covers every type with pass criteria set in advance and proven with logsNearly complete coverageMissing pass criteria or casesNo test plan
Safety and reporting20%Follows all safety rules (no trial values applied to a real drone without review); clear report with firmware versions and limitsNearly completeSome key points missingIgnores safety or no report

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 Analyse autopilot cascade control structuresW 1W 2M1M2M5
CLO2 Estimate state and diagnose the EKFW 3M3
CLO3 Tune and verify control performance from logsW 2W 4W 5M2M4M5