UAT 206 Fundamentals of Control and Autopilot Systems

Worksheet 5 Tuning and testing in SITL

Lab 6 hAssesses CLO2, CLO1

Objective

Compare two tuning sets from real simulator logs and measure path-tracking error with wind

Equipment and materials

  • PX4 (Gazebo) or ArduPilot SITL
  • Flight Review or UAV Log Viewer
  • Python and the module 5 example code
  • Lab L02 instructions

Safety

  • Simulation only; no real flights

Steps

  1. Start SITL and record firmware version, simulator version and parameter file
  2. Command a roll step in hover and export rate data from the log
  3. Apply the metrics function from Example 1 to both tuning sets
  4. Fly a straight-line mission with and without wind per L02 and compute errors with Example 2
  5. Write a short report comparing tunings with plots, parameter files and simulation limits

Record of results

Table 1 Response metrics of the two tuning sets
Tuning setParameter fileRise time Tr (ms)Overshoot Mp (%)Settling time Ts (s)
Table 2 Path-tracking error
ConditionWind settingRMS (m)Maximum (m)Mean (m)
Notes for the short report: firmware version, simulator version, log file names and limits of simulation results

Questions

  1. Which tuning set would you choose? Justify it with all three metrics, not just one.

  2. How close are the measured overshoot and settling time to the second-order formulas, and why should you not judge by looking at the plot alone?

  3. In the crosswind, the mean error is almost as large as the RMS. What does this tell you, and what would you change next?

  4. Why can gains that work well in SITL not go straight onto the real drone?

Check before you hand in

What to hand in

  • Metrics for both tuning sets
  • Tracking error table
  • Short report with parameter files

CLO2 Design and tune PID controllers. CLO1 Model dynamics and analyse system response. (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