Skip to main content

G3000 Autopilot

Introduction

By default, the G3000 includes an autopilot simulation that aims to replicate the behavior of the real-world Garmin GFC 500/700 (and related) autopilots. Many aspects of this autopilot simulation can be customized to suit a particular aircraft installation.

There are three avenues with which you can customize the autopilot:

  • Airplane cfg files: systems.cfg and ai.cfg
  • Airplane panel.xml file
  • Plugins

The following sections describe how to customize the autopilot using each of the three avenues.

systems.cfg/ai.cfg Customization

The systems.cfg and ai.cfg files are used to enable the sim autopilot (required for the G3000 autopilot simulation to function) and to set up some basic autopilot parameters. All autopilot customization is done in the [AUTOPILOT] section of systems.cfg and the [STICKANDRUDDER] section of ai.cfg.

While there are many parameters in these files that are listed in the MSFS SDK documentation, only a subset of them are relevant for customizing the G3000 autopilot. This is because the G3000 uses the sim's Avionics Managed Mode feature to override many of the sim's autopilot functions.

The following subsections describe all of the parameters that can be used to customize the G3000 autopilot. If a parameter is not included below, then under most circumstances it should be omitted from the file in order to revert it to its default value.

Enabling the Sim Autopilot

First, the autopilot_available and flight_director_available parameters in systems.cfg ([AUTOPILOT] section) must be set to 1. This will enable the sim's autopilot and flight director functions. Second, the autothrottle_available parameter must be set to 0. If you wish to add an autothrottle system to a plane, you should implement the autothrottle using plugins.

[AUTOPILOT]
autopilot_available = 1
flight_director_available = 1
autothrottle_available = 0

These are the only required parameters to set for the G3000 autopilot to function, but it is highly recommended to set some or all of the additional parameters described in the following subsections.

Pitch/Roll PIDs

The following parameters in ai.cfg ([STICKANDRUDDER] section) tune the PID controllers that adjust the aircraft's pitch and roll to track the flight director's commands when the autopilot is active:

  • pitchPID
  • rollPID

An explanation for how to tune PIDs is beyond the scope of this documentation, but in short these parameters should be manually tuned until the autopilot is able to track the flight director accurately without too much delay and without too much overshoot/oscillation.

note

There are additional PID parameters in ai.cfg that affect rudder control, tracking of heading, vertical speed, glideslope, and more. These PIDs do not affect the behavior of the G3000 autopilot. However, they do affect the behavior of the "AI copilot" feature in the sim that can be used to automatically fly the plane. As such, these other PID parameters should also be carefully tuned in order to get good results from the AI copilot.

In addition to the above, the following two parameters in systems.cfg ([AUTOPILOT] section) control how the autopilot behaves when switched from the OFF state to the ON state:

  • pitch_pid_reset_mode
  • roll_pid_reset_mode

For more information on the specifics of how these two parameters work, please refer to the MSFS SDK documentation. However, it is highly recommended to set both of them to 2:

[AUTOPILOT]
pitch_pid_reset_mode = 2
roll_pid_reset_mode = 2

Additional Pitch/Roll Tuning

The following parameters in systems.cfg ([AUTOPILOT] section) allow for additional turning of pitch and roll behavior:

  • pitch_use_trim
  • pitch_use_elevator_only
  • max_pitch
  • max_pitch_acceleration
  • max_pitch_velocity_lo_alt
  • max_pitch_velocity_hi_alt
  • max_pitch_velocity_lo_alt_breakpoint
  • max_pitch_velocity_hi_alt_breakpoint
  • max_bank
  • max_bank_acceleration
  • max_bank_velocity

For more information on the specifics of how these parameters work, please refer to the MSFS SDK documentation.

Note that when configuring the max_bank parameter, the limit should be set to the largest bank angle that can ever be commanded by any flight director mode. Bank angle limits for individual flight director modes are configured using panel.xml.

Additionally, the G3000 autopilot supports what Garmin calls Low Bank Mode. The G3000 uses the sim's Max Bank ID feature under the hood to implement Low Bank Mode. Max Bank ID 1 is used when Low Bank Mode is active, and Max Bank ID 0 is used when Low Bank Mode is not active. The bank angle limits for Low Bank Mode are configured in panel.xml, and so should not be configured here in systems.cfg.

Vertical Speed Reference

The following parameters in systems.cfg ([AUTOPILOT] section) control the minimum and maximum values that can be set as the vertical speed reference when the flight director's vertical speed (VS) mode is active:

  • min_vertical_speed_ref
  • max_vertical_speed_ref

Both parameters take values in units of feet per minute. The limits default to -9900 FPM to 9900 FPM if not explicitly defined.

Airspeed Reference

If the airplane does not have an autothrottle, then the airspeed reference is typically only used when the flight director's flight level change (FLC) mode is active. If the airplane does have an autothrottle, then the airspeed reference can also be used to set the autothrottle's speed target.

The following parameters in systems.cfg ([AUTOPILOT] section) control the minimum and maximum values that can be set as the airspeed reference:

  • min_IAS_ref
  • max_IAS_ref
  • min_Mach_ref
  • max_Mach_ref
info

The G3000 supports both manual and FMS speed modes. The above parameters control the limits for both speed modes.

If more complicated logic is required for the airspeed reference limits (e.g. setting dynamic limits), then this logic should be implemented using plugins, and the above parameters should be set to the absolute minimum/maximum limits that are applied under any conditions.

panel.xml Customization

Customization of additional G3000-specific autopilot parameters can be done via panel.xml. These parameters are defined using the <Autopilot> tag. Please refer to the tag documentation for a listing of all the available customization options and details on how to use them.

The following subsections provide additional context for some of the customization options found in panel.xml.

Selected Altitude Reference

By default, the G3000 supports input acceleration for changing the selected altitude reference. Input acceleration can be triggered when the G3000 receives the AP_ALT_VAR_DEC or AP_ALT_VAR_INC key events with zero as the first parameter. If these key events are received with a non-zero value as the first parameter, then input acceleration will not be triggered. Key events that set the selected altitude reference to a specific value never trigger input acceleration.

When the rate of received key events eligible for input acceleration exceeds a threshold value, the observed input rate is transformed into an accelerated input rate. The selected altitude reference is then changed using the accelerated input rate rather than the observed input rate. The accelerated input rate is capped to an asymptotic maximum value. The accelerated input rate will never exceed this maximum value, no matter how high the observed input rate is.

By default, the threshold input rate to trigger acceleration is 5 inputs per second. The maximum accelerated input rate is 50 inputs per second. The accelerated input rate reaches 99% of the maximum value at an observed input rate of 13.3 inputs per second.

It is recommended to use the default configuration for input acceleration, since it has been tuned to give good results. However, you can also customize the behavior using the <AltSel> tag.

Plugin Customization

Plugins can be used to define or add certain complex behaviors to the G3000 autopilot. This is done by returning an instance of G3000AutopilotPluginOptions from the MFD plugin's getAutopilotOptions() method.

The following subsections describe what can be customized using G3000AutopilotPluginOptions.

Flight Director Mode Injection

G3000AutopilotPluginOptions can be used to inject additional flight director modes to the autopilot beyond the standard suite of modes that is included by default. You can only inject additional modes; you cannot replace or override any of the standard modes.

tip

The standard modes that cannot be replaced can be accessed from G3000AutopilotUtils - specifically from the RESTRICTED_LATERAL_MODES and RESTRICTED_VERTICAL_MODES static properties.

To define additional modes to inject, use the optional createAdditionalLateralDirectors() and createAdditionalVerticalDirectors() methods on G3000AutopilotPluginOptions. Both methods should return an iterable of G3000AutopilotAdditionalDirectorEntry. Each entry defines one flight director mode to inject and a factory that creates the PlaneDirector to use for the mode.

The following code shows an example of how to use a plugin to inject additional flight director modes.

import { APValues, registerPlugin } from '@microsoft/msfs-sdk';
import { AbstractG3000MfdPlugin, G3000AutopilotPluginOptions } from '@microsoft/msfs-wtg3000-mfd';

// When defining your custom flight director modes, it is recommended to choose values (numbers)
// that are sufficiently different from the standard mode values to reduce the chances of conflicts
// in case more standard modes are added in the future.

enum MyAPLateralModes {
EXAMPLE1 = 1000,
EXAMPLE2 = 1001,
}

enum MyAPVerticalModes {
EXAMPLE1 = 1000,
EXAMPLE2 = 1001,
}

class MyAutopilotMfdPlugin extends AbstractG3000MfdPlugin {

public getAutopilotOptions(): G3000AutopilotPluginOptions {
return {
createAdditionalLateralDirectors: () => {
return [
{
mode: MyAPLateralModes.EXAMPLE1,
directorFactory: (apValues: APValues) => new MyLateralDirector(apValues)
},
{
mode: MyAPLateralModes.EXAMPLE2,
directorFactory: (apValues: APValues) => new MyOtherLateralDirector(apValues)
}
];
},

createAdditionalVerticalDirectors: () => {
return [
{
mode: MyAPVerticalModes.EXAMPLE1,
directorFactory: (apValues: APValues) => new MyVerticalDirector(apValues)
},
{
mode: MyAPVerticalModes.EXAMPLE2,
directorFactory: (apValues: APValues) => new MyOtherVerticalDirector(apValues)
}
];
}
};
}

}

registerPlugin(MyAutopilotMfdPlugin);

Multiple plugins can each inject their own set of additional flight director modes. If more than one plugin attempts to inject the same mode, then the plugin that was loaded last has priority and will preempt the other plugins' attempt to inject the mode. Directors for preempted modes are not instantiated - in other words if an additional mode director is instantiated, then it is guaranteed to be added to the autopilot.

Any additional flight director modes injected into the autopilot will never be armed or activated by any base G3000 autopilot logic. This means that the only way to arm or activate an injected mode is to directly call the arm() or activate() methods on the mode's PlaneDirector. Additionally, all PlaneDirector instances for injected modes must call their onArm() and onActivate() callbacks at the appropriate times if the callback functions are defined.

You may also choose to define how injected flight director modes are annunciated in the PFD AFCS status box. By default, any additional modes are not annunciated (they are labeled using the empty string). To define labels for injected modes, use the PFD plugin's getAfcsStatusBoxOptions() method. If more than one plugin attempts to define labels for the same mode, then the labels defined by the plugin that was loaded last will be used.

note

You can only define labels for additional injected modes. You cannot override the labels for any of the standard modes.

The following code shows how to use a plugin to define custom labels for the additional flight director modes used in the example above.

import { registerPlugin } from '@microsoft/msfs-sdk';

import { AbstractG3000PfdPlugin, AfcsStatusBoxPluginOptions } from '@microsoft/msfs-wtg3000-pfd';

export class MyAutopilotPfdPlugin extends AbstractG3000PfdPlugin {

public getAfcsStatusBoxOptions(): AfcsStatusBoxPluginOptions {
return {
getAdditionalLateralModeLabels: () => {
return [
{
mode: MyAPLateralModes.EXAMPLE1,
activeLabel: 'EX1',
armedLabel: 'EX1'
},
{
mode: MyAPLateralModes.EXAMPLE2,
activeLabel: 'EX2',
armedLabel: 'EX2'
}
];
},

getAdditionalVerticalModeLabels: () => {
return [
{
mode: MyAPVerticalModes.EXAMPLE1,
activeLabel: 'EX1',
armedLabel: 'EX1'
},
{
mode: MyAPVerticalModes.EXAMPLE2,
activeLabel: 'EX2',
armedLabel: 'EX2'
}
];
}
};
}

}

registerPlugin(MyAutopilotPfdPlugin);