Lesson 09 · Part 2 · Control
Flying a path
Mission: Fly a drone through three waypoints, and see how the position gain and the wind change the overshoot.
The interactive version of this lesson needs JavaScript. Below are its steps as text.
Steps
1. Three waypoints
Press Run. The waypoints are (0.6, 0), (0.6, 0.6) and (0, 0.6) metres, each held for 3 s, with x forward and y left.
Why it matters: A setpoint is the place the drone is asked to be. A path is a list of setpoints with times, and the controller follows each in turn.
2. Predict the overshoot
Predict first. Then set the position kp slider to 3 and press Run.
Why it matters: The position gain turns distance into a desired speed. A high gain asks for a fast approach, and the drone carries past the waypoint before it slows.
3. Position gain, live
Drag the position kp slider, then press Run. Watch the x line reach the waypoint.
Why it matters: The gain sets a trade-off between speed and overshoot. A path with sharp corners is harder than a gentle one.
4. Wind pushes the path
Drag the wind slider to a value you choose (a steady sideways push), then press Run.
Why it matters: A steady wind is a steady error. Without an integral term the drone settles off its waypoint, the same lesson as Lesson 7.
5. A clean approach
Press Run with the position kp at 1.5, then compare the overshoot with the kp 1 and kp 3 runs.
Why it matters: A clean approach uses the largest gain that still stops short of overshoot. Between kp 1 and 1.5 the overshoot starts to appear.
6. Your reading: plan a path
Open the Notebook tab. Write three waypoints for a square of your own, in metres, and the overshoot you saw.
Why it matters: A path in metres with times is what a flight plan is made of. Writing one by hand makes the setpoints and their timing clear.
Go deeper
The maths in this lesson
desired velocity v_des = min(1 m/s, kp_pos·(p_wp − p)) desired accel a_des = kp_vel·(v_des − v) desired tilt θ_des = a_x/g, φ_des = −a_y/g (small angles, heading zero)
The position gain used here is a lesson choice; the firmware position gains were not verified in this build.
Model limits
- No integral term in the position loop.
- Wind is a constant force, not gusts.
- Waypoints are at a fixed height of 0.5 m.