1
0
Fork 0

Aircraft/Generic/JSBSim/Systems: Added a generic airship mooring system.

This commit is contained in:
Anders Gidenstam 2015-05-20 22:54:09 +02:00
parent 11066a5606
commit 5b6a913b80
2 changed files with 587 additions and 0 deletions

View file

@ -0,0 +1,319 @@
<?xml version="1.0"?>
<!--
Airship nose cone and main wire mooring system for JSBSim.
Copyright (C) 2008 - 2015 Anders Gidenstam (anders(at)gidenstam.org)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->
<system name="airship-mooring">
<documentation>
This system models a mast mooring system with a mooring cone connection
and a mooring wire. The mooring cone MUST be located at the aircraft's
visual reference point (VRP).
Usage:
Include the visual-reference-point-extensions system first.
Define the following constant properties:
For the mooring cone connection:
mooring/mooring-spring-coeff-lbs_ft [lbs/ft]
mooring/mooring-damping-coeff-lbs_fps [lbs*sec/ft]
mooring/max-mooring-force-lbs [lbs]
For the mooring wire:
mooring/wire-spring-coeff-lbs_ft [lbs/ft]
mooring/max-wire-force-lbs [lbs]
mooring/max-winch-speed-fps [ft/sec]
For the mooring cone connection:
mooring/mooring-spring-coeff-lbs_ft
mooring/mooring-damping-coeff-lbs_fps
mooring/max-mooring-force-lbs
Define the following external forces:
<force name="mooring-coupling-north" frame="LOCAL">
<location unit="M">
{ VRP }
</location>
<direction>
<x> 1.0 </x>
<y> 0.0 </y>
<z> 0.0 </z>
</direction>
</force>
<force name="mooring-coupling-east" frame="LOCAL">
<location unit="M">
{ VRP }
</location>
<direction>
<x> 0.0 </x>
<y> 1.0 </y>
<z> 0.0 </z>
</direction>
</force>
<force name="mooring-coupling-down" frame="LOCAL">
<location unit="M">
{ VRP }
</location>
<direction>
<x> 0.0 </x>
<y> 0.0 </y>
<z> 1.0 </z>
</direction>
</force>
The following control the mooring operation:
mooring/wire-connected Connect the wire {0,1.0}
mooring/winch-speed-fps Winch speed [ft/sec]
mooring/initial-wire-length-ft [ft]
Location of the mooring mast:
mooring/latitude-deg
mooring/longitude-deg
mooring/altitude-ft
</documentation>
<!-- INTERFACE PROPERTIES -->
<!-- Mooring actions -->
<property value="0.0"> mooring/wire-connected </property>
<property value="0.0"> mooring/winch-speed-fps </property>
<property value="0.0"> mooring/initial-wire-length-ft </property>
<!-- Mooring mast location. Note: Geodetic latitude and altitude. -->
<property value="0.0"> mooring/latitude-deg </property>
<property value="0.0"> mooring/longitude-deg </property>
<property value="0.0"> mooring/altitude-ft </property>
<channel name="Mooring Forces">
<fcs_function name="mooring/latitude-diff-ft">
<function>
<product>
<property> position/latitude-unit-distance-ft_deg </property>
<difference>
<property> mooring/latitude-deg </property>
<property> position/vrp-latitude-deg </property>
</difference>
</product>
</function>
</fcs_function>
<fcs_function name="mooring/longitude-diff-ft">
<function>
<product>
<property> position/longitude-unit-distance-ft_deg </property>
<difference>
<property> mooring/longitude-deg </property>
<property> position/vrp-longitude-deg </property>
</difference>
</product>
</function>
</fcs_function>
<fcs_function name="mooring/altitude-diff-ft">
<function>
<difference>
<property> position/vrp-altitude-ft </property>
<property> mooring/altitude-ft </property>
</difference>
</function>
</fcs_function>
<fcs_function name="mooring/total-distance-ft">
<function>
<pow>
<sum>
<pow>
<property> mooring/latitude-diff-ft </property>
<value> 2.0 </value>
</pow>
<pow>
<property> mooring/longitude-diff-ft </property>
<value> 2.0 </value>
</pow>
<pow>
<property> mooring/altitude-diff-ft </property>
<value> 2.0 </value>
</pow>
</sum>
<value> 0.5 </value>
</pow>
</function>
</fcs_function>
<switch name="mooring/moored">
<default value="0.0"/>
<test logic="AND" value="1.0">
mooring/wire-connected GE 1.0
mooring/total-distance-ft LE 5.0
</test>
</switch>
<fcs_function name="mooring/mooring-force-lbs">
<function>
<product>
<property> mooring/moored </property>
<property> mooring/mooring-spring-coeff-lbs_ft </property>
<property> mooring/total-distance-ft </property>
</product>
</function>
<clipto>
<min> 0.0 </min>
<max> mooring/max-mooring-force-lbs </max>
</clipto>
</fcs_function>
<switch name="mooring/winch-reset">
<default value="-1.0"/>
<test logic="AND" value="0.0">
mooring/wire-connected GT 0.0
</test>
</switch>
<pid name="mooring/wire-length-change-ft">
<!-- NOTE: The plain integrator component does not reset. -->
<input> mooring/winch-speed-fps </input>
<kp> 0.00 </kp>
<ki> 1.00 </ki>
<kd> 0.00 </kd>
<trigger> mooring/winch-reset </trigger>
<clipto>
<min>-mooring/initial-wire-length-ft </min>
<max> 0.0 </max> <!-- Might not be wise. -->
</clipto>
</pid>
<fcs_function name="mooring/wire-length-ft">
<function>
<sum>
<property> mooring/initial-wire-length-ft </property>
<property> mooring/wire-length-change-ft </property>
</sum>
</function>
<clipto>
<min> 0.0 </min>
<max> mooring/initial-wire-length-ft </max> <!-- Might not be wise. -->
</clipto>
</fcs_function>
<fcs_function name="mooring/wire-force-lbs">
<function>
<product>
<property> mooring/wire-connected </property>
<property> mooring/wire-spring-coeff-lbs_ft </property>
<max>
<difference>
<property> mooring/total-distance-ft </property>
<property> mooring/wire-length-ft </property>
</difference>
<value> 0.0 </value>
</max>
</product>
</function>
<clipto>
<min> 0.0 </min>
<max> mooring/max-wire-force-lbs </max>
</clipto>
</fcs_function>
<fcs_function name="mooring/total-force-lbs">
<function>
<sum>
<property> mooring/wire-force-lbs </property>
<property> mooring/mooring-force-lbs </property>
</sum>
</function>
</fcs_function>
<fcs_function name="mooring/force-north-lbs">
<function>
<product>
<property> mooring/wire-connected </property>
<sum>
<product>
<property> mooring/total-force-lbs </property>
<quotient>
<property> mooring/latitude-diff-ft </property>
<property> mooring/total-distance-ft </property>
</quotient>
</product>
<product>
<property> mooring/moored </property>
<property> mooring/mooring-damping-coeff-lbs_fps </property>
<property> velocities/vrp-v-north-fps </property>
</product>
</sum>
</product>
</function>
<output> external_reactions/mooring-coupling-north/magnitude </output>
</fcs_function>
<fcs_function name="mooring/force-east-lbs">
<function>
<product>
<property> mooring/wire-connected </property>
<sum>
<product>
<property> mooring/total-force-lbs </property>
<quotient>
<property> mooring/longitude-diff-ft </property>
<property> mooring/total-distance-ft </property>
</quotient>
</product>
<product>
<property> mooring/moored </property>
<property> mooring/mooring-damping-coeff-lbs_fps </property>
<property> velocities/vrp-v-east-fps </property>
</product>
</sum>
</product>
</function>
<output> external_reactions/mooring-coupling-east/magnitude </output>
</fcs_function>
<fcs_function name="mooring/force-down-lbs">
<function>
<product>
<property> mooring/wire-connected </property>
<sum>
<product>
<property> mooring/total-force-lbs </property>
<quotient>
<property> mooring/altitude-diff-ft </property>
<property> mooring/total-distance-ft </property>
</quotient>
</product>
<product>
<property> mooring/moored </property>
<property> mooring/mooring-damping-coeff-lbs_fps </property>
<property> velocities/vrp-v-down-fps </property>
</product>
</sum>
</product>
</function>
<output> external_reactions/mooring-coupling-down/magnitude </output>
</fcs_function>
</channel>
</system>

View file

@ -0,0 +1,268 @@
<?xml version="1.0"?>
<!--
Extension properties for the JSBSim visual reference point (VRP).
Copyright (C) 2015 Anders Gidenstam (anders(at)gidenstam.org)
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
-->
<system name="visual-reference-point-extensions">
<channel name="position">
<fcs_function name="position/vrp-cg-altitude-offset-ft">
<documentation>
Altitude offset of the visual reference point w.r.t. the centre of gravity.
FIXME: Verify the roll dependence.
</documentation>
<function>
<sum>
<product>
<value>-0.083333333</value>
<difference>
<property>metrics/visualrefpoint-x-in</property>
<property>inertia/cg-x-in</property>
</difference>
<sin>
<property>attitude/pitch-rad</property>
</sin>
</product>
<product>
<value>0.083333333</value>
<difference>
<property>metrics/visualrefpoint-z-in</property>
<property>inertia/cg-z-in</property>
</difference>
<cos>
<property>attitude/pitch-rad</property>
</cos>
</product>
<product>
<value>-0.083333333</value>
<difference>
<property>metrics/visualrefpoint-y-in</property>
<property>inertia/cg-y-in</property>
</difference>
<sin>
<property>attitude/roll-rad</property>
</sin>
</product>
<!-- product>
<value>0.083333333</value>
<difference>
<property>metrics/visualrefpoint-z-in</property>
<property>inertia/cg-z-in</property>
</difference>
<cos>
<property>attitude/roll-rad</property>
</cos>
</product -->
</sum>
</function>
</fcs_function>
<fcs_function name="position/vrp-altitude-ft">
<documentation>
Altitude of the visual reference point.
</documentation>
<function>
<sum>
<property>position/h-sl-ft</property>
<property>position/vrp-cg-altitude-offset-ft</property>
</sum>
</function>
</fcs_function>
<fcs_function name="position/vrp-altitude-agl-ft">
<documentation>
Distance between the visual reference point and the ground surface.
</documentation>
<function>
<sum>
<property>position/h-agl-ft</property>
<property>position/vrp-cg-altitude-offset-ft</property>
</sum>
</function>
</fcs_function>
<fcs_function name="position/vrp-latitude-deg">
<documentation>
Latitude of the visual reference point.
Based on the geocentric to geodetic conversion
vrp-latitude-deg = atan(tan(vrp-gc-latitude_deg)/(1-f)^2))
where for WGS 84 f = 1.0/298.25722.
</documentation>
<function>
<product>
<value>57.29578</value>
<atan>
<product>
<tan>
<product>
<value>0.017453293</value>
<property>position/vrp-gc-latitude_deg</property>
</product>
</tan>
<value>1.0067395</value>
</product>
</atan>
</product>
</function>
</fcs_function>
<fcs_function name="position/vrp-longitude-deg">
<documentation>
Longitude of the visual reference point.
</documentation>
<function>
<property>position/vrp-longitude_deg</property>
</function>
</fcs_function>
<fcs_function name="position/latitude-unit-distance-ft_deg">
<documentation>
Feet per degree of latitude at the present position.
The conversion is based on
http://gis.stackexchange.com/questions/75528/length-of-a-degree-where-do-the-terms-in-this-formula-come-from
but further truncated.
</documentation>
<function>
<product>
<value>3.2808399</value>
<!-- Approximate WGS 84 meters per latitude deg. -->
<sum>
<value>111132.92</value>
<product>
<value>-559.82</value>
<cos>
<product>
<value>2.0</value>
<value>0.017453293</value>
<property>position/vrp-latitude-deg</property>
</product>
</cos>
</product>
</sum>
</product>
</function>
</fcs_function>
<fcs_function name="position/longitude-unit-distance-ft_deg">
<documentation>
Feet per degree of longitude at the present position.
The conversion is based on
http://gis.stackexchange.com/questions/75528/length-of-a-degree-where-do-the-terms-in-this-formula-come-from
but further truncated.
</documentation>
<function>
<product>
<value>3.2808399</value>
<!-- Approximate WGS 84 meters per longitude deg. -->
<sum>
<product>
<value>111412.84</value>
<cos>
<product>
<value>0.017453293</value>
<property>position/vrp-latitude-deg</property>
</product>
</cos>
</product>
<product>
<value>-93.5</value>
<cos>
<product>
<value>3.0</value>
<value>0.017453293</value>
<property>position/vrp-latitude-deg</property>
</product>
</cos>
</product>
</sum>
</product>
</function>
</fcs_function>
</channel>
<channel name="velocities">
<!-- NOTE:
Computing the velocity by derivating the position is probably not
the best way.
-->
<pid name="velocities/vrp-v-north-deg_sec">
<documentation>
</documentation>
<input>position/vrp-latitude-deg</input>
<kp>0.0</kp>
<ki>0.0</ki>
<kd>1.0</kd>
</pid>
<fcs_function name="velocities/vrp-v-north-fps">
<documentation>
The conversion from degrees of latitude per second to ft/sec is based on
http://gis.stackexchange.com/questions/75528/length-of-a-degree-where-do-the-terms-in-this-formula-come-from
but further truncated.
</documentation>
<function>
<product>
<property>position/latitude-unit-distance-ft_deg</property>
<property>velocities/vrp-v-north-deg_sec</property>
</product>
</function>
</fcs_function>
<pid name="velocities/vrp-v-east-deg_sec">
<documentation>
</documentation>
<input>position/vrp-longitude-deg</input>
<kp>0.0</kp>
<ki>0.0</ki>
<kd>1.0</kd>
</pid>
<fcs_function name="velocities/vrp-v-east-fps">
<documentation>
The conversion from degrees of longitude per second to ft/sec is based on
http://gis.stackexchange.com/questions/75528/length-of-a-degree-where-do-the-terms-in-this-formula-come-from
but further truncated.
</documentation>
<function>
<product>
<property>position/longitude-unit-distance-ft_deg</property>
<property>velocities/vrp-v-east-deg_sec</property>
</product>
</function>
</fcs_function>
<pid name="velocities/vrp-v-down-fps">
<documentation>
</documentation>
<input>position/vrp-altitude-ft</input>
<kp>0.0</kp>
<ki>0.0</ki>
<kd>-1.0</kd>
</pid>
</channel>
</system>