This version (17 Jan 2023 20:03) was approved by Doug Mercer.The Previously approved version (21 Nov 2022 16:25) is available.Diff

Oscilloscope and X-Y Plotting Virtual Instruments for ADALM1000 in ALICE 1.3


This document serves as the Oscilloscope and X-Y Plotting Virtual Instrument section of the User’s Guide in the ALICE 1.3 Desktop software interface written for use with the ADALM1000 active learning kit hardware.

Oscilloscope / Main Window:

Be sure that the ALM1000 board is plugged into a USB port before starting the program. Once the program is running the main Oscilloscope window, as shown in figure 1, should appear. This is also serves as the main ALICE desktop window as well as the Oscilloscope VI Window. There are also controls for opening the other virtual instrument windows and certain common control functions. The window is sub divided into 4 sections.

Figure 1, ALICE Desktop main Oscilloscope window

The Top Menu Section

The menu section along the top, shown in figure 1T, contains various buttons and drop-down menus that control Oscilloscope Triggering, Horizontal time base, Horizontal position, how and what signals are displayed, and run acquisition looping / stop acquisition looping / exit program.

Figure 1T, Top Menu Buttons

Triggering functions

The ADALM1000 signal generation and measurement hardware is tightly integrated and can operate in two modes. As an integrated Source/Measurement Unit where the output signals generated by the SMU are synchronized with the input signal measurement function. As such the displayed waveforms will always start at the same point and triggering is not necessary. We refer to this first mode where the AWG restarts at the beginning of each sweep as “discontinuous” mode. We refer to the second mode as “continuous” mode where the AWG runs continuously. In this mode the displayed waveforms will not be stable and move around from sweep to sweep and triggering must be used to display stable waveforms.

The Trigger button is a drop down menu listing which signal to trigger on, CA-V, CA-I, CB-V, CB-I or none. The use of Triggering to display a stable trace is generally necessary when viewing externally generated signals. When viewings internally generated signals from one or the other of the AWG channels a stable trace happens automatically when the AWG Sync function is enabled i.e. the beginning of the AWG output waveform is restarted at the same point at the start of each time sweep.

Figure Trig 1, Trigger Drop Down Menu.

The Auto Level option automatically sets the trigger level to the selected waveform midpoint on each sweep. The trigger point will thus track any changes in the input waveform.

The Low Pass Filter option applies a variable length digital low pass filter function to the selected waveform before searching for the trigger condition. This can be used to filter high frequency noise that might be on the signal of interest and better stabilize the triggering. The length of the filter, in samples, can be set/adjusted in the Change Settings Window. When using trigger filtering Hold Off time must be set to be greater than or equal to the length of the filter, filter length / sample rate.

When Manual Triggering is selected one sweep is acquired and displayed each time the green Run button is clicked.

When Single Shot Triggering is selected triggering is “armed” the program contentiously sweep until the trigger condition is met for the first time capturing and displaying a single event. The acquisition is stopped and Single Shot Triggering is deselected. Reselect to capture another event.

The Edge button is a drop down menu listing either the rising or falling edge for triggering. The Trigger Level entry window contains the trigger level in volts for CA-V and CB-V or mA for CA-I and CB-I.

The 50% button sets the trigger level to the midpoint (50% point) of the selected trigger waveform. i.e. to the (maximum + minimum)/2.

Horizontal Time Controls

Roll Feature Available in Fall 2021 release

There are two sweeping modes in the time domain display. The conventional time per Div based view and a rolling mode. The Roll Mode in a digital storage oscilloscope uses a display different from that of the usual time-based view. While viewing a very low-frequency periodic signal in the usual time per Div based view the screen up dates, is redrawn, with the next new trace only after a screen’s worth of data samples are captured. This can take a few seconds for 100 mS/Div or greater time bases. Rather, in Roll Mode the trace is redrawn continuously and moves from right to left along the time-axis as new samples are taken, resembling what you would see in an analog strip chart. The time axis, rather than starting at the triggering point as in conventional mode, remains static and the waveform moves or rolls. Accordingly, in roll mode, the trace enters at the right of side of the display and travels in a stately fashion across the grid at a speed that is determined by how fast the computer can update (redraw) the display. This will vary from computer to computer based on the speed of the machine you are running the software on. The Roll-Off and Roll-On button between the Time base Entry and Curves Drop down Menu toggles between the Sweep Modes.

The Hold Off entry window, in mS, is used to shift the horizontal position ( apparent time 0 start point ) within the acquired sample point buffers being displayed. The data used for the vertical and horizontal waveform calculations is also shifted by that amount. The sample buffer is generally two screens long so setting the hold off time to more than one screen width is not recommended. This is mainly used when synced to the AWG. Due to the discontinuous nature of the AWG outputs this allows the user to skip over any initial transients that might appear if the system being measured has “inertia” or “state” that needs to settle out. Alice (Python) only supports discontinuous mode right now so the AWG outputs turn off and go into a high impedance state between sweeps.

The Horz Pos entry window is used to change the horizontal position of the time trace. Normally, with the Horz Pos set to 0 the left edge of the grid is “time 0”. Setting Horz Pos to something else shifts the 0 time point on the grid by that amount ( in mSec ). So if you set Horz Poss to a negative number for example you can see time before the trigger.

The Time mS/Div spinbox entry window is used to set the horizontal time base in the standard 1, 2, 5 step increments. Other values maybe entered manually.

Trace Controls

The Curves drop down menu button allows the selection of which signal waveform traces will be displayed vs time. The All button selects all four curves to be displayed and the None button clears all four curves. Plot the Math-X and Math-Y formulas by clicking on those options. ALICE can automatically adjust the trace vertical position to center the CA-V and /or CB-V traces on the midpoint of the waveform each sweep by clicking on either or both of the options below the –Auto Vert Center- heading. This is analogous to a software “AC” coupling mode where the “DC” level of the trace is always centered on the grid.

When using external Resistor Divider attenuators the frequency response of the Channel may be reduced. The software High Pass frequency compensation can be selected for either channel by clicking on the buttons below the –Input HP Comp- heading. See the section on Analog Inputs below

It is also possible to select which of the possible stored reference time traces, if saved via the Snap-Shot option, will be displayed.

At the bottom are options to enable the vertical Time and horizontal Voltage (Current) cursors.

Figure Cur 1, Curves Drop Down Menu.

The green PWR-On button toggles on and off the fixed analog +2.5 V and +5 V power supplies. The button turns red when the supplies are off. The power supplies do not turn completely off but go to around +2 V and can supply only about 20 mA when shorted to ground. This is much less than the 200 mA or so they could supply if accidentally shorted when on. It is good practice to turn off the supplies ( or better yet disconnect them ) when making any modifications to the circuit under test.

The green Run button starts continuous looping acquiring input samples. The red Stop button stops or pauses the acquisition looping. The Stop button also serves as a sort of refresh button. If the Stop button is clicked when stopped the graphics display is redrawn using any new settings that might have changed but using the existing data buffers. The Exit button exits (kills) the program.

Many of the drop down menus on the main oscilloscope screen and the screens for the other instruments include accelerator keys, indicated by () around the accelerator keyboard character next to the menu item. Typing one of these characters while the mouse cursor is inside the graphics drawing area will invoke that menu function. For example typing 1 or 2 will toggle on and off the CA-V and CB-V traces.

ALICE Scope/AWG only option

By setting to 1 the EnableScopeOnly = 1; option in the alice_init.ini file, the Oscilloscope and AWG controls can be combined in one window as shown in figure 1S. The controls all work as they do in the default two window configuration (See AWG guide page for details on AWG). Blue arrows point to AWG related controls, green arrows point to Scope related controls.

Figure 1S, ALICE Scope/AWG only option window

The other virtual instruments can still be accessed by clicking on the Open Instruments button in the Options drop down menu as shown in figure 1Vi.

Figure 1Vi, Other Virtual Instruments controls

The Right Side Menu Section

The Green Conn button in the top row indicates that a ALM1000 board is connected and ready to go. If the button is red and says Recon then a ALM1000 board was not found. Connect board and click on the button to connect to board.

The File drop down menu lists commands for saving and loading configuration settings (.cfg file). Save config does not save waveform data. Only the values of the various controls and settings etc. Which windows are open and where they are placed on the computer screen is also saved. When you Exit ALICE the program saves the configuration in a file named “alice-last-config.cfg”. When ALICE is restarted this configuration is reloaded so the program will be set up as it was when last exited. ALICE also has a feature to read an init file that can set the sizes of the graphics display areas and the trace colors etc upon start-up ( see the section at the end of this document on configuring ALICE for more details ).

On most operating systems there is a way to capture a bit map graphic of any of the display windows at any time. Some are built in or done through a support program or application. In Windows:

Press the <alt> and <printscreen> keys to capture the currently selected window in the copy buffer (clip-board). Then start a program such as Word or Paint (any similar program). Use Paste to place the screen shot into your document or drawing etc. Then save that file to disk.

It is possible to save the graphics display area to an encapsulated postscript file (.eps). This is used to save a graphics file to be included in another program like a word processor to write a Lab report.

It is also possible to save (with Save To CSV button) the captured channel A and B voltage and current signal data to a coma separated values file (.csv extension). For most Time/Div settings the number of sample points is 2 screen widths with a minimum of 2,000 samples and a maximum of 200,000. This saved table of raw sample values can then be loaded into other programs for analysis such as a spreadsheet program (Excel) or numerical processing program like MATLAB, Octave or Python. Similarly, it is possible to load (with Load From CSV button) in trace data into the channel A and B voltage and current signal data buffers from a saved csv file. This only works when stopped. If the green Run button is pressed new data is captured over writing the data that was loaded from the file.

The Options drop down menu, figure 2, lists a command for enabling smoothing where spline curves are used to connect the input sample points rather than the default straight lines. A second option for connecting the sample points is to use a zero order hold function where a horizontal line and a vertical line are used. This looks like a stair step waveform much like the output of the Digital-to-Analog converters used to generate the AWG output signals actually produce.

Figure 2, Options Drop Down Menu

The Trace Avg button turns on trace averaging. The number of sweeps to average can be set from the Change Settings controls with the Number of Traces to Average entry. The width of the traces in pixels can be set with the Trace Width in Pixels entry. The width of the grid in pixels can be set with the Grid Width in Pixels entry.

The currently displayed traces will be saved via the Snap-Shot option as reference traces. They can be added to the graphics plot area by selecting the desired trace from the Curves drop down menu for time plots. They will be drawn in a darker color corresponding to the matching live waveform trace.

The Graphics display area can be drawn with either a Black (default) or White background. Use these two buttons to select which is used. The last option button starts the self calibration procedure. See later section for more details.

The CA and CB measure drop down menus, figure 3, list which vertical measurements for the Channel A and B voltage and current signals are to be displayed along the bottom of the graphics display area.

Figure 3, Measurements Drop Down Menu ( CA )

The displayed vertical measurements can be the following:

  • Average, which is the sample by sample sum of the data record divided by the number of samples. For most Time/Div settings the number of samples is 2 screen widths.
  • Minimum, which is the minimum value within the data record.
  • Maximum, which is the maximum value within the data record.
  • Base, used mainly for square waves it is the voltage level of the lower flat portion of the wave which may be different from the Min value due to undershoot.
  • Top, used mainly for square waves it is the voltage level of the upper flat portion of the wave which may be different from the Max value due to overshoot.
  • Midpoint, which is the maximum value plus the minimum value divided by two.
  • Peak-to-Peak, which is the maximum value minus the minimum value.
  • RMS, or True RMS which is the square root of the sum of the sample by sample data record squared divided by the number of samples.
  • CA-CB and CB-CA differences of the Average ( DC ) voltage values of the channels.
  • The true RMS value of the sample by sample difference of the A and B channel voltages (A-B RMS)
  • Display User defined measurement.

The displayed horizontal measurements for the voltage traces can be the following:

  • High pulse width ( time waveform is above the mid-value )
  • Low pulse width ( time waveform is below the mid-value )
  • Duty Cycle ( percent of time waveform is High )
  • Period ( time between 2 rising edges where waveform crosses mid-value )
  • Frequency ( 1 / period )

Figure 3g shows examples of many of the possible waveform measurements. Six of the vertical measurements are derived directly from the waveform data array. These are Avg, Min, Max, Top, Base and RMS. The rest are calculated from these six. P-P is obviously Max – Min. Mid is (Max + Min / 2). CA-CB is CA Avg – CB Avg.

Figure 3g, Measurement examples

The User measurement option allows the user to calculate any other measurements based off these constants. When clicked on the user is prompted for a label to be used while displaying the value and a formula for calculating the value. Clicking on Cancel for either the label or formula turns off the display of the User measurement.

For example the overshoot can be calculated by the formula:

(MaxV1 –VATop)/(VATop-VABase)

A second example would be the gain of a circuit where channel A is considered the input and channel B is the output. The gain would be the ratio of the two P-P values:


A third example is to calculate the rms value of just the AC portion of a signal. The ALM1000 inputs only accept positive voltages thus all “AC” signals must have some DC offset. The built-in True RMS calculation includes this DC component. To remove the DC portion and just display the rms value of the AC portion of Channel A you can use the following formula:

math.sqrt(SV1**2 - DCV1**2)

The Crest factor can be calculated which is the ratio of peak-to-RMS values. The crest factor for single frequency sine waves is 1.414 (1/0.707), but can be as high as five or more for random noise. The crest factor for the channel A waveform would be the ratio of the Max and RMS values:


Another common waveform calculation is the peak-to-average ratio or PAR.


Two more examples are to calculate the Peak positive and negative slew rates. The Numpy ediff1d function takes the differences between consecutive elements of an array. We can use this to calculate the dv/dt or the time rate of change between samples. Each sample is 10 uSec apart so we get V/10uS or we can divide by 10 for V/uS or multiply by 100 for V/mS. We can then use the Numpy max or min function to find the positive ( maximum ) slew rate or the negative ( minimum ) Slew Rate using the following formulas:

numpy.max(numpy.ediff1d(VBuffA))*100 or

We can extend this calculation to estimate the rise and fall times for square wave signals assuming a more or less constant ( peak ) slew rate between the 10% to 90% levels. If we divide 0.8 ( 80% ) times the peak-to-peak value of the waveform by the peak slew rate we get the rise or fall times.

(MaxV1-MinV1)*0.8 / (numpy.max(numpy.ediff1d(VBuffA))*100) or
(MaxV1-MinV1)*0.8 / (numpy.min(numpy.ediff1d(VBuffA))*100)

If the waveform has significant overshoot or undershoot you could alternatively use the VATop and VABase values rather than the Max and Min values.

Waveform calculated Vertical measurement scalars:

DCV1 is the channel A Average voltage
MinV1 is the channel A Minimum voltage
MaxV1 is the channel A Maximum voltage
VATop is the channel A Top voltage
VABase is the channel A Base voltage
SV1 is the channel A RMS voltage
DCV2 is the channel B Average voltage
MinV2 is the channel B Minimum voltage
MaxV2 is the channel B Maximum voltage
VBTop is the channel B Top voltage
VBBase is the channel B Base voltage
SV2 is the channel B RMS voltage
DCI1is the channel A Average current in mA
MinI1 is the channel A Minimum current in mA
MaxI1 is the channel A Maximum current in mA
SI1 is the channel A RMS current in mA
DCI2 is the channel B Average current in mA
MinI2 is the channel B Minimum current in mA
MaxI2 is the channel B Maximum current in mA
SI2 is the channel A RMS current in mA

Waveform calculated Horizontal measurement constants:

CHAHW is the channel A High Pulse Width
CHALW is the channel A Low Pulse Width
CHADCy is the channel A Duty Cycle
CHAperiod is the channel A Period
CHAfreq is the channel A Frequency
CHABphase is the channel A to channel B relative phase angle
CHBHW is the channel B High Pulse Width
CHBLW is the channel B Low Pulse Width
CHBDCy is the channel B Duty Cycle
CHBperiod is the channel B Period
CHBfreq is the channel B Frequency

The Math menu button, figure 4, opens a control screen that lists which sample point by sample point calculated waveform combining the Channel A and B voltage and current signals is to be displayed vs time.

Figure 4, Math traces control screen

One of the following built-in calculated waveforms can be displayed at a time:

  • CA-V + CB-V, the sum of the channel A and B voltage waveforms
  • CA-V – CB-V, the difference of the channel A and B voltage waveforms
  • CB-V – CA-V, the difference of the channel B and A voltage waveforms
  • CA-I – CB-I, the difference of the channel A and B current waveforms
  • CB-I – CA-I, the difference of the channel B and A voltage waveforms
  • CA-V * CA-I, the product of the channel A voltage and current waveforms which is instantaneous power
  • CB-V * CB-I, the product of the channel B voltage and current waveforms which is instantaneous power
  • CA-V / CA-I, the ratio of the channel A voltage and current waveforms which is instantaneous resistance
  • CB-V / CB-I, the ratio of the channel B voltage and current waveforms which is instantaneous resistance
  • CB-V / CA-V, the ratio of the channel B voltage and channels A voltage waveforms which is instantaneous voltage gain assuming CA-V is input and CB-V is output
  • CB-I / CA-I, the ratio of the channel B current and channel A current waveforms which is instantaneous current gain assuming CA-I is input and CB-I is output

The first three calculations result in voltages and share the corresponding left side voltage scale on the display grid. The two current differences result in a current and share the corresponding right side current scale on the display grid. The two product waveform calculations result in mW and share the corresponding right side scale on the display grid. The two voltage over current waveform calculations result in Ohms and share the corresponding right side scale on the display grid. These calculated waveforms can produce strange looking results for periodic waveforms driving non-resistive loads such as capacitors or inductors. The final two ratio calculations can be used to calculate voltage gain and current gain respectively and are dimensionless.

If Formula is selected then the mathematical formula entered in the top formula, will be plotted vs time. This allows greater flexibility in waveform plotting at the expense of typing in the function to be plotted. See section on Advanced Math Traces below on how to enter formulas. Any one of the four channel vertical axis controls can be chosen for the Formula axis using the Math Axis entry. Generally when plotting using Formula, one or the other of the four channels are not being displayed and its axis controls will be available to be used. Two more math formulas, X Math Trace and Y Math Trace can also be entered/edited through these controls.

The AWG control Window is opened by default when the program is started. Since all of the displays use the AWGs in some fashion, it is important that this window be available to all. If you dismiss ( minimize to the tool bar ) the AWG control window, clicking on the AWG Window button will bring back the window.

The X-Y Plots Window button opens the X vs Y display window.

The Spectrum Window button opens the Spectrum Analyzer display window.

The Bode Plot Window button opens the Bode Plot display window.

The Impedance Window button opens the Impedance Analyzer display window.

To update the display window for a particular tool ( when running ) the matching Time Plot, X-Y Plot, Freq Plot, Bode Plot and/or Impedance Plot enable check boxes must be selected. More than one display can be selected at a time but some combinations such as X-Y and Spectrum or X-Y and Impedance would not make much sense while Time and X-Y or Time and Spectrum might.

Analog Inputs

To keep production costs of the board low, certain trade offs were made. One was to forego programmable input gain ranges that use resistor dividers and perhaps adjustable frequency compensation capacitors. This limited the usable input voltage range to 0 to +5V.

At the bottom of this section, just above the ADI logo, are entry windows which allow input gain and offset adjustments or corrections for any external resistor divider attenuator networks that might be added to the channel A and B inputs ( possibly used when in the high impedance or Split I/O modes ). Save and Load Adj buttons can be found under the File drop down menu.

Input Divider Calculator

To make calculating an input resistor divider's Gain and Offset values based on the resistor values used and offset connections a simple calculator window has been included (since release 1.3.14). The button directly above the Gain and Offset entries will open the calculator.

Figure Div1, Input Divider Calculator.

Values for resistor R1 and resistor R2 are entered as well as any offset voltage that is applied to the bottom of the divider. The Exact values, as measured with a bench DMM, can be entered for R1 and R2 to calculate more accurate gain and offset results. The Rint internal 1 MegΩ resistance of the channels is taken into account in the calculation as this will have a significant effect for higher values of R1 and R2. Click the Calculate button to calculate the values. The Channel A or B entries can then be set to the calculated values using the Set CH A and Set CH B buttons respectively. These values can then of course be tweaked as needed for even better accuracy.

Software Frequency Compensation

The input capacitance, CINT, of the analog inputs in the high Z mode is approximately 390 pF (for the rev D design and slightly higher for the rev F design). This relatively large capacitance along with relatively high resistance dividers can significantly lower the frequency response. In figure In1 we again revisit the input structure of the M1k and connecting an external resistive voltage divider R1 and R2,3. The contents of the blue box represent the input of the M1k in Hi-Z mode. To introduce an optional DC offset for measuring negative voltages resistor R2 is included and could be connected to either the fixed 2.5V or 5V supplies on the M1k. The CINT and effective resistance of the divider network form a low pass pole in the frequency response.

The ADALM1000 (Rev. F version) has the ability to separate the voltage measurement connection from the voltage / current output pin, the Split I/O mode control in the AWG settings. The size of the parasitic capacitance is significantly different when using the CH A/B pins in Hi-Z mode vs using the AIN/BIN pins. The required external compensation capacitor value will be very different between the two pins.

To give you a rough idea let's use 400 pF for CINT and 1 MΩ for the resistor divider. That would result in a low pass response with a 3 dB roll-off starting at around 400 Hz. A capacitor would generally be needed across the input resistor R1 to frequency compensate the divider. Such a hardware solution generally requires the capacitor (or alternatively the divider resistors) to be adjustable.

Figure In1, External voltage divider options

It would be nice to not have to use a compensation capacitor, adjustable or otherwise. A digital (software) frequency compensation feature has been implemented in the ALICE 1.3 Desktop software package.

The software frequency compensation for each channel consists of a cascade of two adjustable first order high pass filters. The time constant and the gain of each stage can be adjusted. Normal first order high pass filters do not pass DC so a DC gain of 1 path is added to the overall second order high pass software compensation filter. This structure is often called a shelving filter because of the shape of its frequency response.

Exponential compensation
An Exponential compensation technique adds one or more exponentially decaying terms to a step in the signal. With 2 available stages, ALICE can correct for multiple spurious inductances and capacitances in the input divider circuit. Exponential compensation works best for overshoots and undershoots smaller than about 10% of the step height. In this case, a sum of exponential terms is an accurate generic model for such defects.

In figure In2 we show the new controls for the input compensation. To turn on and off the compensation for Channels A and B check boxes are added under the Curves drop down menu. Turning on compensation applies to both the Scope and Spectrum tools (time and frequency measurements). The filter time constant and gain settings can be set using new entry slots in the Settings Controls screen. The DC gain and offset adjust controls are unchanged.

Figure In2, Software frequency compensation controls

Simple Divider Example

The following examples use resistor values from the ADAPL2000 Analog Parts Kit and the intention is to keep the input resistance equal to at least 1 MΩ. No external compensation capacitor was used. A 500 Hz square wave from the Channel A AWG output is used to observe the step response of the example resistor dividers and adjust the compensation filter settings.

As a simple first example we can just use the 1 MΩ R1 resistor and not include the other resistors from figure In1. This gives us a total input resistance of 2 MΩ.

The first step will be to determine the exact divider ratio and correct for any DC offset. We need a known input voltage source to calibrate the gain adjustment factor. The board has two fixed voltage sources we can use, the +2.5 V and +5 V pins. We need to first directly measure these two voltages before adding any external resistors. With the A and B channels in Hi-Z mode, connect either CH-A (or CH-B) directly to the +2.5 voltage pin. Write down the DC average value you read. Now connect it to the +5 voltage pin. Again record the DC average value. You can double check / confirm these reading by measuring the +2.5 and +5 pins with CH-B. The DC average values should be very close to the same. Now we know the “exact” voltages and will use them as a “transfer standard” to calibrate the external divider.

Now as we said for this simple example we will add a 1 Meg Ω resistor in series with the CH-A and/or CH-B inputs. Connect one end of the resistor to the CH-A (or CH-B) pin. The other end will be the new analog measurement input. First we want to enter a first estimate for the gain under the Adjust Gain / Offset heading.In this case we know it will be about 2. Now connect the end of the 1 Meg resistor to a GND pin. Adjust the value under the Offset until the DC average value for that channel reads as close to zero as possible. Now connect the 1 Meg resistor to the +5 pin. Adjust the value under the Gain until the DC average value for that channel reads as close to the value you measured earlier for that pin as possible. The gain and offset adjustments interact with each other so you will want to iterate going back and forth between measuring the GND pin adjusting Offset and +5 pin adjusting Gain to get the closest reading for both cases. Once you are happy with the entered values you can also measure the +2.5 pin and check the reading against the value you measured earlier. It should be very close. You can Save and Load these adjustment values for later use by clicking on the Save and Load Adj under the Files drop down menu.

File Drop Down Menu

Figure In3, Settings for just 1.0 MΩ R1

As we can see for this example the DC gain setting is slightly more than 2 which is to be expected based on the internal 1 MΩ resistor and external 1 MΩ R1 resistor forming a 2:1 voltage divider. There is a small DC offset due to the leakage current from the ESD protection diodes on the M1k inputs and the parallel combination of RINT and R1. Your values will likely be completely different based on your hardware.

The input gain factor of 2 (2.17 to be exact) increases the allowable measurement range from 0 to +5 V to about 0 to +10 V. Enough to work with circuits powered from a 9 V battery. If you have a 9 V battery try measuring it by connecting the - battery terminal to GND and the + battery terminal to the end of the 1 Meg resistor. You should read about +9 V for the DC average.

Adjusting the compensation filter

The stage 1 filter Time Constant is adjusted to correct for the majority of the AC roll-off and the stage 2 filter Time Constant and Gain are tweaked to take out the remaining higher frequency (2nd order) roll off. A number of TC and Gain combinations are potentially possible and there may be more than one “right answer”.

A factor of 2X might not be enough of an increase in the maximum voltage to be measured. We might also like to measure negative voltages. For a second example we use two 470 KΩ resistors for R2 and R3 along with the 1 MΩ R1. R2 is connected to the fixed +5V supply to introduce some positive offset.

Figure In4, Settings for R1 = 1.0 MΩ, R2,3 = 470KΩ

As we can see the DC gain setting is slightly more than 6 based on the internal 1 MΩ resistor in parallel with the equivalent parallel combination of the two 470 KΩ R2,3 resistors (235 KΩ) and the external 1 MΩ R1 resistor forming a voltage divider of about 6:1. The input range is now slightly more than 30 V p-p.

For more on the use of input attenuators please refer to the following two documents:

M1K Analog Inputs
M1K Breadboard Adapters

The Bottom Menu Section

The menu section along the bottom contains the range ( V/Div, mA/Div ) and position controls for the Channel A and B voltage and current waveform displays. The entry labels are color coded to match the waveform trace colors. The V/Div and mA/Div spinboxs set the corresponding vertical ranges in the standard 1, 2, 5 step increments. Other values maybe entered manually. The position entry windows determine the vertical position of their scales with respect to the blue center line on the grid. That is to say the value entered corresponds to the number displayed next to the blue center line.

The default arrangement of the entry widgets and the buttons that serve as labels for the entries is for the labels to be to the right as shown in figure Scale 1. In the alice_init.ini file an optional flag can be set to swap this arrangement with the labels to the left as shown in figure Scale 2.

Figure Scale 1, Default arrangement for Channel control buttons; ButtonOrder = 0

Figure Scale 2, Alternate arrangement for Channel control buttons; ButtonOrder = 1

The Graphics Display Area

The graphics display area, show in figure 5, is where the various signal waveforms are plotted on either a black or white background depending on which is selected under the Options drop down. It consists of a main 10 by 10 grid with the center vertical and horizontal grid lines drawn in dark blue. Each major grid is sub divided into 5 sub grids by the short tick marks along the blue center lines. The horizontal grid lines are labeled with color coded text to match the corresponding waveform trace with the voltage scales on the left and current scales on the right.

The red triangle, drawn on the left side in the example shown because the trigger input is set to CA-V indicates the trigger level.

Above the main grid area is a line of text showing the device ID and Sample rate and if the acquisition loop is running or stopped. Below the main grid are three lines of text which display various information about the displayed plots. The first line shows the current time per division setting and the horizontal position of the left most grid line with respect to 0 time i.e. the trigger point.

The second and third lines of text are for displaying information related to Channel A and Channel B respectively. The selected V/Div is displayed along with any of the vertical measurements selected for that voltage channel. If a current waveform is being displayed the selected mA/Div is displayed along with any of the vertical measurements selected for that current channel.

Figure 5 Graphics display area

Grid Markers and Cursors

While stopped (red Stop button clicked) if you left click anywhere within the display grid a numbered marker “x” point will appear at that position. In the upper left corner of the display grid the maker number along with the vertical ( voltage or current ) and horizontal ( time ) values will also appear. For marker points > 1 the vertical and horizontal delta to the previous point will also be displayed. Clicking the red Stop button again will clear the markers. Clicking on the green CA-V/Div, cyan CA mA/Div, orange CB-V/Div or yellow CB mA/Div buttons along the bottom of the main Time display window will select which vertical range / position axis will be used and the marker will be drawn in that color.

Under the Curves Drop down menu there are selectors for displaying the T cursor ( time ) and V cursor ( voltage ). When selected if you right click anywhere within the display grid either a vertical or horizontal cursor line, or both, will be drawn at that location. The vertical, horizontal, or both values for that point will be displayed. Scrolling with the mouse wheel will move the vertical line left–right when only the T cursor is selected and the horizontal line up-down when only the V cursor is selected. When both are selected the mouse wheel moves the vertical line left–right. With the Shift key pressed the mouse wheel will move the horizontal line up-down.

Advanced Math Traces

In addition to the pre-programed Math traces, ALICE Desktop provides a method of plotting user defined equations or formulas using the voltage and current waveform buffers for channels A and B. The formulas are written in conventional Python syntax which is basically the same as you would expect to write any math expression. Any of the Python math ( and numpy ) module functions can be used such as math.sqrt() or math.sin() etc. Any of the ALICE global variables can be used but below is a list of the most useful available variables and constants:

Waveform Buffers:

VBuffA is the Channel A voltage sample array ( in volts )
VBuffB is the Channel B voltage sample array ( in volts )
IBuffA is the Channel A current sample array ( in amps, multiply by 1000 for mA )
IBuffB is the Channel B current sample array ( in amps, multiply by 1000 for mA )
VmemoryA is the Channel A voltage memory array used for Trace Averaging
VmemoryB is the Channel B voltage memory array used for Trace Averaging
ImemoryA is the Channel A current memory array used for Trace Averaging
ImemoryB is the Channel B current memory array used for Trace Averaging
AWGAwaveform is the Channel A AWG waveform memory array (used for non-built in waveforms)
AWGBwaveform is the Channel B AWG waveform memory array (used for non-built in waveforms)
t is the time index ( 10 uSec per point )
SAMPLErate is the sampling rate, 100000 samples per Sec, or 10 uSec per sample

Vertical Position variables:

CHAOffset is the value in the channel A voltage position entry window
CHBOffset is the value in the channel B voltage position entry window
CHAIOffset is the value in the channel A current position entry window
CHBIOffset is the value in the channel B current position entry window

As a simple example, to plot the difference between the channel A and B voltage waveforms the following formula would be used:

(VBuffA[t] - VBuffB[t] - CHAOffset)

As the program iterates over the time index t, the channel B voltage value is subtracted from the channel A voltage value and then offset on the screen by the channel A position variable. This replicates the built-in math trace CA-V – CB-V.

A more advanced example calculates the time derivative of the channel B voltage waveform, or slew rate, and scales it to V/mSec:

(VBuffB[t] - VBuffB[t-1] ) * 100

Again as the program iterates over the time index t, the channel B voltage value at t-1 is subtracted from the channel B voltage value at t and then multiplied by 100. The 100 scales the time from the 10 uSec per time sample to 1 mSec. The screen shot in figure 6, shows the result for a 4 V p-p triangle wave at 1 KHz. Since we are not displaying the channel B current we can use its settings as the vertical axis for the math trace by setting the Math Axis to I-B. The orange triangle wave changes 4 V in 500 uS for a slew rate of + and – 8 V/mSec shown with the magenta Math trace.

Figure 6, Calculating the slew rate

A few words of caution, care must be taken when writing the formula to not cause a Python syntax error or other math exception such as divide by zero. If you make a mistake ALICE will stop and put up the math formula entry window so you can find and correct your mistake.

DC Example:

To demonstrate how to use the Oscilloscope Tool as a DC voltmeter consider the resistor voltage divider network, shown in figure E1. We wish to measure the voltages at the 4 nodes and the voltages across the 6 resistors. In the figure the nodes are numbered from N0 to N4 with N0 being the ground or common node that all the voltage measurements will be made with respect to. With the Oscilloscope Tool we can measure two node voltages at a time and the voltage difference between those two nodes. Set both AWG channels to Hi-Z mode in the AWG control window and from the Meas CA menu select from the –CA-V- section the Avg and CA-CB check boxes. Likewise from the Meas CB menu select from the –CB-V- section the Avg and CB-CA check boxes.

Figure E1, Test resistor network, measuring nodes N1 and N2

We start with the network powered from the fixed +5 volt power supply at node N1 and the channel A input also connected to N1. The channel B input is connected to node N2. Click on the Run button and the N1, N2 node voltages will be displayed along with the difference between them as CA-CB and CB-CA. We can now proceed around the network measuring pairs of nodes until we can fill out table 1 below. Figure E2 shows the voltmeter inputs connected to nodes N3 and N4. Any combination of two nodes can be measured and the voltage difference between the two nodes will be displayed.

Figure E2, Test resistor network, measuring nodes N3 and N4


Table 1 Node voltages

From the measured node voltages ( and the difference voltages ) we can get the voltages across the 6 resistors shown in table 2.

R1N1 – N2 =0.972
R2N2 – N0 =3.958
R3N2 – N3 =2.188
R4N3 – N4 =0.991
R5N4 – N0 =0.779
R6N2 – N4 =3.179

Table 2 Resistor voltages

From these voltages and the values of the resistors the currents through the resistors can be calculated.

The X-Y Plotting Tool:

When the X-Y Plot Window button is clicked in the Main Window the X-Y display Window should appear, as shown in figure 13. It is sub divided into 3 sections.

Figure 13, X-Y Plots window

The menu on the right allows selection of which of the four possible input channel waveform signals or Math formula is to be used for the X and Y axis. Given four possible signals, Channel A voltage and current, Channel B voltage and current, there are in theory 16 possible combinations for X and Y. Not all 16 have been implemented since, for example, plotting a signal vs itself such as CA-V vs CA-V is a rather meaningless straight line.

Under the -X Axis- heading there are two options to display the histogram of either the channel A voltage or the channel B voltage waveforms. The horizontal axis is in volts and controlled by either the CA or CB V/Div and V Pos controls. The vertical axis is the histogram count or number of hits at a given voltage level. The vertical axis scale is controlled by the CA or CB mA/Div control.

It is also possible to select Math on one or the other or both axis. If Math is selected for just one axis then the selected trace from the Math drop down menu is used. Only a few of the built-in Math traces are supported. If Math is selected for both axis then the entered X formula and Y formula, using the Enter X or Y Formula buttons, will be plotted. This allows greater flexibility in X-Y plotting at the expense of the typing in the function to be plotted. See the earlier section on how to enter Advanced Math Traces for the Oscilloscope display. The same applies here to the X and Y formulas.

Any one of the four vertical axis controls can be chosen for the X and Y axis using the Math X or Y Axis buttons. Generally when X-Y plotting using Math one or the other of the four channels are not being displayed and its axis controls will be available to be used.

The X-Cur and Y-Cur check boxes select vertical and horizontal cursor lines which operate much the same as the T and V cursors in the Time display grid.

There is also a check button to display the saved X-Y reference trace (see note above in Oscilloscope section on Snap-Shot option).

Using ALICE XY display and The Lissajous Pattern

Oscilloscope and X-Y Plot Examples:

To demonstrate some of the features of the ALICE Oscilloscope and X-Y Plot Tools the following example circuit is offered. In figure E3 we see a simple NPN transistor ( 2N3904 ) in the common emitter configuration with a 100 KΩ resistor used to bias the base and a 1 KΩ resistor as the collector load. The collector load is supplied from the fixed +5 V power supply. We will use the ALICE software to plot IB vs VBE. We will also determine the value of CA-V corresponding to IC = 2 mA and then measure the input to output voltage gain around that operating point.

Figure E3, NPN common emitter amplifier

To plot VBE and IB we first start out with the channel B input (CB-V) connected to the base of the transistor. As the formula in figure E3 states, IB can be calculated by taking the difference of CA-V and CB-V and dividing by the 100 KΩ resistor value. 100 KΩ is chosen to simplify the calculations so that the current is found by just moving the decimal point of the measured voltage ( i.e. 1 V = 10 uA ).

Set up the AWGs as follows: Channel A, Mode set to SVMI, Shape set to Triangle, Min set to 0.0, Max set to 5.0, Freq set to 100. Channel B Mode set to Hi-Z. Be sure that the Sync AWG box is selected.

The time base should be set to 0.5 mSec/Div so that the rising half cycle from 0 to 5.0 volts will fill the grid. Set the Hold Off to 10 mSec so the start of the second cycle will be displayed. Under the Curves menu select CA-V and CB-V. Under the Math menu select CAV - CBV.

Press the green Run button. You should see something like figure E4.

Figure E4, VBE and IB plot

The green CA-V trace is the 0 to 5 V ramp that is being applied to the 100 KΩ resistor. The orange CB-V trace is the voltage on the base of the transistor or VBE. The magenta CAV-CBV math trace is the voltage across the 100 KΩ resistor and represents IB as 10 uA/V.

Pause or Stop the program ( red Stop button )

To make an XY plot of IB vs VBEopen the X-Y Plot Window and check the X-Y Plot box. In the X-Y Display window press the CB-V button in the -X Axis- section and the Math button in the -Y Axis- section. In the X-Y Window set the CB V Pos entry to 0.5 and the CB V/Div to 0.1. Press the green Run button. You should see something like figure E5.

Figure E5, IB vs VBE

The base current is very small when VBE is less than 0.6 V so there is likely to be noise in that part of the trace. Remember that the vertical voltage scale ( 0.5 V/Div ) is divided by the 100 KΩ resistor so it is 5 uA per division.

To plot the collector current move the Channel B input to the collector of the transistor. Now we need to go back to the time display window. Uncheck the X-Y Plot box and make sure the Time Plot box is checked. Under the Math menu select none for now.

Press the green Run button. You should see something like figure E6.

Figure E6, VCE plot

To turn the plot of VCE into IC we can use the gain and offset adjustment equation for channel B to calculate the equation for IC in figure E3. The “adjustment” equation is as follows:

V_dis = (V_raw – Offset )*Gain

Vdis is the “adjusted” ( scaled by some gain factor ) value to be displayed
Vraw is the measured value
Offset is the “adjustment” value entered for offset
Gain is the “adjustment” value entered for gain or scale factor

If we set the Offset equal to the actual value of the +5 V supply divided by the Gain adjustment (1.0) factor and change the sign of the Gain factor ( i.e. make it -1.0) we have the formula for IC from figure E3. After changing the channel B offset and gain factors press the green Run button and you should see something like figure E7.

Figure E7, IC plot

IC should be nearly zero where CA-V is less than 0.6 V. You may need to tweak the Offset factor to get IC to be exactly on the 0.0 grid line. An easy way to check this is to temporarily move the channel B input to the +5 V power supply. Now the difference between CB-V and the supply is exactly zero.

Remember that the vertical voltage scale ( 0.5 V/Div ) is divided by the 1 KΩ resistor so it is 0.5 mA per division. With the program paused, under the Options menu press the SnapShot button. This saves a copy of the displayed CA-V and CB-V traces. Under the Curves menus select RB-V. This will now display the saved IC plot.

Now move the channel B input back to the base of the transistor. Under the Math menu select the CAV-CBV math trace. Reset the Channel B Offset and Gain calibration factors to their normal values. Press the green Run button. You should see something like figure E8.

Figure E8, IC, IB and VBE plot

Now we have plots of IC ( dark orange ), IB ( magenta ) and VBE ( orange ) on the same grid as the base resistor bias CA-V is swept from 0 to 5 V ( green ).

Under the Curves Menu select the V cursor. Right click on the dark orange IC curve where it crosses the 1200uSec time grid. The voltage value at that point will appear next to the horizontal cursor line. The Use the mouse wheel it adjust the cursor up or down so it lines up exactly where the IC curve cross the time grid line. It should look like figure E9.

Figure E9, voltage cursor added.

The beta of the transistor can now be calculated by scrolling the cursor down till it lines up exactly where base current (magenta trace) at the same time grid line. The displayed voltage will represent the base current. Beta will be IC / IB. For this example IB is about 13 uA so beta will be around 154. The CA-V value where the green trace crosses the same Time Grid as IC = 2 mA should correspond to the base bias point where IC is equal to 2 mA. This is the bias point we would like to center our input signal on for the next measurement of the amplifier gain.

Move the channel B input back to the collector of the transistor.

Calculate new Min and Max values for Channel A by adding and subtracting 0.25 V to the 2 mA bias point we just measured. Enter these for Channel A. Set Channel A mode to sine wave. Under the Curves menu turn off the RB-V trace and under the Math menu select none. Set the time base to 2.0 mS/Div and the Hold Off to 0.0 so that two cycles of the input waveform are displayed. Under the Meas CA and CB menus in the -CA V- and -CB V- sections select Avg and P-P to be displayed.

Press the green Run button. You should see something like figure E10.

Figure E10, Amplifier input / output gain

The DC average of the output waveform should be at about 2 V ( 2 mA in the collector load resistor ) below the +5 V power supply or about +3 V. The voltage gain of the amplifier will be the Channel B P-P value divided by the Channel A P-P value. Which for this example is about 1.5.

Applying Digital Filtering:

With this interface, ALICE Desktop can apply digital filtering to the captured Channel A and B voltage waveform data before being displayed in the Time and/or Frequency domains. Digital filtering can also be applied to the contents of the generated AWG waveform buffers as well. ALICE uses the numpy convolve function to perform the filtering function. It is possible to have the program generate a simple Box Car (moving average) filter by setting the length and then clicking on the Box Car check box.

The supplied list of coefficients is convolved with the captured data buffer. The list of filer coefficients for either Channel A or B is first loaded from a single column .csv file by using the “Load CH A Filter Coef” and “Load CH B Filter Coef” buttons. The length ( number of coefficients ) and file name will then be displayed. The digital filter(s) will be applied to the voltage waveform data buffers if the “Filter CH A” and/or “Filter CH B” checkboxes are checked.

Figure 42, Digital Filter Control Interface

The arithmetic sum of the coefficients should equal 1 for the “filter” to have an overall gain of one. A simple low pass filter for example has a rectangular (box-car) shape. The coefficients for a length of 2 would be [ 0.5, 0.5 ]. For a length of 4 the coefficients would be [ 0.25, 0.25, 0.25, 0.25 ] and so on. A few example filter files can be found here:

Alternatively, a formula for the filter coefficients can be entered using the CH A or CH B Filter formula buttons. The program puts up an entry window where the formula can be entered. Conventional Python syntax is used and all the math and numpy library functions are available as in the the rest of ALICE. The program looks at the arithmetic sum of the coefficients and scales them appropriately for an overall gain of 1 through the filter.

The DFiltACoef and DFiltBCoef / AWGFiltACoef and AWGFiltBCoef array variable are used to store the filter coefficients. The Filter formula coefficient scaling feature can be used to scale a set of filter values read from a file. First read in the values from the file and then simply pass the array through the formula function by entering DFiltACoef or DFiltBCoef for the formula.

There are many filter design tools that can be found by searching the web. Here is one that works well but we are not necessarily endorsing it over any others that might be out there:

TFilter Online FIR filter design

The array of coefficients ( filter taps ) that it generates as part of the C source code can be copy and pasted into a .csv file for use in ALICE.

The interface for the digital filters can be enabled or disabled by setting the following variable to either 1 or 0 in the alice_init.ini file, see ALICE Advanced User’s Guide for more details.


For Further Reading:

Return to the ALICE Main Page.

university/tools/m1k/alice/oscilloscope-x-y-user-guide.txt · Last modified: 17 Jan 2023 20:03 by Doug Mercer