Simulink Design Optimization
This example shows how to estimate the parameters of an engine throttle.
|On this page…|
The Simulink® model for the system is shown below.
The throttle controls the air mass flow into the intake manifold of an engine. The throttle body contains a butterfly valve that opens when the driver presses down on the accelerator pedal. This lets more air enter the cylinders and causes the engine to produce more torque.
A DC motor controls the opening angle of the butterfly valve. There is also a spring attached to the valve to return it to its closed position when the DC motor is de-energized. The amount of rotation of the valve is limited to approximately 90 degrees. Therefore, if a large command input is applied to the motor, the valve hits the hard stops preventing it from rotating further.
The motor is modeled as a torque gain and a time-delay input with parameters Kt and input_delay. The butterfly valve is modeled as a mass-spring-damper system with parameters J, c and k. This system is augmented with hard stops to limit the valve opening to 90 degrees. We know the model components, however, the parameter values of the system are not known accurately. A look at the response of this system (shown below) shows that it does not match the experimental data; hence the parameters need to be estimated for a better fit.
Double-click the Parameter Estimation GUI with preloaded data block in the model to open a pre-configured estimation GUI session.
A new data set can be created by clicking on the "Transient Data" node and pressing the "New" button in the right-hand-side panel. These data sets can then be used for estimation and/or validation.
We have already defined three data sets. The first one will be used for parameter estimation and the remaining two for validating the response of the Simulink model with the estimated parameters.
These data sets can be imported from various sources including MATLAB® variables, MAT files, Excel® files, or comma-separated-value files. Once we import the data, we can plot them to confirm that we have the right data sets in our estimation project.
The next step is to define the variables for the estimation. This establishes which parameters of the simulation can be adjusted, and any rules governing their values.
The Estimation variables are selected by clicking on the "Variables" node and pressing the "Add" button. This opens a "Parameter Selection Dialog" from which we can select the model parameters that we desire to estimate.
We have already added the four unknown parameters in our model using the selection dialog. These parameters are the butterfly valve inertia, J; the damping coefficient, c; the return spring constant, k; and the time lag in motor response, input_delay.
On the panel to the right of the list of parameters, you can set the initial guesses for the parameter values, and the minimum and maximum bounds on these values.
Since we know from our physical insight that all of these parameters have positive values, we set their lower limits to zero. We also put an upper bound of 0.1 sec on the time delay parameter. We can also select an initial value for the parameters. These may come from some quick calculations of some formulas that determine the parameters.
In order to run an estimation, we first need to create an "Estimation" node. This is done by clicking on the "Estimation" node and pressing the "New" button in the right-hand-side panel.
In our project, we have already created an estimation node called "New Estimation". We can click on this node to set up its various options.
The first panel is where we select the data sets to be used in this estimation. It is possible to use one or more data sets at once in a given estimation. For this model, we will use the data set called "Estimation Data".
The next panel called "Parameters" is where we select which parameters to adjust in this estimation. Even though we selected four parameters, in general, it is not necessary to estimate all of them at once. However, since our model is simple enough we will estimate all four parameters.
Now we are almost ready to start our estimation. However, in order to monitor the progress of the estimation process, we would like to create a number of dynamics plots, called "Views".
Two plot types are created to view the estimation results. The plot below shows the experimental data overlaid with the simulated data. The simulated data come from the model with the estimated parameters. The results of the estimation appear satisfactory as the estimated (blue) curve closely matches the measured results.
We can also view how the parameters changed in the model. The plot below shows the trajectory of the parameters at each iteration of the estimation process. It is shown that the parameters settle to their final values as the estimation process converges to a solution.
It is important to validate the results against other data sets. A successful estimation will not only match the experimental data that was used for estimation, but also the other data sets that were collected in experiments. A validation was already created for this project. Clicking on this validation node will create a measured vs. simulation plot that can be used to compare the simulation response against experimental data.
Using the other two data sets for the validation, we can confirm that our estimation was successful. This shows that the estimation process is robust enough to handle a variety of inputs.
It is therefore shown that the parameters in the model were estimated well to match the experimental data and the estimation was robust enough to be able to validate the model with additional experimental data.
We conclude the validation of the estimated model is an important step in determining how robust the estimation was. We could ask why validate when the estimation data set returned very good results. Without validation of our model, there is no way of telling if the parameters estimated were over fitted for a particular data set. Using additional data sets for validation shows how the model responds to a variety of different inputs and if our original estimation was appropriate.