Main Content

Use Panels to Monitor Signals and Control Parameters

A panel floats above the model canvas and follows you through the model hierarchy. Using panels, you can monitor signals, tune parameters, and debug from anywhere in your model without adding collections of dashboard blocks throughout the model.

You can use panels to model real dashboards, for example, the dashboard in your car. To model displays and controls on the panel, such as gauges, lamps, knobs, buttons, and switches, you can promote blocks to the panel from the Dashboard library, the Customizable Blocks library, and the Aerospace Blockset library.

For information about how to create, populate, edit, and manage the visibility of panels, see Getting Started with Panels.

In this example, you simulate sensor failures in a fuel control system. You use panels to control the parameter values that activate different failure modes and to monitor the effect on fuel consumption.

Open Example Model

Open the sldemo_fuelsys model from the Model Fault-Tolerant Fuel Control System example.

openExample('simulink_automotive/ModelingAFaultTolerantFuelControlSystemExample')

The sldemo_fuelsys model has a Dashboard subsystem that contains controls and indicators for interactively simulating the model. Navigate inside the Dashboard subsystem.

The subsystem contains four areas: Inputs, Fault Injection, Fuel (g/s), and Air/Fuel Ratio.

This example creates and then utilizes a panel that contains the control blocks from the Fault Injection area and a panel that contains the display blocks from the Fuel (g/s) area.

The Dashboard subsystem contains four areas. The Input area contains a Toggle Switch block with the annotation Engine Speed (rad/s). The Fault Injection area contains four pairs of Slider Switch blocks and Lamp blocks, respectively with the annotations Throttle Angle, Engine Speed, EGO, and MAP. The Fuel (g/s) area contains a Half Gauge block and a Dashboard Scope block. The Air/Fuel Ratio area contains a Quarter Gauge Block, a Gauge block, and a Dashboard Scope block.

Create Panels

If you already created a panel containing the dashboard blocks and annotations from the Fault Injection or Fuel (g/s) areas by working through the examples in Getting Started with Panels or Create Tabbed Panels, skip the task for creating that panel.

To create the Fault Injection panel, promote the dashboard blocks in the Fault Injection area to a panel:

  1. Draw a selection box around the blocks. Where the selection box ends, an ellipsis appears.

    Fault Injection area with a selection box around its contents and an ellipse at the endpoint of the selection box by the lower right corner of the area

  2. Pause on the ellipsis.

  3. In the action bar that expands, click Promote to Panel . The dashboard blocks are promoted from the area to the panel, but the annotations are not.

    Fault Injection area with a panel floating above it that contains all the dashboard blocks from the area

Add the annotations from the Fault Injection area to the panel:

  1. Select the panel.

  2. Pause on the ellipsis (…) that appears.

  3. In the action bar that expands, click Edit Panel .

  4. Drag the lower left corner of the panel to the left to make room for the annotations.

    Panel resized to cover Fault Injection area

  5. To see the annotations in the Fault Injection area, drag the panel away from the area. To drag the panel, click and hold down your pointer on the panel name or on any empty spot inside the panel, then move the pointer.

  6. For each annotation from the Fault Injection area, double-click the panel where you want the annotation, then type the annotation text. When you finish typing, press Enter. You can drag the annotations to move them around the panel.

  7. When you finish, click the canvas.

  8. To rename the panel, in the Simulink® Toolstrip, on the Panels tab, in the Edit section, click Rename Panel. The Property Inspector appears. On the Parameters tab, in the Name text box, type Fault Injection.

    Panel with annotations from Fault Injection area

Use the same approach to create the Fuel (g/s) panel from the dashboard blocks in the Fuel (g/s) area.

Panel containing the Half Gauge block and Dashboard Scope block from the Fuel (g/s) area

Now you have modular panels to use while interactively simulating the sldemo_fuelsys model.

Simulate Model

Suppose you need to understand and debug the fuel_rate_control subsystem.

Navigate to the top level of the sldemo_fuelsys model. Navigate inside the fuel_rate_control subsystem, then navigate inside the control_logic Stateflow® chart.

Start a simulation. Once the simulation starts, on the Fault Injection panel, modify the position of one or more Slider Switch blocks to induce a failure in the system.

  • Observe the changes in the Stateflow chart as the system state changes in response to one or more failures.

  • Observe the changes in fuel consumption by monitoring the panel you created from the Fuel (g/s) area.

Tip

If the simulation progresses too quickly, you can use simulation pacing to slow the progression of simulation time relative to clock time. For more information, see Simulation Pacing Options.

The video shows the panels floating above the control_logic Stateflow chart. The simulation is running. On the Fault Injection panel, the pointer clicks the Throttle Angle Slider Switch block. In the Stateflow chart, different states activate. On the Fuel panel, the fuel consumption displayed on the Half Gauge and Dashboard Scope blocks increases. The pointer clicks the Throttle Angle Slider Switch block again. The Stateflow chart and Fuel panel displays revert to their previous behavior. Then, the pointer clicks the Engine Speed Slider Switch block, In the Stateflow chart, different states activate. On the Fuel panel, the fuel consumption displayed on the Half Gauge and Dashboard Scope blocks increases to a higher value than when the Throttle Angle switch was flipped. The pointer clicks the Engine Speed Slider Switch block again.

See Also

Related Topics