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

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

Guidance, Navigation and Control · Classical Feedback Control · M3-L1 · Intermediate

Rescue the Phase Margin

Bench log · Hopper on the test range

13:20. Hopper's pitch loop was fine on Monday. A heavier engine was fitted on Tuesday, with a slower gimbal servo, and now the vehicle rings in pitch after every command. The gains have not been touched.

You will see what the refit did on the Bode plot, learn to measure the margins from stand data whose phase wraps, and compute the compensator that puts the margin back.

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 reads the margins on a Bode plot and shows that a lead compensator must be centred at the crossover, where the phase margin is read. Stage 2 measures the margins from a sampled response: interpolating in log frequency and unwrapping the phase, without which the phase crossover is never found. Stage 3 computes the lead from the required phase.

    Grading compares your margins with the exact ones and checks the loop with your compensator: the added phase, the unit gain at the crossover and the margins reached, on hidden servos and delays.

    Theory for this lab

    Classical Feedback Control labs

    1. M3-L1: Rescue the Phase Margin: this lab.
    2. M3-L2: When the Gimbal Saturates

    Educational simplification: one loop, one lead, the reference gains of the module. A real design also checks the closed-loop response, the noise gain of the lead and the margin at the other loop-breaking points (modules 3 and 12).

    Get the next lab

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