Six different types of digital filter can be configured inside the autopilot
configuration file. There are four low-pass filter types and two gain filter
types.
The low-pass filter types are:
* Exponential
* Double exponential
* Moving average
* Noise spike filter
The gain filter types are:
* gain
* reciprocal
Example 1:
pressure-rate-filterfalsedouble-exponential/autopilot/locks/pressure-rate-filtertrue
/autopilot/internal/pressure-rate
0.1
This will filter the pressure-rate property. The output will be to a new
property called filtered-pressure-rate. You can select any numerical property
from the property tree. The input property will not be affected by the filter,
it will stay the same as it would if no filter was configured.
Example 2:
airspeed elevator-trim gain reciprocal filterfalse/autopilot/locks/airspeed-elevator-trim-gaintruereciprocal/autopilot/settings/elevator-trim-airspeed-reciprocal-gain7
/velocities/airspeed-kt
0.0050.02
This will use the /velocities/airspeed-kt property to produce a gain factor
that reduces as airspeed increases. At airspeeds up to 350kt the gain will
be clamped to 0.02, at 700kt the gain will be 0.01 and at 1400kt the gain will
be 0.005. The gain will be clamped to 0.005 for airspeeds > 1400kt.
The output from this filter could then be used to control the gain in a PID
controller:
Pitch holdfalse/autopilot/locks/pitchtrue/orientation/pitch-deg/autopilot/settings/target-pitch-deg0.05/autopilot/internal/elevator-trim-gain0.021.00.10.02.0
0.2
-1.01.0
IMPORTANT NOTE: The tag in PID controllers has been revised to operate in
the same way as the elements in filters. However, the original format
of will continue to function as before i.e. 0.02 will specify a
fixed and unalterable gain factor, but a warning message will be output.
The gain type filter is similar to the reciprocal filter except that the gain
is applied as a simple factor to the input.
-------------------------------------------------------------------------------
Parameters
The name of the filter. Give it a sensible name!
If this tag is set to true debugging info will be printed on the
console.
Encloses the and tags which are used to enable or
disable the filter. Instead of the and tags, a
tag may be used to define a condition. Check README.conditions for more
details about conditions. Defaults to enabled if unspecified.
The type of filter. This can be exponential, double-exponential,
moving-average, noise-spike, gain or reciprocal.
The input property to be filtered. This should of course be a
numerical property, filtering a text string or a boolean value does not make
sense.