主要内容

发动机设计和成本权衡

This example shows how to use Simulink® Design Optimization™ to optimize a design for performance and cost. In this example, you tune an automotive engine speed controller while reducing controller costs by tuning sensor accuracy and actuator response time.

打开模型

Open the automotive engine model using the command below. The following subsystems model the engine response:油门和歧管,Induction to Power Stroke Delay,燃烧,拖动扭矩车辆动力学。该模型感兴趣的主要信号是RPM中的发动机速度。控制系统由铅延迟组成控制器,rpm Sensor, 和油门执行器块。该模型由速度参考的步骤更改驱动。

open_system(“enginetradeoff_demo”)

Design Overview

The design has the following objectives:

Engine performance objective:

The engine must respond to step changes in the speed reference with the following characteristics:

  • Maximum overshoot of 2%

  • 上升时间为4秒,达到参考速度的90%

  • Settling time of 7.5 seconds to reach within 2% of the reference speed

该目标作为约束性能要求堵塞。该块的输入是发动机速度,该发动机速度通过速度参考值标准化。这意味着,尽管速度参考会发生变化,但性能要求保持不变。

成本minimization objective:

The design cost of the controller is to be minimized. This objective uses sensor and actuator parameterization to compute a design cost. The design cost is computed so that it is always greater than 1 and the optimization attempts to drive the cost to 1.

We use a custom requirement to minimize this cost. TheENGINETRADEOFF_COSTfunction used by the custom requirement simply returns the cost value to be minimized.

类型ENGINETRADEOFF_COST
function Cost = enginetradeoff_cost(u) %Compute controller cost based on sensor accuracy, actuator response, and %controller sampling time. % Copyright 2013 The MathWorks, Inc. %Cost constants min_cost = 1; %Minimum cost > 0 sensor_var_min = 1e-3; %Minimum sensor variance (most expensive) sampling_min = 1e-2; %Minimum controller sampling time (most expensive) throttle_max = 2*pi*10; %Maximum actuator response frequency (most expensive) %Get variable names varnames = {u.DesignVars.Name}; %Form cost Cost = min_cost; %Add sensor cost index = strcmp(varnames, 'sensor_std'); if any(index) Cost = Cost + sensor_var_min./max(u.DesignVars(index).Value,sensor_var_min); end %Add sampling cost index = strcmp(varnames, 'Ts'); if any(index) Cost = Cost+ sampling_min./max(u.DesignVars(index).Value,sampling_min); end %Add throttle cost index = strcmp(varnames, 'Tthrottle'); if any(index) Cost = Cost + u.DesignVars(index).Value/throttle_max; end

模型参数化:

To achieve the performance and cost objectives, we parameterize the following in the model:

  • 速度参考的最终步骤值:这确保设计在从低速到高速值的一系列操作点上工作。

  • 控制器的增益,极点和零值:这使我们能够更改控制器性能。我们使用优化调整这些值。

  • Response time of the throttle actuator: The response time is optimized to minimize controller cost. The actuator cost is inversely proportional to the response time, i.e., a faster response time implies a more expensive actuator.

  • Accuracy of the rpm sensor: The accuracy is specified by a standard deviation value and optimized to minimize controller cost. The sensor cost is inversely proportional to standard deviation, i.e., a smaller standard deviation implies a more accurate sensor, which is more expensive.

Running the Optimization

优化发动机控制器的性能和成本涉及:

  • Optimizing the controller, sensor, and actuator parameters.

  • 在不同的操作条件上优化响应。

对于这种类型的问题,最好在迭代地构建设计,而不是为所有目标进行优化。在这里,我们使用划分和征服策略,如下表所示。这个想法是将优化的参数值从一个阶段使用作为下一阶段的初始猜测。

You can launch the响应优化器使用AppsSimulink工具条或万博1manbetxsdotoolMATLAB®的命令。您可以在响应优化器首先打开模型,然后双击模型底部的橙色块。来自响应优化器,按下图模型响应button to simulate the model and show how well the initial design satisfies the design requirements.

示例保存的优化项目对应于阶段2。在此阶段,我们优化了操作范围内的控制器参数。为此,我们指定K,PZ作为调谐参数和最终步骤值,final_step,参考信号作为不确定参数。在此阶段,定制控制器成本目标不包括在优化问题中。

我们通过配置模型如下:在第3阶段介绍控制器成本目标:

  • Open the不确定的变量editor from the响应优化器和then unselect the check box forfinal_step。This removes sweeping the model over different operating points from the optimization problem and thus reduces computational load.

  • Open theDesign Variableseditor from the响应优化器然后选择复选框sensor_std调整此参数。

  • 点击Selectbutton in the响应优化器to open the设计要求editor, and then select the check box for custom成本。这说明了优化过程中成本最小化目标。

我们通过按下优化按钮响应优化器。The plots are updated to indicate that the design requirements are now satisfied.

为阶段4配置优化:

  • Open theDesign Variableseditor from the响应优化器然后选择复选框tthrottle调整此参数。

You can start the optimization by pressing the优化button from响应优化器

为阶段5配置优化:

  • Open the不确定的变量editor from the响应优化器然后选择复选框final_step将模型扫到操作范围内。

You can start the optimization by pressing the优化按钮响应优化器

%关闭模型bdclose(“enginetradeoff_demo”)