Versions Compared

Key

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

...

  • Read ZeroPilot-SW commands

    • On the top left of the model, there are a series of blocks named read*. These blocks read the latest actuator and throttle commands that the autopilot produces and feed them into the model at every time step. The whole SeperateYawAndPitch block is there because our code thinks it’s controling Spike, which is an airplane with ruddervators, while the model models a cessna 172, which is an aircraft with a conventional tail.

  • Figure out the appropriate coefficients.

    • You’ll notice that the read* blocks feed into a block named aerodynamic coefficients. If you double click it, you can take a look.The appropriate coefficients are determined by using the data about actuator position, altitude, mach number, etc, and performing a linear interpolation inside the datcom tables.

  • From those coefficients, determine the forces and moments

    • The coefficients that were just determined are fed into a block named aerodynamic forces and moments. This is a built in Simulink block. It doesent actually do anything special. Once you have the coefficients, getting the forces and moments is just a matter of multiplying each one with the wing area (or reference span or some other area) and the dynamic pressure. Now we know the 3D forces and moments that act on the aircraft as result of the actuators.

  • At the same time, the coefficients that occur as a result of non actuator related reasons are computed.

    • In the bottom left of the model, there’s a bunch more lookup tables that feed into another aerodynamic forces and moments block. This accounts for the forces that act on the aircraft that are not related to the actuators. Things like the lift produced by the wings and the drag force resulting from the aircraft flying through the air. I just didnt put these in a clean simulink subsystem yet, which is why the lookup tables are exposed rather than in a block.

  • The actuator and non actuator forces and moments, aswell as the propulsion and gravity forces are summed together.

    • Couple notes here. The gravity vector needs to be converted from the inertial to the body reference frame, so it is multiplied by the appropriate direction cosine matrix. The throttle force always points “forward” as far as the aircraft is concerned so no adjustment is necessary. Also, since both the gravity and throttle vectors point through the center of gravity of the aircraft, neither force produces a moment.

  • The position, orientation, velocity vector, and all kinds of other stuff about the aircraft are computed.

    • The summed forces and moments are fed into the 6 dof block. This block is pretty magical. with all kinds of integration and other crap that doesent actually need to be known by the person using it, it figures out how that body behaves. THis block also contains the initial state of the body. Information like initial velocity, initial orientation, initial position, mass and moment of inertia tensor are specified here.

  • The information output by the 6 dof block is fed into the writeToFile block.

    • This block just writes all the important info that gets fed back into our ZeroPilot-SW to files.

  • Side note: there are a couple of blocks in the left middle of the model. They do very simple processing to calculate airspeed, sideslip angle, angle of attack, mach number and dynamic pressure.

...