Skip to Main Content Skip to Search
Product Documentation

MBT Spark Estimator Problem

What Is an Estimator?

The cam timings optimization results solved a control problem. You can also use CAGE to calibrate estimator problems. Here you will use an MBT model to produce a spark estimator feature which estimates MBT spark when each cam is on or off, using the cam timings found by the optimization.

View the Feature

  1. Select File > Open Project and load the example project, Gasoline_optimization.cag from the mbctraining directory.

  2. Click Feature in the Processes pane to go to the Feature view.

    The features Exhaust_CAM, Intake_CAM, and MBT_Spark are in the Feature tree. The MBT_Start_Feature was used to provide initial values for the optimization, as described in Defining Variable Values.

  3. Select MBT_Spark and view the strategy by selecting Feature > Graphical Strategy Editor.

  4. Examine the strategy model. Observe the Multiport Switch block which switches between MBT tables depending on whether each cam is on or off. The variables Intake_On and Exhaust_On are used to define whether cams are parked or not. All the MBT tables (with and without cams) share the same speed (N) and load (L) normalizers.

    If you wanted to import this strategy model, you would double-click the MBC_Spark blue outport to parse the strategy into CAGE. This strategy has already been imported into this project so just close the model window.

  5. Expand the MBT_Spark feature in the tree to see the MBT tables that have been created by importing the strategy: MBT_Base, MBT_Intake, MBT_Exhaust, and MBT_Dual. These tables share the same normalizers in speed and load.

  6. Similarly view the strategies for the Exhaust and Intake CAM features. These features switch between parked cams and active cams depending on the threshold value. The CAM features define the cam inputs and switch between the optimal CAM tables (from the optimization results) and the parked values. You can use the linking functionality in the Feature Filling Wizard to connect features and tables to models.

View Variables

You need some variables and constants to define when the cams are parked so the strategy can switch between optimal cam timings and parked cams at a threshold value.

View how this is done:

  1. Click Variable Dictionary in the Data Objects pane to switch to the Variable Dictionary view.

  2. Click to select the new variable Exhaust_On.

  3. Observe the Minimum is 0 and the Maximum is 1.

  4. The variable Intake_On has the same values.

Also two constants define the parked cam positions:

  1. Select Exhaust_Parked.

  2. Observe the Set Point of this constant is 0.

  3. Select Intake_Parked; this has a Set Point of 0.

Edit and Import Boundary Model

To edit the boundary model and import it to CAGE,

  1. Open the Model Browser (enter mbcmodel at the MATLAB command line).

  2. Load the example project. Select File > Open Project, locate and select Gasoline_project.mat in the mbctraining directory.

  3. Select the DIVCP test plan node in the tree.

  4. Select TestPlan > Boundary Constraints (or click Edit boundary constraint in the toolbar).

    The Boundary Editor opens.

  5. Select the Star shaped constraint in the tree, and click Remove boundary model from best in the toolbar. You need only Star shaped(N, L) in the collection of best boundary models.

  6. Close the Boundary Editor. In the Model Browser, observe the single constraint Global/Star shaped(N, L) listed under Boundary Model in the right information pane.

  7. Return to CAGE and select File > Import From Project.

    The CAGE Import Tool appears. You can import directly from the Model Browser when it is open, and the CAGE Import Tool automatically displays the available items.

  8. Select knot (the datum model) from the list.

  9. Click the Import Selected Items button.

  10. The Import dialog opens displaying the model you selected for import. Double-click the CAGE Model Name column cell to edit the name to MBTwithSpeedLoadBoundary, and click OK to import the model.

Use the Feature Fill Wizard

You can use the Feature Fill Wizard to fill and optimize the values in tables by reference to the model. You can fill multiple tables at once using the wizard, and you can Fill from the top feature node or from any table node in a feature.

  1. Click Feature in the Processes pane to return to the Feature view, then select the feature node MBT_Spark.

  2. Click in the toolbar, or select Feature > Fill. This opens the Feature Fill Wizard.

  3. Select all four table check boxes to fill all tables.

    You could also explore setting gradient bounds to constrain table filling for smoothness.

    This time leave the other settings at the defaults and click Next.

  4. Choose filling model, constraint, and links.

    • Make sure MBT is the Model to fill the tables.

    • Select ECP in the left Variables list and the Exhaust_CAM feature in the right Links list and click Link.

    • Select ICP in the left list and Intake_CAM in the right list and click Link.

    • Click Select next to Constraint. The Edit Constraint dialog box opens.

      Select the model MBTwithSpeedLoadBoundary, select Boundary constraint as the Evaluate quantity, and click OK. This boundary model constraint ensures you only fill over speed/load points where the data was collected.

    When you return to the Feature Fill Wizard, click Next.

  5. Set values to optimize over.

    • Enter 0, 1 in the Exhaust_On Value edit box, and press Enter.

    • Enter 0, 1 in the Intake_On Value edit box, and press Enter.

    You use these values because the strategy includes the following tables.

    TableIntake_On ValueExhaust_On Value
    MBT_Base (cams parked)00
    MBT_Exhaust01
    MBT_Intake10
    MBT_Dual11

    The N and L normalizer values are automatically selected. You can edit normalizers manually, or you can click the Initialize From Normalizer button here to reach a dialog where you can select normalizers and interleave values between breakpoints. Interleaving values can minimize interpolation error by adding values between each normalizer value. In this way, you can create a grid of more points than table cells to optimize over. Leave the setting alone for now.

    Click Next.

  6. Fill tables and generate plots.

    Click the Fill Tables button. Watch the graph as the optimization progresses.

    When it is finished, select all enabled check boxes, and click Finish. Plots appear summarizing the feature fill data.

Inspect Results

Look at the filled tables, linked models and exported data set.

  1. In the Feature view, select in turn the tables MBT_Base, MBT_Intake, MBT_Exhaust, and MBT_Dual in the feature tree.

    Observe the yellow mask area of cells in each table — the mask is defined by the limits from the MBTwithSpeedLoadBoundary boundary constraint model you selected. The rest of the table values are extrapolated after the mask cells are filled by the Feature Fill Wizard (specified by the Extrapolate check box). Table values are limited to [-10 60] as specified in the Table Bounds in the Feature Fill Wizard.

    The lower comparison pane (if you have it open) does not change as you change table, because it displays a comparison between the whole feature and the model, not individual tables. Note if you use links the comparison pane is not showing a true comparison as the cam inputs are not constant. The comparison pane is showing the comparison using constant values for the cam timings.

  2. Click Models to select the Models view. Look at the feature model and fill model MBT_SPARK_Model and MBT_SPARK_FillModel. If you can't view the whole Connections diagram of MBT_SPARK_FillModel, right-click and select Zoom To Fit.

    The linking functionality in the Feature Fill Wizard allows features and tables to be connected to models and any expression to be connected to feature inputs. These links can be made permanent by creating feature models and fill models that are static snapshots of the table on finishing the feature fill wizard (specified by the Feature model and Fill model with links check boxes on screen 4 of the Feature Fill Wizard).

    Notice that the CAM features are converted to feature models (Exhaust_CAM_Model and Intake_CAM_Model are new feature models) and they are connected to MBT_SPARK_FillModel.

  3. Click Data Sets to select the Data Sets view. Select the dataset MBT_SPARK_FillResults to study the gridded data, the model and feature values for the feature fill. Click View Data in the toolbar to see the data table view. All the links in the feature fill process are defined in this data set — try clicking column headers to see highlighted linked input columns.

CAGE Import Tool

Suppose that you are calibrating a similar engine at a later date. You would build new models for this engine and then want to solve the same problems in CAGE. The CAGE Import Tool allows you to reuse the setup from your old CAGE session. All that is necessary to import new models on top of the existing ones and rerun the optimizations and feature fill problems. For example you could import new BTQ (replace BTQ), knot (replace MBT and MBTwithSpeedLoadBoundary) and EXTEMP models from the example file Gasoline_Project.mat as follows:

  1. Select File > Import From Project.

    The CAGE Import Tool appears.

  2. You can choose a project file or import directly from the Model Browser if it is open. If the Model Browser is open, the CAGE Import Tool automatically shows the items available. Use the Import From Project File button to select a file.

    If you are choosing a project file, a file browser dialog opens. Locate Gasoline_Project.mat and click Open.

  3. The CAGE Import Tool displays the available items. Select the items you want to import from the list: BTQ, EXTEMP, and knot.

  4. Click the Import Selected Items button.

  5. The Import dialog opens displaying the items you selected for import.

    • Double-click the CAGE Model Name column cells to edit item names.

    • Choose to replace BTQ, EXTEMP and MBT. For knot, select Replace from the Action list, then double-click the CAGE Model Name column cells to open a dialog to select the correct item, MBT, to replace.

    • Click OK to import the items.

Now you can run the optimization again to generate new optimal CAM timings with new models. Export the optimization results to the INTCAM and EXHCAM tables, and use the Feature Fill Wizard to fill the MBT_SPARK strategy using the same steps as before.

  


Recommended Products

Includes the most popular MATLAB recorded presentations with Q&A sessions led by MATLAB experts.

 © 1984-2012- The MathWorks, Inc.    -   Site Help   -   Patents   -   Trademarks   -   Privacy Policy   -   Preventing Piracy   -   RSS