Targetware: Flight Model Development


Flight Testing with "fmtest"

Introduction

fmtest is a Targetware utility designed to help users develop and test flight models. In essence, it acts as a virtual wind tunnel. The way fmtest works is by running lua scripts, although it can also act as an interactive interpreter (executing lua commands as you type them). It can handle all the standard lua functions, plus a variety of new, Targetware-specific functions. Like "tool", fmtest is a command line utility. That means you will need to use the OS X terminal (Mac), Console (Linux), or DOS command prompt (Windows). There is no GUI for this utility.

Running fmtest

To run fmtest, change directories to your Targetware directory, then call fmtest by either pointing it towards an existing lua script:

./fmtest -s scripts/dr1test.lua

All examples on this page show fmtest running on an OS X/linux machines; on windows, use "fmtest.exe" instead of "fmtest".

Note that fmtest assumes that it is in the same folder as the Targetware application, and looks for the "data" folder on the same level as itself. If you have put fmtest in some other location, you can use the "-r [pathToTargetware]" option to specify a different data root.

You can also have fmtest drop into interactive interpreter mode after running the specified lua script, by using the "-i" option:

fmtest -s scripts/emilTest.lua -i

FM Testing Functions for Lua

The Targetware-specific functions created for lua, available via fmtest, are as below. Parameters in <angle brackets> are required, parameters in [square brackets] are optional.

Data Setting Functions

fm.setroot( <directory> )

This changes the data root on the fly.

fm.setmodel( <filename> )

This sets the model to be tested, for example:

fm.setmodel( "/rs/planes/camel.acm" )

It also clears all setup information, and restarts the test from scratch.

fm.setoption( <option>, <choice> )

This sets an option loadout on a model. the first number is an integer for the option slot, the second is an integer for the option choice for that slot.

fm.setfuelload( <number> )

This sets the fuel load on the model. the number should range from 0.0 for no fuel to 1.0 for full fuel.

fm.setalt( <meters> )

This sets the wind tunnel to a pressure and temperature equivalent to the given altitude in meters on a standard day.

fm.setias( <km/h> )

This sets model's IAS in km/h.

fm.settas( <km/h> )

This sets the model's TAS in km/h.

fm.setmach( <mach number> )

This sets the model's mach number.

fm.setalpha( <degrees> )

This sets the model's angle of attack to the relative wind.

fm.setbeta( <degrees> )

This sets the model's slip angle to the relative wind.

fm.setpitch( <degrees> )

This sets the model's pitch angle. the relative wind is kept at the same angle, so this is mainly useful for altering the model's attitude relative to gravity.

fm.setbank( <degrees> )

This sets the model's bank angle. the relative wind is kept at the same angle, so this is mainly useful for altering the model's attitude relative to gravity.

fm.setgear( <state>, [gear] )

This deploys or retracts landing gear. <state> is either true (extend) or false (retract). if [gear] is 0 or is left off entirely, this will apply to all landing gear. otherwise, [gear] indicates the specific landing gear to be deployed.

fm.setairbrake( <state>, [airbrake] )

This deploys or retracts airbrakes. <state> is either true (extend) or false (retract). if [airbrake] is 0 or is left off entirely, this will apply to all airbrakes. otherwise, [airbrake] indicates the specific airbrake to be deployed.

fm.setbombbay( <state>, [bomb bay] )

This deploys or retracts bomb bays. <state> is either true (extend) or false (retract). if [bomb bay] is 0 or is left off entirely, this will apply to all bomb bays. otherwise, [bomb bay] indicates the specific bomb bay to be deployed.

fm.setflap( <notch>, [flap] )

This deploys flaps to the given notch. if [flap] is 0 or is left off entirely, this will apply to all flaps. otherwise, [flap] indicates the specific flap to be deployed.

fm.setcflap( <angle>, [cflap] )

This deploys cflaps to the angle. if [cflap] is 0 or is left off entirely, this will apply to all cflaps. otherwise, [cflap] indicates the specific cflap to be deployed.

fm.setcontrols( <roll>, <pitch>, <yaw> )

This sets the stick and rudder. <roll>, <pitch> and <yaw> should range from -1.0 to 1.0.

fm.settrim( <roll>, <pitch>, <yaw> )

This sets the trim tabs. <roll>, <pitch> and <yaw> should range from -1.0 to 1.0.

fm.setstart( <state>, [engine] )

This starts or stops engines. <state> is either true, to start, or false, to stop. if [engine] is 0 or is left off entirely, this applies to all engines. otherwise, [engine] indicates the specific engine to be effected.

fm.setthrottle( <number>, [engine] )

This sets engine throttles. <number> should range from 0.0 to 1.0. if [engine] is 0 or is left off entirely, this applies to all engines. otherwise, [engine] indicates the specific engine to be effected.

fm.setboost( <state>, [engine] )

This sets engine boost. <state> is either true, for boost, or false, for no boost. if [engine] is 0 or is left off entirely, this applies to all engines. otherwise, [engine] indicates the specific engine to be effected.

fm.setadi( <state>, [engine] )

This sets engine ADI. <state> is either true, for ADI, or false, for no ADI. if [engine] is 0 or is left off entirely, this applies to all engines. otherwise, [engine] indicates the specific engine to be effected.

fm.setnitro( <state>, [engine] )

This sets engine nitro. <state> is either true, for nitro, or false, for no nitro. if [engine] is 0 or is left off entirely, this applies to all engines. otherwise, [engine] indicates the specific engine to be effected.

fm.setmixture( <level>, [engine] )

This sets engine mixture. <level> is 0 for shutoff, 1 for lean, and 2 for rich. if [engine] is 0 or is left off entirely, this applies to all engines. otherwise, [engine] indicates the specific engine to be effected.

fm.setblower( <setting>, [engine] )

This sets engine blowers. <setting> ranges from 0 to the maximum blower setting for that engine. if [engine] is 0 or is left off entirely, this applies to all engines. otherwise, [engine] indicates the specific engine to be effected.

fm.setautoblower( <state>, [engine] )

This sets engine autoblower. <state> is either true, so that the engine uses the best possible blower setting at all times, or false, for manual control over the blower setting. if [engine] is 0 or is left off entirely, This applies to all engines. otherwise, [engine] indicates the specific engine to be effected.

fm.setrpm( <number>, [engine] )

This sets engine rpm. <number> should range from 0 to the maximum rpm for The engine. if [engine] is 0 or is left off entirely, this applies to all engines. otherwise, [engine] indicates the specific engine to be effected.

fm.setproppitch( <number>, [engine] )

This sets an engine's propeller pitch. <number> should range from the minimum to the maximum pitch angle on the propeller. if [engine] is 0 or is left off entirely, this applies to all engines. otherwise, [engine] indicates the specific engine to be effected.

fm.setcoolingflaps( <number>, [engine] )

This sets engine cooling flaps. <number> should range from 0.0 to 1.0. if [engine] is 0 or is left off entirely, this applies to all engines. otherwise, [engine] indicates the specific engine to be effected.

fm.setautocooling( <state>, [engine] )

This sets engine automatic cooling flaps. <state> is either true, so that the engine controls cooling flap settings on its own, or false, for manual control over the cooling flaps. if [engine] is 0 or is left off entirely, This applies to all engines. otherwise, [engine] indicates the specific engine to be effected.

fm.setfeather( <state>, [engine] )

This sets feathers or unfeathers a propeller. <state> is either true, to feather, or false, to unfeather. if [engine] is 0 or is left off entirely, this applies to all engines. otherwise, [engine] indicates the specific engine to be effected.

Data Reading Functions

The rest of the functions are used to read data from the wind tunnel, rather than to set conditions.

fm.forces()

this returns three numbers: the X, Y and Z axis forces on the aircraft.

fm.moments()

this returns three numbers: the pitch, roll, and yaw axis moments on the aircraft.

fm.accel()

this returns three numbers: the X, Y and Z axis accelerations.

fm.angularaccel()

this returns three numbers: the pitch, roll and yaw axis angular accelerations.

fm.gforce()

this returns three numbers: the lateral G's, acceleration G's, and vertical G's on the aircraft.

fm.mass()

this returns the current mass of the aircraft in kilograms.