UAT 206 Fundamentals of Control and Autopilot Systems

Worksheet 3 Altitude PID in simulation

Analysis activity 6 hAssesses CLO2

Objective

Explore the effect of P, I, D, climb-rate limits and derivative filtering, and link them to real autopilot parameters

Equipment and materials

  • Python and the module 3 example code
  • PX4 or ArduPilot documentation

Safety

  • Simulation and desk work only; no real flights

Steps

  1. Run Example 1, changing KP, KI and KD one at a time; tabulate overshoot and settling time
  2. Use Example 3, switching rate_limit and stop_i, and compare a 2 m/s climb-rate limit with and without stopping I against no limit
  3. Use Example 4, changing KD and KI together, and see whether overshoot keeps falling
  4. Use Example 2 with N from 5 to 20 and watch the D-term peak
  5. Identify the rate loop's P, I, D and filter parameters in the PX4 or ArduPilot docs
  6. Write the tuning order you will use in SITL in module 5

Record of results

Table 1 Effect of changing one gain at a time
CaseKPKIKDOvershoot (m)Time to stay within ±0.2 m (s)
Table 2 Climb-rate limit and D-term peaks
CaseSettingResultUnit
Table 3 Rate-loop parameters
TermPX4 parameterArduPilot parameterWhat it does

Questions

  1. From Table 1, which change cut overshoot the most? Why does removing I almost remove overshoot in this model, and should you remove I on a real drone? Also, why does KD 3.0 give more overshoot than KD 2.0 even though D damps oscillation?

  2. With a 2 m/s climb-rate limit but I still accumulating while limited, the result is worse than no limit at all. Why?

  3. Why does a larger N give a higher D-term peak, and why does computing D from the measurement fix the problem at its source?

  4. A friend gives standard-form gains K = 2 and Ti = 4 s. What Ki do you enter in parallel form, and why must you know which form the autopilot uses before borrowing gains?

  5. Write the tuning order you will use in SITL in module 5, with reasons.

Check before you hand in

What to hand in

  • Results table against gains
  • Plots of climb-rate limit and D-term peaks
  • Rate-loop parameter table
  • Tuning order

CLO2 Design and tune PID controllers. (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