XY Plot Module

This article describes how to use the XY plot module of imperix Cockpit to interact with the user code running on imperix controllers, namely the B-Box 4, the B-Box RCP, the B-Board PRO, the Programmable Inverter and the B-Box Micro. This page provides a detailed explanation of the module’s features.

For new users, it is recommended to read the following articles beforehand to get started with the imperix software development kits (SDKs) and the Cockpit monitoring software:

XY Plot basics

The XY plot module allows for visualizing the relationship between two variables by plotting one against the other in a two-dimensional plane. This is particularly useful for analysing current trajectories in motor control, Maximum Power Point Tracking (MPPT) characteristics, or phase-current relationships in multilevel converters.

The sampling frequency of the XY plot can range from 10Hz up to the CPU control task frequency. The maximal amount of the recorded data depends on this value and the number of acquired variables. Once the allocated memory buffer fills up, the oldest acquired points are automatically disregarded.

XY Plot interface

The plot preview shows a downsampled overview of all variables used by any of the curves. The color of each variable corresponds to the color associated with its curve. The plot preview can be collapsed to optimize space when using Cockpit on a small monitor.

These plots display the X and Y variables of all curves over time and allow the monitoring of the temporal evolution of the signals. The color of each variable matches the color of the curve that makes use of it. Each plot can be individually collapsed to optimize space when using Cockpit on a small monitor.

The main plot area where the curves are drawn. Each curve represents the relationship between its assigned X and Y variables, plotted against each other.

Displays the current XY plot state. The possible states are:

  • Offline: the target is disconnected from the host computer or the user code is not running on the target.
  • Stopped: the acquisition is stopped. The data that was acquired before the acquisition was stopped remains on display.
  • Paused: the XY Plot window is not rolling with the acquisition.
  • Live: the XY Plot window is rolling with newly acquired data.

Clears all of the data acquired by the XY plot. If the XY plot is acquiring, the acquisition will continue.

These buttons provide options for adjusting the plot view:

  • Vertical and horizontal autoscale: Autoscales both axes, ensuring the acquired signals fit in the plots.
  • Horizontal autoscale: Autoscales the horizontal axis. If paused, monitoring will automatically resume. When Keep aspect ratio is enabled, the vertical axis may also be adjusted to maintain the configured ratio.
  • Vertical autoscale: Autoscales the vertical axis. When Keep aspect ratio is enabled, the horizontal axis may also be adjusted to maintain the configured ratio.
  • Continuous autoscale: When enabled, continuously auto-scales both axes, ensuring that the curves never go out of scope.

Controls the acquisition and display of the XY plot. The pause button temporarily freezes the display while data acquisition continues in the background. The stop button halts both display and acquisition. Clicking the play button from a paused or stopped state will resume or restart the acquisition.

The bottom bar displays information about the plotted curves and provides controls for each curve:

  • Style: Modify the color and line style of each curve
  • Curve Name: Rename the curve identifier
  • Toggle visibility: Show or hide individual curves using the eye icon
  • Remove curve: Delete a curve using the X button
  • X Axis / Y Axis: Change the variables assigned to each axis of the curve

The main settings panel for the XY plot module:

  • Keep aspect ratio: When enabled, maintains a fixed aspect ratio for the XY plot, ensuring proportional scaling on both axes. The ratio can be customized from 1:1 up to 1:100 or 100:1.
  • Display X and Y time plots: When enabled, shows the individual time-domain plots (2) above the main XY plot.
  • Sample rate [Hz]: Sets the sampling frequency for data acquisition.
  • Window [s]: Sets the time window length for the displayed data.
  • Retention time: Displays the maximal length of the recorded data in time.
  • Buffer usage: Shows the current state of the memory buffer as a percentage.

Allows manual configuration of the X-axis range by setting the maximum and minimum values. When Keep aspect ratio is enabled, changing the X-axis range will automatically update the Y-axis range to maintain the configured ratio.

Allows manual configuration of the Y-axis range by setting the maximum and minimum values. When Keep aspect ratio is enabled, changing the Y-axis range will automatically update the X-axis range to maintain the configured ratio.

XY Plot tips and tricks

  • To add a curve to the XY plot, open the user variable section of the project pane. Variables can be added one by one: the first variable will create a new curve and be assigned as the X value, and the second variable will complete the curve by being assigned as the Y value. Alternatively, multiple variables can be added at once by holding Ctrl while clicking to select individual variables, or by holding Shift to select a range of variables. The first selected variable becomes X and the second becomes Y. If more than two variables are selected, multiple curves will be created following the same logic (3rd and 4th variables create a second curve, etc.). The bottom bar can also be used to change the X and Y axis variables directly for each curve.
  • To inspect specific data points, pause or stop the acquisition and move the cursor along the time axis in the X or Y time plots. A marker on the XY plot will follow, indicating the corresponding position on the curve.
  • To zoom in and out, place the mouse cursor where to zoom. Then, use the mouse wheel to zoom in or out around the mouse cursor. Both axes are zoomed simultaneously.
  • To zoom on a specific area, click and drag to draw a blue rectangle over the zoom area. When Keep aspect ratio is enabled, the zoom may not perfectly match the selected area, but will approximate it as closely as possible while maintaining the configured ratio.
  • To achieve a horizontal autoscale, right-click and drag horizontally. A light grey horizontal strip will appear. Release the mouse button to perform the horizontal autoscale.
  • To achieve a vertical autoscale, right-click and drag vertically. A light grey vertical strip will appear. Release the mouse button to perform the vertical autoscale.
  • Many of the XY plot functionalities can also be accessed through context menus by right-clicking on a plotted curve or on the empty space in the plots.

XY Plot application examples

The following examples illustrate typical use cases of the XY Plot module:

  • Stator current trajectory during a motor homing sequence. The pattern shows the current vector as the rotor position is aligned by the control. Further details are provided in Field-Oriented Control of PMSM.
  • Power-voltage (P-V) characteristic of a photovoltaic string. The curve shows the MPPT algorithm reaching the maximum power point. Further details are provided in Maximum Power Point Tracking (MPPT).
  • Current trajectory of an MMC inverter with low fundamental frequency and harmonic current injection. The X and Y time plots show the evolution of the αβ-axis circulating currents.