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

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

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

LQR for Hopper and Its Margins

Bench log · Hopper on the test range

09:10. The lateral LQR for Hopper was designed on paper and passed the textbook test: at least 60 degrees of phase margin, guaranteed. On the stand, the loop rings at 9 rad/s and the gimbal servo is warm.

You will choose the weights, find what the margin really is with the 25 rad/s servo and 15 ms of delay in the loop, and write the function that computes the loop gain of the real chain.

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: LQR margins are guaranteed at the plant input for an ideal actuator; the gimbal servo and the delay remove most of them, and the weight on the gimbal sets the crossover and so what is left. Stage 2: Bryson's rule for the weights. Stage 3: the loop gain of the full chain, with the servo and the delay in it.

    Grading evaluates the margins of your choice with the real gimbal, compares your weights with Bryson's and your loop gain with the exact one at five frequencies on hidden gains, servos and delays.

    Theory for this lab

    State-Space and Optimal Control labs

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

    Educational simplification: hover linearization of the lateral channel, a first-order servo and a pure delay. A real design also treats the sensor delay, the filter and the margins at the sensor side of the loop (module 12).

    Get the next lab

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