Towards Gaussian Process Models of Complex Rotorcraft Dynamics - Final
Towards Gaussian Process Models of Complex Rotorcraft Dynamics - Final
Presented at the AHS International 74th Annual Forum & Inm Elements of identity matrix (II )
Technology Display, Phoenix, Arizona, USA, May 14–17, 2018.
Copyright c 2018 by AHS International, Inc. All rights reserved. k Kernel Function
1
n Time step approach ensures that the ‘black box’ (machine-learnt) model
will step-in only when the simplified physical-law model de-
R Number of Monte Carlo runs viates from the ideal. In the current study, as a preliminary
step towards this goal, the authors aim to develop and vali-
v Generic system input
date a black box model using machine learning methods that
y∗ Prediction from the Gaussian Process given x ∗ can emulate the dynamic behaviour of a rotorcraft. Crucially,
the methods used are probabilistic and are therefore able to
capture the uncertainties associated with such an approach.
INTRODUCTION
In this paper, machine learning is used to create a Gaussian
Flight simulators are a vital part of the aircraft life cycle. They process (GP) non-linear autoregressive model that predicts
are used in design and development phases, testing and qual- pitch, roll and yaw rate of the Bo105 helicopter trained only
ification activities as well as in training and research (Ref. 1, upon a longitudinal cyclic input. The autoregressive model
2). Due to their availability and cost compared to the corre- makes a prediction using the longitudinal cyclic position as
sponding real actual aircraft, their use continues to increase. well as previous observations of the relevant output.
Simulators can also help to address the increased demand for
new pilots, who are needed to replace the current ageing popu- The Gaussian process model for pitch, roll and yaw rate
lation of pilots. Moreover, the military is increasing the use of are compared to physical law based models, which are im-
simulators for mission rehearsal in land, sea and air contexts. plemented using Advanced Rotorcraft Technology’s (ART)
FLIGHTLAB software (Ref. 9). The comparison provides
The heart of any flight simulation facility is the flight dynam-
an excellent basis for future work where our approach will
ics model. Techniques to design and develop such models
predict model error.
are well known and documented (Ref. 3, 4). However, there
is a requirement for the entire simulation system to run in
real-time and this can lead to simplifications to the underlying NUMERICAL METHODS
physics having to be made, particularly for more complex air-
craft such as rotorcraft. These simplifications that are applied Gaussian Processes
mean that the flight model cannot necessarily capture all of the
complex dynamics that would be present during the equivalent
real scenario. They can lead to significant differences between Gaussian Processes (GPs) have been widely used in recent
the model and the real aircraft. These differences can, in the years for many different applications. In the current work,
worst case, have a negative impact, for example, on training GPs are used to perform regression (they can also perform
for the crew using the simulator. other tasks such as classification (Ref. 10)). An advantageous
property of GPs is that they can be used to quantify the un-
The quality of the flight dynamics model speaks to the ‘fi- certainties in one’s predictions which, here, produces a worst
delity’ of the simulation device. The ‘engineering fidelity’ of case scenario given the model uncertainty. This property of
such a device is typically measured using a series of quan- being able to quantify errors is useful. For example, in the
titative requirements contained within simulator qualification current context whereby the authors wish to extend the work
documents such as (Ref. 5, 6). It is recognized that examining to predict model error, GPs could be used to quantify the
the response of the simulator in this way only partially serves uncertainties involved in capturing the discrepancies between
to characterize its utility. While efforts are underway to seek physical-law based simulators and reality. Another beneficial
methods that can better meet this need (Ref. 7), this paper property of GPs is that, once trained, they can produce
seeks to explore techniques whereby the accuracy of the flight very fast emulators of complex models - this is beneficial
dynamics element of the simulation device can be improved, when dealing with non-linear behaviour such as helicopter
even when the modelled physics can no longer accurately rep- dynamics.
resent the situation.
The aim, then, of the research presented in this paper, was to
(start to) develop simulation methods that can more accurately
capture the complex dynamics of rotorcraft, while still being Linear Regression To aid the understanding of the Gaussian
able to be run in real-time. The research is based on the hy- process, consider a model which is defined as a linear combi-
pothesis that current flight dynamics models can be improved nation of fixed basis functions (Ref. 10, 11):
using machine learning; data-based models that, once trained,
can predict the model error 1 that is present in current simula- f (xx) = w T φ (xx) (1)
tors. This approach aims to generate a ‘grey box’ model that
combines physical-law based simulations (i.e. ‘white box’) where x is the input vector, w is a vector of parameters to be
with data based simulations (i.e. ‘black box’). The ‘grey box’ identified, φ is a vector of ‘basis functions’ and f is a latent
function. One can choose the prior distribution over w to be:
1 Model error captures the inaccuracy of the physical law based model
compared to that of the flight test data. For more information on model error
see the study by Kennedy and O’Hagan (Ref. 8) p(w w | 0 , γ −1 I )
w) = N (w (2)
2
where γ is the precision of the distribution, and I is an iden- discussed in a later Section).
tity matrix. The function values are given by vector f :
f (xx1 )
The distribution over y , conditional on f , is given by:
f (xx2 )
f = .
(3) p(yy | f ) = N (yy | f , β −1 I ). (11)
..
f (xxN ) The marginal distribution of y is defined as:
Z
where N is the number of of training points. Using equation p(yy) = p(yy | f )p( f )d f (12)
(1), the vector f is given by:
where Φ is a design matrix (for more information see Bishop p(yy) = p(yy | 0 ,C
C) (13)
(Ref. 10)) . Given the prior (equation (2)), one can then show
that f is Gaussian, with mean and covariance matrix: where the elements of C are given by:
w] = 0
E[ f ] = Φ E[w (5) Cnm = C(xxn , x m ) = k(xxn , x m ) + β −1 Inm (14)
The kernel chosen for the current study was used by Higdon One step ahead predictions (OSAP) use the previously ob-
et al (Ref. 12). The kernel takes the form of: served data to predict a single step into the future. Using GP
N to represent the prediction made by a Gaussian Process then,
i i 2)
k(xxn , x m ) = ∏ α (4(xxn −xxm ) (21) in our specific case, a OSAP is defined as:
i
y∗n = GP (δnx , yn−1 ) (25)
where x i is used to represent the ith element of the vector x .
The kernel of equation (21) allows the hyperparameter (α) to where yn−1 is the previous observation of the relevant quantity
always be between zero and one. This is beneficial when us- (i.e. roll, pitch or yaw). During ‘training’ of the GP, OSAP
ing a property of GPs that allows the relevance of inputs to are used to quantify the fidelity of the emulator. The obvious
be determined (known as ‘Automatic Relevance Determina- disadvantage of this approach is that the resulting model can
tion’). The relevance property is not explored in the present only predict a single step into the future. Predicting further
paper, however it is of future interest for the authors. into the future requires ‘full model predictions’.
58
Simulated Annealing Simulated annealing is a form of Fig. 1: 3-2-1-1 Longitudinal stick input
MCMC which uses MA. The difference is that the method
slowly increases the influence of the likelihood, via a variable
ζ (Ref. 20). Increasing the influence of the likelihood Using the theory, cited in the previous Section, a GP model
increases the influence of the data and this assists algorithm was also created to predict the Bo105 pitch, roll and yaw rates
convergence. As with the MA, a prior is chosen to generate from the 3-2-1-1 longitudinal cyclic input. We note that, here,
a candidate hyperparameter θ (s) , a small initial value of ζ the GP models do not use all of the available training data..
is also chosen. For each ζ value, a full run of the MA is The GPs only use 32 ‘training’ points from Figure 1, which
conducted using a user-defined number of samples. The rate are denoted by diamonds. All three GP models (pitch, roll and
at which ζ is increased is called the annealing schedule. yaw) are compared to the Bo105 flight model predictions and
In the current paper an adaptive annealing schedule is used the flight test data in the following sections.
to ensure constant change in Shannon entropy of the target
distribution (Ref. 20). The optimisation stops when ζ reaches
Pitch Rate
one, in which case the whole likelihood has been introduced.
The pitch rate response is investigated first. Figure 2 shows
The advantage of using this method over the standard MA is the OSAP predictions made by the GP. As was discussed pre-
that is it easier to tune and often demonstrates better conver- viously, it would be expected that the predictions are very
gence, as the proposal width is being updated after each run close the Bo105 flight test data. The RMS error between the
of the MA. GP model and the Flight Test data is 0.0012.
5
a Gaussian. In the case of FMP, the predictions have come
0.15
from a mixture of Gaussian’s.. Another possible reason is that
0.1
the GP assume the likelihood is also a Gaussian, this may not
0.05
be the case for a real system such as the Bo105 helicopter. For
Pitch Rate (rad/s)
0
more information on non Gaussian likelihoods see the study
-0.05 by Saul et al. (Ref. 21).
-0.1
-0.1
-0.15
Figure 3 shows the predicted helicopter response from the Confidence bounds
Flight Test data
FMP. This is a better test of the GP model. It is clear to see -0.2 GP Model
Training Points
that the predictions are not as accurate as for the OSAP model. -0.25
0 1 2 3 4 5 6 7 8
However, this is to be expected given that, for this model, the Time (s)
0.1
0.05
Pitch Rate (rad/s)
-0.05
-0.1
0.1
Pitch Rate (rad/s)
-0.1
-0.2
Confidence bound
Flight Test data
-0.3
FLIGHTLAB Model
GP Model
-0.4
0 1 2 3 4 5 6 7 8
Time (s)
Fig. 5: Comparison of the pitch rate response of the real helicopter to the FLIGHTLAB and GP model
-0.2
-0.3
Table 1: RMSE of the predictions of pitch rate for the GP and
FLIGHTLAB models compared to the flight test data of the -0.4
Roll Rate
-0.1
Confidence bounds
-0.2 Flight Test data
GP Model
Training Points
-0.3
0 1 2 3 4 5 6 7 8
Yaw Rate
Time (s)
0.1
Roll Rate (rad/s)
-0.1
Confidence Bounds
-0.2 Flight Test data
FLIGHTLAB Model
GP Model
-0.3
0 1 2 3 4 5 6 7 8
Time (s)
Fig. 10: Comparison of the roll rate response of the real helicopter to the FLIGHTLAB and GP model
0.2
The comparison of the GP model for the prediction of yaw rate
Confidence bounds
Flight Test data
to the FLIGHTLAB model and the Bo105 helicopter data is
0.15 GP Model
Training Points
shown in Figure 13. Both models make quite poor predictions
0.1 overall with the FLIGHTLAB model over predicting the yaw
Yaw Rate (rad/s)
-0.1
Prediction of yaw rate, corresponding to Figure 13
-0.15
0 1 2 3 4 5 6 7 8
Model RMSE
Time (s) Gaussian Process 0.043
FLIGHTLAB Model 0.052
Fig. 11: Gaussian process full model yaw rate predictions
with incorporated hyperparameter uncertainty from the sim-
Table 4: RMSE of the predictions of yaw rate for the GP and
ulated annealing results
FLIGHTLAB models compared to the flight test data of the
Bo105.
The accepted samples of the GP model for yaw rate are shown
in Figure 9. The accepted samples are used in the hyperpa-
rameter uncertainty.
DISCUSSION
This investigation has presented some early results relating to
the potential use of Gaussian Process models to the applica-
tion of real-time helicopter response prediction. The on-axis
predictions of Figures 5 and 7 show promise for the methods.
The method works well on the data that it was trained on, as
might be expected. However, it also works well on unseen
data. The slightly surprising result is how well the GP model
works for off-axis response rates. In this regard, the GP model
performed no less well than the physics-based FLIGHTLAB
model and, in a global sense at least, introduced a lower over-
all magnitude of error into the response. That said, the GP
Fig. 12: Yaw rate Simulated annealing results models do not yet predict the finer points of the responses
9
0.2
Confidence Bounds
0.15 Flight Test data
FLIGHTLAB Model
GP Model
0.1
Yaw Rate (rad/s)
0.05
-0.05
-0.1
-0.15
0 1 2 3 4 5 6 7 8
Time (s)
Fig. 13: Comparison of the yaw rate response of the real helicopter to the FLIGHTLAB and GP model
shown in the flight test data. It is hoped that this might be im- FUTURE WORK
proved when the models are trained using lateral and rudder
pedal response data. As noted above, the on-axis predictions from the GP model
are very good, the off-axis predictions less so. It is anticipated
Where this method shows promise is in its ability to indicate
that the prediction of roll and yaw rate could be improved by
estimates of the uncertainty in its predictions. A key advan-
incorporating other inputs into the NARX structure, i.e. re-
tage over GPs relative to other methods, is that GPs can pro-
sponse data from flight test points that use lateral cyclic and
vide confidence bounds on their predictions. It can be seen
rudder pedal position. This will form an early part of the fu-
from Figures 5 and 13 that the level of confidence in the
ture work.
pitch rate prediction is higher than the yaw rate, for exam-
ple, as might be expected from the source of the training data. As this work is only a preliminary step towards the author’s
This ability to provide the degree of uncertainty might, in the main aim which is the prediction of model error, this would
longer term, be able to inform differences in, for example, pi- be one of the next steps. Further future work would include
lot opinion or workload/handling qualities rating between the implementing our data-based model into e.g. FLIGHTLAB
real vehicle and simulator experiments. software for simulations purposes.
The GP was only trained on a limited amount of data; these
CONCLUSION training points were chosen by selecting every 25th point. One
of the problems associated with GPs is their computational
Gaussian Process models, using only a small amount of
cost of training (O(N 3 ), where N is the number of training
training data, can produce excellent predictions of on-axis
points). It is therefore beneficial to choose a subset of the
longitudinal helicopter response data. In both a qualitative
available data to use for training. A method called ‘sparse
and quantitative sense (lower RMSE), the GP-predicted
Gaussian Processes’ (Ref. 22) can be used on the training
responses are an improvement on a physics-based model
data to automatically select points which are more ‘informa-
developed for real-time operation. The GPs also produce, to
tion rich’. A useful property of GPs is that they can determine
some degree, ‘better’ predictions for the off-axis responses
the relative relevance of the input data; this information can be
of roll and yaw rate using training data based only upon
used to analyse whether or not the correct NARX structure has
longitudinal axis inputs. The results shown in the paper
been used. This property could be utilized to establish which
provide an excellent basis for the prediction of model error in
other helicopter inputs to the NARX structure should be in-
future work.
cluded to improve the accuracy of the predicted response.