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

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

Guidance, Navigation and Control · Modelling a Vehicle for GNC · M2-L1 · Intermediate

Trim and Linearize Hopper

Bench log · Hopper on the test range

08:50. Hopper has been refitted with a heavier battery on one side, and the thrust line now passes 4 cm to one side of the centre of mass. The old trim, a vertical body and a centred gimbal, makes the vehicle drift sideways and tilt away.

You will find the new hover by hand, make the computer find it for any mass and offset, build the linear model that the control design of module 4 will use, and measure how far from the trim that model can be trusted.

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 shows that hover with an off-centre mass is a tilted state: the gimbal cancels the torque, and the body leans to cancel the sideways push of the tilted thrust. Stage 2 solves the trim with Newton's method. Stage 3 linearizes by central differences and shows why the step size matters. Stage 4 measures the validity of the linear model and shows that for an unstable axis it is limited by time as well as by amplitude.

    Grading evaluates your trim in the exact dynamics (residuals below 1e-6) and compares your Jacobians with the analytic ones to 1e-5, on hidden masses and offsets.

    Theory for this lab

    Modelling a Vehicle for GNC labs

    1. M2-L1: Trim and Linearize Hopper: this lab.
    2. M2-L2: Find the Simulator Bug

    Educational simplification: the lateral channel only, with constant thrust magnitude and a pitch inertia that does not change. The full planar model of module 2 adds the vertical axis and the mass loss.

    Get the next lab

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