Gas station without pumps

2019 December 19

Macos 10.15 Catalina vs PteroDAQ

I had a serious scare today.

First, I found out that the software for my Analog Discovery 2 was crashing on the MacBook Air that I will be using for lectures and lab next quarter.  It behaved normally at first and then crashed for no discernible reason after a couple of minutes.  I figured that the problem was probably related to the macos “upgrades” I had done recently, so I checked the Digilent website, and they had just posted a new version of the software last week, addressing the changes that Apple had made to their USB stack (which broke almost all 3rd-party software and a fair amount of Apple’s own software).  I downloaded the new version of Waveforms from the Digilent site and everything worked again.

But any changes to the USB stack are likely to break the code that PteroDAQ uses for finding what devices are connected, so I checked PteroDAQ with my usual setup.  The GUI for PteroDAQ did not list the Teensy board as it used to do, and PteroDAQ couldn’t run!  I spent a long time with ioreg trying to figure out how to modify macgetports.py to find the device again.  The Teensy board was visible as an AppleUSBDevice and AppleUSBInterface, but not as an IOSerialBSDClient as it used to be.  I could not figure out how to open it as a serial port!

Now my usual setup involves going through a USB 2.0 hub (in the Cerebrus cable), so I dug around in my drawer of parts until I found a plain USB-micro data cable.  Hooking up the Teensy board directly with that cable did show an IOSerialBSDClient interface, and PteroDAQ worked fine.  So the problem is just that connections through the USB 2.0 hub are not made the same way they used to be—the serial connection no longer is visible the way it used to be.

I’ll enter an issue for this on the PteroDAQ GitHub, but I won’t try to fix it unless it turns out that modern USB C-USB 3 docks exhibit the same problem.

2019 January 6

OpenScope MZ review: Bode plot

Filed under: Circuits course,Data acquisition — gasstationwithoutpumps @ 14:47
Tags: , , ,

Continuing the review in OpenScope MZ review, I investigated using the OpenScope MZ for impedance analysis (used in both the loudspeaker lab and the electrode lab).

Waveforms Live does not have the nice Impedance Analyzer instrument that Waveforms 3 has, so impedance analysis is more complicated on the OpenScope MZ than on the Analog Discovery 2.  It can be done well enough for the labs of my course, but only with a fair amount of extra trouble.

There is a “Bode Plot” button in Waveforms Live, which performs something similar to the “Network Analyzer” in Waveforms, but it uses only a single oscilloscope channel, so the setup is a little different. I think I know why the Bode plot option uses only one channel, rather than two channels—the microcontroller gets 6.25Msamples/s total throughput, which would only be 3.125Msamples/s per channel if two channels were used. In contrast, the AD2 gets a full 100Msamples/s on each channel, whether one or two is used, so is effectively 32 times faster than the OpenScope MZ.

We still make a voltage divider with the device under test (DUT) and a known reference resistor, and connect the waveform generator across the whole series chain.  Because there is only one oscilloscope channel, we have to do two sweeps: first one with the oscilloscope measuring the input to the series chain (using the “calibrate” button on the Bode panel), then another sweep measuring just across the DUT.  The sweeps are rather slow, taking about a second per data point, so one would probably want to collect fewer data points than with the AD2.  Also there is no short or open compensation for the test fixture, and the frequency range is more limited (max 625kHz).

The resulting data only contains magnitude information, not phase, and can only be downloaded in CSV format with a dB scale.  It is possible to fit a model of the voltage divider to the data, but the gnuplot script is more awkward than fitting the data from the impedance analyzer:

load '../definitions.gnuplot'
set datafile separator comma

Rref=1e3

undb(db) = 10**(db*0.05)
model(f,R,C) = Zpar(R, Zc(f,C))
div(f,R,C) = divider(Rref, model(f,R,C))

R= 1e3
C= 1e-9
fit log(abs(div(x,R,C))) '1kohm-Ax-Bode.csv' skip 1 u 1:(log(undb($2))) via R,C

set xrange [100:1e6]
set ylabel 'Voltage divider ratio'
plot '1kohm-Ax-Bode.csv' skip 1 u 1:(undb($2)) title 'data', \
      abs(div(x,R,C)) title sprintf("R=%.2fkohm, C=%.2fnF", R*1e-3, C*1e9)

The fitting here results in essentially the same results as the fitting done with the Analog Discovery 2.

Although the Bode plot option makes the OpenScope MZ usable for the course, it is rather awkward and limited—the Analog Discovery 2 is still a much better deal.

2019 January 5

OpenScope MZ review

During the CyberWeek sales I bought myself an OpenScope MZ USB scope from Digilent, to see how it compared with the Analog Discovery 2, which I use frequently.  I particularly wanted to see whether I could recommend it as a low-cost alternative ($89 list) for the AD2 ($279 list, but $179 with academic discount).

I’ve not had a chance to do much testing yet, but the short answer is that I would recommend saving up for the Analog Discovery 2—the OpenScope MZ is nowhere near being a professional instrument, but the AD2 is close.

The first thing I tested was the function generator.  The OpenScope MZ does not have a real DAC, but uses digital output pins and a resistor ladder to generate analog voltages.  The result is a “DAC” that is non-monotonic.  The non-monotonicity can be observed by generating a sawtooth waveform and observing the result with an Analog Discovery 2.

The non-monotonicity is worst when the DAC switches from 0x1ff to 0x200 (from 511 to 512 out of 1024 steps). This was a 3Vpp sawtooth at 10Hz. The OpenScope MZ also has a much larger offset than the AD2.

To get clean measurements, I set the AD2 to average 100 traces.  I also did 16-fold oversampling, so that I could get good time resolution while recording the whole period.

The steps are not of uniform duration, but don’t seem to be a simple pattern of single or double clock pulses:

The step durations vary here from 64µs to 136µs in this small sample, but with 1024 steps in 0.1s, I would expect 97.66µs.

The step heights are not completely consistent either, but seem to average to roughly the right value:

The step size should be 3V/1024=2.93mV, but in this range the average step size is a little high. (but the first step at the bottom left is too small).  The variable duration of the steps is also very visible here.

The speed limitations of the amplifier for the OpenScope’s function generator are also quite clear:

There seems to be a 12V/µs slew rate limitation, and the large step at the end of the sawtooth has a 258ns fall time. By way of contrast, the AD2 has about a 40ns fall time for the same 10Hz ramp up and a slew rate of about 120V/µs.

I found the Analog Discovery 2 falling edge rather interesting—the stepwise descent may be an artifact of recording the waveform with the same instrument used for generating it (so that the oversampling does not work correctly), but it might also indicate that the ramp edge is digitally pre-filtered to keep it from overshooting.

2017 February 18

Digilent’s OpenScope

Filed under: Uncategorized — gasstationwithoutpumps @ 10:08
Tags: , , , ,

 

Digilent, which makes the excellent Analog Discovery 2 USB oscilloscope, which I have praised in several previous post, is running a Kickstarter campaign for a lower-cost oscilloscope: OpenScope: Instrumentation for Everyone by Digilent — Kickstarter.

I’m a little confused about this design, though, as is it is a much lower-quality instrument without a much lower price tag (they’re looking at $100 instead of the $180 or $280 price of the Analog Discovery 2, so it is cheaper, but the specs are much, much worse). The OpenScope looks like a hobbyist attempt at an oscilloscope, unlike the very professional work of the Analog Discovery 2—it is a real step backwards for Digilent.

Hardware Limitations:

  • only a 2MHz bandwidth and 6.25MHz sampling rate (much lower than the 30MHz bandwidth and 100MHz sampling of the Analog Discovery 2)
  • 2 analog channels with shared ground (instead of differential channels)
  • 12-bit resolution (instead of 14-bit)
  • 1 function generator with 1MHz bandwidth and 10MHz sampling (instead of 2 channels 14MHz bandwidth, 100MHz sampling)
  • ±4V programmable power supply up to 50mA (instead of ±5V up to 700mA)
  • no case (you have to 3D print one, or buy one separately)

On the plus side, it looks like they’ll be basing their interface on the Waveforms software that they use for their real USB oscilloscope, which is a decent user interface (unlike many other USB oscilloscopes).  They’ll be doing it all in web browsers though, which makes cross-platform compatibility easier, at the expense of really messy programming and possibly difficulty in handling files well.  The capabilities they list for the software are much more limited than Waveforms 2015, so this may be a somewhat crippled interface.

I would certainly recommend to students and educators that the $180 for the Analog Discovery 2 is a much, much better investment than the rather limited capabilities of the OpenScope.  For a hobbyist who can’t get the academic discount, $280 for the Analog Discovery 2 is probably still a better deal than $100 for the OpenScope. The Analog Discovery 2 and a laptop can replace most of an electronics bench for audio and low-frequency RF work, but the OpenScope is much less capable.

The only hobbyist advantage I can see for the OpenScope (other than the slightly lower price) is that they are opening up the software and firmware, so that hobbyists can hack it.  The hardware is so much more limited, though, that this is not as enticing as it might be.

Some people might be attracted by the WiFi capability, but since power has to be supplied by either USB or a wall wart, I don’t see this as being a huge win.  I suppose there are some battery-powered applications for which not being tethered could make a difference (an oscilloscope built into a mobile robot, for example).

Going from a high-quality professional USB scope to a merely adequate hobbyist scope for not much less money makes no sense to me. It would have made more sense to me if they had come out with OpenScope 5 years ago, and later developed the Analog Discovery 2 as a greatly improved upgrade.

2016 December 27

FET I-vs-V with Analog Discovery 2 again

 

In FET I-vs-V with Analog Discovery 2, I plotted Id vs. Vgs curves for an nFET:

The Ids-vs-Vgs curves do not superimpose as nicely as curves I’ve measured with PteroDAQ. I don’t yet understand why not.

Yesterday, I played with sweeping the power supply (Power waveform generator).  In this post, I used that capability to plot Id vs Vds curves for different gate voltages (Vgs) of a different nFET (since the AOI518 is an obsolete part).  The setup is the same as for the previous test—the function generator is connected to the gate, the power supply to the drain load resistor in series with the nFET whose source is connected to ground, and the two oscilloscope channels monitor the voltage across the load resistor and across the nFET.  The difference is that I use the power-waveform option to put a 1Hz triangle wave on the power supply, but put just a DC offset (AC amplitude 0V) on the function generator output, so that the gate voltage is constant as the drain voltage is adjusted.

The saturation regions are well plotted up to Vgs=2.7V. I averaged 10 or 20 scans for each of these curves, to reduce quantization noise for small voltages or small currents.

The saturation regions are well plotted up to Vgs=2.7V. I averaged 10 or 20 scans for each of these curves, to reduce quantization noise for small voltages or small currents.

I got quite different results when I removed and replaced the nFET from the breadboard—the breadboard contacts seem to have a variation of about ±0.05Ω in resistance, which is much larger than the on-resistance of the nFET when fully on. I took measurements with a wire between the source and drain to estimate the wiring resistance, but wiggling the wire produced very different results.

In the next graph, I tried subtracting off the wiring resistance to get the on-resistance, but I’m really quite dubious about the measurements smaller than 0.5Ω, because of the unrepeatability of the bread board contact resistance.

The numbers here look good (close to the spec sheet), but repeating the measurements could result in ±0.1Ω, which makes the Ron measurements for fully on transistors rather useless.

The numbers here look good (close to the spec sheet), but repeating the measurements could result in ±0.1Ω, which makes the Ron measurements for fully on transistors rather useless.

By using a smaller power resistor, I could probably get saturation currents for slightly higher gate voltages, up to the current limit of the power supplies in the Analog Discovery 2, but better on-resistance measurements would require a better jig for making low-resistance contacts to the FET.

By using a much larger resistor, I could measure low currents more accurately, which would give me a better idea of the leakage currents—I don’t really believe the measurements for Vgs=2.1V, because the current appears to decrease with increasing Vds, which is probably an artifact of measuring a small difference in voltage with a large common-mode signal.

I tried using larger resistors to measure the saturation currents, but the results varied a lot depending on what size load resistor is used. I believe that the difference is due to temperature changes from self-heating. If I sweep out to larger Vds voltages (using a smaller load resistor, hence smaller IR drop across it), but about the same saturation current, I’m dissipating more power in the transistor, so making it warmer. This appears to increase the saturation current. Reducing the range of the voltage with the same load resistor drops the curve down, just as increasing the load resistor does. I suspect that proper measurement requires a jig that holds the transistor at a nearly constant temperature, as well has having very low contact resistance.

The saturation current seems to vary by about ±10% as I change load resistors. The effect is most likely thermal—note that using a smaller voltage sweep for Vgs=2.3V and Rload=51Ω resulted in almost the same curve as Rload=270Ω, because the power dissipated was about the same.

The saturation current seems to vary by about ±10% as I change load resistors. The effect is most likely thermal—note that using a smaller voltage sweep for Vgs=2.3V and Rload=51Ω resulted in almost the same curve as Rload=270Ω, because the power dissipated was about the same.

Note that the thermal explanation also works for explaining why the superposition does not work well for the Id vs Vgs plots—at lower load resistances, more power is dissipated in the transistor, and it gets warmer, shifting the current curve upward.

Next Page »