FGFCS Class Reference

#include <FGFCS.h>

Inherits FGModel, and FGXMLFileRead.

List of all members.


Detailed Description

This class also encapsulates the identical "system" and "autopilot" capability. FGFCS owns and contains the list of FGFCSComponents that define a system or systems for the modeled aircraft. The config file for the aircraft contains a description of the control path that starts at an input or command and ends at an effector, e.g. an aerosurface. The FCS components which comprise the control laws for an axis are defined sequentially in the configuration file. For instance, for the X-15:

    <flight_control name="X-15 SAS">
      <channel>
        <summer name="Pitch Trim Sum">
           <input> fcs/elevator-cmd-norm </input>
           <input> fcs/pitch-trim-cmd-norm </input>
           <clipto>
             <min>-1</min>
             <max>1</max>
           </clipto>
        </summer>

        <aerosurface_scale name="Pitch Command Scale">
          <input> fcs/pitch-trim-sum </input>
          <range>
            <min> -50 </min>
            <max>  50 </max>
          </range>
        </aerosurface_scale>

        ... etc.

In the above case we can see the first few components of the pitch channel defined. The input to the first component (a summer), as can be seen in the "Pitch trim sum" component, is really the sum of two parameters: elevator command (from the stick - a pilot input), and pitch trim. The next component created is an aerosurface scale component - a type of gain (see the LoadFCS() method for insight on how the various types of components map into the actual component classes). This continues until the final component for an axis when the <output> element is usually used to specify where the output is supposed to go. See the individual components for more information on how they are mechanized.

Another option for the flight controls portion of the config file is that in addition to using the "NAME" attribute in,

    <flight_control name="X-15 SAS">

one can also supply a filename:

    <flight_control name="X-15 SAS" file="X15.xml">
    </flight_control>

In this case, the FCS would be read in from another file.

Properties

Author:
Jon S. Berndt
Version:
Revision
1.23
See also:
FGActuator

FGDeadBand

FGFCSFunction

FGFilter

FGGain

FGKinemat

FGPID

FGSensor

FGSummer

FGSwitch

FGFCSComponent

Element

Definition at line 189 of file FGFCS.h.


Public Types

enum  SystemType { stFCS, stSystem, stAutoPilot }

Public Member Functions

void AddGear (void)
void AddThrottle (void)
 FGFCS (FGFDMExec *)
 Constructor.
ifstream * FindSystemFile (string system_filename)
string FindSystemFullPathname (string system_filename)
string GetComponentStrings (string delimeter)
 Retrieves all component names for inclusion in output stream.
string GetComponentValues (string delimeter)
 Retrieves all component outputs for inclusion in output stream.
double GetDt (void)
FGPropertyManagerGetPropertyManager (void)
FGStateGetState (void)
 Retrieves the State object pointer.
bool InitModel (void)
bool Load (Element *el, SystemType systype)
 Loads the Flight Control System.
bool Run (void)
 Runs the Flight Controls model; called by the Executive.
 ~FGFCS ()
 Destructor.
Landing Gear brakes
double GetBrake (FGLGear::BrakeGroup bg)
 Gets the brake for a specified group.
double GetCBrake (void) const
 Gets the center brake.
double GetLBrake (void) const
 Gets the left brake.
double GetRBrake (void) const
 Gets the right brake.
void SetCBrake (double cmd)
 Sets the center brake group.
void SetLBrake (double cmd)
 Sets the left brake group.
void SetRBrake (double cmd)
 Sets the right brake group.
Pilot input command retrieval
double GetDaCmd (void) const
 Gets the aileron command.
double GetDeCmd (void) const
 Gets the elevator command.
double GetDfCmd (void) const
 Gets the flaps command.
double GetDrCmd (void) const
 Gets the rudder command.
double GetDsbCmd (void) const
 Gets the speedbrake command.
double GetDsCmd (void) const
 Gets the steering command.
double GetDspCmd (void) const
 Gets the spoiler command.
bool GetFeatherCmd (int engine) const
 Gets the prop feather command.
double GetGearCmd (void) const
 Get the gear extend/retract command.
double GetMixtureCmd (int engine) const
 Gets the mixture command.
double GetPitchTrimCmd (void) const
 Gets the pitch trim command.
double GetPropAdvanceCmd (int engine) const
 Gets the prop pitch command.
double GetRollTrimCmd (void) const
 Gets the aileron trim command.
double GetThrottleCmd (int engine) const
 Gets the throttle command.
double GetYawTrimCmd (void) const
 Gets the rudder trim command.
Aerosurface position retrieval
double GetDaLPos (int form=ofRad) const
 Gets the left aileron position.
Aerosurface position retrieval
double GetDaRPos (int form=ofRad) const
 Gets the right aileron position.
double GetDePos (int form=ofRad) const
 Gets the elevator position.
double GetDfPos (int form=ofRad) const
 Gets the flaps position.
double GetDrPos (int form=ofRad) const
 Gets the rudder position.
double GetDsbPos (int form=ofRad) const
 Gets the speedbrake position.
double GetDspPos (int form=ofRad) const
 Gets the spoiler position.
double GetGearPos (void) const
 Gets the gear position (0 up, 1 down), defaults to down.
double GetMixturePos (int engine) const
 Gets the mixture position.
double GetPropAdvance (int engine) const
 Gets the prop pitch position.
bool GetPropFeather (int engine) const
 Gets the prop feather position.
double GetSteerPosDeg (int gear) const
 Gets the steering position.
double GetTailhookPos (void) const
 Gets the tailhook position (0 up, 1 down).
double GetThrottlePos (int engine) const
 Gets the throttle position.
double GetWingFoldPos (void) const
 Gets the wing fold position (0 unfolded, 1 folded).
Pilot input command setting
void SetDaCmd (double cmd)
 Sets the aileron command.
void SetDeCmd (double cmd)
 Sets the elevator command.
void SetDfCmd (double cmd)
 Sets the flaps command.
void SetDrCmd (double cmd)
 Sets the rudder command.
void SetDsbCmd (double cmd)
 Sets the speedbrake command.
void SetDsCmd (double cmd)
 Sets the steering command.
void SetDspCmd (double cmd)
 Sets the spoilers command.
void SetFeatherCmd (int engine, bool cmd)
 Sets the propeller feather command for the specified engine.
void SetGearCmd (double gearcmd)
 Set the gear extend/retract command, defaults to down.
void SetMixtureCmd (int engine, double cmd)
 Sets the mixture command for the specified engine.
void SetPitchTrimCmd (double cmd)
 Sets the pitch trim command.
void SetPropAdvanceCmd (int engine, double cmd)
 Sets the propeller pitch command for the specified engine.
void SetRollTrimCmd (double cmd)
 Sets the aileron trim command.
void SetThrottleCmd (int engine, double cmd)
 Sets the throttle command for the specified engine.
void SetYawTrimCmd (double cmd)
 Sets the rudder trim command.
Aerosurface position setting
void SetDaLPos (int form, double pos)
 Sets the left aileron position.
void SetDaRPos (int form, double pos)
 Sets the right aileron position.
void SetDePos (int form, double pos)
 Sets the elevator position.
void SetDfPos (int form, double pos)
 Sets the flaps position.
void SetDrPos (int form, double pos)
 Sets the rudder position.
void SetDsbPos (int form, double pos)
 Sets the speedbrake position.
void SetDspPos (int form, double pos)
 Sets the spoiler position.
void SetGearPos (double gearpos)
 Set the gear extend/retract position, defaults to down.
void SetMixturePos (int engine, double cmd)
 Sets the actual mixture setting for the specified engine.
void SetPropAdvance (int engine, double cmd)
 Sets the actual prop pitch setting for the specified engine.
void SetPropFeather (int engine, bool cmd)
 Sets the actual prop feather setting for the specified engine.
void SetSteerPosDeg (int gear, double pos)
 Sets the steering position.
void SetTailhookPos (double hookpos)
 Set the tailhook position.
void SetThrottlePos (int engine, double cmd)
 Sets the actual throttle setting for the specified engine.
void SetWingFoldPos (double foldpos)
 Set the wing fold position.

Constructor & Destructor Documentation

FGFCS ( FGFDMExec fdmex  ) 

Parameters:
Executive a pointer to the parent executive object

Definition at line 68 of file FGFCS.cpp.


Member Function Documentation

double GetBrake ( FGLGear::BrakeGroup  bg  ) 

Parameters:
bg which brakegroup to retrieve the command for
Returns:
the brake setting for the supplied brake group argument

Definition at line 707 of file FGFCS.cpp.

double GetCBrake ( void   )  const [inline]

Returns:
the center brake setting.

Definition at line 528 of file FGFCS.h.

string GetComponentStrings ( string  delimeter  ) 

Parameters:
delimeter either a tab or comma string depending on output type
Returns:
a string containing the descriptive names for all components

Definition at line 777 of file FGFCS.cpp.

string GetComponentValues ( string  delimeter  ) 

Parameters:
delimeter either a tab or comma string depending on output type
Returns:
a string containing the numeric values for the current set of component outputs

Definition at line 814 of file FGFCS.cpp.

double GetDaCmd ( void   )  const [inline]

Returns:
aileron command in range from -1.0 - 1.0

Definition at line 209 of file FGFCS.h.

double GetDaLPos ( int  form = ofRad  )  const [inline]

Returns:
aileron position in radians

Definition at line 277 of file FGFCS.h.

double GetDaRPos ( int  form = ofRad  )  const [inline]

Returns:
aileron position in radians

Definition at line 284 of file FGFCS.h.

double GetDeCmd ( void   )  const [inline]

Returns:
elevator command in range from -1.0 - 1.0

Definition at line 213 of file FGFCS.h.

double GetDePos ( int  form = ofRad  )  const [inline]

Returns:
elevator position in radians

Definition at line 289 of file FGFCS.h.

double GetDfCmd ( void   )  const [inline]

Returns:
flaps command in range from 0 to 1.0

Definition at line 225 of file FGFCS.h.

double GetDfPos ( int  form = ofRad  )  const [inline]

Returns:
flaps position in radians

Definition at line 309 of file FGFCS.h.

double GetDrCmd ( void   )  const [inline]

Returns:
rudder command in range from -1.0 - 1.0

Definition at line 217 of file FGFCS.h.

double GetDrPos ( int  form = ofRad  )  const [inline]

Returns:
rudder position in radians

Definition at line 294 of file FGFCS.h.

double GetDsbCmd ( void   )  const [inline]

Returns:
speedbrake command in range from 0 to 1.0

Definition at line 229 of file FGFCS.h.

double GetDsbPos ( int  form = ofRad  )  const [inline]

Returns:
speedbrake position in radians

Definition at line 299 of file FGFCS.h.

double GetDsCmd ( void   )  const [inline]

Returns:
steering command in range from -1.0 - 1.0

Definition at line 221 of file FGFCS.h.

double GetDspCmd ( void   )  const [inline]

Returns:
spoiler command in range from 0 to 1.0

Definition at line 233 of file FGFCS.h.

double GetDspPos ( int  form = ofRad  )  const [inline]

Returns:
spoiler position in radians

Definition at line 304 of file FGFCS.h.

bool GetFeatherCmd ( int  engine  )  const [inline]

Parameters:
engine engine ID number
Returns:
feather command for the given engine (on / off)

Definition at line 253 of file FGFCS.h.

double GetGearCmd ( void   )  const [inline]

0 commands gear up, 1 down. defaults to down.

Returns:
the current value of the gear extend/retract command

Definition at line 270 of file FGFCS.h.

double GetGearPos ( void   )  const [inline]

Returns:
gear position (0 up, 1 down)

Definition at line 328 of file FGFCS.h.

double GetLBrake ( void   )  const [inline]

Returns:
the left brake setting.

Definition at line 520 of file FGFCS.h.

double GetMixtureCmd ( int  engine  )  const [inline]

Parameters:
engine engine ID number
Returns:
mixture command in range from 0 - 1.0 for the given engine

Definition at line 243 of file FGFCS.h.

double GetMixturePos ( int  engine  )  const [inline]

Parameters:
engine engine ID number
Returns:
mixture position for the given engine in range from 0 - 1.0

Definition at line 320 of file FGFCS.h.

double GetPitchTrimCmd ( void   )  const [inline]

Returns:
pitch trim command in range from -1.0 to 1.0

Definition at line 257 of file FGFCS.h.

double GetPropAdvance ( int  engine  )  const [inline]

Parameters:
engine engine ID number
Returns:
prop pitch position for the given engine in range from 0 - 1.0

Definition at line 341 of file FGFCS.h.

double GetPropAdvanceCmd ( int  engine  )  const [inline]

Parameters:
engine engine ID number
Returns:
pitch command in range from 0.0 - 1.0 for the given engine

Definition at line 248 of file FGFCS.h.

bool GetPropFeather ( int  engine  )  const [inline]

Parameters:
engine engine ID number
Returns:
prop fether for the given engine (on / off)

Definition at line 346 of file FGFCS.h.

double GetRBrake ( void   )  const [inline]

Returns:
the right brake setting.

Definition at line 524 of file FGFCS.h.

double GetRollTrimCmd ( void   )  const [inline]

Returns:
aileron trim command in range from -1.0 - 1.0

Definition at line 265 of file FGFCS.h.

FGState* GetState ( void   )  [inline]

This is used by the FGFCS-owned components.

Returns:
pointer to the State object

Definition at line 352 of file FGFCS.h.

double GetSteerPosDeg ( int  gear  )  const [inline]

Returns:
steering position in degrees

Definition at line 324 of file FGFCS.h.

double GetTailhookPos ( void   )  const [inline]

Returns:
tailhook position (0 up, 1 down)

Definition at line 332 of file FGFCS.h.

double GetThrottleCmd ( int  engine  )  const

Parameters:
engine engine ID number
Returns:
throttle command in range from 0 - 1.0 for the given engine

Definition at line 400 of file FGFCS.cpp.

double GetThrottlePos ( int  engine  )  const

Parameters:
engine engine ID number
Returns:
throttle position for the given engine in range from 0 - 1.0

Definition at line 418 of file FGFCS.cpp.

double GetWingFoldPos ( void   )  const [inline]

Returns:
wing fold position (0 unfolded, 1 folded)

Definition at line 336 of file FGFCS.h.

double GetYawTrimCmd ( void   )  const [inline]

Returns:
rudder trim command in range from -1.0 - 1.0

Definition at line 261 of file FGFCS.h.

bool Load ( Element el,
SystemType  systype 
)

Load() is called from FGFDMExec.

Parameters:
el pointer to the Element instance
systype type of system (FCS, Autopilot, System)
Returns:
true if succesful

Definition at line 526 of file FGFCS.cpp.

bool Run ( void   )  [virtual]

Returns:
false if no error

Reimplemented from FGModel.

Definition at line 193 of file FGFCS.cpp.

void SetCBrake ( double  cmd  )  [inline]

Parameters:
cmd brake setting in percent (0.0 - 1.0)

Definition at line 511 of file FGFCS.h.

void SetDaCmd ( double  cmd  )  [inline]

Parameters:
cmd aileron command

Definition at line 369 of file FGFCS.h.

void SetDaLPos ( int  form,
double  pos 
)

Parameters:
cmd left aileron position in radians

Definition at line 229 of file FGFCS.cpp.

void SetDaRPos ( int  form,
double  pos 
)

Parameters:
cmd right aileron position in radians

Definition at line 248 of file FGFCS.cpp.

void SetDeCmd ( double  cmd  )  [inline]

Parameters:
cmd elevator command in percent

Definition at line 373 of file FGFCS.h.

void SetDePos ( int  form,
double  pos 
)

Parameters:
cmd elevator position in radians

Definition at line 267 of file FGFCS.cpp.

void SetDfCmd ( double  cmd  )  [inline]

Parameters:
cmd flaps command in percent

Definition at line 385 of file FGFCS.h.

void SetDfPos ( int  form,
double  pos 
)

Parameters:
cmd flaps position in radians

Definition at line 305 of file FGFCS.cpp.

void SetDrCmd ( double  cmd  )  [inline]

Parameters:
cmd rudder command in percent

Definition at line 377 of file FGFCS.h.

void SetDrPos ( int  form,
double  pos 
)

Parameters:
cmd rudder position in radians

Definition at line 286 of file FGFCS.cpp.

void SetDsbCmd ( double  cmd  )  [inline]

Parameters:
cmd speedbrake command in percent

Definition at line 389 of file FGFCS.h.

void SetDsbPos ( int  form,
double  pos 
)

Parameters:
cmd speedbrake position in radians

Definition at line 324 of file FGFCS.cpp.

void SetDsCmd ( double  cmd  )  [inline]

Parameters:
cmd steering command in percent

Definition at line 381 of file FGFCS.h.

void SetDspCmd ( double  cmd  )  [inline]

Parameters:
cmd spoilers command in percent

Definition at line 393 of file FGFCS.h.

void SetDspPos ( int  form,
double  pos 
)

Parameters:
cmd spoiler position in radians

Definition at line 343 of file FGFCS.cpp.

void SetFeatherCmd ( int  engine,
bool  cmd 
)

Parameters:
engine engine ID number
cmd feather (bool)

Definition at line 496 of file FGFCS.cpp.

void SetGearCmd ( double  gearcmd  )  [inline]

Parameters:
gear command 0 for up, 1 for down

Definition at line 419 of file FGFCS.h.

void SetGearPos ( double  gearpos  )  [inline]

Parameters:
gear position 0 up, 1 down

Definition at line 478 of file FGFCS.h.

void SetLBrake ( double  cmd  )  [inline]

Parameters:
cmd brake setting in percent (0.0 - 1.0)

Definition at line 503 of file FGFCS.h.

void SetMixtureCmd ( int  engine,
double  cmd 
)

Parameters:
engine engine ID number
cmd mixture command in percent (0 - 100)

Definition at line 436 of file FGFCS.cpp.

void SetMixturePos ( int  engine,
double  cmd 
)

Parameters:
engine engine ID number
cmd mixture setting in percent (0 - 100)

Definition at line 451 of file FGFCS.cpp.

void SetPitchTrimCmd ( double  cmd  )  [inline]

Parameters:
cmd pitch trim command in percent

Definition at line 397 of file FGFCS.h.

void SetPropAdvance ( int  engine,
double  cmd 
)

Parameters:
engine engine ID number
cmd prop pitch setting in percent (0.0 - 1.0)

Definition at line 481 of file FGFCS.cpp.

void SetPropAdvanceCmd ( int  engine,
double  cmd 
)

Parameters:
engine engine ID number
cmd mixture command in percent (0.0 - 1.0)

Definition at line 466 of file FGFCS.cpp.

void SetPropFeather ( int  engine,
bool  cmd 
)

Parameters:
engine engine ID number
cmd prop fether setting (bool)

Definition at line 511 of file FGFCS.cpp.

void SetRBrake ( double  cmd  )  [inline]

Parameters:
cmd brake setting in percent (0.0 - 1.0)

Definition at line 507 of file FGFCS.h.

void SetRollTrimCmd ( double  cmd  )  [inline]

Parameters:
cmd aileron trim command in percent

Definition at line 405 of file FGFCS.h.

void SetSteerPosDeg ( int  gear,
double  pos 
) [inline]

Parameters:
cmd steering position in degrees

Definition at line 474 of file FGFCS.h.

void SetTailhookPos ( double  hookpos  )  [inline]

Parameters:
tailhook position 0 up, 1 down

Definition at line 482 of file FGFCS.h.

void SetThrottleCmd ( int  engine,
double  cmd 
)

Parameters:
engine engine ID number
cmd throttle command in percent (0 - 100)

Definition at line 362 of file FGFCS.cpp.

void SetThrottlePos ( int  engine,
double  cmd 
)

Parameters:
engine engine ID number
cmd throttle setting in percent (0 - 100)

Definition at line 381 of file FGFCS.cpp.

void SetWingFoldPos ( double  foldpos  )  [inline]

Parameters:
wing fold position 0 unfolded, 1 folded

Definition at line 486 of file FGFCS.h.

void SetYawTrimCmd ( double  cmd  )  [inline]

Parameters:
cmd rudder trim command in percent

Definition at line 401 of file FGFCS.h.


The documentation for this class was generated from the following files:

Generated on Tue May 26 00:55:10 2009 for JSBSim Flight Dynamics Model by  doxygen 1.5.5