NOTE:
This manual may contain outdated information. For documentation of the most recent features
refer to
http://wiki.flightgear.org/index.php/Howto:_Design_an_autopilot
http://wiki.flightgear.org/index.php/Autopilot_Configuration_Reference
COMMON SETTINGS
==============================================================================
Currently four types of digital filter implementations are supported. They all serve an
individual purpose or are individual implementations of a specific filter type.
Each filter implementation uses the same set of basic configuration tags and individual
configuration elements. These individual elements are described in the section of the
filter.
The InputValue
==============================================================================
Each filter has several driving values, like the input value itself, sometimes a reference
value, a gain value and others. Most of these input values can bei either a constant value
or the value of a property. They all use the same syntax and will be referred to as InputValue
in the remaining document.
The complete XML syntax for a InputValue is
/some/property/name0.01.0
0.0infinity-infinityfalse-180.0-180.0
The enclosing element is the element defined in each filter, like , ,
etc. These elements will be described later.
The value of the input is calculated based on the given value, scale and offset as
value * scale + offset
and the result is clipped to min/max, if given.
With the full set of given elements, the InputValue will initialize the named property to the value
given, reduced by the given offset and reverse scaled by the given scale.
Example:
/controls/flight/rudder0.00.50.5
Will use the property /controls/flight/rudder as the input of the filter. The property will be initialized
at a value of zero and since the property usually is in the range [-1..+1], the the value of will
be in the range (-1)*0.5+0.5 to (+1)*0.5+0.5 which is [0..1].
The default values for elements not given are:
: 0.0
: 1.0
: 0.0
: none
: unclipped
: unclipped
: false
Some examples:
/position/altitude-ft0.3048
Gives the altitude in meters. No initialization of the property is performed, no offset applied.
0.0
A constant reference of zero.
A abbreviated method of defining values exist for using a just constant or a property. The above
example may be written as
0.0
Or if the reference is defined in a property
/some/property/name
No initialization, scaling or offsetting is performed here.
The logic behind this is: If the text node in the element (the text between the opening and closing tag)
can be converted to a double value, it will be interpreted as a double value. Otherwise the text will
be interpreted as a property name.
Examples:
3.1415927 - The constant of PI (roughly)
/position/altitude-ft - The property /position/altitude-ft
3kings - The constant 3. The word kings is ignored
food4less - The property food4less
The element may also be written as for backward compatibility.
There may be one or more InputValues for the same input of a filter which may be bound to conditions.
Each InputValue will have its condition checked in the order of InputValues given in the configuration
file. The first InputValue that returns true for its condition will be evaluated. Chaining a number
of InputValues with conditions and an unconditioned InputValue works like the C language equivalent
if( condition ) {
// compute value of first element
} else if( condition2 ) {
// compute value of second element
} else if( condition3 ) {
// compute value of third element
} else {
// compute value of last element
}
Example: Set the gain to 3.0 if /autopilot/locks/heading equals dg-heading-hold or 2.0 otherwise.
/autopilot/locks/headingdg-heading-hold3.02.0
If the element is used and set to the value "true", only the absolute value of the input
(the positive part) is used for further computations. The abs function is applied after all
other computations are completed.
OutputValue
==============================================================================
Each filter drives one to many output properties. No scaling or offsetting is implemented
for the output value, these should be done in the filter itself.
The output properties are defined in the element by adding elements
within the element. For just a single output property, the element
may be ommited. For backward compatibility, may be replaced by .
Nonexisting properties will be created with type double.
Example: (Multiple output properties)
Example: a single output property
Other Common Settings
==============================================================================
String The name of the filter. Used for debug purpose.
Example:
pressure rate filter Boolean If true, this filter puts out debug information when updated.
Example:
false
InputValue The input property driving the filter.
Refer to InputValue for details.
InputValue The reference property for filter that need one.
Refer to InputValue for details.