| 1 |
Specifying and Configuring and Aircraft Electrical System |
| 2 |
========================================================= |
| 3 |
|
| 4 |
Written by Curtis L. Olson <http://www.flightgear.org/~curt> |
| 5 |
|
| 6 |
February 3, 2003 - Initial revision. |
| 7 |
June 14, 2005 - Important update |
| 8 |
|
| 9 |
UPDATE - June 14, 2005 |
| 10 |
====================== |
| 11 |
|
| 12 |
The xml data driven electrical system described in this document has |
| 13 |
severe flaws and is (or should be) obsolete. It is still supported |
| 14 |
for backwards compatibility, but new electrical systems should not be |
| 15 |
modeled with this system. Instead you should make a procedural |
| 16 |
electrical system model using nasal, or wait for a better data driven |
| 17 |
electrical system model to be developed "some time" in the future. |
| 18 |
|
| 19 |
Currently the old/deprecated electrical system has been made into a |
| 20 |
proper subsystem. Most aircraft will load the default "systems" |
| 21 |
configuration via the "/sim/systems/path" property which is set in the |
| 22 |
top level preferences.xml file and which defaults to a value of |
| 23 |
"Aircraft/Generic/generic-systems.xml". The generic-systems.xml file |
| 24 |
in turn specifies an electrical system based on the old/obsolete |
| 25 |
system. The default electrical system configuration file named in |
| 26 |
"generic-systems.xml" is "generic-electrical.xml". This mechanism |
| 27 |
provides a generic electrical system to any aircraft that doesn't |
| 28 |
define their own electrical system. Also note that you can still |
| 29 |
specify a path to an "old" xml config file using |
| 30 |
"/sim/systems/electrical" in your aircraft-set.xml file. This is |
| 31 |
again for backwards compatibility. |
| 32 |
|
| 33 |
|
| 34 |
|
| 35 |
What follows here is a description of the "old" "deprecated" |
| 36 |
"obsolete" electrical system. |
| 37 |
|
| 38 |
|
| 39 |
|
| 40 |
Introduction |
| 41 |
============ |
| 42 |
|
| 43 |
The FlightGear electrical system model is a simplification of reality. |
| 44 |
We don't model down to the level of individual electrons, but we do |
| 45 |
try to model a rich enough subset of components so that a realistic |
| 46 |
electrical system may be implemented (at least from the pilot's |
| 47 |
perspective.) We try to model enough of the general flow so that |
| 48 |
typical electrical system failures can be implemented and so that the |
| 49 |
pilot can practice realistic troubleshooting techniques and learn the |
| 50 |
basic structure and relationships of the real aircraft electrical |
| 51 |
system. |
| 52 |
|
| 53 |
The FlightGear electrical system is essentially a directed graph built |
| 54 |
of 4 major components: suppliers, buses, outputs, and connectors. |
| 55 |
Suppliers are the power sources such as batteries and alternators. |
| 56 |
Buses collect input from multiple suppliers and feed multiple outputs. |
| 57 |
Outputs are not strictly necessary, but are included so we can assign |
| 58 |
current draws, and name generic output types, as well as provide a |
| 59 |
consistent naming scheme to other FlightGear subsystems. Finally |
| 60 |
connectors connect a supplier to a bus, or a bus to an output, and |
| 61 |
optionally can specify a switch property (either a physical switch or |
| 62 |
a circuit breaker.) |
| 63 |
|
| 64 |
At run time, FlightGear parses the electrical system config file and |
| 65 |
builds a directed graph (in the computer science sense.). Each time |
| 66 |
step, the current is propagated forward through the system, starting |
| 67 |
at the suppliers, flowing through the buses, and finally to the |
| 68 |
outputs. The system follows the path specified by connectors and |
| 69 |
honors the state of any connector switches. |
| 70 |
|
| 71 |
FlightGear uses a depth first recursive decent algorithm to propagate |
| 72 |
the current through the system. As the recursive calls complete, the |
| 73 |
current draw of the "leaf nodes" can be summed up and back-propagated |
| 74 |
through the system. This allows us to compute the total downstream |
| 75 |
current draw at each component of the system. This allows us to |
| 76 |
discharge the battery based on actual loads, and allows us to build an |
| 77 |
accurate functioning ammeter model. |
| 78 |
|
| 79 |
|
| 80 |
Suppliers |
| 81 |
========= |
| 82 |
|
| 83 |
A supplier entry could look like the following: |
| 84 |
|
| 85 |
<supplier> |
| 86 |
<name>Battery 1</name> |
| 87 |
<prop>/systems/electrical/suppliers/battery[0]</prop> |
| 88 |
<kind>battery</kind> |
| 89 |
<volts>24</volts> |
| 90 |
<amps>60</amps> <!-- WAG --> |
| 91 |
</supplier> |
| 92 |
|
| 93 |
<name> can be anything you choose to call this entry. |
| 94 |
<prop> is the name of a property that will be updated with the state |
| 95 |
of this supplier. |
| 96 |
<kind> can be "battery", "alternator", or "external". |
| 97 |
<volts> specifies the volts of the source |
| 98 |
<amps> specifies the amps of the source |
| 99 |
|
| 100 |
Currently <volts> and <amps> are not really modeled in detail. This |
| 101 |
is more of a place holder for the future. |
| 102 |
|
| 103 |
For alternators, you must additionally specify: |
| 104 |
|
| 105 |
<rpm-source>/engines/engine[0]/rpm</rpm-source> |
| 106 |
|
| 107 |
The value of the rpm source determines if the generator is able to |
| 108 |
produce power or not. |
| 109 |
|
| 110 |
|
| 111 |
Buses |
| 112 |
===== |
| 113 |
|
| 114 |
A bus entry could look like the following: |
| 115 |
|
| 116 |
<bus> |
| 117 |
<name>Essential/Cross Feed Bus</name> |
| 118 |
<prop>/systems/electrical/outputs/bus-essential</prop> |
| 119 |
<prop>/systems/electrical/outputs/annunciators</prop> |
| 120 |
<prop>/systems/electrical/outputs/master-switch</prop> |
| 121 |
</bus> |
| 122 |
|
| 123 |
<name> is whatever you choose to call this bus |
| 124 |
|
| 125 |
You can have an arbitrary number of <prop> entries. Each entry is the |
| 126 |
name of a property that will be updated with the value of the current |
| 127 |
at that bus. This allows you to wire devices directly to the bus but |
| 128 |
does not allow you to insert a switch or circuit breaker in between. |
| 129 |
See "Outputs" and "Connectors" if you want to do that. |
| 130 |
|
| 131 |
|
| 132 |
Outputs |
| 133 |
======= |
| 134 |
|
| 135 |
An output entry could look like the following: |
| 136 |
|
| 137 |
<output> |
| 138 |
<name>Starter 1 Power</name> |
| 139 |
<prop>/systems/electrical/outputs/starter[0]</prop> |
| 140 |
</output> |
| 141 |
|
| 142 |
An output isn't entirely unlike a bus, but it's nice conceptually to |
| 143 |
have a separate entity type. This enables us to specify a common set |
| 144 |
of output property names so that other subsystems can automatically |
| 145 |
work with any electrical system that follows the same conventions. An |
| 146 |
output lives on the other side of a switch, so this is how you can |
| 147 |
wire in cockpit switches to model things like fuel pump power, |
| 148 |
avionics master switch, or any other switch on the panel. |
| 149 |
|
| 150 |
<name> is whatever you choose to call this bus |
| 151 |
|
| 152 |
You can have an arbitrary number of <prop> entries. Each entry is the |
| 153 |
name of a property that will be updated with the value of the current |
| 154 |
at that bus. This allows you to wire devices directly to the bus but |
| 155 |
does not allow you to insert a switch or circuit breaker in between. |
| 156 |
See "Outputs" and "Connectors" if you want to do that. |
| 157 |
|
| 158 |
Other FlightGear subsystems can monitor the property name associated |
| 159 |
with the various outputs to decide how to render an instrument, |
| 160 |
whether to run the fuel pump, whether to spin a gyro, or any other |
| 161 |
subsystem that cares about electrical power. |
| 162 |
|
| 163 |
|
| 164 |
Connectors |
| 165 |
========== |
| 166 |
|
| 167 |
An connector entry could look like the following: |
| 168 |
|
| 169 |
<connector> |
| 170 |
<input>Alternator 1</input> |
| 171 |
<output>Virtual Bus 1</output> |
| 172 |
<switch>/controls/switches/master-alt</switch> |
| 173 |
<initial-state>off</initial-state> <!-- optional tag --> |
| 174 |
</connector> |
| 175 |
|
| 176 |
A connector specifies and input, and output, and any number of |
| 177 |
switches that are wired in series. In other words, all switches need |
| 178 |
to be true/on in order for current to get from the input to the output |
| 179 |
of the connector. |
| 180 |
|
| 181 |
<input> specifies the <name> of the input. Typically you would |
| 182 |
specify a "supplier" or a "bus". |
| 183 |
|
| 184 |
<output> specifies the <name> of the output. Typically you would |
| 185 |
specify a bus or an output. |
| 186 |
|
| 187 |
You can have an arbitrary number of <switch> entries. The switches |
| 188 |
are wired in series so all of them need to be on (i.e. true) in order |
| 189 |
for current to pass to the output. |
| 190 |
|
| 191 |
Note: by default the system forces any listed switches to be true. |
| 192 |
The assumption is that not every aircraft or cockpit may implement |
| 193 |
every available switch, so rather than having systems be switched off, |
| 194 |
with no way to turn them on, we default to switched on. |
| 195 |
|
| 196 |
This is a problem however with the starter switch which we want to be |
| 197 |
initialized to "off". To solve this problem you can specify |
| 198 |
<initial-state>off</initial-state> or |
| 199 |
<initial-state>on</initial-state> Switches default to on, so you |
| 200 |
really only need to specify this tag if you want the connector's |
| 201 |
switch to default to off. |
| 202 |
|
| 203 |
|
| 204 |
Summary |
| 205 |
======= |
| 206 |
|
| 207 |
The electrical system has a lot of power and flexibility to model a |
| 208 |
variety of electrical systems. However, it is hopelessly flawed and |
| 209 |
cannot model a lot of more complex electrical behavior needed for the |
| 210 |
advanced electrical systems found on larger and more complex aircraft. |
| 211 |
Please consider writing a procedural model for your electrical system |
| 212 |
in nasal or wait for a better data driven electrical system model to |
| 213 |
be developed. If you know something about electrical systems, please |
| 214 |
volunteer to write a better data driven model! :-) |