Autopilot algorithms

Nodes: nav sim com | Module: shiva | Parameters: Autopilot

The module provides control loops for navigation and stabilization.

Configuration parameters

  • Autopilot

    Control parameters

    • mode Operation mode option [off,local,primary,secondary,failsafe,auxillary]

      The priority of data, published by the module. All priorities, except local are broadcasting data in network.

    • Roll

      Roll [deg] to Ailerons [%]

      • tc Time constant real [s] 0.1

        Smaller values make it faster to respond, larger values make it slower to respond. The error is divided by this time constant to get the rate setpoint.

      • Kp Proportional gain real 2
      • Ki Integral gain real 2.5
      • Kd Differential gain real
      • Kff Feed forward gain real
      • Lp Rate limit real [deg/s] 40
      • Li Integral limit byte [%] 10
      • Lo Output limit byte [%] 100
      • rdiff Rate limit diff real
      • ifactor Integral large error factor word [deg/s]
      • trim

        Regulator output trimming factors.

        • low Low speed trim real [%]
        • high High speed trim real [%]
        • flaps Flaps trim real [%]
      • gain

        Regulator output gains.

        • low Low speed gain real
        • high High speed gain real
        • flaps Flaps gain real
        • stab Stability gain real

          This value is the gain multiplier for ailerons control when estimated stability is 1 (unstable). I.e. when parameter set to 0.2 - the ailerons output will be multiplied by 0.2 when in stall condition, thus lowering the output value. For reverse ailerons - set parameter to negative, i.e. when set to -0.5, the ailerons gain will be -0.5 in stall condition, making it reversed, and zero at about 0.5 of estimated stability. See chart for details.

      • cmd

        Setpoint

        • max Setpoint limit real [deg] 45
        • slew Setpoint slew rate limit word [deg/s] 40
        • diff Setpoint limit diff real
        • offset Setpoint offset real [deg]
    • Pitch

      Pitch [deg] to Elevator [%]

      • tc Time constant real [s] 0.5

        Smaller values make it faster to respond, larger values make it slower to respond. The error is divided by this time constant to get the rate setpoint.

      • Kp Proportional gain real 6
      • Ki Integral gain real 3.5
      • Kd Differential gain real
      • Kff Feed forward gain real
      • Lp Rate limit real [deg/s] 40
      • Li Integral limit byte [%] 25
      • Lo Output limit byte [%] 100
      • rdiff Rate limit diff real
      • ifactor Integral large error factor word [deg/s]
      • trim

        Regulator output trimming factors.

        • low Low speed trim real [%]
        • high High speed trim real [%]
        • flaps Flaps trim real [%]
        • stab Stall condition trim byte [%]

          The estimated stability value will be multiplied by this factor and subtracted from elevator control [%]. This will make elevator down when in stall condition.

      • gain

        Regulator output gains.

        • low Low speed gain real
        • high High speed gain real
        • flaps Flaps gain real
      • cmd

        Setpoint

        • max Setpoint limit real [deg] 20
        • slew Setpoint slew rate limit word [deg/s] 10
        • diff Setpoint limit diff real
        • offset Setpoint offset real [deg]
    • Yaw

      Yaw [deg] to Rudder [%]

      • tc Time constant real [s] 2.5

        Smaller values make it faster to respond, larger values make it slower to respond. The error is divided by this time constant to get the rate setpoint.

      • Kp Proportional gain real 6
      • Ki Integral gain real 1.1
      • Kd Differential gain real
      • Kff Feed forward gain real
      • Lp Rate limit real [deg/s] 40
      • Li Integral limit byte [%] 5
      • Lo Output limit byte [%] 100
      • rdiff Rate limit diff real
      • ifactor Integral large error factor word [deg/s]
      • trim

        Regulator output trimming factors.

        • low Low speed trim real [%]
        • high High speed trim real [%]
        • flaps Flaps trim real [%]
      • gain

        Regulator output gains.

        • low Low speed gain real
        • high High speed gain real
        • flaps Flaps gain real
      • slew Yaw setpoint slew rate limit word [deg/s]
      • slip Slip error to yaw rate proportional gain real 2
    • Bearing

      Waypoint to Roll [deg]. L1 controller for trajectory navigation.

      • dist L1 period real [m] 25
      • damp Damping factor real 0.9
      • radius Waypoint switch radius word [m] 50

        The waypoint is passed when the distance is lower than this value.

      • trig Waypoint heading rate switch trigger word [deg/s] 10

        Another way to detect waypoint passed condition, i.e. when the rate of heading to the waypoint is higher than this value - the waypoint is considered as passed.

      • topt Turn direction optimization option [optimized,shortest]

        Enabling this option will optimize turn directions to avoid large bank angle changes. I.e. for U-turns this makes aircraft to continue existing turn maneuver when applicable.

    • Airspeed

      Kinetic Energy to Pitch (TECS). This controller regulates rate of energy by changing the commanded pitch angle.

      • tc Time constant real [s] 6

        Smaller values make it faster to respond, larger values make it slower to respond. The error is divided by this time constant to get the rate setpoint.

      • Kp Energy rate error gain real 0.5

        The energy rate error is multiplied by this factor to provide pitch angle.

      • Ki Integrator gain real 1.1

        Trimming for the pitch angle to maintain commanded rate of energy.

      • Li Integral limit byte [deg]
      • weight Speed vs altitude tecs weighting factor real 1

        This parameter adjusts the amount of weighting that the pitch control applies to speed vs height errors. Setting it to 0 will cause the pitch control to control height and ignore speed errors. This will normally improve height accuracy but give larger airspeed errors. Setting it to 1 will cause the pitch control loop to control speed and ignore height errors. This will normally reduce airspeed errors, but give larger height errors. The value of 0.5 allows the pitch control to simultaneously control height and speed.

      • slew Speed setpoint slew rate real [m/s^2] 1

        Commanded airspeed rate of change limit.

    • Altitude

      Potential Energy to Throttle (TECS). This controller regulates rate of energy by changing the engine throttle.

      • tc Time constant real [s] 10

        Smaller values make it faster to respond, larger values make it slower to respond. The error is divided by this time constant to get the rate setpoint.

      • Kp Energy rate error gain real 0.3

        The energy rate error is multiplied by this factor to provide throttle.

      • Ki Integrator gain real 0.1

        Trimming gain for the throttle to maintain commanded rate of energy.

      • roll Roll to energy rate feedforward real

        Increasing this gain increases the amount of throttle that will be used to compensate for the additional drag created by turning.

      • slew Vertical speed setpoint slew rate real [m/s^2] 1

        Commanded vertical speed rate of change limit.

    • Engine

      RPM to Throttle governor

      • Kp Proportional gain real 2.5
      • Kd Differential gain real 3.1
      • Ki Integral gain real
      • Kff Feed forward gain real 0.5
      • rpm

        Engine RPM

        • filter

          Kalman filter

          • err Rpm measurement error word [rpm] 100
          • proc Process noise real 0.2
          • rate Rpm rate lp filter real 0.1
        • cruise Cruise rpm dword [rpm]

          This is the RPM setting for cruise speed.

        • max Maximum rpm dword [rpm]

          This is the engine maximum allowed RPM.

        • min Minimum rpm dword [rpm]

          This is the engine idle RPM.

        • slew Rpm setpoint max slew rate word [rpm/s] 500

          Maximum slew rate for the commanded RPM

        • start Startup rpm slew rate word [rpm/s]

          Maximum slew rate for the commanded RPM on startup procedure

      • thr

        Throttle setpoint

        • max Max throttle byte [%] 100

          This is the maximum throttle that can be used by the regulator. For overpowered aircraft, this should be reduced to a value that provides sufficient thrust to climb at the maximum pitch angle.

        • min Min throttle byte [%]

          This is the minimum throttle that can be used by the regulator. For electric aircraft this will normally be set to zero, but can be set to a small non-zero value if a folding prop is fitted to prevent the prop from folding and unfolding repeatedly in-flight or to provide some aerodynamic drag from a turning prop to improve the descent rate. For aircraft with internal combustion engine this parameter should be set for desired idle rpm.

        • slew Throttle max slew rate byte [%/s]

          Maximum slew rate for the commanded throttle

        • start Startup throttle slew rate byte [%/s] 10

          Maximum slew rate for the commanded throttle on startup procedure

      • prop

        Prop pitch

        • max Max prop pitch real [%] 100

          This is the maximum prop pitch that can be used by the regulator.

        • min Min prop pitch real [%]

          This is the minimum prop pitch that can be used by the regulator.

        • slew Prop max slew rate byte [%/s]

          Maximum slew rate for the commanded prop

        • start Prop setting on startup real [%]
        • gain Prop multiplier on low rpm real 0.1
      • glider

        Engine Governor RPM to Prop pitch [%]

        • Kp Proportional gain real
        • Kd Differential gain real
        • Ki Integral gain real
    • Taxi

      Taxiways navigation

      • Steering

        Yaw [deg] to Steering [%]

        • tc Time constant real [s] 2.5

          Smaller values make it faster to respond, larger values make it slower to respond. The error is divided by this time constant to get the rate setpoint.

        • Kp Proportional gain real 5
        • Ki Integral gain real 0.1
        • Kff Feed forward gain real 0
        • Lp Rate limit real [deg/s] 1000
        • Li Integral limit byte [%] 5
        • gain Steering high speed gain real 0.1
      • Track

        Crosstrack [m] to Yaw [deg]

        • dist L1 period real [m] 6
        • damp Damping factor real 1.7
        • trig Taxiway switch radius word [m] 15
      • Brakes

        Speed to Brakes [%]

        • Kp Proportional gain real 10
        • Kd Differential gain real
    • Flaps

      Auto flaps control

      • max Vso flaps byte [%]
      • min Vsi flaps byte [%]
      • step Step in automatic mode byte [%]
      • takeoff Takeoff flaps byte [%]
      • approach Approach flaps byte [%]
      • final Final approach flaps byte [%]
      • ld Flaps ld gain real

        Flaps level will affect proportionally the LD ratio when this parameter is set. The corrected LD ratio is used by landing procedure only to estimate landing patterns. F.ex. when set to 0.6 - full flaps will make LD ratio (used by landing procedure) to be 0.6 of estimated LD, but 50% flaps will make LD to be 0.8 of estimated value.

    • Hover

      Hovering regulators

      • tc Time constant real [s] 4

        Smaller values make it faster to respond, larger values make it slower to respond. The error is divided by this time constant to get the rate setpoint.

      • pitch

        Velocity X [m/s] to Pitch [deg]

        • Kp Proportional gain real 3
        • Ki Integral gain real 0.1
        • Kd Differential gain real
        • Kff Feed forward gain real
        • Li Integral limit byte [deg] 8
        • vel Speed limit real [m/s]
      • roll

        Velocity Y [m/s] to Roll [deg]

        • Kp Proportional gain real 3
        • Ki Integral gain real 0.1
        • Kd Differential gain real
        • Kff Feed forward gain real
        • Li Integral limit byte [deg] 5
        • vel Speed limit real [m/s]
    • Takeoff

      Takeoff procedure

      • mode Takeoff mode option [runway,launcher,helipad]
      • check

        Checks to perform before takeoff

        • pwr Power state option

          Will cancel takeoff if power is not valid

        • hdg Heading error byte [deg]

          Will cancel takeoff if heading error is more than this value

        • xtrack Crosstrack error byte [m]

          Will cancel takeoff if crosstrack error is more than this value

      • run

        Takeoff Run phase parameters

        • speed Max speed byte [m/s]
        • pitch Run phase pitch angle byte [deg]
      • climb

        Takeoff Climbing phase parameters

        • pitch Liftoff phase pitch angle byte [deg]
        • altitude Liftoff phase altitude byte [m]
        • thr Climbing throttle byte [%]
      • launcher

        Launcher parameters

        • acc Launcher trigger acceleration byte [m/s^2]
        • tdelay Launcher throttle delay real [s]
        • cdelay Launcher controls delay real [s]
    • Landing

      Landing procedure

      • mode Landing mode option [runway,parachute,helipad]
      • agl Agl correction altitude word [m]
      • app

        Approach phase parameters

        • Kp Delta [m] to speed [m/s] gain real 0.1
        • thr Approach throttle byte [%] 5
        • cap Energy capacity factor real
        • airbrk

          Distance error[m] to airbrake[%]

          • Kp Proportional gain real
          • Ki Integral gain real
          • Lp Proportional limit byte [%]
          • Li Integral limit byte [%]
          • Lo Output limit byte [%]
          • bias Bias byte [%]
      • flare

        Flare phase parameters

        • alt Flare phase altitude byte [m] 20
        • pitch Flare max pitch angle limit real [deg]
        • sink Flare sink rate real [m/s] 0.5
        • airbrk

          Vertical speed error[m/s] to airbrake[%]

          • Kp Proportional gain real
          • Lo Output limit byte [%]
      • touch

        Touchdown phase parameters

        • alt Touchdown phase altitude byte [m] 3
        • pitch Touchdown max pitch angle limit byte [deg] 6
        • VS1G Stall speed at 1g load factor real [m/s] 0

          This speed is defined as the one-G stall speed at which the airplane can develop a lift force (normal to the flight path) equal to its weight.

      • run

        Run phase parameters

        • speed Speed to trigger run phase byte [m/s]
        • acc Acceleration to trigger run phase byte [m/s^2]
        • alt Altitude check to trigger run phase option
        • brakes Brakes slew rate limit byte [%/s]
        • thr Throttle blocking option [cut,override,shutdown,ignore]