System Identification Module

This article describes how to use the Cockpit System Identification module to interact with the user code running on imperix controllers. This page provides a detailed explanation of all of the module’s features. For users seeking getting-started assistance with Cockpit itself, a separate article is available in PN300.

System Identification module basics

The System Identification (Sys. Id.) module allows the user to launch a system identification experiment and examine the resulting frequency response estimate.

To perform the system identification experiment, the module injects an excitation signal at the control task rate and records the system response. The excitation is a pseudorandom binary sequence (PRBS) signal and it is injected using the Scope transient generator and the System Identification Injector block.

The data acquired by the Scope is then used by the Sys. Id. module to calculate the frequency response estimates and display their Bode plots. More details on the estimation technique are given in SD041.

Transfer functions in the module are represented with enumerated variables (TF_0, TF_1, TF_2,…). The module always has at least one transfer function variable present (TF_0). The Scope data used to estimate the frequency response corresponding to a transfer function variable is chosen by setting its numerator and denominator. Any Probe variable defined by the user code can be set as the numerator and denominator.

Sys. Id. module interface

The two plot areas show the magnitude and phase of the transfer function variables displayed in the module.

This menu provides options to configure the excitation before injecting it. The available settings are:

  • Inj. name, that allows the user to set the active injector. The available names correspond to the injector names set in the Sys. Id. Injector block while building the user code
  • Inj. mode, which can be:
    • Open loop‘, meaning that the excitation will be added to the estimated average value of the Injector block input signal
    • Closed loop‘, meaning that the excitation will be added to the Injector block input signal
  • Peak-topeak, which sets the difference between the high and low state values of the PRBS
  • Advanced PRBS settings, that include:
    • Order, which determines the length of one period of the PRBS. For an order \(N\), the length of a period is \(L=2^N-1\)
    • Repetitions, which configures how many periods of the PRBS will be injected. For \(R\) repetitions, \(R\) transfer functions are estimated using data recorded during each period. The final estimate displayed in the module is then calculated as the average of these estimates
    • Pre-excitation time [s], that sets the duration of the PRBS injected before the \(R\) full periods. The data recorded over this interval is not used for estimation. Instead, the pre-excitation samples are used to transition the system to the new steady state induced by the injected PRBS input

Clicking on this button will initiate the Scope module transient sequence and inject the configured excitation. After the system response is captured and transferred from the Scope to the Sys. Id. module, the added transfer functions are automatically estimated and plotted.

The Numerator and Denominator fields allow the user to select probe variables whose data will be used as inputs to the transfer function estimate. Changing the Numerator or Denominator recalculates the estimate, if the probe data was captured in a Scope during the last excitation.

These two buttons allow the removal or the addition of transfer function variables. The remove button always removes the last variable. There is no upper limit to the number of variables but TF_0 can not be removed.

When switched on, a slidable vertical cursor is shown. The magnitude and phase values at the cursor position are displayed in the bottom bar for all transfer function variables.

Besides the fields that allow the precise definition of the displayed x-axis range, the Sys. Id. module offers the option to switch between linear and log-scaling for the frequency axis.

Besides the fields that allow the precise definition of the displayed y-axis range, the Sys. Id. module offers the option to set different Scale settings for the y-axis magnitude:

  • ‘Absolute, linear’, which displays the magnitudes of the estimated transfer function, without any visual or mathematical rescaling
  • ‘Absolute, log10’, which arranges the magnitude values in a log-scale
  • ‘Relative, dB’, which transforms the magnitude values according to the Amplitude dB formula: \(20\text{log}_{10}\big(\frac{|X|}{X_{ref}}\big)\), where \(|X|\) is the estimated transfer function magnitude and \(X_{ref}\) is set in the Ref. val. input field below the Scale menu
  • ‘Relative, log10’, which divides all of the magnitude values with \(X_{ref}\) and arranges the resulting values in a log-scale

Besides the fields that allow the precise definition of the displayed y-axis range, the Sys. Id. module offers additional settings for the phase plot value axis:

  • The Wrap phase setting, which when toggled on, restricts all phase plots between \(-180^{\circ}\) and \(180^{\circ}\)
  • The Units option, which allows switching between using degrees and radians for the phase plot

Variables added to the module are displayed in the SYS.ID. tab of the bottom bar. The bottom bar SYS.ID. tab menus allow the user to:

  • Modify each variable’s display style
  • Toggle a variable’s visibility without removing it
  • Remove a variable from the module
  • Change the transfer function variable numerator or denominator

In addition to this, if the vertical cursor is enabled, the magnitude and phase value of the variables at the position of the vertical cursor are displayed here.

When switched on, clicking on the plot shows an annotation box for the closest plotted point. The annotation contains the x- and y-axis position of the point, as well as the name of its variable.

Interacting with Sys. Id. module graphs and plots

The Sys. Id. module consists of two plot areas that display graphs of the transfer function variables. This section lists out the tips and tricks for manipulating plot variables and plot areas in the module.

Managing plot variables

Added transfer function variables will show up as rows in a table in the bottom bar tab corresponding to the module. Here, variables can be removed and their style and visibility and plotting order can be managed. If the vertical cursor is enabled, the magnitude and phase values at the cursor position are shown as well.

All of these actions can also be accessed from context menus by right-clicking on a plotted variable or on the empty space in the plots.

Transfer function variable context menu and plot area context menu

Managing plot areas

The total module height can be freely distributed between the magnitude and phase plots. To resize plot heights click on the border between the plot areas and drag.

  • To zoom in and out along the horizontal axis, place the mouse cursor over the area of interest. Then, use the mouse wheel to zoom in or out around the location of the mouse cursor.
  • To zoom in and out along the vertical axis, place the mouse cursor over the area of interest. Then press the Ctrl key and use the mouse wheel to zoom in or out around the location of the mouse cursor.
  • To zoom on a specific area, click and drag to draw a blue rectangle over the zoom area.
  • To achieve a horizontal auto-scale, right-click and drag horizontally. A light grey horizontal strip will appear. Release the mouse button to perform the horizontal auto-scale.
  • To achieve a vertical auto-scale, right-click and drag vertically. A light grey vertical strip will appear. Release the mouse button to perform the vertical auto-scale.
  • To enter panning mode press and hold the mouse middle button or Ctrl + Left mouse button and move the mouse.
  • To prevent a plot from changing the displayed range of values, hover over the y-axis and click the lock icon that shows up. The same can be done from the y-axis pane menu in the right bar.

Sys. Id. application examples

  • This example implements . Further details are provided in PN215.
  • This example implements . Further details are given in PN216.