Oct 6, 1995 - Gary J Gray and David J Murray-Smith. Centre for Systems and Control &. Dept. Electronics and Electrical Engineering. University of Glasgow.
LOCAL MODEL NETWORK ESTIMATION OF A HELICOPTER ENGINE AND CONTROLLER USING OUTPUT ERROR AND EQUATION ERROR METHODS Gary J Gray and David J Murray-Smith Centre for Systems and Control & Dept. Electronics and Electrical Engineering University of Glasgow 6th October, 1995. Abstract A helicopter engine and speed controller were modelled using a local model network. This is a network of models each of which is valid over some operating range. The network combines the outputs of the model to simulate the complete nonlinear system. The local model parameters τe2 and τe3 are estimated from simulated data generated by simulating the nonlinear system with inputs that excited the complete operating range. The parameters are then estimated using an equation error and an output error method, and then identified both locally and globally. The data sets included data where the scheduling variable (engine torque) was changing rapidly and data where it was changing slowly. The models are estimated with added measurement noise. The technique is found to provide useful information regarding the structure of the system. The output error method is found to work only when the scheduling variable is changing slowly. Introduction A local model network is a set of different models which are actuated according to some input condition. This could be an input or a system state or some other variable. Each model is simulated in parallel and the outputs are multiplied with a basis function and totalled to give the local model network output as in Figure 1. Essentially the basis functions control what happens as the operating point moves from one local model to another. The basis functions are normalised so that the total is always one. 1
f^1 (
)
y^1
2
f^2(
)
y^2
)
P nA
f^nA (
y^
)
y^nA
Figure 1 General architecture of a local model network Each local model has a centre point which defines where the model is most active. A common network type is to have the local models as linear models and to have a different parameter set for each local model. The helicopter main rotor is designed to rotate at a constant speed. This speed is maintained by a control system which has rotor speed as the control input and fuel flow to the engine as its output. Increased fuel flow to the engine causes more torque to be produced, increasing rotor speed. The helicopter engine and controller can be modelled together as a two state dynamic system with two
Page 1
time constants, τe2 and τe3 (equation (1)) that vary according to the engine output torque (Figure 1 and equation (2)).
(1)
(2)
Figure 2 Plot of time constants against engine torque
This nonlinear system can be represented by a linear local model network. The scheduling variable in this case is engine output torque. The local models are the same structure as that in equation (1), but with different values for τe2 and τe3 for each local model. The model network was set up with evenly spaced models across the range of possible values of engine torque each with the time constants set according to equations (2). The simulation results were similar to the results of simulating the nonlinear system (Figure 3). For this investigation, the structure of the model network was fixed and the parameters of the individual local models were estimated. The parameters were estimated using output error and equation error techniques. The local model parameters were estimated globally and locally. Global estimation is where the model network is taken as one model and all the parameters are estimated together. Local estimation is where each local model is identified independently by weighting the estimation with the activation function1. The estimation was also done with and without simulated measurement noise. Simulation To simulate the local model network, each local model is integrated separately over some small time step and at the end of that time step, the output from each local model is multiplied by its activation function and summed to produce the initial conditions for the next small time step. The integration is done using a variable step size fourth order Runge-Kutta algorithm. A program local was written to simulate the nonlinear system and simulate the local model network. MATLAB programs were written to estimate parameters. These programs called the C++ code for the simulations. MATLAB’s data processing features are useful for setting up simulated data and investigation and plotting of results. Figure 3 shows the linear model response of a single model network over the nonlinear model response. The bottom graph shows the basis function, which in this case is one since a linear model can be thought of as a single model network.
Page 2
nonlinear model and linear model
4
torque (scheduling variable)
0.5
x 10
0 −0.5 −1 −1.5 −2 −2.5 −3 −3.5 0
1
2
3
4
5 time
6
7
8
9
10
1
2
3
4
5 time
6
7
8
9
10
2
basis function
1.5
1
0.5
0 0
Figure 3 time response of single linear model network and the nonlinear model Estimation There are two components to estimating a local model network - the structure and the parameters. The structure is the number of local models and their respective centres and widths. The parameters describe the local models themselves. This program estimates the parameters of the local models. It can also be configured to estimate the parameters of the nonlinear model - these being the parameters which describe the dependence of the two time constants, τe2 and τe3, on the engine output torque (equations (1) and (2)). A local model network consisting of six local models was constructed. The parameters of this local model networks were estimated. Simulated data was used. This was generated by creating an input function which covered the complete operating range of the scheduling variable and adding band limited noise to this input signal so that all modes of the system would be excited. A nonlinear simulation was then run and the results stored as the simulated data. Measurement noise could also be added to this data. Two forms were chosen for the basic input function, a ramp and a sawtooth. With the ramp function, the system went from one basis function to another gradually, spending some time in each one. With the sawtooth function, the system response changed quickly. The estimation was done with and without measurement noise and using local and global estimation for each case. For this example, local estimation involved six estimations of two parameters each and global estimation involved one estimation of twelve parameters. Identification Method The parameters were identified in each case using least squares optimisation. Two methods were evaluated; •
Equation error where acceleration data is used and the least square error found using regression techniques on the differential equation describing the system, and,
Page 3
•
Output error where system output data is used and the least square is minimised by a maximum likelihood method.
Equation Error Estimation The system differential equation are (from equation (1)), (3)
(4)
(5) Equation (3) was used for the equation error estimation. Simulated data for x° 0 was generated and the cost function in equation (6) was minimised.
(6)
where z is the RHS of equation (3) and ∼ z∼ is the experimental data. GG is the weighting matrix and N is the number of data points. The cost function was minimised using a Gauss-Newton algorithm. the parameters are adjusted according to (7) where ξL is the parameter vector at iteration number L, and the first and second derivatives are, (8)
(9)
The Cramer-Rao bound represents the uncertainty of the parameter value and is calculated by taking the information matrix, inverting it, and taking the square root of the corresponding diagonal element. That is,
Page 4
(10)
Estimation of the parameters is an iterative process although for this system, convergence was fast. Output error estimation uses a similar method except that the system equations are integrated and the error between data and model output is minimised. The weighting matrix used here was the basis activation function, σ, for the local model estimation and unity for the global estimation.
Page 5
Results Local estimation, output error
Local estimation, equation error
Page 6
Global output error estimation
Local output error estimation
0 −2 1
2
3
4
1
2
3
4
5
6
7
8
9
10
5 6 time (seconds)
7
8
9
10
x 10
0 −2 −4 0
0.5
1
2
3
4
5 6 time(seconds)
7
8
9
10
1
2
3
4
5 6 time(seconds)
7
8
9
10
1
0 0
basis
basis
2 torque (Nm)
torque(Nm)
x 10
−4 0 1
Equation error global estimation, no noise : 25−Aug−95
4
4
2
0.5
0.6
0 0 0.4
0.5 0.2
0 −3.5
−3
−2.5
−2
−1.5 torque(Nm)
−1
−0.5
0
0 −3.5
0.5
4
x 10
0
1
2
3
4
1
2
3
4
5
6
7
8
9
10
5 6 time (seconds)
7
8
9
10
x 10
−2
−1.5 torque (Nm)
0.5
−1
−0.5
0
0.5 4
x 10
0
−5 0
1
2
3
4
5 6 time(seconds)
7
8
9
10
1
2
3
4
5 6 time(seconds)
7
8
9
10
1
0 0
basis
basis
5
−2 −4 0 1
−2.5
equation error global estimation with noise : 25−Aug−95
4
torque (Nm)
torque(Nm)
2
−3
4
x 10
0.5
0.5 0 0
0 −0.5 −3.5
−3
−2.5
−2
−1.5 torque(Nm)
−1
−0.5
0
0.5
1.5
4
x 10
1
1
0.5
0 −1 −3.5
−3
−1.5 torque(Nm)
−1
−0.5
0
0 −3.5
0.5
x 10
1
2
3
4
5 6 time(seconds)
7
8
9
x 10
−2
−1.5 torque (Nm)
−1
−0.5
0
0.5 4
x 10
−2
−4 0
10
1
2
3
4
5 6 time(seconds)
7
8
9
10
1
2
3
4
5 6 time(seconds)
7
8
9
10
1 basis
1 basis
−2.5
equation error global estimation with no noise : 25−Aug−95
4
0
−2
−4 0
−3
4
x 10
torque (Nm)
torque (Nm)
−2
output error global estimation with no noise : 25−Aug−95
4
0
−2.5
0.5
0 0
1
2
3
4
5 6 time(seconds)
7
8
9
0.5
0 0
10
1 0.5 0.5
0 −3.5
−3
−2.5
−2
−1.5 torque (Nm)
0
0 −3.5
0.5
x 10
0
1
2
3
4
5 6 time(seconds)
7
8
9
−2
−1.5 torque (Nm)
−1
−0.5
0
0.5 4
x 10
0
1
2
3
4
5 6 time(seconds)
7
8
9
10
1
2
3
4
5 6 time(seconds)
7
8
9
10
1 basis
basis
x 10
−5 0
10
1
0.5
0 0
−2.5
equation error global estimation with noise : 25−Aug−95
4
5
−2 −4 0
−3
4
x 10
torque (Nm)
torque (Nm)
−0.5
2 : 25−Aug−95
4
2
−1
1
2
3
4
5 6 time(seconds)
7
8
9
0.5
0 0
10
2 0.5 1 0 −1 −3.5
−3
−2.5
−2
−1.5 torque (Nm)
−1
−0.5
0
0 −3.5
0.5 4
x 10
Page 7
−3
−2.5
−2
−1.5 torque (Nm)
−1
−0.5
0
0.5 4
x 10
Estimation of parameters of nonlinear model The four parameters describing the relationship of the time constants and the engine output torque were estimated using a least squares output error method with and without measurement noise. The results were as expected and are given in Table I. The parameters come from equations (11), and are analogous to (2).
with noise
with no noise
g1
0.0323
0.03
b1
0.0991
0.1
g2
0.394
0.4
b2
0.575
0.6
(11)
Discussion Local model learning was investigated with different input shapes for local and global learning with output error and equation error estimation and with and without measurement noise. Input signal shape Some of the simulated data was generated using a ramp as the fundamental shape since this gave a smooth transition between local models as in ?. The local model parameters were also estimated using a sawtooth fundamental for the simulated data. This data covered the same range of values as the ramp, but changes between basis functions more quickly. For equation error local estimation, it appeared not to make much of a difference. For global estimation however, the error margins on the estimates were smaller for the sawtooth. This makes sense because there is obviously more high frequency information in that waveform. For output error estimation, there is little difference dependent on input signal for global estimation. Local estimation however gives inaccurate results for the parameter estimates with the sawtooth input signal. This could be because any one basis function is only active for a small period of continuous time meaning that there is insufficient data to estimate the time constants. Measurement Noise For the output error estimation and the equation error estimation, the addition of measurement noise increased the error bounds of the estimated parameters as would be expected. The estimation still produced reasonable results for both global and local estimation.
Page 8
Equation error v. Output error Generally, the equation error results had a lower error bounds and more accurate results. Especially for the quickly changing input function where output error estimation was not possible. The output error method does have the benefit of the possibility of expansion to a full maximum likelihood method which would be more robust to the measurement and state noise found in real data. Local model estimation v. Global model estimation Generally, the global estimation appears to give the more accurate plot of the structure of the model (i.e. the variation of the time constants with the scheduling variable). In some cases however, the output error method works better with local estimation - especially with noisy data. In the case where the basis function is changing rapidly however, local model estimation was not possible where the record length of individual sections of output multiplied by basis was not long enough to identify the parameters. Conclusions A local model network can give an accurate representation of a nonlinear system using a network of linear models. These models can be physical and plots of the estimated parameters against the scheduling variable(s) can provide structural information about the system. This feature could prove useful in nonlinear system identification problems. The output error method should be more robust against noise than an equation error method and appears to work well so long as the scheduling variable is not changing too quickly. Global estimation solves the problem but introduces other problems to do with the validity of the local model parameters in the context of the local model rather than as part of the network as a whole [1]. Suggestions for Further Work The output error estimation requires sensitivity coefficients to be generated (these are the derivatives of the model network output with respect to parameters in individual local models). These can be used in sensitivity analysis of the local model network providing insight into how the local model parameters affect the output. References
1.
Murray-Smith, R., ’A local model network approach to nonlinear modelling’, Ph.D. thesis, University of Strathclyde, 1994, chapter 3.
Page 9