A $1.2\ \text{kg}$ drone must hover at a fixed point $4\ \text{m}$ above the ground. Its position controller asks for an acceleration $$\vec a = k_p\,(\vec x_{goal} - \vec x) - k_d\,\vec v$$ and tilts the drone to get it.
The wind blows at $6\ \text{m/s}$ at a height of $10\ \text{m}$ but is slower near the ground (wind shear, exponent $0.3$), and it is turbulent: eddies up to about $20\ \text{m}$ across make the air speed vary with a standard deviation of $2\ \text{m/s}$ in every direction. The drone's side area is $0.06\ \text{m}^2$ with a drag coefficient of $1.0$.
With the starting settings ($k_p = 0.3\ \text{s}^{-2}$, $k_d = 0.5\ \text{s}^{-1}$) the drone is blown metres away. Tune the controller so that, after settling for $2\ \text{s}$, it never strays more than $0.75\ \text{m}$ from its hover point.
Drag: $F = \tfrac{1}{2}\rho v^2 A C_d$. A change $\delta v$ in the air speed changes the force by about $\rho v A C_d\,\delta v$.
The controlled drone is a mass on a spring with a damper: $\ddot x + k_d \dot x + k_p x = a_{wind}$, with natural frequency $\omega_n = \sqrt{k_p}$ and damping ratio $\zeta = k_d/(2\sqrt{k_p})$.
A steady push $a$ moves a spring to a new rest point $a/k_p$. Pushes slower than $\omega_n$ do much the same, so the drift falls as $1/k_p$.
Question
Which position gains $k_p$ and $k_d$ keep the drone within $0.75\ \text{m}$ of its hover point?
Your setup must satisfy
After settling (from t = 2 s) the drone stays within 0.75 m of its hover point
Drag to orbit ยท scroll to zoom ยท right-drag to pan
Your settings
Hints
Solution
Step 1: The wind at the drone $$v = 6 \times (4/10)^{0.3} = 6 \times 0.76 = 4.56\ \text{m/s}$$
Step 2: The steady push $$F = \tfrac{1}{2} \times 1.225 \times 4.56^2 \times 0.06 \times 1.0 = 0.76\ \text{N}, \qquad a = F/m = 0.64\ \text{m/s}^2$$ The controller has no integral term, so the drone settles downwind of its hover point by $$x_{steady} = \frac{a}{k_p}$$ With $k_p = 0.3$ that is $2.1\ \text{m}$, already far too much.
Step 3: The turbulent push Each $1\ \text{m/s}$ change in air speed changes the drag by $\rho v A C_d = 1.225 \times 4.56 \times 0.06 = 0.34\ \text{N}$. With $\sigma = 2\ \text{m/s}$: $$\sigma_F \approx 0.67\ \text{N}, \qquad \sigma_a \approx 0.56\ \text{m/s}^2$$ Most of the energy of the turbulence is in slow changes, so the drone wanders by about $\sigma_a/k_p$ (standard deviation), and its largest excursions are about three times that.
Step 4: Choose $k_p$ Largest distance $\approx (0.64 + 3 \times 0.56)/k_p = 2.3/k_p$. For $0.75\ \text{m}$: $$k_p \gtrsim 3$$ Take $k_p = 6$ for margin: about $2.3/6 = 0.39\ \text{m}$.
Step 5: Choose $k_d$ $\omega_n = \sqrt{6} = 2.45\ \text{rad/s}$. A damping ratio of about $0.8$ settles quickly with little overshoot: $$k_d = 2\zeta\sqrt{k_p} = 2 \times 0.8 \times 2.45 \approx 4$$
Answer: $k_p \approx 6\ \text{s}^{-2}$, $k_d \approx 4\ \text{s}^{-1}$. The simulation's largest distance is $0.41\ \text{m}$, as estimated. With $k_p = 4$, $k_d = 3$ it is $0.59\ \text{m}$ (still a pass); with $k_p = 2.25$, $k_d = 2.4$ it is $0.92\ \text{m}$ (a fail); the starting settings drift $4.95\ \text{m}$.
Why not make $k_p$ huge? A real drone can only tilt so far and its motors respond with a delay, so very stiff gains make it oscillate. The simulation limits the tilt to $30ยฐ$.
How others did
Nobody has tried this yet.Be the first. Your answer starts the stats.
Only each person's first answer, given before viewing the solution, is counted.
Discussion 0 comments
Log in to join the discussion.