Main Content

Aero.Aircraft.ControlState Class

Namespace: Aero

Define control states of fixed-wing aircraft

Description

An object of the Aero.Aircraft.ControlState class represents the state of a single controllable input, such as a control surface or a thrust setting, within a fixed-wing aircraft model. Each object stores the current position, limits, and properties for a specific control input. During simulation, each object is used to compute aerodynamic forces and thrust based on control commands.

Note

This class is managed by the Aero.FixedWing.State class. Do not directly use the Aero.Aircraft.ControlState class. To set up the command state vectors on a fixed-wing object, use the setupControlStates method.

Class Attributes

Sealed
true

For information on class attributes, see Class Attributes.

Properties

expand all

Current control state value, specified as a scalar numeric.

Attributes:

GetAccess
public
SetAccess
public

Data Types: double

Maximum value of control surface, specified as a scalar numeric.

Attributes:

GetAccess
public
SetAccess
public

Data Types: double

Minimum value of control surface, specified as a scalar numeric.

Attributes:

GetAccess
public
SetAccess
public

Data Types: double

Control states upon which the control state depends, specified as a two-element vector.

For asymmetrical control surfaces, the two asymmetrical control states are settable, but the resulting effective control state is not.

Attributes:

GetAccess
public
SetAccess
public

Data Types: char | string

Current control state value, specified as 'on' or 'off'. Specify 'on' to make the control state settable. Otherwise, set to 'off'.

Tip

For asymmetrical control surfaces, the two asymmetrical control states are settable, but the resulting effective control state is not.

Attributes:

GetAccess
public
SetAccess
public

Data Types: double

Aero.Aircraft.Properties object, specified as a scalar.

Attributes:

GetAccess
public
SetAccess
public

Examples

collapse all

Initialize the control and command states on a cruise state.

[C182, CruiseState] = astC182();
CruiseState = setupControlStates(CruiseState,C182);
CruiseState.ControlStates
ans=1×4 ControlState array with properties:
    Position
    MaximumValue
    MinimumValue
    DependsOn
    Settable
    Properties

CruiseState.ControlStates(1)
ans = 
  ControlState with properties:

        Position: 0
    MaximumValue: 0.3491
    MinimumValue: -0.3491
       DependsOn: [""    ""]
        Settable: on
      Properties: [1×1 Aero.Aircraft.Properties]

Set up control states for an Aero.FixingWing object. The control states store data about positions of controllable surfaces and thrusts.

Create a fixed-wing object.

aircraft = astC182();

Create an Aero.FixedWing.State object.

state = Aero.FixedWing.State(1, ...
    "UnitSystem","English (ft/s)",...
    "AngleSystem","Radians", ...
    "TemperatureSystem","Fahrenheit", ...
    "Mass",82.2981, ...
    "Airspeed", 220.1, ...
    "Beta", -0.013, ...
    "AltitudeMSL",5000);
state.Environment = aircraftEnvironment(aircraft,"ISA",state.AltitudeMSL);
state.Inertia.Variables = [
    948, 0,    0   ;
    0  , 1346, 0   ;
    0  , 0   , 1967;
    ];
state.CenterOfGravity = [0.264, 0 , 0] .* 4.9;
state.CenterOfPressure = [0.35, 0, 0] .* 4.9;

Use the setupControlStates method to define control states in state and set control positions for the elevator and propeller.

state = setupControlStates(state, aircraft);
state = setState(state, ["Elevator", "Propeller"],[deg2rad(3.57), 0.809])
state = 
  State with properties:

                     Mass: 82.2981
                  Inertia: [3×3 table]
          CenterOfGravity: [1.2936 0 0]
         CenterOfPressure: [1.7150 0 0]
              AltitudeMSL: 5000
             GroundHeight: 0
                       XN: 0
                       XE: 0
                       XD: -5000
                        U: 220.0814
                        V: -2.8612
                        W: 0
                 Airspeed: 220.1000
                      Phi: 0
                    Theta: 0
                      Psi: 0
                        P: 0
                        Q: 0
                        R: 0
                    Alpha: 0
                     Beta: -0.0130
                 AlphaDot: 0
                  BetaDot: 0
                   Weight: 2.6488e+03
              AltitudeAGL: 5000
              GroundSpeed: 220.1000
               MachNumber: 0.2006
             BodyVelocity: [220.0814 -2.8612 0]
           GroundVelocity: [220.0814 -2.8612 0]
                       Ug: 220.0814
                       Vg: -2.8612
                       Wg: 0
          FlightPathAngle: 0
              CourseAngle: -0.0130
     InertialToBodyMatrix: [3×3 double]
     BodyToInertialMatrix: [3×3 double]
         BodyToWindMatrix: [3×3 double]
         WindToBodyMatrix: [3×3 double]
    BodyToStabilityMatrix: [3×3 double]
    StabilityToBodyMatrix: [3×3 double]
          DynamicPressure: 49.6090
              Environment: [1×1 Aero.Aircraft.Environment]
            ControlStates: [1×4 Aero.Aircraft.ControlState]
         OutOfRangeAction: "Limit"
         DiagnosticAction: "Warning"
               Properties: [1×1 Aero.Aircraft.Properties]
               UnitSystem: "English (ft/s)"
        TemperatureSystem: "Fahrenheit"
              AngleSystem: "Radians"

Compute the aircraft forces and moments.

[F1, M1] = forcesAndMoments(aircraft, state)
F1 = 3×1

    9.6367
   44.1007
 -232.5206

M1 = 3×1

  372.8702
  -50.9126
 -218.5500

Deflect the elevator up to get a positive pitching moment, and then recompute forces and moments.

state = setState(state, "Elevator", deg2rad(4.5));
[F2, M2] = forcesAndMoments(aircraft, state)
F2 = 3×1

    9.6367
   44.1007
 -292.7681

M2 = 3×1

  372.8702
 -795.8233
 -218.5500

Limitations

You cannot subclass Aero.Aircraft.ControlState.

Version History

Introduced in R2021a