主要内容

Optimize Multi-Injection Diesel Engine Calibration Using Statistical Models

After creating the statistical models to fit the data, you can use them in optimizations. You can use the accurate statistical engine model to replace the high-fidelity simulation and run much faster, enabling the optimization to generate calibrations in feasible times.

  1. Run an optimization to choose whether to use Pilot Injection at each operating point.

  2. Optimize fuel consumption over the drive cycle, and meet these constraints:

    • Constrain total NOx

    • Constrain turbocharger speed

    • Constrain smoothness of tables

  3. Fill lookup tables for all control inputs.

Set Up Models and Tables for Optimization

To perform an optimization, you need to import the statistical models created earlier in the Model Browser.

  1. In MATLAB®, on the Apps tab, in the Automotive group, click MBC Optimization.

  2. To see how to import models, on the home page, click Import From Project.

    The CAGE Import Tool opens. Here, you can select models to import from a model browser project file or direct from the Model Browser if it is open. However, the toolbox provides an example file with the models already imported, so click Close to close the CAGE Import Tool.

  3. On the home page, in the Case Studies list, select the multi-injection example, or select File > Open Project and browse to the example file CI_MultiInject.cag, found in matlab\toolbox\mbc\mbctraining.

  4. Click Models in the left Data Objects pane to view the models.

  5. To see how to set up tables to fill with the results of your optimizations, select Tools > Create Lookup Tables from Model. The Create Lookup Tables from Model wizard opens.

    Create lookup table from model wizard with lookup table inputs.

  6. Select the model BSFC and the Create operating point data set check box, and click Next.

  7. If you left the defaults, you would use the model operating points for the table breakpoints. However, you need to create different tables to the operating points.

    1. Clear the Use model operating points check box.

    2. Select SPEED and TQ for the axis inputs.

    3. Enter 11 for the table rows and columns.

      Create lookup table from model wizard with lookup table inputs.

    Click Next.

  8. View the last screen to see how many tables CAGE will create for you if you finish the wizard.

    Click Cancel to avoid creating new unnecessary tables in your example file. The example file already contains all the tables needed for your calibration results.

    Create lookup table from model wizard with normalizers.

  9. Select the Lookup Tables view to see all the tables. Observe there are tables named _wPilot and _noPilot that will be filled by optimization results. The goal is to fill separate tables for each mode, pilot injection active and no pilot injection.

Examine the Point Optimization Setup

The example file CI_MultiInject.cag shows the results of the multistage process to finish this calibration.

  1. Click Optimization in the left Processes pane to view the optimizations.

    To complete the calibration, you need to start with a point optimization to determine whether to use Pilot Injection at each operating point. You use the results of this point optimization to set up the sum optimization to optimize fuel consumption over the drive cycle, and meet these constraints:

    • Constrain total NOx

    • Constrain turbocharger speed

    • Constrain smoothness of tables

  2. Select the BSFC_PointOpt optimization to view the setup.

  3. View the two objectives in the Objectives pane. These are set up to minimize BSFC and PEAKPRESS. Double-click an objective to view its settings.

  4. Observe that the Constraints pane shows a boundary model constraint.

  5. Learn the easiest way to set up an optimization like this by selecting Tools > Create Optimization from Model.

  6. In the Optimization Quick Start dialog box:

    1. On the Objectives page:

      • Set Optimization type to Modal optimization: find optimal operating mode (requires composite models). The optimization identifies which pilot mode (active pilot injection or no pilot injection) is best to use at each operating point.

      • Set Model to BSFC.

      • Set Goal to minimize.

      Optimization Quick Start dialog box displaying the Objectives page with BSFC selected as the model to minimize.

    2. Click Next.

  7. The optimization is constrained by a model boundary constraint. Click Next again.

  8. The optimization specifies Operating points as Unique operating points. Click Apply to create the optimization.

    Create optimization from model with 7 free variables selected.

  9. Compare your new optimization with the example BSFC_PointOpt. Notice the example has a second objective, to minimize PEAKPRESS. To see how to set this up, right-click the Objectives pane and select Add Objective.

Examine the Point Optimization Results

The example file CI_MultiInject.cag shows the results of the multistage process to finish this calibration.

  1. Expand the first optimization node, BSFC_PointOpt, and select the output node underneath, BSFC_PointOpt_Output.

  2. Select View > Selected Solution (or the toolbar button) to view which mode the optimization selected as best at each operating point. The left-hand pane provides all optimization results. The right-hand pane provides the results for the current run.

    View of optimization results showing which mode the optimization selected as best at each operating point. The left-hand pane provides all optimization results. The right-hand pane provides the results for the current run.

  3. Review the Results Contour plot to see which mode has been selected across all operating points. Use this view to verify the distribution of mode selection.

  4. Click to select a point in the table or Results Contour, and you can use the Selected solution controls at the top to alter which mode is selected at that point. You might want to change selected mode if another mode is also feasible at that point. For example, you can change the mode to make the table more smooth.

  5. Use the other objectives to explore the results. For example, you might want to manually change the selected mode based on an extra objective value. It can be useful to view plots of the other objective values at your selected solutions. To display another plot or change the view, right-click the plots to view the options.

    For example, right-click the Objective Contours plot. Select Current View > Objective Graphs.

    Objective Contours plot. Left-hand pane shows results contour and operating point results. Right-hand pane shows the optimization solution.

  6. To see both solutions for a particular operating point, use the Pareto Slice view. You can inspect the objective value (and any extra objective values) for each solution. If needed, you can manually change the selected mode to meet other criteria, such as the mode in adjacent operating points, or the value of an extra objective.

For details on tools for choosing a mode at each operating point, see Analyze Modal Optimization Results.

Create Sum Optimization from Point Optimization

The point optimization results determine whether to use pilot injection at each operating point. When you are satisfied with all selected solutions for your modal optimization, you can make a sum optimization over all operating points. The pilot injection mode must be fixed in the sum optimization to avoid optimizing too many combinations of operating modes.

The results of the point optimization were used to set up the sum optimization to optimize fuel consumption over the drive cycle. To see how to do this:

  1. From the point optimization output node, BSFC_PointOpt_Output, select Solution > Create Sum Optimization.

    The toolbox automatically creates a sum optimization for you with your selected best mode for each operating point. The create sum optimization function converts the modal optimization to a standard single objective optimization (fmincon algorithm) and changes the Mode Variable to a fixed variable.

  2. Compare your new optimization with the example sum optimization, BSFC_SumOpt. The example shows you need to set up more constraints to complete the calibration.

    Constraints table with name, description, type and application point set.

    The additional constraints make the optimization meet these requirements:

    • Constrain total NOx

    • Constrain maximum turbocharger speed

    • Constrain smoothness of tables with gradient constraints

  3. Import all required constraints to your new optimization by selecting Optimization > Constraints > Import Constraints. Select the example sum optimization and import all but the first boundary model constraint.

  4. Double-click the additional constraints to open the Edit Constraint dialog box and view the setup.

    This sum constraint controls the total NOx.

    Edit constraint wizard showing type, name, and bound

    This constraint controls maximum turbocharger speed.

    Edit constraint wizard with VGTSPEEDNorm selected

    Observe that this constraint does not use the VGTSPEED model directly, but instead uses a function model VGTSPEEDNorm. You can examine this function model in the Models view. The function model scales the constraint to help the optimization routines, which have problems if constraints have very different sizes. VGTSPEED is of order of 165000, while the other constraints are of the order of 1, so the function model VGTSPEEDNorm normalizes VGTSPEED by dividing it by 165000.

    The following constraint controls the gradient across the MAINSOI table.

    Edit constraint wizard with MAINSOI selected

  5. In the Optimization view, in the Constraints pane, observe that:

    • The gradient constraints are in pairs, one with pilot and one with no pilot. Separate table gradient constraints are required for different modes because the goal is to fill separate tables for each mode.

    • All the gradient constraints have an entry in the Application Point Set column.

      Constraint table with name, description and application point set. MainSOI_wPilot selected

  6. Right-click the table gradient constraint MainSOI_wPilot and click Select Application Point Set to see how these are set up.

    Application point set for MainSOI_wPilot

  7. Observe the Interpolate for each mode option is selected. This application point set restricts the table gradient constraint to Mode 1 (active) points only. You can create an application point set like this by selecting New subset and then choosing a subset of the optimization points by clicking in the plot or table. The application points here correspond to the operating points where the point optimization determined that the pilot mode should be active (Mode = 1). For comparison, here is the results contour plot for the point optimization results.

    Contour plot for speed.

  8. Compare the results contour plot with the application points for the next table gradient constraint, MainSOI_noPilot. These application points restrict the table gradient constraint to Mode 2 points only, where the pilot is inactive.

    Application point set for MainSOI_wPilot

Your sum optimization now contains all the required constraints and is ready to run. Next, view the results in the example sum optimization.

Fill Lookup Tables from Optimization Results

CAGE remembers lookup table filling settings. To view how the example tables are filled:

  1. Expand the example sum optimization node BSFC_SumOpt and select the BSFC_SumOpt_Output node.

  2. Select Solution > Fill Lookup Tables (or use the toolbar button) to open the Lookup Table Filling from Optimization Results Wizard.

  3. On the first screen, observe all the tables in the CAGE tables to be filled list. Click Next.

  4. On the second screen, observe all the tables are matched up with optimization results to fill them with. Click Next.

    Lookup table filling from optimization results wizard with MAINSOI selected.

  5. On the third screen, observe how some tables have a Filter Rule set up so that they are filled only with results where Mode is 1 or 2. You can create a filter rule like this by entering Mode==1 in the Filter Rule column.

    Lookup table filling from optimization results wizard with MAINSOI filter rule selected.

    You can either click Finish to fill all the tables, or Cancel to leave the tables untouched. The example tables are already filled with these settings.

These plots show results similar to the calibration results.

Pilot Mode Table

3D plot of mode versus speed and torque.

This graphic shows the plot of the table to select the active or inactive pilot mode depending on the speed and commanded torque

You need to fill calibration tables for each control variable described in Multi-Injection Diesel Problem Definition, in both pilot modes, active and inactive.

Following are all the pilot active tables.

Main Injection Timing (SOI) Table

3D plot of main injection timing (SOI) versus speed and torque.

Total Injected Fuel Mass Table

3D plot of total injected fuel mass versus speed and torque.

Fuel Pressure Delta Table

3D plot of fuel pressure delta mass versus speed and torque.

Exhaust Gas Recirculation (EGR) Valve Position Table

3D plot of exhaust gas recirculation versus speed and torque.

Variable-Geometry Turbo (VGT) Position Table

3D plot of exhaust gas recirculation versus speed and torque.

Pilot Injection Timing (Pilot SOI Delta) Table

3D plot of pilot SOI delta versus speed and torque.

Pilot Fuel Mass Fraction Table

3D plot of fuel mass fraction versus speed and torque.

Examine the Multiobjective Optimization

The example file CI_MultiInject.cag also shows an example multiobjective optimization. This can useful for calibrations where you want to minimize more than one objective at a time, in this case, BSFC and NOX. The multiobjective optimization uses the gamultiobj algorithm.

  1. Select the BSFC_NOX node to see how the optimization is set up. Observe the 2 objectives and the optimization information: Multiobjective optimization using a genetic algorithm.

  2. Expand the BSFC_NOX node and select the BSFC_NOX_Output to view the results. To select the view that you want to examine, right-click in the pane and select Current View. Select the view.

  3. Examine the Pareto graphs. It can be useful to display the Solution Information view at the same time to view information about a selected solution. You might want to select a dominated solution (orange triangle) over a pareto solution (green square) to trade off desired properties.

    Solution Information view showing Pareto graphics, objective contours and optimization results.

  4. Select the Sum_BSFC_NOX node to see how the sum optimization is set up. The sum optimization was created from the point optimization results. Observe the 2 objectives and all the constraints.

  5. Expand the Sum_BSFC_NOX node and select the Sum_BSFC_NOX_Output to view the results.

Tip

Learn how MathWorks® Consulting helps customers develop engine calibrations that optimally balance engine performance, fuel economy, and emissions requirements: see Optimal Engine Calibration.