7.2. Graph window

The graph window of the Jrk G2 Configuration Utility shows a real-time graph of several important variables from the Jrk. You can open the graph window by selecting “Graph” from the “Windows” menu, or by clicking on the graph in the “Status” tab.

While the graph window is open, the graph is displayed there instead of in the Status tab. The controls in the graph window allow you to select which variables to plot and configure how they are plotted. When you close the graph window, the graph moves back to the Status tab.

Variables plotted on the graph

Most of the variables that can be plotted in the graph are documented in Section 10, with these exceptions:

  • The “Error” variable is the “Scaled feedback” minus the “Target”. This is the same as the error variable used by the PID calculation (Section 7.5), except it does not account for the feedback wraparound setting.
  • The “Raw current (mV)” variable is the measured voltage on the Jrk’s internal current sense line (see Section 7.6).
  • The “Current” variable is the Jrk’s estimate of the motor current (see Section 7.6).
  • The “Current chopping” variable shown in the graph is 1 if hardware current chopping has happened since the last time the graph was updated, and 0 otherwise. When “Current chopping” is 1, it means the motor exceeded the configured hard current limit. This variable is derived from the Jrk’s “Current chopping occurrence count” variable. Note that this variable is only valid for the Jrk G2 18v19, 24v13, 18v27, and 24v21. The Jrk G2 21v3 cannot detect when current chopping occurs.

The graph window is updated every 50 ms, so if the Jrk’s PID period is faster than that (which it is by default), then the graph will not be able to show readings from every PID period.

Choosing which variables are shown

By default, only the “Target” and “Scaled feedback” variables are plotted. You can add more variables to the graph by checking the corresponding checkboxes, and you can hide variables by unchecking the corresponding checkboxes.

The “Show all/none” button show all the variables by default, but if all the variables are shown already then it will hide all of them.

Changing plot colors

To change the color of a plot, right-click on the corresponding checkbox and select “Change color”. You can switch back to the default color by selecting “Reset color” from the that menu. You can change all the plots to use their default colors by selecting “Reset all colors” in the “Options” menu in the upper left corner of the graph window.

In the “Options” menu, you can select “Use dark theme” to change the graph’s background to black and use a different set of colors for plotting variables. To get back to light mode, select “Use default theme” in the “Options” menu. The graph keeps track of the plot colors for dark mode separately from the colors you choose in light mode, so any color changes you make while one theme is selected will not affect the other theme.

Entering the plot position and scale

The graph window allows you to set the position and scale of each plotted variable independently, much like an oscilloscope.

The scale is the number of counts of the variable value that correspond to one vertical division of the graph. The vertical divisions are marked by the heavier horizontal lines on the graph; there are ten divisions total. The default scale of many of the variables is 819; this means that one division corresponds to 819 counts, and five divisions corresponds to 4095 counts.

The position specifies where the X axis of the plot is located, in units of the variable value, relative to the vertical midpoint of the graph. Another way to think about it is that zero minus the position is equal to the variable value at the vertical midpoint of the graph. For example, if the scale is 100 and the position is 200, then the X axis of the plot will be located two divisions above the vertical midpoint of the graph, and any data points plotted at the vertical midpoint of the graph indicate a variable value of −200. The X axis of a plot is the horizontal line at which the variable value is zero.

You can set the position and the scale directly using the numeric inputs on the right side of the graph. After selecting a numeric input, you can either type in a number or use the arrow keys to go up and down in steps. You can press PageUp or PageDown to go up or down 10 steps at a time.

You can switch back to the default position and scale for a plot by right-clicking on the corresponding checkbox and selecting “Reset position and scale”. You can change all the plots to use their default positions and scales by selecting “Reset all positions and scales” from the “Options” menu.

The location of each plot’s X axis is marked with a right-pointing arrowhead on the left side of the graph. Similar arrows are also drawn on the top and bottom sides of the graph if any of plotted variable values have overflowed the top or bottom side of the graph and thus are not visible. If you see arrows on the top or bottom, it means there is data off the screen that you cannot see, and you might consider adjusting the position or scale to make that data visible.

Setting the plot position and scale with the mouse

As an alternative to entering the position scale using the numeric inputs, it is possible to select a plot and then use the mouse to set the position and scale.

First, to select a plot, you need to do one of the following:

  • Right-click on the corresponding checkbox and select “Select”. This is the most reliable way to select a plot.
  • Adjust the position or scale of a plot using the numeric inputs. This automatically selects the plot as a side effect.
  • Click near any of the plot’s data points or arrowheads to select it. If multiple plots are visible and overlapping, this does not always work reliably. If you click close to two different plots, the one that is closest to your mouse cursor will be selected.

When a plot is selected, labels for its position and scale will appear on the left side of the screen near its X axis arrowhead, all of its arrowheads will be slightly bigger than usual, and the plotted data line will be slightly thicker. You can look for any of these visual cues in order to make sure you have selected the right plot.

Once you have selected a plot, you can adjust its position by holding the Shift key and dragging upwards or downwards on the graph surface. More specifically: put your mouse cursor in the graph area, start holding down the shift key, start holding down the left mouse button, move the mouse up or down, and release the mouse button. You can release the shift key any time after you start holding down the mouse button.

You can also drag a plot without using the shift key, but your mouse will have to be pointing to that plot or one of its arrowheads when you start dragging, and if there is another plot nearby you might accidentally end up dragging that plot instead. Holding down the shift key allows you to drag the selected plot from any part of the graph.

While a plot is selected, you can also zoom in and out (affecting both the position and the scale) by using your mouse wheel while the cursor is over the graph area. When you do this, the vertical position of your mouse matters: the zooming is centered on the horizontal line going through your cursor, meaning that any data points on that horizontal line will not move (or move very little) as you zoom in and out. If you’re zooming in, you should probably put your cursor over the data you want to see while you are zooming in.

You can also use the mouse wheel on the “Scale” and “Position” numeric inputs, as an alternative to using the arrow keys.

Time settings

By default, the graph window shows the last 10 seconds of data from the Jrk. The right side of the graph corresponds to the most recent data, and the left side of the graph corresponds to data that is 10 seconds old. You can change the timespan to be anything from 1 to 90 seconds by entering the desired number of seconds into the numeric input labeled “Time (ms)”.

You can stop the graph from moving by clicking the “Pause” button, and then restart it later by clicking the “Run” button.

The software keeps track of the last 90 seconds of data for all variables, so if something interesting happens and then the data for it scrolls off the graph, just press the Pause button quickly and set the time span to 90 seconds to see the what happened. You can change any of the graph settings while the graph is paused.

Saving and loading graph settings

In the “Options” menu, the “Save graph settings…” and “Load graph settings…” commands allow you to save your graph settings to a text file and load them back later. These settings are generally lost whenever you restart the Jrk configuration utility, so if you have spent a lot of time adjusting the appearance of your graph then you might find it useful to save those settings for later.

Related Products

Jrk G2 18v19 USB Motor Controller with Feedback
Jrk G2 24v13 USB Motor Controller with Feedback
Jrk G2 18v27 USB Motor Controller with Feedback
Jrk G2 24v21 USB Motor Controller with Feedback
Jrk G2 21v3 USB Motor Controller with Feedback
Jrk G2 21v3 USB Motor Controller with Feedback (Connectors Soldered)
Log In
Pololu Robotics & Electronics
Shopping cart
(702) 262-6648
Same-day shipping, worldwide
Menu
Shop Blog Forum Support
My account Comments or questions? About Pololu Contact Ordering information Distributors