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

Thesis - Beaver simulation

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

Chapter 5

97

Figure 5-11(continued).

(aellaplbl

[Sap] a@ue aseqd

~ W P P / A ~

[8ap] q 8 u e aseqd

Figure 5-12. Control-input Bode plots for longitudinal linearized 'Beaver' model (input signal: 6,)

Chapter 6

101

Chapter 6. Using the nonlinear SIMULINK 'Beaver' model in practice.

6.1 Introduction.

In the preceding chapter, the SIMULINKimplementation of the nonlinear 'Beaver' model, described in chapter 4, was verified by comparing some openloop results with other literature. This chapter will show how these open-loop results were created. It is recommended to read this chapter first before using the 'Beaver' model for other AACS research purposes, because it will illustrate the main principles. It is adviceable to read part I1 of this report too if you want to design and/or analyze AACSs, because there it will be illustrated how the complete 'Beaver' autopilot logic was connected to the 'Beaver' model in SIMULINKIn. appendix F, all models and analytical tools will be shown in detail.

All systems and helpfiles mentioned in this chapter have been stored on a floppy disk which should be included to this report (contact the author a t the address on the cover page if this floppy disk is not included). The systems are contained in the subdirectory EXAMPLES. See appendix H for more information about the directory structure and installation procedure of the models. All model-directories can be added to the MATLABpath by running M0DINIT.M first.

6.2 Creating nonlinear open-loopresponses to deflections of control surfaces engine inputs.

The nonlinear open-loop responses from section 5.3 were created with the system OLOOPI, which is shown in figure 6-1. On the left side of this figure, the input signals are generated. The S-function block which calls the nonlinear 'Beaver' model, is contained in the centre of this figure, and on the right side of the figure, some blocks to visualize outputs and/or send outputs to the MATLABworkspace have been included.

To create open-loop responses to deflections of control surfaces or changes in engine-setting, the user must first define the appropriate input signals. In this case, we wanted to examine block-shaped inputs to the elevator, ailerons, and rudder, and ramp-shaped changes of flap angle, engine speed, and manifold pressure. Block and ramp signals are not included in the standard Sourceslibrary of SIMULINK,but they can easily be created easily with some Step-Fcn blocks and Rate-limiters.

The input signals to the control surfaces and flaps are Muced together, yielding the deviation from the nominal inputvector to the aerodynamic model, Au,. The nominal value ua(0) must be added to get the total value of the aerodynamic inputvector u,. In a similar way, the input signals to the engine are Muced, yielding the deviation from the nominal inputvector to the engine model, A q . The initial value q ( 0 ) is added to get u,. Finally, ua and u, are Muxed together with the wind and turbulence velocities and accelerations, which in this case are zero. The resulting inputvector to the S-function BEAVER thus equals: u = [ uaT:u 0 0 0 0 0 0 ] T.

During the simulation, the time-trajectories of the outputs of the system BEAVER are send to the columns of the table Out in the MATLABworkspace, the inputs are sent to the columns of the table In, and a time-axis is created in the vector time. However, a s explained in section F.2.4 of appendix F, the outputvector from the S-function block is defined differently than the definition of Out, see table F-5. The outputvector from the S-function BEAVER equals:

So the signals which leave the Demux block on the right of the S-function block must have sixteen elements in total. The user can connect other blocks to the sixteen outputs from this Demux block, for instance auto-scaling plotting blocks or Scopes.

Before starting simulations, it is necessary to connect the right input signal(s) to the Mux block (in figure 6-1, only a block-shaped input signal to the elevator is considered; all other signals are generated too, but they are not yet connected to the 'Beaver' model). it is also necessary to load the model parameters into the MATLABworkspace and to define the initial conditions. This can be done by double-clicking blocks no. 2 and 3a or 3b on top of the system OLOOP1. If the datafiles with model parameters AEROMOD.MAT, AIRCRAFT.MAT, and ENGMOD.MAT are not present in the model directories, they can be generated by clicking block no.1 on top of the system. Finally, it may be useful to fix some state variables, which can be done by clicking block no. 4 on top of the system.

Step no.

Action

1Connect the required input block(s) to the M u blocks on the left side of the system.

2Load model parameters into the MATLABworkspace (click block 2 and if necessary block 1).

3Define initial conditions xinco, uaO,and utO in the MATLAB workspace (click block 3a or 3b, or define these vectors manually).

4If it is necessary to fur some states, click block 4.

5Set simulation options, and start simulation. Use a Scope or plot block if you want to visualize signals during simulation.

6The results of the simulation are stored in the columns of the tables I n and Out, and a time-axis is stored in the vector time in the MATLABworkspace. The results can be saved, plotted, used for other calculations, etc.

Table 6-1.Steps to be taken to simulate the system from figure 6-1.

Chapter 6

103

Block 3a calls the aircraft trim routine ACTRIM.M, and block 3b calls the load routine INCOLOAD.M (see appendix F.2.7),which can be used to load initial conditions from a MAT-file, which should contain the variables uaO = ua(0), utO = u,(O), and the initial value of the state vector xinco = x(0). Of course, it is also possible to create these vectors manually in the MATLABworkspace.

Table 6-1summarizes the steps which must be taken when performing simulations with the system OLOOPl from figure 6-1. Only if the user is not satisfied with the definitions of the input and outputvectors, it is necessary to change the system BEAVER (see appendix F). For the simulation of this system, the integrators ADAMS 1GEAR are best suited, even though they have starting difficulties due to the step-inputs. These integrators give accurate results for a n error tolerance of 10'~Use. RK45 or RK23 with a n error tolerance of lom7if the simulation spans a small time-interval, or if input signals with many large discontinuities are created.

6.3 Creating linear open-loop responses to deflections of control surfaces and engine inputs.

The system OLOOPI-L from figure 6-2 looks similar to the system OLOOPl from figure 6-1, but it uses a linear aircraft model in stead of the nonlinear aircraft model BEAVER. The same input signals as in OLOOPl are generated and M w e d on the left of the system. However, in this case, it is not necessary to add the initial values of the inputvectors ua and u,to these inputsignals, because the linearized aircraft model is a small-perturbation model, which expresses all inputs, outputs, and state variables a s deviations from their nominal values.

Before starting a simulation of OLOOPl L, it is necessary to define the linear state-space matrices Abeav, Bbeav, be& and Dbeau in the MATLABworkspace. This can be done by clicking block 5a on top of the system (in that case, the state-space matrices will be loaded from a MAT-file),by manually defining the matrices (which is not recommendable, because they are quite large), or by using block 5 to linearize the system in the working point, defined by the initial conditions xinco, u d , and utO.

When using block 5, the parameters of the 'Beaver' model need to be loaded to the MATLABworkspace first by clicking block no. 2. If SIMULINKcan't find the datafiles AEROMOD.MAT, ENGMOD.MAT, and ATRCRAFT.MAT, use block 1 to create them. It is also necessary to define the initial conditions xinco, uaO, and utO in the MATLABworkspace by clickingblock 4 to trim the aircraft model or block 4a to load the initial conditions from a MAT-file before starting the linearization process. Use block 3 if you want to fix some states to their initial values (use this block before linearizing!). Table 6-2 summarizes the steps which should be taken when simulatingthe system OLOOPI-L from figure 6-2.

Note that in this case, the matrices In and Out and the time-axis time will not be generated in the MATLABworkspace, because those variables were sent to the workspace internally within the nonlinear aircraft model BEAVER! In stead, three new To Workspace blocks have been included in the system OLOOP1-L to send the time-trajectories of the inputs and outputs to the columns of the matrices yin and yout, respectively. A time-axis is created too,

Step no.

Action

1Connect the required input signal(s) to the M u block on the left side of the system

2Load the state-space matrices into the MATLABworkspace from file (click block 4a),

or:

2a Load model parameters into the MATLABworkspace from file (click block 2 and if the datafiles don't exist yet, click block 1).

2b Define initial conditions xinco, u d , and utO, by typing them in, loading them from file (click block 3a), or by trimming the aircraft model (click block 3).

2c Linearize the aircraft model in the workpoint, defined by xinco, uaO, and utO (click block 4).

3Set simulation options and start simulation. Use a Scope block to visualize the input or output signals during simulation.

4After simulating, a time-axis has been stored in the vector t in the MATLABworkspace, the time-trajectories of the input variables are stored in the matrix yin, and the time-trajec- tories of the outputs are stored in the matrix yout (see table F-5 for definitions of the S-function inputs and outputs).

Table 6-2. Steps to be taken to simulate the system from figure 6-2.

in the vector t. Table F-5 of appendix F gives the definition of the S-function inputs and outputs, which correspond with the inputs and outputs yin and yout, used by the linearized aircraft model. Note: the time-trajectories ofx, and ye, computed with the linear state-space model are inaccurate, so the linear model is not suitable for navigation purposes (see chapter 5)!

The SIMULINKintegrator LINSIM is perfectly suited for the simulation of this linear system. It gives accurate results if the error tolerance is set to

If other, nonlinear system dynamics are added to the system, use RK45 with an accuracy of lo-' or ADAMSIGEAR with a n accuracy of 10'~It. might be necessary to use smaller values of the error-tolerance for some purposes.

6.4 Creating nonlinearopen-loopresponses to atmospheric turbulence.

Figure 6-3 shows the system OLOOP2, which was used to create the open-loop responses to atmospheric turbulence, shown in chapter 5. The system is equal to the system from figure 6-1, but this time no external inputs to the control

I

Chapter 6

105

surfaces and engine have been given, except for the initial (trimmed) values of the input vectors u, and q.

The turbulence inputs are generated with the blocks UDRYDI, VDRYDI, and WDRYDI, which will be described in section F.3 of appendix F. These blocks generate turbulence velocities and their time-derivatives according to the Dryden turbulence models, see appendix B. The user must specify the scale lengths L, , L, ,and L, ,the standard deviations a, , a,#,and a, ,and the mean veloGty. Although t h e coefficients of the ~ r ~ dfiltersg actually depend upon the airspeed, this dependence is neglected here, because the speed-range of the 'Beaver' is quite limited. In section F.3 it is shown how Dryden filters with varying coefficients can be implemented in SIMULINK(giving the blocks UDRYDZ, VDRYDZ, and WDRYDZ). In practice, the filters with constant coefficients will give satisfying results, see section F.3.

Before starting simulations of OLOOP2, the model parameters must be loaded into the MATLABworkspace, and the initial conditions xinco, u d ,and utO must be defined. Also, it might be useful to neglect some of the aircraft dynamics, by fixing some states to their initial values. The same system initialization blocks as in figure 6-1 have been used here, so the actions, listed in table 6-1 are still valid (only this time, atmospheric disturbances are used as inputs in stead of inputs to the engine and/or control surfaces).

The minimum stepsize must be limited to a value which is not too small, because otherwise, the simulations will become very slow. This is caused by the white noise input, which is actually a discrete signal which changes in every time-step taken by the integration method. The plots from chapter 5 were created with a minimum time-step of 0.02 seconds. In this case, the only suitable integration method is RK45 (or alternatively RK23), because the other integrators work efficiently for smooth signals only.

6.5 Linearization of the aircraft model and applicationsfor the linear model.

In the system OLOOP1-L from figure 6-2, block 4 was used to linearize the aircraft model in the workpoint, defined by the state vector xinco and the input vectors u d and utO. The resulting linear aircraft model is obtained directly by applying the SIMULINKroutine LINMOD to the system BEAVER, which yields a linear state-space model which uses the small-perturbation versions of the input and state variables of the system BEAVER. Block 4 is therefore called Tiny linearization of Beaver model, implying that the linear model is obtained directly with the command LINMOD. However, sometimes it may be more convenient to derive separate models for the longitudinal and lateral motions of the aircraft, for which reason, a more sophisticated linearization routine, called ACLIN, has been developed. See appendix F.2.7 for details of both the in.and the Full-blown linearization options.

In chapter 5, the routine ACLIN has been used to extract some characteristics of the open-loop motions of the 'Beaver'. To do so, the flight-condition of the aircraft had to be defined first by applying the aircraft trim routine ACTRIM (this time starting from the MATLABcommand-line by typing a c t r i m ) and then applying ACLIN itself (by typing a c l i n ) .

, B,,

First the symmetrical state-space models were derived, neglecting the longitu- dinal-lateral cross-coupling (option 1in the Fix States menu). After linearization, separate models for longitudinal and lateral aircraft dynamics were created (answer Y to the respective question), without taking into account the engine inputs and atmospheric disturbances. The resulting symmetrical state matrices A, and B, have been listed in table 5-2.

The same procedure was followed once again to derive the asymmetrical state model, this time using option 2 in the Fix States menu. This yielded the asymmetrical state model A,, from table 5-2. Applying the eig command of MATLAB,the eigenvalues of the systems were obtained, from which a number of characteristic quantities for the open-loop motions could easily be derived. The results of this basic open-loop system analysis have been listed in table 5-3.

Finally, the longitudinal linear aircraft model was used to create the Bode-plots from figure 5-12, using the MATLABcommands bode and logspace as follows:

Here, the Bode-plots were created for the first input signal, which in this case was a,, and the outputs were V, a, q, and 0. When linearizing with ACLIN, it will always be specified which definitions of input and output vectors are used.

6,6Conclusions,

In this chapter, the practical use of the SIMULINK'Beaver' model has been illustrated by analyzing the systems, used for open-loopanalysis of the 'Beaver' in chapter 5. The nonlinear model can be trimmed and linearized fully within the M.ATLAB/~IMULINKenvironment, so it is never necessary to move to another computer platform during the offline analysis " of the aircraft. Here, only open-loop analysis of the 'Beaver' was treated, but closing the loops in SIMULINKis really straightforward. In part I1 of this report, the control laws of the 'Beaver' autopilot will be implemented in SIMULINKand connected to the nonlinear 'Beaver' model in a similar way as the open-loop input signals shown in this chapter.

On-line analysis covers piloted simulation in a real-time flightsimulator, off-line analysis covers the whole system identification, design, and analysis, which doesn't need to be done in real-time, and which doesn't require pilot-in-the-loopsimulations.

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