JSBSim Systems: Difference between revisions

From FlightGear wiki
Jump to navigation Jump to search
(Created)
 
 
(2 intermediate revisions by 2 users not shown)
Line 1: Line 1:
A '''JSBSim''' System is a chain of components usually within a separate XML file referenced from the main file. The system is a chain of individual control components. A suite of configurable components is available in '''JSBSim''' that includes gains, filters, switches, etc. An aircraft system is specified as a string of components within the <channel> element of a <system>, <autopilot>, or <flight_control> specification in the aircraft configuration file. Groupings of components which perform a related task are placed in a <channel> element.  See "3.1.9 Systems, Autopilot, and Flight Control" in the JSBSim reference manual.
A '''JSBSim System''' is a chain of components usually within a separate [[XML]] file referenced from the main file. The system is a chain of individual control components. A suite of configurable components is available in [[JSBSim]] that includes gains, filters, switches, etc. An aircraft system is specified as a string of components within the <code><channel></code> element of a <code><system></code>, <code><autopilot></code>, or <code><flight_control></code> specification in the aircraft configuration file. Groupings of components which perform a related task are placed in a <code><channel></code> element.  See "3.1.9 Systems, Autopilot, and Flight Control" in the [http://jsbsim.sf.net/JSBSimReferenceManual.pdf JSBSim reference manual].


== Overview ==
== Overview ==


A system is defined by convention in Systems/system-name.xml. To include the system in the main JSBSim file use <system file="system-name"/>
A system is defined by convention in <tt>Systems/system-name.xml</tt>. To include the system in the main JSBSim file use <code><system file="system-name"/></code>


== Creating a JSBSim system ==
== Creating a JSBSim system ==


The Systems/system-name.xml file follows the structure:
The <tt>Systems/system-name.xml</tt> file follows the structure:


* <?xml version="1.0"?>
* <code><?xml version="1.0"?></code>
**  <system name="SystemName">
**  <code><system name="SystemName"></code>
**  <property value="xx">systems/name/property</property>
**  <code><property value="xx">systems/name/property</property></code>
***    <channel name="channel-name"> definitions </channel>
***    <code><channel name="channel-name"> definitions </channel></code>
***    <channel name="channel-name"> definitions </channel>
***    <code><channel name="channel-name"> definitions </channel></code>
** </system>
** <code></system></code>


There can be only one system per file, with many channels. Any properties that need to be added (such as definitions, inputs) sit between the system and the channel definition.
There can be only one system per file, with many channels. Any properties that need to be added (such as definitions, inputs) sit between the system and the channel definition.
Line 36: Line 36:
==== name ====
==== name ====


The channel name. Generally best to make this unique and meaningful. Specified via name="" tag.
The channel name. Generally best to make this unique and meaningful. Specified via <code>name=""</code> tag.


==== active ====
==== active (execute) ====


A property that defines 1 or 0 indicating whether a channel is to be executed or not. execute="property/name"
A property that defines 1 or 0 indicating whether a channel is active (whether to be executed or not). <code>execute="property/name"</code>


==== execrate ====
==== execrate ====


Specified via execrate="intvalue" and defines the rate (or more accurately frame skip) for the system. Less critical systems can be run at a slower rate to conserve resources. Most dynamics modules cannot be run at a slower rate, although inputs to dynamics modules can be.
Specified via <code>execrate="intvalue"</code> and defines the rate (or more accurately frame skip) for the system. Less critical systems can be run at a slower rate to conserve resources. Most dynamics modules cannot be run at a slower rate, although inputs to dynamics modules can be.


For example a value of 4 will result in the channel within the system being executed every 4th frame (quarter rate). A value of zero or 1 is the same as omitting the execrate element, and results in the channel running at full rate.
For example a value of 4 will result in the channel within the system being executed every 4th frame (quarter rate). A value of zero or 1 is the same as omitting the execrate element, and results in the channel running at full rate.
Note: This feature is new as of version 2016.2 of Flightgear.


===== execrate and dt =====
===== execrate and dt =====


When channels are running slower than full rate the value of dt in simulation/dt is not the correct value for the channel. When dt is neeed for the channel the property simulation/channel-dt should be used instead.  
When channels are running slower than full rate the value of dt in simulation/dt is not the correct value for the channel. When dt is neeed for the channel the property simulation/channel-dt should be used instead.


== Related content ==
== Related content ==
* [[Howto: Write a fuel system in JSBSim]]
* [[Howto: Write a fuel system in JSBSim]]
* [[Howto: Setup winch and aerotowing for JSBSim-aircraft]]
* [[Howto: Setup winch and aerotowing for JSBSim-aircraft]]
{{JSBSim}}

Latest revision as of 17:08, 7 April 2016

A JSBSim System is a chain of components usually within a separate XML file referenced from the main file. The system is a chain of individual control components. A suite of configurable components is available in JSBSim that includes gains, filters, switches, etc. An aircraft system is specified as a string of components within the <channel> element of a <system>, <autopilot>, or <flight_control> specification in the aircraft configuration file. Groupings of components which perform a related task are placed in a <channel> element. See "3.1.9 Systems, Autopilot, and Flight Control" in the JSBSim reference manual.

Overview

A system is defined by convention in Systems/system-name.xml. To include the system in the main JSBSim file use <system file="system-name"/>

Creating a JSBSim system

The Systems/system-name.xml file follows the structure:

  • <?xml version="1.0"?>
    • <system name="SystemName">
    • <property value="xx">systems/name/property</property>
      • <channel name="channel-name"> definitions </channel>
      • <channel name="channel-name"> definitions </channel>
    • </system>

There can be only one system per file, with many channels. Any properties that need to be added (such as definitions, inputs) sit between the system and the channel definition.

System Definition Tag

There can be only one system per file. It requires simply the name of the system.

Properties

The properties defined in a system are usually constants or new input properties that need to be controlled.

Channel

The channel tag defines the name, an optional active (on/off) flag and the rate at which the system should execute.

  • Name
  • Active
  • Execrate

name

The channel name. Generally best to make this unique and meaningful. Specified via name="" tag.

active (execute)

A property that defines 1 or 0 indicating whether a channel is active (whether to be executed or not). execute="property/name"

execrate

Specified via execrate="intvalue" and defines the rate (or more accurately frame skip) for the system. Less critical systems can be run at a slower rate to conserve resources. Most dynamics modules cannot be run at a slower rate, although inputs to dynamics modules can be.

For example a value of 4 will result in the channel within the system being executed every 4th frame (quarter rate). A value of zero or 1 is the same as omitting the execrate element, and results in the channel running at full rate.

Note: This feature is new as of version 2016.2 of Flightgear.

execrate and dt

When channels are running slower than full rate the value of dt in simulation/dt is not the correct value for the channel. When dt is neeed for the channel the property simulation/channel-dt should be used instead.

Related content