Skip to Main Content Skip to Search
Product Documentation

Setting Up a Feature Calibration

Procedure Overview

A feature calibration is the process of calibrating lookup tables and their normalizers by comparing a collection of lookup tables to a model. The collection of lookup tables is determined by a strategy.

A feature refers to the object that contains the model and the collection of lookup tables. For example, a simple feature for calibrating the lookup tables for the maximum brake torque (MBT) consists of

Having already set up your variable items and models, you can follow the procedure below to set up your feature calibration:

  1. Add a feature. This is described in the next section, Adding a Feature.

  2. Assign a model. This is described in Assigning a Model.

  3. Set up your strategy. This is described in Setting Up Your Strategy.

  4. Set up the tables. This is described in Setting Up Tables.

This section describes steps 1, 2, and 3 in turn.

When you have completed these four steps, you are ready to calibrate the normalizers, tables, and features.

Adding a Feature

A feature consists of a model and a collection of lookup tables, organized in a strategy.

To add a feature to your session, select File -> New -> Feature. This automatically switches you to the Feature view and adds an empty feature to your session.

An incomplete feature is a feature that does not contain both an assigned model and a strategy. If a feature is incomplete, it is displayed as in the tree display. If a feature is complete, it is displayed as in the tree display.

Assigning a Model

Having already added a feature and a model to your session, you can assign a model to your feature.

To assign a model to your feature,

  1. Highlight the top feature node in the tree display.

  2. Click Select Model to select the model you want to work with. A dialog box appears.

  3. Highlight the correct model to assign to your feature and click OK. You will see the model name and inputs appear above the Select Model button.

Setting Up Your Strategy

A strategy is an algebraic collection of tables, and forms the structure of the feature.

For example, a simple strategy to calibrate a feature for MBT adds two tables:

To evaluate the feature side by side with the model, you need to have a strategy that takes some or all of the same variables as the model. The strategy is expressed using Simulink diagrams. You can either import a strategy or you can construct a strategy.

The following topics are described next:

Importing a Strategy

To import a Simulink strategy,

  1. Highlight the top feature node in the tree display.

  2. Select File > Import > Strategy.

  3. Select the appropriate .mdl file. CAGE checks the strategy for more than one outport.

  4. Select the outport that you want to use.

    If there is more than one outport to your strategy, a Simulink window opens. Double-click the correct blue outport to parse (or import) the strategy to your feature.

    If there is only one outport to your strategy, a dialog box opens.

    • Click Automatic to parse the strategy without viewing it.

    • Click Manual to edit the strategy. When you are finished editing double-click the blue outport circle to parse the strategy to your feature. The Simulink windows close and parse this strategy to your feature.

To view a representation of your strategy, select the Feature node. Your strategy is represented in the Strategy pane. Select View > Full Strategy Display to switch between the full description and the simplified expression. You can select and copy the strategy equation to the clipboard.

For information about using Simulink to amend strategies, see Constructing a Strategy.

Example.  In the matlab\toolbox\mbc\mbctraining directory, there is a Simulink diagram called tutorial.mdl. If you import this and click Manual in the dialog box, you see the following diagram.

Double-click the Torque-Output outport to parse the strategy into the Strategy pane.

Constructing a Strategy

For you to perform a feature calibration, the strategy and the model must have some variables in common.

To construct a strategy using Simulink,

  1. Highlight the correct feature by clicking the Feature node.

  2. Select Feature > Graphical Strategy Editor or press Ctrl+E.

    Three Simulink windows open:

    • The strategy window for editing your strategy, like the following example.

    • A library window, cgeqlib, with all the blocks available for building a strategy.

    • A library window with all the existing blocks in your session, organized in libraries.

  3. In the strategy window, build your strategy using the blocks available in the library windows.

  4. Double-click the blue outport circle to parse the strategy into the CAGE session.

      Note   This closes all three Simulink windows and parses your strategy into the feature.

About Feature Parsing

The library, cgeqlib contains all the blocks available for building a strategy, as described in Constructing a Strategy. Tables in the current CAGE session are shown in dark green. A black table block signifies that a new table will be created in CAGE. If you copy a CAGE table block, a new table is created and the block color changes to black to signify this.

Normalizers in the current CAGE session are shown in light blue. Normalizer blocks must be inputs to tables. A black Normalizer block signifies that a new normalizer will be created in CAGE. If you copy a CAGE table block a new normalizer is created and the block color changes to black to signify this.

Some rules for feature parsing:

If the parsing of the Simulink diagram fails, you see an error message in a dialog box, and any renamed items or changed connections in the current feature are restored. You can then correct the Simulink diagram and reparse the diagram.

For more information about using Simulink to build your strategy, see Simulink Help.

If you need to parse strategies older than Release 2008a, you can use the function cgStrategyTables to set the style for strategy parser behavior for 1D tables. Pre-R2008a, the CAGE strategy parser interpreted 1D tables as normalizers if they fed into a lookup table. In R2008a, a normalizer block was added to the cgeqlib library, and lookup table blocks are now always interpreted as lookup tables. This change creates an incompatibility for any older strategies saved as mdl files and reimported into CAGE. If you need to parse pre-R2008a strategies, use the function as follows:

cgStrategyTables('Pre-R2008a') 

This reverts the parser behavior to the pre-R2008a interpretation of 1D lookup tables. A warning is issued when a 1D table is converted to a normalizer. You can turn the warning off as follows:

warning off mbc:cgslparser:ObsoleteNormalizer

Reset the parser style to Release 2008a and later as follows:

cgStrategyTables('R2008a') 

You can query the current strategy table style by entering:Style = cgStrategyTables.

Exporting Strategies

Simulink strategies can be exported. For example, you might want to

To export a strategy from CAGE,

  1. Highlight the Feature node that contains the strategy that you want to save.

  2. Select File > Export > Strategy.

  3. Assign a name for your strategy.

    The strategy is saved as a Simulink model (.mdl) file.

Working With Features

When you select a Feature node you see the Feature view, shown. The Feature view enables you to calibrate the entire feature, that is, fill all the table values by referring to a model.

The parts of the Feature view include

  1. The strategy for the selected feature. This is the algebraic collection of the tables that you are using to calibrate the selected feature.

  2. The model associated with the selected feature.

  3. The Feature History pane, which displays the history of the feature.

Use the Feature menu to control your strategy and model, and initialize and fill the tables in your strategy:

  


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