Autopilot algorithms

Nodes: nav sim | 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.0
      • Ki Integral gain real 2.5
      • Kd Differential gain real
      • Kff Feed forward gain real
      • Lp Rate limit real [deg/s] 40.0
      • Li Integral limit real [%] 10.0
      • Lo Output limit real [%] 100.0
      • rdiff Rate limit diff real
      • ifactor Integral large error factor real [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 real [deg/s] 40
        • diff Setpoint limit diff real
        • offset Setpoint offset real [deg]
    • Pitch

      Pitch [deg] to Elevator [%]

      • 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.5
      • Ki Integral gain real 3.5
      • Kd Differential gain real
      • Kff Feed forward gain real
      • Lp Rate limit real [deg/s] 40.0
      • Li Integral limit real [%] 25.0
      • Lo Output limit real [%] 100.0
      • rdiff Rate limit diff real
      • ifactor Integral large error factor real [deg/s]
      • trim

        Regulator output trimming factors.

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

          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 real [deg/s] 20
        • diff Setpoint limit diff real
        • offset Setpoint offset real [deg]
    • Yaw

      Yaw [deg] to Rudder [%]

      • 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.5
      • Ki Integral gain real 3.5
      • Kd Differential gain real
      • Kff Feed forward gain real
      • Lp Rate limit real [deg/s] 120.0
      • Li Integral limit real [%] 10.0
      • Lo Output limit real [%] 100.0
      • rdiff Rate limit diff real
      • ifactor Integral large error factor real [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 real [deg/s] 80
      • slip Slip error to yaw rate proportional gain real 1.5
    • Bearing

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

      • dist L1 period real [m] 20.0
      • damp Damping factor real 0.75
      • 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 to be 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] 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.

      • Kp Energy rate error gain real 0.01

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

      • Ki Integrator gain real 0.05

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

      • weight Speed vs altitude tecs weighting factor real 1.0

        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.0

        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] 7

        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.01

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

      • Ki Integrator gain real 0.2

        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] 2

        Commanded vertical speed rate of change limit.

    • Engine

      Governor

      • Kp Proportional gain real 2.5
      • Kd Differential gain real 3.1
      • Kff Feed forward factor real 0.5
      • lpf Rpm lp filter real 0.1
      • rpm

        Engine RPM

        • 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 Commanded rpm max slew rate real [rpm/s] 500

          Maximum slew rate for the commanded RPM

      • thr

        Throttle setpoint

        • max Max throttle real [%] 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 real [%]

          This is the minimum throttle that can be used by the controller. 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 real [%/s]

          Maximum slew rate for the commanded throttle

    • Taxi

      Taxiways navigation

      • Steering

        Yaw [deg] to Steering [%]

        • 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.5
        • Ki Integral gain real 0.1
        • Kff Feed forward gain real 0.5
        • Lp Rate limit real [deg/s] 30.0
        • Li Integral limit real [%] 10.0
        • gain Steering high speed gain real 0.1
      • Track

        Crosstrack [m] to Yaw [deg]

        • dist L1 period real [m] 5.0
        • damp Damping factor real 0.5
        • trig Taxiway switch radius word [m] 5
      • Brakes

        Speed to Brakes [%]

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

      Auto flaps control

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

      Takeoff procedure

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

        Checks to perform before takeoff

        • 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]
        • tslew Throttle rate limit real [%/s]
      • 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.01
        • thr Approach throttle byte [%] 10
        • cap Energy capacity factor real
      • flare

        Flare phase parameters

        • alt Flare phase altitude byte [m] 15
        • pitch Flare max pitch angle limit byte [deg]
        • sink Flare sink rate real [m/s]
      • touch

        Touchdown phase parameters

        • alt Touchdown phase altitude byte [m] 4
        • pitch Touchdown max pitch angle limit byte [deg] 8
        • speed Speed to trigger run phase byte [m/s] 15
        • acc Acceleration to trigger run phase byte [m/s^2] 5
        • brakes Brakes slew rate limit byte [%/s]
        • thr Throttle blocking option [cut,override,ignore]