Update of /cvsroot/jsbsim/JSBSim/systems
In directory vz-cvs-3.sog:/tmp/cvs-serv13369
Modified Files:
afcs.xml rpm_governor.xml
Log Message:
afcs was parametrized too. It cab now be turned into a 'simpler' rate-damper (or SAS), also the altitude-hold function can be switched between h-agl/h-sl mode.
The rpm-governor was optimized for the current (ah1s) engine/rotor combination.
Index: afcs.xml
===================================================================
RCS file: /cvsroot/jsbsim/JSBSim/systems/afcs.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** afcs.xml 17 Jan 2011 22:08:56 -0000 1.2
--- afcs.xml 22 Aug 2012 19:23:12 -0000 1.3
***************
*** 1,33 ****
<?xml version="1.0"?>
! <!-- =============================
! outputs:
! ap/rudder-cmd
! ap/aileron-cmd
! ap/elevator-cmd
! ap/collective-cmd
- ============================= -->
! <system name="automated flight control">
<!-- ==================
! ROLL CHANNEL
! ================== -->
<property value="0.0"> ap/afcs/roll-channel-active-norm </property>
<property value="0.0"> ap/afcs/phi-trim-rad </property>
! <property value="0.0"> ap/afcs/x-lat-trim </property>
<channel name="afcs-roll">
! <fcs_function name="ap/afcs/x-lat-ctrl">
<function>
<product>
! <value> 0.33 </value>
<difference>
! <property> fcs/x-lat </property>
! <property> ap/afcs/x-lat-trim </property>
</difference>
</product>
--- 1,65 ----
<?xml version="1.0"?>
+ <system name="automated flight control">
! <!-- ===================================================================
! Automatic flight control system (AFCS)
! Based on the AFCS for the CH-54/S-64 helicopter described in
! /SH79/, eqns. 13-16.
! The system is adjustable via 'ap/afcs/adj/*' properties, it
! offers basic altitude- and heading-hold features, but can
! also be turned into a pure 'Rate-Damper' (or SAS, 'Stability
! Augmentation System').
! 'Altitude-hold' and 'heading-hold' features.
!
! Setting ap/afcs/adj/altitude-error-ctrl-gain to zero disables
! the altitude-hold feature. When altitude-hold is used the control
! input can be turned to 'h-sl' by setting 'ap/afcs/h-agl-mode'
! to zero.
! The 'ap/afcs/heading-hold-enable' property switches a simple
! 'heading-hold' function on or off.
!
!
! SH79: Shaugnessy, J. D., Deaux, Thomas N., and Yenni, Kenneth R.;
! Development and Validation of a Piloted Simulation of a
! Helicopter and External Sling Load - NASA TP-1285; 1979
!
! =================================================================== -->
!
!
! <!-- ==================
! OUTPUT
! ================== -->
!
! <property value="0.0"> ap/rudder-cmd </property>
! <property value="0.0"> ap/aileron-cmd </property>
! <property value="0.0"> ap/elevator-cmd </property>
! <property value="0.0"> ap/collective-cmd </property>
!
<!-- ==================
! ROLL CHANNEL
! ================== -->
+ <!-- 'control' parameters -->
<property value="0.0"> ap/afcs/roll-channel-active-norm </property>
<property value="0.0"> ap/afcs/phi-trim-rad </property>
! <property value="0.0"> ap/afcs/lateral-trim </property>
! <!-- afcs 'setup' parameters -->
! <property value="0.33"> ap/afcs/adj/lateral-ctrl-gain </property>
! <property value="-0.133"> ap/afcs/adj/roll-err-ctrl-gain </property>
! <property value="-0.096"> ap/afcs/adj/roll-rate-ctrl-gain </property>
<channel name="afcs-roll">
! <fcs_function name="ap/afcs/lateral-ctrl">
<function>
<product>
! <property> ap/afcs/adj/lateral-ctrl-gain </property>
<difference>
! <property> fcs/lateral-gain </property>
! <property> ap/afcs/lateral-trim </property>
</difference>
</product>
***************
*** 41,45 ****
<function>
<product>
! <value> -0.133 </value>
<difference>
<property> attitude/phi-rad </property>
--- 73,77 ----
<function>
<product>
! <property> ap/afcs/adj/roll-err-ctrl-gain </property>
<difference>
<property> attitude/phi-rad </property>
***************
*** 56,60 ****
<function>
<product>
! <value> -0.096 </value>
<property> velocities/p-aero-rad_sec </property>
</product>
--- 88,92 ----
<function>
<product>
! <property> ap/afcs/adj/roll-rate-ctrl-gain </property>
<property> velocities/p-aero-rad_sec </property>
</product>
***************
*** 70,74 ****
<property> ap/afcs/roll-channel-active-norm </property>
<sum>
! <property> ap/afcs/x-lat-ctrl </property>
<property> ap/afcs/roll-err-ctrl </property>
<property> ap/afcs/roll-rate-ctrl </property>
--- 102,106 ----
<property> ap/afcs/roll-channel-active-norm </property>
<sum>
! <property> ap/afcs/lateral-ctrl </property>
<property> ap/afcs/roll-err-ctrl </property>
<property> ap/afcs/roll-rate-ctrl </property>
***************
*** 81,99 ****
<!-- ==================
! PITCH CHANNEL
! ================== -->
<property value="0.0"> ap/afcs/pitch-channel-active-norm </property>
<property value="0.0"> ap/afcs/theta-trim-rad </property>
! <property value="0.0"> ap/afcs/x-lon-trim </property>
<channel name="afcs-pitch">
! <fcs_function name="ap/afcs/x-lon-ctrl">
<function>
<product>
! <value> 0.475 </value>
<difference>
! <property> fcs/x-lon </property>
! <property> ap/afcs/x-lon-trim </property>
</difference>
</product>
--- 113,136 ----
<!-- ==================
! PITCH CHANNEL
! ================== -->
+ <!-- 'control' parameters -->
<property value="0.0"> ap/afcs/pitch-channel-active-norm </property>
<property value="0.0"> ap/afcs/theta-trim-rad </property>
! <property value="0.0"> ap/afcs/longitudinal-trim </property>
! <!-- afcs 'setup' parameters -->
! <property value="0.475"> ap/afcs/adj/longitudinal-ctrl-gain </property>
! <property value="0.281"> ap/afcs/adj/pitch-err-ctrl-gain </property>
! <property value="0.727"> ap/afcs/adj/pitch-rate-ctrl-gain </property>
<channel name="afcs-pitch">
! <fcs_function name="ap/afcs/longitudinal-ctrl">
<function>
<product>
! <property> ap/afcs/adj/longitudinal-ctrl-gain </property>
<difference>
! <property> fcs/longitudinal-gain </property>
! <property> ap/afcs/longitudinal-trim </property>
</difference>
</product>
***************
*** 107,111 ****
<function>
<product>
! <value> 0.281 </value>
<difference>
<property> attitude/theta-rad </property>
--- 144,148 ----
<function>
<product>
! <property> ap/afcs/adj/pitch-err-ctrl-gain </property>
<difference>
<property> attitude/theta-rad </property>
***************
*** 122,126 ****
<function>
<product>
! <value> 0.727 </value>
<property> velocities/q-aero-rad_sec </property>
</product>
--- 159,163 ----
<function>
<product>
! <property> ap/afcs/adj/pitch-rate-ctrl-gain </property>
<property> velocities/q-aero-rad_sec </property>
</product>
***************
*** 136,142 ****
<property> ap/afcs/pitch-channel-active-norm </property>
<sum>
! <property> ap/afcs/x-lon-ctrl </property>
! <property> ap/afcs/pitch-err-ctrl </property>
! <property> ap/afcs/pitch-rate-ctrl </property>
</sum>
</product>
--- 173,179 ----
<property> ap/afcs/pitch-channel-active-norm </property>
<sum>
! <property> ap/afcs/longitudinal-ctrl </property>
! <property> ap/afcs/pitch-err-ctrl </property>
! <property> ap/afcs/pitch-rate-ctrl </property>
</sum>
</product>
***************
*** 148,157 ****
<!-- ==================
YAW CHANNEL
! ================== -->
<property value="0.0"> ap/afcs/yaw-channel-active-norm </property>
<property value="0.0"> ap/afcs/psi-trim-rad </property>
<channel name="afcs-yaw">
<!-- if zero the pid integrator is enabled -->
<!-- if negative the pid integrator is reset -->
--- 185,209 ----
<!-- ==================
YAW CHANNEL
! ================== -->
+ <!-- 'control' parameters -->
<property value="0.0"> ap/afcs/yaw-channel-active-norm </property>
<property value="0.0"> ap/afcs/psi-trim-rad </property>
+ <!-- afcs 'setup' parameters -->
+ <property value="1.0"> ap/afcs/heading-hold-enable </property>
+ <property value="0.0"> ap/afcs/adj/yaw-rate-ctrl-gain </property>
<channel name="afcs-yaw">
+
+ <fcs_function name="ap/afcs/psi-trim-deg">
+ <!-- utility -->
+ <function>
+ <product>
+ <value> 57.2958 </value>
+ <property> ap/afcs/psi-trim-rad </property>
+ </product>
+ </function>
+ </fcs_function>
+
<!-- if zero the pid integrator is enabled -->
<!-- if negative the pid integrator is reset -->
***************
*** 160,209 ****
<test value="0.0"> ap/afcs/yaw-channel-active-norm GT 0.999 </test>
</switch>
! <fcs_function name="ap/afcs/psi-error-rad-raw">
! <function>
! <difference>
! <property> attitude/psi-rad </property>
! <property> ap/afcs/psi-trim-rad </property>
! </difference>
! </function>
! </fcs_function>
! <fcs_function name="ap/afcs/psi-error-rad-mapped">
! <function>
! <product>
! <value> 2.0 </value>
! <property> ap/afcs/yaw-channel-active-norm </property>
! <atan>
! <tan>
! <product>
! <value> 0.5 </value>
! <property> ap/afcs/psi-error-rad-raw </property>
! </product>
! </tan>
! </atan>
! </product>
! </function>
! </fcs_function>
! <!-- avoid jumping when abs(delta) is around 180 deg -->
<fcs_function name="ap/afcs/psi-error-rad">
<function>
! <product>
! <property> ap/afcs/psi-error-rad-mapped </property>
! <table>
! <independentVar lookup="row"> ap/afcs/psi-error-rad-mapped </independentVar>
! <tableData>
! -3.1416 0.0
! -3.0 1.0
! 3.0 1.0
! 3.1416 0.0
! </tableData>
! </table>
! </product>
</function>
</fcs_function>
<pid name="ap/afcs/yaw-err-pid">
<input> ap/afcs/psi-error-rad </input>
! <kp> 0.45 </kp>
! <!-- G_theta_t_psi 0.133 -->
! <ki> 0.002 </ki>
<kd> 0.0 </kd>
<trigger> ap/afcs/yaw-err-pid-inhibit </trigger>
--- 212,231 ----
<test value="0.0"> ap/afcs/yaw-channel-active-norm GT 0.999 </test>
</switch>
!
<fcs_function name="ap/afcs/psi-error-rad">
<function>
! <sin>
! <difference>
! <property> attitude/psi-rad </property>
! <property> ap/afcs/psi-trim-rad </property>
! </difference>
! </sin>
</function>
</fcs_function>
+
<pid name="ap/afcs/yaw-err-pid">
<input> ap/afcs/psi-error-rad </input>
! <kp> 0.33 </kp>
! <ki> 0.0025 </ki>
<kd> 0.0 </kd>
<trigger> ap/afcs/yaw-err-pid-inhibit </trigger>
***************
*** 216,221 ****
<function>
<product>
! <property> ap/afcs/yaw-channel-active-norm </property>
! <value> 0.5 </value>
<property> velocities/r-aero-rad_sec </property>
</product>
--- 238,242 ----
<function>
<product>
! <property> ap/afcs/adj/yaw-rate-ctrl-gain </property>
<property> velocities/r-aero-rad_sec </property>
</product>
***************
*** 226,257 ****
</clipto>
</fcs_function>
! <summer name="ap/afcs/yaw-cmd-sum">
! <input> ap/afcs/yaw-err-pid </input>
! <input> ap/afcs/yaw-rate-ctrl </input>
<output> ap/rudder-cmd </output>
! </summer>
</channel>
<!-- =====================
! ALTITUDE CHANNEL
! ===================== -->
<property value="0.0"> ap/afcs/altitude-channel-active-norm </property>
! <property value="50.0"> ap/afcs/h-agl-trim-ft </property>
<channel name="afcs-altitude">
! <!-- reported h-agl-ft seems way jumpy -->
<lag_filter name="position/h-agl-ft-lag">
<input> position/h-agl-ft </input>
<c1> 1.0 </c1>
</lag_filter>
<fcs_function name="ap/afcs/altitude-error-ctrl">
<function>
<product>
! <property> ap/afcs/altitude-channel-active-norm </property>
! <value> -0.00035 </value>
<difference>
! <property> position/h-agl-ft-lag </property>
! <property> ap/afcs/h-agl-trim-ft </property>
</difference>
</product>
--- 247,302 ----
</clipto>
</fcs_function>
! <fcs_function name="ap/afcs/yaw-cmd-sum">
! <function>
! <product>
! <property> ap/afcs/yaw-channel-active-norm </property>
! <sum>
! <product>
! <property> ap/afcs/heading-hold-enable </property>
! <property> ap/afcs/yaw-err-pid </property>
! </product>
! <property> ap/afcs/yaw-rate-ctrl </property>
! </sum>
! </product>
! </function>
<output> ap/rudder-cmd </output>
! </fcs_function>
!
</channel>
<!-- =====================
! ALTITUDE CHANNEL
! ===================== -->
+ <!-- 'control' parameters -->
<property value="0.0"> ap/afcs/altitude-channel-active-norm </property>
! <property value="50.0"> ap/afcs/altitude-trim-ft </property>
! <!-- afcs 'setup' parameters -->
! <property value="1.0"> ap/afcs/h-agl-mode </property>
! <property value="-0.00035"> ap/afcs/adj/altitude-error-ctrl-gain </property>
! <property value="0.00"> ap/afcs/adj/altitude-rate-ctrl-gain </property>
!
<channel name="afcs-altitude">
! <!-- smooth out terrain jumps -->
<lag_filter name="position/h-agl-ft-lag">
<input> position/h-agl-ft </input>
<c1> 1.0 </c1>
</lag_filter>
+
+ <switch name="ap/afcs/altitude-input">
+ <default value="position/h-sl-ft"/>
+ <test value="position/h-agl-ft-lag">
+ ap/afcs/h-agl-mode == 1
+ </test>
+ </switch>
+
<fcs_function name="ap/afcs/altitude-error-ctrl">
<function>
<product>
! <property> ap/afcs/adj/altitude-error-ctrl-gain </property>
<difference>
! <property> ap/afcs/altitude-input </property>
! <property> ap/afcs/altitude-trim-ft </property>
</difference>
</product>
***************
*** 261,267 ****
--- 306,339 ----
<max> 0.40 </max>
</clipto>
+ </fcs_function>
+
+ <fcs_function name="ap/afcs/altitude-rate-ctrl">
+ <function>
+ <product>
+ <property> ap/afcs/adj/altitude-rate-ctrl-gain </property>
+ <property> velocities/h-dot-fps </property><!-- velocities/w-fps ?? -->
+ </product>
+ </function>
+ <clipto>
+ <min> -0.40 </min>
+ <max> 0.40 </max>
+ </clipto>
+ </fcs_function>
+
+ <fcs_function name="ap/afcs/collective-cmd-sum">
+ <function>
+ <product>
+ <property> ap/afcs/altitude-channel-active-norm </property>
+ <sum>
+ <property> ap/afcs/altitude-error-ctrl </property>
+ <property> ap/afcs/altitude-rate-ctrl </property>
+ </sum>
+ </product>
+ </function>
<output> ap/collective-cmd </output>
</fcs_function>
+
</channel>
</system>
+
Index: rpm_governor.xml
===================================================================
RCS file: /cvsroot/jsbsim/JSBSim/systems/rpm_governor.xml,v
retrieving revision 1.2
retrieving revision 1.3
diff -C2 -r1.2 -r1.3
*** rpm_governor.xml 17 Jan 2011 22:08:56 -0000 1.2
--- rpm_governor.xml 22 Aug 2012 19:23:12 -0000 1.3
***************
*** 1,26 ****
<?xml version="1.0"?>
<!-- =================================================================
! A very generic RPM governor.
! You need to declare the target RPM 'fcs/nominal-rpm' in your
! fdm_config, eg:
!
! <system name="governor_decl">
! <property value="300.0"> fcs/nominal-rpm </property>
! </system>
!
! When developing a new helicopter fdm you should run the rotor
! in constant-speed mode (by setting ExternalRPM to -1 and
! manipulate propulsion/engine[x]/x-rpm-dict accordingly),
! and implement a proper governor as last step. Otherwise a
! bad governor might spoil a good model.
================================================================= -->
- <system name="RPM Governor">
<property value="0.0">fcs/rpm-governor-active-norm</property>
<channel name="RPM-Governor">
--- 1,27 ----
<?xml version="1.0"?>
+ <system name="RPM Governor (AH1S)">
<!-- =================================================================
! RPM governor for the ah1s model (Adjusted for electric engines,
! and rather 'crisp').
! A more basic/lazy PID might use the following values:
! <kp> 0.0035 </kp>
! <ki> 0.001 </ki>
! <kd> 0.0 </kd>
!
! Note:
! When developing a new helicopter fdm you should run the rotor
! in constant-speed mode (by setting ExternalRPM to -1 and
! manipulate propulsion/engine[x]/x-rpm-dict accordingly).
! Implement the governor as last step, otherwise chances are high
! that a bad governor might spoil a good model.
================================================================= -->
<property value="0.0">fcs/rpm-governor-active-norm</property>
+ <property value="324.0"> fcs/nominal-rpm </property>
<channel name="RPM-Governor">
***************
*** 46,52 ****
<pid name="fcs/throttle-pid">
<input>fcs/rpm-delta</input>
! <kp> 0.0035 </kp>
! <ki> 0.001 </ki>
! <kd> 0.0 </kd>
<trigger> fcs/rpm-governor-pid-inhibit </trigger>
<clipto>
--- 47,53 ----
<pid name="fcs/throttle-pid">
<input>fcs/rpm-delta</input>
! <kp> 0.07 </kp>
! <ki> 0.0012 </ki>
! <kd> -0.0008 </kd>
<trigger> fcs/rpm-governor-pid-inhibit </trigger>
<clipto>
|