UAT 305 Autopilot and Control Technology

Worksheet 1 Exploring timing in the autopilot

Lab 3 hAssesses CLO1

Objective

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

Equipment and materials

  • 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

Record of results

Table 1 Load of 10 tasks from the scheduler_tasks table
Task nameRate (Hz)Expected time (µs)Share of CPU time (%)PM in log (if any)
Table 2 Total delay and phase lost at an 8 Hz crossover
Step or caseDelay (ms)Phase lost (°)Remaining phase margin (°)
Table 3 Board hardware and output delay
Item (IMU, bus, ESC, GPS)Value or parameter foundUpdate rate (Hz)Average delay (ms)Phase at 8 Hz (°)

Questions

  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?

  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?

  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?

  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?

Check before you hand in

What to hand in

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

CLO1 Analyse autopilot cascade control structures. (CLOs are a web-team draft; the course owner sets the final ones.)

Instructors: answers and teaching notes for this worksheet are in the teaching pack