Skip to Main Content Skip to Search
Home |   Select Country  Choose Country  |  Contact Us  |  Cart Store 
Create Account | Log In
Products & Services Industries Academia Support User Community Company

 

Newsletters - MATLAB News & Notes

Fitting a Statistical Model to Test Engine Data

by Chris Hayhurst

Lookup tables in engine controllers have historically been calibrated directly from test data, forcing engine tests to be run at most or all operating points in order to achieve a full calibration. As engines are becoming more complicated, the number of input variables increases and the number of tests required grows exponentially. At the same time there is pressure to test and calibrate engines in less time, using fewer prototypes and making better reuse of testing effort in subsequent programs.

It is possible instead to use design-of-experiment techniques to plan a reduced engine test, fit statistical models to the results, and then use those models to perform analytical rather than experimental calibration.

The Model-Based Calibration Toolbox provides a clear process from test planning to analytical calibration.

In order to rely on models for the calibration stage, the models themselves must be capable of fitting complex engine responses and incorporating constraint information and measures of validity.

Example: Modeling the Torque Response of an Automotive Engine

This article illustrates how the process introduced above is used in the production of a "two-stage" (local and global) statistical model based on a set of torque measurements from a specifically-designed engine test.

The Model-Based Calibration Toolbox design-of-experiment editor produces a candidate set of test points, constrained to a region in which the engine is capable of operating. Click on image to see enlarged view.
A plot showing engine torque recorded over a sweep of spark advance angle for a selection of operating points of the remaining input variables. Click on image to see enlarged view.
A view, generated by the Model-Based Calibration Toolbox, of the two-stage model structure showing how the data is going to be fitted. Click on image to see enlarged view.

Planning the Test

Data is often acquired in a structured way; here, holding all input variables fixed except for one local input variable-in this case a sweep of spark advance angle. To preserve as much statistical information as possible the structure of the testing should be taken into account during the model fitting. The two-stage modeling approach is a technique taken from the pharmaceutical industry that can capture the structure of measured data locally and globally. In the local stage, torque is modeled against spark advance. The global stage extends the model over the global variables: engine load, speed, and air-fuel ratio. The model output is reconstructed from the combination of the local and global stages.

Fitting the Model

Once the data is imported into the toolbox and the model structure decided, the two-stage model is fitted automatically and becomes available for analysis. For this particular engine response, the data typically has two distinct regions on either side of the maximum recorded torque. This shape of response is hard to fit with a single polynomial type curve unless a high order is used. A polynomial spline is selected from the available model types to fit this behavior. This curve type has two polynomials joined in a continuous way at a 'knot' and allows many fewer coefficients to be used to fit data that has two or more distinct regions.

Tools are provided for automatically or manually identifying outliers, (anomalous data points). The plot shows a fit to a local spark sweep (lower graph) with one point automatically flagged as an outlier based on the statistical measure of studentized residuals.

The lower plot shows a good curve fit using the polynomial spline. The upper plot shows the very high residuals for the last point, explaining why this point has been automatically identified as an outlier (red circle). Click on image to see enlarged view.

When a type of curve, such as this polynomial spline, is heuristically fitted to data, the coefficients of the curve are not always physically meaningful. The Model-Based Calibration Toolbox lets you pick an equivalent number of curve parameters, or 'response features' that do have physical meaning. In this case, two of the four parameters chosen are the maximum torque and the spark value at maximum torque. The red dot on the lower plot shows the maximum point, which is also where the spline knot has been placed.

Extending the model fit over the other three input parameters (engine speed, load, and air-fuel ratio) involves fitting other models to the way the local response features, such as maximum torque, vary, so that

Maximum torque = f (speed, load, air-fuel ratio)

These response feature models are also fitted automatically, but the user has control over the model type used and the way in which the fit is performed, as shown in the local model case.

The overall torque model is reconstructed from the local and the global models together.

Torque = f (spark, speed, load, air-fuel ratio)

This model can now be used as a prediction of torque that can be evaluated at thousands of operating points in a few seconds, instead of a few minutes for one point testing of a physical engine. This opens the door for analytical calibration, in which large numbers of evaluations are required to determine the optimum settings for the engine under any driving condition.

The last stage in the modeling exercise is to export the model to a form in which it can be evaluated. The exported model has three outputs available:

  • The response being modeled: Torque = f (spark, speed, load, air-fuel ratio)
  • The prediction error to assess the accuracy of prediction
  • A logical constraint output: the operating point inside or outside the viable operating region of the engine

You can export the model to MATLAB, for use in a script, or to Simulink, for a part of a larger vehicle model. From a Simulink representation of the model, you can use MathWorks tools for code generation to place the model into a real-time hardware-in-the-loop test.

The reconstructed model (green) is compared to the local curve (blue dots) to assess the fit. Click on image to see enlarged view.
The overall model can now be evaluated anywhere within the engine's operating envelope. This plot shows a range of engine speed and air fuel ratio, The surface is colored by 'Prediction Error', showing that at high load and high speed the model is unreliable (red). Click on image to see enlarged view.

Simulink block produced by exporting a model from the Model-Based Calibration Toolbox showing the extra information provided in addition to the torque output.

Further Reading

  • Model-Based Calibration Toolbox Model Browser User Guide
    Technical Documents: Two-Stage Models for Engines
  • Holliday, T., Lawrance, A. J., Davis, T. P.,
    Engine-Mapping Experiments: A Two-Stage Regression Approach, Technometrics, 1998, Vol. 40, pp 120-126.
  • For more information on the Model-Based Calibration Toolbox visit
    www.mathworks.com/products/mbc/

Next Article

Contact sales
E-mail this page
Print this page
Subscribe to newsletters