1 Six different types of digital filter can be configured inside the autopilot
2 configuration file. There are four low-pass filter types and two gain filter
5 The low-pass filter types are:
12 The gain filter types are:
20 <name>pressure-rate-filter</name>
22 <type>double-exponential</type>
24 <prop>/autopilot/locks/pressure-rate-filter</prop>
27 <input>/autopilot/internal/pressure-rate</input>
28 <output>/autopilot/internal/filtered-pressure-rate</output>
29 <filter-time>0.1</filter-time>
32 This will filter the pressure-rate property. The output will be to a new
33 property called filtered-pressure-rate. You can select any numerical property
34 from the property tree. The input property will not be affected by the filter,
35 it will stay the same as it would if no filter was configured.
40 <name>airspeed elevator-trim gain reciprocal filter</name>
43 <prop>/autopilot/locks/airspeed-elevator-trim-gain</prop>
46 <type>reciprocal</type>
48 <prop>/autopilot/settings/elevator-trim-airspeed-reciprocal-gain</prop>
51 <input>/velocities/airspeed-kt</input>
52 <output>/autopilot/internal/elevator-trim-gain</output>
57 This will use the /velocities/airspeed-kt property to produce a gain factor
58 that reduces as airspeed increases. At airspeeds up to 350kt the gain will
59 be clamped to 0.02, at 700kt the gain will be 0.01 and at 1400kt the gain will
60 be 0.005. The gain will be clamped to 0.005 for airspeeds > 1400kt.
62 The output from this filter could then be used to control the gain in a PID
66 <name>Pitch hold</name>
69 <prop>/autopilot/locks/pitch</prop>
73 <prop>/orientation/pitch-deg</prop>
76 <prop>/autopilot/settings/target-pitch-deg</prop>
79 <prop>/autopilot/internal/target-elevator-trim-norm</prop>
84 <prop>/autopilot/internal/elevator-trim-gain</prop>
97 IMPORTANT NOTE: The <Kp> tag in PID controllers has been revised to operate in
98 the same way as the <gain> elements in filters. However, the original format
99 of <Kp> will continue to function as before i.e. <Kp>0.02</Kp> will specify a
100 fixed and unalterable gain factor, but a warning message will be output.
102 The gain type filter is similar to the reciprocal filter except that the gain
103 is applied as a simple factor to the input.
104 -------------------------------------------------------------------------------
107 <name> The name of the filter. Give it a sensible name!
109 <debug> If this tag is set to true debugging info will be printed on the
112 <enable> Encloses the <prop> and <value> tags which are used to enable or
113 disable the filter. Defaults to enabled if unspecified.
115 <type> The type of filter. This can be exponential, double-exponential,
116 moving-average, noise-spike, gain or reciprocal.
118 <input> The input property to be filtered. This should of course be a
119 numerical property, filtering a text string or a boolean value does not make
122 <output> The filtered value. You can make up any new property.
124 <u_min> The minimum output value from the filter. Defaults to -infinity.
126 <u_max> The maximum output value from the filter. Defaults to +infinity.
128 These are the tags that are applicable to all filter types. The following tags
131 <filter-time> This tag is only applicable for the exponential and
132 double-exponential filter types. It controls the bandwidth of the filter. The
133 bandwidth in Hz of the filter is: 1/filter-time. So a low-pass filter with a
134 bandwidth of 10Hz would have a filter time of 1/10 = 0.1
136 <samples> This tag only makes sense for the moving-average filter. It says how
137 many past samples to average.
139 <max-rate-of-change> This tag is applicable for the noise-spike filter. Is
140 says how much the value is allowed to change per second.
142 <gain> This, and it's enclosed <prop> and <value> tags, are only applicable to
143 the gain and reciprocal filter types. The <prop> tag specifies a property node
144 to hold the gain value and the <value> tag specifies an initial default value.
145 The gain defaults to 1.0 if unspecified.
147 The output from the gain filter type is: input * gain.
148 The output from the reciprocal filter type is: gain / input.
150 The gain can be changed during run-time by updating the value in the property