Добавил:
Upload Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:

Thesis - Beaver simulation

.pdf
Скачиваний:
38
Добавлен:
19.02.2016
Размер:
5.22 Mб
Скачать

Chapter 4. Implementation of the nonlinear

'Beaver' model in SIMULINK.

4.1 Introduction,

The models described in chapter 2 and appendices A to C can now be transferred into a SIMULINKsystem. There are different possible ways to do this. Ref.[25] described how the models can be programmed as a set of MATLABfunctions. This yielded a structure which was quite flexible, but only for experienced users. In this chapter, the systems will be implemented as SIMULINK block-diagrams, which are much faster, more flexible, and more user-friendly than the models from ref.[25]. Adding new output equations, deletingunwanted relations, or changing submodels to implement other aircraft is now really straightforward. In this chapter, the general structure of the models will be outlined. Appendix F gives a detailed description of all blocks from the SIMULINKimplementation. See chapter 6 for some examples which illustrate how to use the SIMULINKmodels in practice.

4.2 Modular structure of the aircraft models.

The dynamics of a n aircraft can be written as a set of nonlinear state equations, which can be derived from basic Newton mechanics and some kinematic relations. In appendix A, this derivation is described in detail; chapter 2 gives a short summary of the resulting equations. It will now be shown how the dynamic model of the aircraft dynamics can be divided into a number of submodels, which, in turn, can be implemented as different blocks in SIMULINK.

There are twelve state equations: three equations for the velocities along the aircraft's body axes (in this report, these expressions have been replaced by equations for the angle of attack, sideslip angle, and true airspeed), three equations for the rotational velocities along the aircraft's body axes, three equations which define the attitude of the aircraft relatively to the earth, and finally, three equations which define the position of the aircraft relatively to the earth. Consequently, there are twelve state variables.

The time-derivatives of the state variables are nonlinear functions of the states themselves and of external forces and moments acting upon the aircraft. The most important contributions to the total forces and moments are caused by aerodynamic influences, the operation of the powerplant (includingslipstream effects), the influence of gravity, and additional terms which must be taken into account in non-steady atmosphere. These contributions can be modelled separately and implemented as separate SIMULINKblocks.

The forces and moments are functions of the state variables and external inputs and/or disturbances, such as deflections of control surfaces, engine power settings, and components of wind and atmospheric turbulence. They also depend upon a number of airdata variables, which, in turn, are functions of some atmospheric properties, such as temperature, air density, and pressure. Besides the equations for the forces and moments themselves, all other equations can be implemented as separate SIMULINKfunction blocks, and the functions which are closely related can be grouped together.

Before examining the implementation of these models in SIMULINK,it is useful to consider the model structure used in the DUT-flightsimulator first. Figure 4-1 shows the sequence of calculations used in this simulator ", see ref.[l9]. A number of subroutines (aircraft module, engine module, ...)have to be called to calculate the time derivatives, i.e., to evaluate the state equations. The time derivatives of the state variables are integrated numerically with integration routines which have been included centrally within the simulation program. Before starting the actual simulations, a numerical trim routine is used to calculate steady-state values of the state and input variables, valid for a flightcondition, which must be specified by the user (airspeed, altitude, flap setting, engine speed). Refs.[G] and [la] describe the structure of this simulation software in more detail.

Figure 4 1 . Modular structure of the DUT-flightsimulator software (sequence of computations).

The figure shows the calculation sequence, used for off-line simulation. I t is necessary to include additional modules todetermine the deflections of the actuators of the motion system, the indications of the cockpit instruments, and the visual system display for on-line piloted flightsimulation.

Chapter 4

61

In ref.[25], it was described how the structure from figure 4-1 can be transferred to a SIMULINKsystem in M-file format. Contrary to the flightsimulator software, the numerical integrators were not included in the model from ref.[25], because SIMULINKitself takes care of the numerical integration. Here, the simulation model will be implemented a s a SIMULINKblock-diagram, which doesn't include numerical integration routines either, because it also uses the built-in SIMULINKintegrators.

The structure of the graphical model still looks a lot like figure 4-1, but it is much more flexible than the Fortran or M-file implementation. The model was implemented by first creating blocks and groups containing closely related sets of equations, and then connecting these elements to eachother, to obtain the complete system. It is not necessary to edit any programs in order to add or delete equations, although it is still possible to include calls to Fortran, C , or Matlab subroutines if very complicated equations are to be implemented. The models from this report have been constructed entirely as block-diagrams!

 

Airdata group

 

 

ua

 

Fa

 

 

 

 

,

 

 

7

 

 

 

ut

 

 

a%c t

.

Engine group

Ft

 

 

 

 

 

I

 

 

 

Gravity forces

 

 

I I

Fwind

 

 

 

 

 

 

Wind forces

 

Fw

 

 

 

6

 

Flightpath

 

a

 

 

 

Y ~ P

 

Time derivatives

 

Y-

 

of U, V, and w

 

 

 

 

 

(output equations!)

 

 

 

 

Sort forces

 

 

 

Accel

 

 

 

Body-axes accelerations

yacc

 

 

and specific forces

 

 

 

w i n d

 

 

 

Figure 4-2. Structure of main level of 'Beaver' model in SIMULINK.

Figure 4-2 shows the global structure of the 'Beaver' models in SIMULINKblockdiagram format. If some additional input and output ports are added to this system, it is possible to connect the nonlinear aircraft model to other systems by means of a SIMULINK-function block (see chapter 3). Figure 4-2 actually shows the second level of the graphical 'Beaver' model; the first level, which only consists of additional input and output ports and a data storage block, will be treated in detail in appendix F.

There are two block types: (i) 'basic' blocks with the blockname displayed in the block itself, and (ii) subsystem blocks, with the name of the subsystem displayed underneath the block. The internal structure of the first block type can't be accessed directly by the user; these blocks behave like black-boxes I). In figure 4-2, the blocks Gravity, Fwind, Flpath, Accel, FMsort, and uvwdot are of type 1.All subsystem blocks (type 2) have been built up from a number of blocks of type 1.The user can zoom in to such subsystems, until the deepest level is reached. In figure 4-2, the blocks Airdata group, Aerodynamics group, Engine group, and Aircraft equations of motion are of type 2. Figures 4-3 to 4-6 show the structure of these submodels. The internal structure of the block State derivatives from figure 4-6, which forms another subsystem to which the user can zoom in further, is shown in figure 4-7.

The blocks Atmosph, Airdatal, Airdata2, Airdata3, Dimless, Aeromod (Beaver), FMdims, Power (Beaver), Engmod (Beaver), xdotcorr (Beaver), Helpfcn, Vabdot, pqrdot, Eulerdot, uvw, and xyHdot are blocks of type 1.The internal structure of all blocks of type 1will be discussed in detail in appendix F. The Integrator and Gain blocks are standard SIMULINKblocks, see appendix E. The Gain block is used to fix certain state variables, for instance to exclude symmetrical or asymmetrical motions, to fix the airspeed arbitrarily, etc.

The following input and output vectors are used (the acronyms, used in the programs, and block-diagrams are shown between brackets):

Inputvectors :

%external inputs for the aerodynamic model (ua)

Ut external inputs for the engine model (ut)

uWindwind velocities and time derivatives of wind velocities, necessary to compute wind forces and the position of the aircraft relatively to the earth (uwind)

Outputvectors:

~Y

,y y y

Y ~ J

atmosphere (-related) variables (j7atm) airdata (-related) variables group 1 b a d l )

airdata (-related) variables group 2 (j7ad2) airdata (-related) variables group 3 (j7ad3) dimensionless body-axes rotational velocities (ydl)

The user only needs to know the definitions of the input and output vectors for these blocks. Since the internal structure has been hidden from the user, it is possible to use the blocks in the same way as standard SIMULINKblocks. This was achieved by applying the 'masky-hnc- tion of SIMULINK,see appendix E. The internal structure of the blocks will be treated in detail in appendix F.

Chapter 4

63

 

engine power and dimensionless pressure increase across the

 

propeller (ypow)

 

aerodynamic force and moment coefficients (Ca)

 

engine force and moment coefficients (Ct)

 

aerodynamic forces and moments (Fa)

 

engine forces and moments (Ft)

 

gravity forces (Fgr)

 

forces due to nonsteady atmosphere (Fw)

Yfi

flightpath variables ('yfp)

Ymc

accelerations and specific forces (yacc)

ybvel

body-axes velocities relatively to the surrounding atmosphere

 

('ybvel)

Other vectors:

xstate vector

xtime derivative of the state vector (xdot)

See appendix F for detailed definitions.

The overall structure of the aircraft model is clearly visible in figure 4-2: the state derivatives are functions of external forces and moments, which have been divided in different categories. Blocks to calculate some atmosphere and airdata variables have been included to compute the forces and moments, and a number of additional airdata variables, flightpath variables, and accelerations have been added as additional output variables.

Atmosph

-

 

 

T

 

 

x

 

 

yatm

B

 

--yad2

 

Airdatal

 

pT ~)

2

yadl

 

1

I

 

Airdata2

, 3

 

+ Airdata3

yad3

Figure 4-3. Structure of the block 'Airdata group'.

I

Aeromod

(Beaver)

ua

Ca

FMdims

yadl

Fa

Figure 4-4. Structure of the block 'Aerodynamics group'.

x

Power

(Beaver)

ut

s

 

 

Engmod

 

(Beaver)

yatm

Ct

 

yadl

FMdims

 

 

Ft

Figure 4-5. Structure of the block 'Engine group'.

Integrator

x

Gain to fix

 

"9

states

State derivatives

uwind

xdot

 

yatm

 

Figure 4-6. Structure of the block 'Aircraft equations of motion'.

alpha dot beta dot

 

 

 

Vabdot

 

 

 

 

 

 

p dot

 

 

 

 

 

I

qdot

(

 

 

 

 

rdot

 

 

 

 

 

pqrdot

 

 

 

 

 

-+isp=

theta dot

 

 

*ybvel

 

 

 

phi dot

 

 

 

 

 

eulerdot

 

 

 

 

Body-axes

 

 

 

-

 

velocities

 

 

 

 

UVW

xe dot

i

 

DeMux

 

 

-

 

 

 

 

ye dot

 

 

B

b--%

 

 

uwind

Time derivatives

 

H dot

 

 

 

 

 

 

 

 

of windspeeds

 

 

xvHdot

 

 

 

excluded...

 

 

 

 

 

Figure 4 7 . Structure of the block 'State derivatives'.

If a part of the aircraft model needs to be changed, most other blocks can remain the same. For instance, removing all 'additional outputs' from this block-diagram can be done within only a few seconds. Adding other outputvariables takes some more time, since a new output-function block must be constructed, but implementing such blocks within this structure shouldn't be too difficult if the definitions of all input and outputvectors are known. Replacing the engine forces and moments model and the aerodynamic model of the 'Beaver' for similar models of other aircraft is also quite simple.

The parameters of the different submodels, such as coefficients for the aerodynamic and engine forces and moments models, have to be defined within the MATLABworkspace, using the M-files MODBUILDand LOADERSee. appendix F for more details.

It is necessary to define the initial values of the state and input variables in the vectors xinco (=x,),uaO (=u,(O)), and utO (=u,(O))in the MATLABworkspace. Normally, states and inputs which yield a certain user-specified steadystate flight condition are used as initial conditions. They need to be calculated before the actual simulation is started, using a numerical aircraft trim routine, similarly to the DUT-flightsimulator calculating sequence shown in figure 4-1.

In appendix E, it will be shown how the steady-state values of the input and state variables can be found numerically. The resulting aircraft trim routine is a n M-file called ACTRIM, which will be treated in section F.2.7 of appendix F. The user can save trimmed flight conditions to MAT-files, so it will not be necessary to recompute the steady-state condition every time a simulation is started.

In order to further integrate linear and nonlinear analysis, it is useful to linearize the aircraft models in several working points. Linearized aircraft models play a very important role in the AACS design and analysis, because the whole linear system theory can be applied to such models. In this report, it will be illustrated that the standard SIMULINKlinearization routine LINMOD can be used for this purpose. The working point is again defined by the values of x and u which yield a steady-state flight condition.

The combination of the nonlinear aircraft model in SIMULINK,the aircraft trim routine, and the linearization tools from SIMULINKmakes it possible to do the whole linear and nonlinear off-line (control-) system analysis in the same working environment. In this way, it is much easier to make the step from linear to nonlinear system analysis, which will encourage the users to do more experiments to analyze the systems, and a t the same time reduce the risk of making errors.

4.3 Adding external disturbances,navigationand approach models, and control loops.

If some additional input and output ports are included in the system shown in figure 4-2, it is possible to implement the nonlinear aircraft model as a subsystem within larger simulation models. In this way, other SIMULINKmodels can be connected to the 'Beaver' model. Examples of such models are: blocks to generate external disturbances and navigation signals (which may be needed for some control loops),control structures, and models of actuators and sensors. To keep the file size within limits, and to ensure a clear, modular structure, it is recommended to implement each model as a separate S-function. Different

Соседние файлы в предмете [НЕСОРТИРОВАННОЕ]