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

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

Guidance, Navigation and Control · Aided Navigation and Attitude Determination · M7-L2 · Advanced

Two Vectors, One Attitude

Bench log · Hopper on the test range

06:30. A small satellite has a Sun sensor accurate to 0.05 degrees and a magnetometer accurate to a degree. The attitude solution is excellent in some parts of the orbit and wanders by tens of degrees in others, and the flight software has TRIAD with the magnetometer as the primary vector because it was written first.

You will see what the geometry does, rewrite TRIAD, and write the weighted solution that uses both sensors properly.

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 attitude about the common direction of two vectors is fixed only by the angle between them, so the error is amplified by 1/sin(separation); TRIAD with the poor vector first passes its whole error on, and Wahba's solution weights the vectors by their accuracy. Stage 2: TRIAD with normalized axes. Stage 3: Davenport's q-method, with the weights.

    Grading evaluates the rms attitude error of your choice over 120 trials, checks that your TRIAD matrix is orthogonal and exact, and compares your Wahba solution with the weighted optimum to 1e-7 in every matrix entry on hidden measurements.

    Theory for this lab

    Aided Navigation and Attitude Determination labs

    1. M7-L1: Solve the Fix
    2. M7-L2: Two Vectors, One Attitude: this lab.
    3. M7-L3: Ride Through the Outage

    Educational simplification: two vectors with isotropic Gaussian direction errors and known accuracies; real sensors have biases, alignment errors and eclipses (module 7).

    Get the next lab

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