FixTheRobot Explore Robotics / Guidance, Navigation and Control / M4 / M4-L2

This lab works on phones, but writing code is much easier on a laptop.

Guidance, Navigation and Control · State-Space and Optimal Control · M4-L2 · Advanced

The Observer That Spoils the Loop

Bench log · Hopper on the test range

07:55. Hopper's pitch-rate gyro died overnight and the replacement is two weeks away. The flight computer can still read position, velocity and tilt, so the controller will use an estimate of the pitch rate. The first try rings, and the second chatters.

You will find the window of observer bandwidths that works, and write the update the flight code runs 50 times a second.

Your task

    Simulation
    solution.pyLoading Python…
    Ctrl+Enter runs
    What Python can I use?

    Plain Python 3 with the standard library and the course library gnckit (import gnckit as g: transfer functions and margins, state space and LQR, the Hopper model, quaternions, a convex solver). NumPy is not available in the browser. Your code runs in a background worker: an endless loop is stopped after a few seconds and the page stays usable. It runs in your browser and is never sent anywhere.

    Hints

    What this lab teaches

    Stage 1: the observer bandwidth is a trade. A slow observer leans on the model, which is wrong by the authority error; a fast one passes the tilt noise into the gimbal and puts its poles into the band where the servo and the delay have already taken the margin. Stage 2: an observer is the plant model with the same input, corrected by the measurement; leaving out the input term makes every control action look like a disturbance.

    Grading evaluates the margins, the noise activity and the settling time of your choice, and compares your update with the reference to 1e-9 on hidden bandwidths and inputs.

    Theory for this lab

    State-Space and Optimal Control labs

    1. M4-L1: LQR for Hopper and Its Margins
    2. M4-L2: The Observer That Spoils the Loop: this lab.

    Educational simplification: a two-state observer for tilt and rate, with measured position and velocity and a first-order servo the observer does not model. Module 4 treats the full LQG design and loop-transfer recovery.

    Get the next lab

    Get notified when new robotics labs are released. One email per new lab, nothing else.