Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

...

Attitude Manager now runs as a threaded event loop, generating a new result at a constant time (Since PID’s run using approximated integrals and derivatives, it is important to keep timing as constant as we can). There are three main elements or “sections” of the event loops:

  1. Getting Instructions (from State Manager)

  2. Running Controls Algorithms

  3. Output Mixing

Out of the three events, the most complicated is running controls. It is the only event with “memory” of the system state, since getting instrucitons and output mixing quite literally do what they’re told to do in one step. Attitude Manager expects a common type of data from system manager, as follows:

...

These are still under development, we aren’t super sure how we want to store the configuration of the drone, but the controls interfaces will be aware of how that particular model of flight control works, as well as have configurable PID’s that are loaded on runtime (not compile time), so you could theoretically plug in a different SD Card with different configurations loaded and fly different planes. I would check the code to see what is the most up to date in this area.

Fatal Failure

When Attitude Manager receives a waypoint with the FATAL_FAILURE waypoint type it should bring all the motor throttles to 0 and send an ack message to System Manager. Then System Manager will stop the AM and PM threads.

^^ Suggestion from Gordon Fountain (Deactivated) (Not yet AM team approved)

3. Output Mixing

The last stage of AM is output mixing, where the return values (which are channel : percentage pairs) from Controls are mixed. This is handled by a tiny bit of logic and only applies to VTOL aircraft, and briefly during a transition from one stage of flight to the next. Depending on airspeed, AM might initiate the following procedure to transition from quad to fixed wing (the reverse is true from fixed wing to quad).

...