Main Content

Monitor and Tune Signals and Parameters on Parrot Hardware

You can use Monitor and Tune (External Mode) action to tune parameters and monitor a Simulink® model running on your target hardware.

Monitor and Tune enables you to tune model parameters and evaluate the effects of different parameter values on model results in real-time. When you change parameter values in a model, the modified parameter values are communicated to the target hardware immediately. You can monitor the effects of different parameter values by viewing the output signals on Sink blocks or in Simulation Data Inspector (SDI). Doing so helps you find the optimal values for performance. This process is called parameter tuning.

Monitor and Tune accelerates parameter tuning. You do not have to rerun the model each time you change parameters. You can also use Monitor and Tune to develop and validate your model using the actual data and hardware for which it is designed. This software-hardware interaction is not available solely by simulating a model.

The support package supports Monitor and Tune simulation over these communication interfaces:

Communication InterfaceDescription
TCP/IPIn External mode simulation over TCP/IP, use the Sources blocks to change parameter values and the Sink blocks to monitor the effects of parameter tuning.
XCP on TCP/IPIn Universal Measurement and Calibration Protocol (XCP)-based External mode simulation over TCP/IP, you can use:
  • Dashboard blocks: In addition to Sources and Sink blocks, you can use Dashboard blocks to change parameter values and to monitor the effects of parameter tuning. The Dashboard library contains set of blocks using which you can interactively control and visualize the model.

  • Simulation Data Inspector (SDI): You can inspect and compare data from multiple simulations to validate model designs using Simulation Data Inspector.

Prepare a Simulink Model for External Mode

This section explains how to prepare a Simulink model to run in External mode.

  1. Configure the hardware network as described in Model Configuration Parameters for Parrot Minidrone.

  2. Create or open a Simulink model.

  3. Set the Simulation stop time parameter, located to the left of Simulation mode.

    The default value is 10.0 seconds. To run the model for an indefinite period, enter Inf.

  4. Configure the Model Configuration Parameters for the hardware as described in Model Configuration Parameters for Parrot Minidrone. In External mode, set the Communication interface parameter based on the type of External mode simulation to run on the model.

  5. Ensure that you select the Verbose check box to view the external mode execution progress and updates in the Diagnostic Viewer or in the Command Window.

  6. Click Apply and then OK to close the Model Configuration Parameters dialog box.

Signal Monitoring and Parameter Tuning of Simulink Model

This section explains how to run:

External Mode Simulation over TCP/IP

Note

This section applies only when you set the communication interface to TCP/IP.

Before you begin, complete the Prepare a Simulink Model for External Mode section and ensure that you have placed Sink blocks in the model to monitor the simulation output.

  1. To start the simulation, open the Hardware tab and click the Monitor & Tune.

    After few seconds, Simulink starts running the model on the hardware.

  2. Change the parameter values in the model. Observe the corresponding changes in the simulation output.

  3. Find the optimal parameter values by making adjustments and observing the results in the Sink blocks.

  4. After you are satisfied with the results, stop the Monitor and Tune action, and save the model.

XCP-Based External Mode Simulation over TCP/IP

Note

This section applies only when you set the communication interface to XCP on TCP/IP.

Before you begin, complete the Prepare a Simulink Model for External Mode section.

  1. In the Simulink model, identify the signals to be logged for monitoring during simulation.

    Simulink displays a logged signal indicator for each logged signal.

  2. To start the simulation, open the Hardware tab and click the Monitor & Tune.

    After several minutes, Simulink starts running the model on the hardware.

    During simulation, when new simulation data becomes available in SDI, the Simulation Data Inspector button appears highlighted.

  3. View the simulation output in Sink blocks or in SDI.

    • Sink blocks – To view the simulation output, double-click the Sink blocks in the model.

    • SDI – To view the new simulation data, perform these steps:

      1. Click the Simulation Data Inspector button.

      2. A new simulation run appears in the Inspect pane. The Inspect pane lists all logged signals in rows, organized by simulation run. You can expand or collapse any of the runs to view the signals in a run.

      We recommend you use SDI rather than using Sink blocks for the following reasons:

      • Streaming data to SDI does not store data in memory, making more efficient use of the memory available on the hardware. Sink blocks such as Scope stores data in buffers before sending the data to the host.

      • Using SDI, you can stream signals from top models and reference models simultaneously. Scope blocks can only log signals from a top-level model.

  4. Change the parameter values in the model. Observe the corresponding changes in the simulation output.

  5. Find the optimal parameter values by making adjustments and observing the results in the Sink blocks.

  6. After you are satisfied with the results, stop the Monitor and Tune action, and save the model.

Stop Monitor and Tune

To stop the model that is running in Monitor and Tune, open the Hardware tab and click the Stop button .

If the Simulation stop time parameter is set to a specific number of seconds, Monitor and Tune stops when that time elapses.

Limitations While Using XCP-Based External Mode Simulation over TCP/IP

  • You might experience data drops while using Sink blocks such as Scope and Display blocks. In such cases, use Simulation Data Inspector (SDI).

  • While using data Sink blocks such as Video Viewer block, you might experience very low update rate. In such cases, switch to TCP/IP external mode.

Related Topics