...

Attitude/airspeed manager

Image RemovedImage Added

The

...

duty of this module is to constantly accept instructions from the path manager module (it's told what attitude and airspeed are required) and use information it gets from the appropriate sensors to get the aircraft to arrive at the desired attitude and airspeed as fast as possible.

This state machine is meant to be implemented inside a thread of its own.

The sensors relevant to the attitude manager are the IMU and the airspeed sensor.

A the heart of the "process data" state are the Sensor Fusion algorithm and the PID algorithm. For the most part, they can be ported from PicPilot.

Data is also transferred up to the higher level Path manager, because it can make use of the IMU data in it's own Sensor fusion algorithms.


Some notes:

  • Any time we don’t have a new sensor measurement (if we even run that fast), maybe we should extrapolate what’s going on based on previous measurements.Looks like most of the data processing algorithms used by the PicPilot can be ported. Pid gains have even already been tuned for Spike it seems.
  • Stall protection / verifying whether the higher level is asking for garbage belongs in this module.The whole “gather new instructions” and “Communicate results” thing might not need to actually be operations done. We may want to have key things shared between higher and lower levels. This was done across multiple chips via DMA on the PicPilot. Things would be much simpler here since we’ve only got one big autopilot chip.
  • Autonomous take offs/landings should be opaque to this module. If a higher level module tells it what speed and attitude the plane needs to be at, this module just obliges, having no idea whether we’re at 10 000 feet or about to land/on the ground.

...