主要内容

通过仪表板块调整和可视化模型

这blocks in the Dashboard library help you control and visualize your model during simulation and while the simulation is paused. This example uses theModeling a Fault-Tolerant Fuel Control System示例模型sldemo_fuelsysto showcase the control and visualization capabilities of Dashboard blocks. To open the model, use this command:

openexample('simulink_automotive/ModelingAFaultTolerantFuelControlSystemExample')

Note

Dashboard blocks cannot connect to signals inside referenced models or subsystems.

Explore Connections Within the Model

这Dashboard subsystem contains blocks for controlling and visualizing signals in the Fault-Tolerant Fuel Control System model. Explore the connections between the signals and Dashboard blocks. Click either a signal or a Dashboard block to highlight the connections.

在仪表板子系统中,单击拨动开关在燃油板中。将鼠标悬停在块上方的省略号上,然后单击其上方的箭头跳到连接的块或信号。

From the top level of the model, click theair_fuel_ratio信号并查看仪表板子系统,Quarter Gauge, 和Half Gaugehighlighted.

模拟变化的模型状态

在仪表板子系统中,开关提供了对节气门角度,发动机速度,自我和地图信号的状态的控制。对于每个传感器信号,开关在normalfail, allowing you to simulate the system response to each single-point failure. Clicking any one of these switches before simulation, during simulation, or while a simulation is paused changes the state in the model.

Run the simulation and observe the control system response to each single-point failure.

  1. Start the simulation.

  2. As the simulation runs, click one of the switches to simulate a component failure.

    Observe the changes in the燃料air_fuel_ratio信号中的信号Dashboard ScopeGauge当您翻转每个开关时会阻止。

  3. Stop the simulation when you are finished.

View Signal Data

Dashboard blocks allow you to view signal data using gauges, lamps, and dashboard scopes. In this example, the Dashboard blocks provide visual feedback about the fuel input and air-to-fuel ratio during simulation, after simulation, and while a simulation is paused.

要捕获不同类型的信息并更有效地可视化信号,请将多个仪表板块连接到单个信号。例如,您可以可视化air_fuel_ratio信号使用Gauge,Quarter Gauge, 和Dashboard Scope块。

Use theQuarter Gaugeblock, labeled Normal Range in the example, to see small fluctuations in the instantaneousair_fuel_ratio信号虽然其值位于正常操作范围内。这Gaugeblock, labeled Full Range, allows you to see the behavior of the instantaneousair_fuel_ratiosignal outside of the normal range. TheDashboard Scope块显示了air_fuel_ratiosignal over time.

Tune Parameters During Simulation

Dashboard blocks allow you to tune parameters in your model during a simulation. To explore the tuning capability within the fuel system model, replace the engine speed拨动开关用aKnob:

  1. Delete the engine speed拨动开关.

  2. Add aKnobblock from the Dashboard library.

  3. 点击Connectbutton that appears when you pause on theKnobblock. When you click theConnectbutton, the Simulink®Editor enters connect mode, which facilitates connecting Dashboard blocks to signals and parameters in your model.

  4. Navigate to the top level of the model and select theEngine Speedblock. TheEngine Speed块为a持续的block whose持续的valueparameter you can tune with theKnobblock.

    When you select theEngine Speedblock, the names of tunable parameters associated with the block appear in a table.

  5. Select the option button next toengine_speedin the table. Then, to exit connect mode, click theExitbutton in the upper-right of the model canvas.

Now that theKnob块连接到engine_speed参数,您可以将刻度间隔和范围设置为对模拟有意义的值。双击Knobblock to access the block parameters. In this example, setMinimumto75,最大to750, 和刻度间隔to75. Then, click好的.

模拟模型并调整engine_speedparameter using theKnob.

  1. Start the simulation.

  2. As the simulation runs, drag the pointer on theKnobto adjust the value ofengine_speed.

    在使用时注意Knobto adjust the value ofengine_speed,air_fuel_ratiovalue displayed on theGaugeblocks and in theDashboard Scopeblock changes.

  3. 完成调整参数后,停止模拟。

相关话题