Autopilot configuration reference: Difference between revisions

Jump to navigation Jump to search
+template: Note; Moving image to top
No edit summary
(+template: Note; Moving image to top)
Line 1: Line 1:
[[File:FgPlot.jpg|400px|thumb|[[FGPlot]] can be used to plot the value properties while tuning an autopilot.]]
{{forum|46|Autopilot & Route Manager}}
{{forum|46|Autopilot & Route Manager}}
{{Autoflight Navigation}}
{{Autoflight Navigation}}
Line 7: Line 9:
adds the autopilot at fdm rate, using a <property-rule> runs the same config at frame rate.
adds the autopilot at fdm rate, using a <property-rule> runs the same config at frame rate.


Refer to [[Howto: Design an autopilot]] as a guide how to use these elements.  
Refer to [[Howto:Design an autopilot]] as a guide how to use these elements.  


For built-in runtime plotting of FlightGear properties (including FDM/Autopilot properties), check out [[FGPlot]] (available in FlightGear 2.11+).
For built-in runtime plotting of FlightGear properties (including FDM/Autopilot properties), check out [[FGPlot]] (available in FlightGear 2.11+).
[[File:FgPlot.jpg|400px]]


== Structure Of a Configuration File ==
== Structure Of a Configuration File ==
Line 35: Line 36:
</syntaxhighlight>
</syntaxhighlight>


Note: Using aliased property names is good style and makes the configuration file more readable. For complex autopilot systems spread over multiple autopilot configuration files, the params section may be included from an external file using <tt><params include="my-params.xml"/></tt> to avoid duplication of code.
{{note|Using aliased property names is good style and makes the configuration file more readable. For complex autopilot systems spread over multiple autopilot configuration files, the params section may be included from an external file using <tt><nowiki><params include="my-params.xml"/></nowiki></tt> to avoid duplication of code.}}


The location and the name of the configuration file is up to the developer. A descriptive name like 'autopilot.xml' might be a good choice. Most developers put these files into the Systems folder of the aircraft.
The location and the name of the configuration file is up to the developer. A descriptive name like 'autopilot.xml' might be a good choice. Most developers put these files into the Systems folder of the aircraft.
Line 149: Line 150:
  <reference>/my/property</reference>
  <reference>/my/property</reference>


Note: the shortcut syntax is only valid, if neither <property> nor <value> element exists.
{{note|The shortcut syntax is only valid, if neither <property> nor <value> element exists.
If both, <property> '''and''' <value> element exist, the property will be initialized with the given value with scale and offset applied correctly.
If both <property> '''and''' <value> element exist, the property will be initialized with the given value with scale and offset applied correctly.
Properties don't have to exist, the will be created as needed.
Properties don't have to exist, the will be created as needed.}}
 
{{note|For backward compatibility, the notation <prop> instead of <property> is also valid but considered deprecated and might go away in future releases.}}
'''Note:''' for backward compatibility, the notation <prop> instead of <property> is also valid but considered deprecated and might go away in future releases.


==== Linear transformation of the input value ====
==== Linear transformation of the input value ====
Line 246: Line 246:
After processing of a component, the resulting value passes a transformation stage where it can be clipped or normalized into a given period. Periodic values such as angular properties may be normalized into a given period by adding a <period> element, defining the lower and upper bounds of the period. Additionally, a maximun and a minimum value may be given which will guarantee that the output value will ever exceed a defined value.  
After processing of a component, the resulting value passes a transformation stage where it can be clipped or normalized into a given period. Periodic values such as angular properties may be normalized into a given period by adding a <period> element, defining the lower and upper bounds of the period. Additionally, a maximun and a minimum value may be given which will guarantee that the output value will ever exceed a defined value.  


'''Note:''' Both, periodical normalization and clipping may be defined. If both are given, the value will be normalized first and the clipping will be applied to the normalized value.
{{note|Both periodical normalization and clipping may be defined. If both are given, the value will be normalized first and the clipping will be applied to the normalized value.}}


The following example shifts the computed value into the interval of [-180..180] thereafter being limited into the interval of [-30..30]. The following table contains some computed values and the resulting written value:
The following example shifts the computed value into the interval of [-180..180] thereafter being limited into the interval of [-30..30]. The following table contains some computed values and the resulting written value:
Line 390: Line 390:
If the output is set from the J and clock inputs of the JK flipflop, the timer starts on the raising edge of the clock input. The output signal will be true for exactly the time defined in the <time> element.  
If the output is set from the J and clock inputs of the JK flipflop, the timer starts on the raising edge of the clock input. The output signal will be true for exactly the time defined in the <time> element.  


Note: the optional <R> and <K> inputs may be used to reset the output before the internal timer expired. This will also reset the timer to zero, so no additional event will be triggered after the defined timer interval.
{{note|The optional <R> and <K> inputs may be used to reset the output before the internal timer expired. This will also reset the timer to zero, so no additional event will be triggered after the defined timer interval.}}


<syntaxhighlight lang="xml">
<syntaxhighlight lang="xml">

Navigation menu