Model Interface

Configuring FLIGHTLAB models to work with FCMDRIVER

Basic setup

fcmdriver requires certain data structures to be defined in the model. To set these up, execute:

path("$FL_DIR/fcmdriver/scripts/");
exec("fcmdriver.configure",1);

in Scope prior to dumping the model.

See also

FCMDUMP in the Scope online help.

Trim settings

In some math models, it is necessary to turn off flight control system modes or change other settings while trimming.

Parameters to be set prior to a trim are controlled by the @TRIMCONFIG variable list, and their values are specified in WORLD_ANALYSIS_APTRIM_TRIMCONFIG. For example:

pushg(world_analysis)
group aptrim
    varlist @trimconfig = ..
    world_model_control_cpg_configpar_asas,  ..
    world_model_control_cpg_configpar_dsas;
    trimconfig = [0 ; 0];
    varlist @unused = trimconfig;
popg;

This will set ASAS and DSAS to 0 at the beginning of the trim process. At the end of the trim, the previous values of @TRIMCONFIG are restored.

Tunable trim parameters

The following tunable parameters may be set to configure the trim process:

ANALYSIS_APTRIM_TRIMTIME [sec]
Number of seconds to run trim

These parameters may be set at any time after executing fcmdriver.configure.

Custom I/O

To add user-defined FLCOMMS blocks:

First, declare all of the FLCOMMs blocks you wish to access before dumping the model:

FCMDUMP(@BLOCK1);
FCMDUMP(@BLOCK2);
...
FCMDUMP("model.fcm");

Next, list all of the relevant data blocks in the [MODEL] section of the fcmdriver configuration file:

[MODEL]
outputs = @BLOCK1 @BLOCK2
inputs = @INPUTS1 @INPUTS2 @INPUTS3

Blocks in the outputs list will be copied from the model to FLCOMMS once per frame. Blocks in the inputs list will be copied from FLCOMMS to the model once per frame.

You may also specify input and output lists in system comments in the FCM file:

// In Scope, before dumping the model:
describe("ICD-Outputs: @BLOCK1 @BLOCK2 ...");
describe("ICD-Inputs: ...");

The driver uses the ICD-Outputs (resp. ICD-Inputs) system comment as the default if outputs= (resp. inputs=) is not specified in the driver configuration file.