Author Topic: Keithley 2015 THD with FFT and Harmonic graphs  (Read 10161 times)

0 Members and 1 Guest are viewing this topic.

Offline 2bluescTopic starter

  • Contributor
  • Posts: 16
Keithley 2015 THD with FFT and Harmonic graphs
« on: May 31, 2017, 01:57:31 am »
Hey all,

After getting my Keithley 2015 THD for some small amplifier projects I was shocked that nobody had put together some tools to automate the beast.  The DMM is simple to get THD or THD+N numbers on the display, but that never tells the whole pictures.  After some digging around I managed to extract the first FFT plot (make a WAG at the bin bandwidth, manual doesn't say) and plot some graphs.  I haven't seen anyone share FFT spectrum plots from the device, so I'm hear to share!

The first screenshot (read title on plot) is with the internal source generator generating a 1kHz sine wave at 1Vrms.  The internal generator isn't that amazing, and as others have pointed out: A sound card on a PC can probably do better if you can eliminate the noise of the PC.  The 2015's gen spec is "-64dB THD+N with harmonics 2-5" which calculates out to 0.063%.  It measures 0.02% THD+N, which should include all harmonics and be more pessimistic.  Seems well within spec.

The second screenshot is my FIIO D03K optical to analog DAC generating the same 1kHz sine wave with the volume at -3.0 dB according to the software mixer in Linux.  The D03K DAC is rated for "Total harmonic distortion: <0.008%" and the Keithley measures it at 0.003% on the THD+N setting (assuming they measure and calculate the same).  Impressive for both the DAC and the 2015.  The spec sheet for the 2015 lists the THD+N residual distortion at 0.056% from 20-20kHz, so this is well within that spec (at least at 1kHz and 0.5Vrms) as well.  I'm not sure if I'm reading the spec sheet right in this department, what is actually described in the Keithley 2015 spec sheet for "Residual distortion"?

In short it works as expected and I'm assuming that the Keithley 2015 meter is reading well beyond what my ears can hear (audiophoolery aside).

That said I have a few comments:
  • The Keithley 2015 SCPI command reference describes the :FFTransform:BINS command, but it doesn't discuss the bandwidth of each bin.  From my own empirical measurements, bin[1] measures from 61-121Hz and bin[291] measures from 19915-19983Hz.  That means the first bin is 60 Hz wide and the last bin is 68 Hz wide.  Does anyone have ideas on how this actually works?  Is it really not documented anywhere?  My graphs are plotting bins 1-500 which is approximately 0-34.2kHz.  The plots place the data at the center of each bin and that's why 1kHz doesn't line up with the grid lines.  I don't think I can do much better without a finer grain FFT.  I assume this is the limit of the Keithley 2015.  Also, if bin[500] = 34.2kHz, it's unfortunate that I can't define a small bin width to zoom in on certain frequencies instead of measuring out to 1023 * 60 = 61.3kHz which seems only useful for catching higher harmonics at higher frequencies.  The docs for the Keithley 2015-P (note the P for peak) seems to have definable bin width or ambiguous documentation, neither would surprise me.
  • A Keithley 2015 quick reference guide (doc #2015-903-01 Rev. A, Dec 2001) mentions a :DISTortion:BNoIse SCPI command and the user manual (Doc #2015-900-01 Rev. F, Aug 2003) doesn't even mention the command.  The ref guide describes it as "Background noise is the residual voltage after the input signal’s fundamental and harmonics are removed." for frequencies greater then 61 Hz. Are there any more forgotten commands?  :-// Hopefully one to reisze bins
  • This is my first time playing with a SCPI over UART, but it seems after I send the "*RST" command the first letter of almost any command I send next is dropped.  Not sure if this is my RS232-USB converter (seems unlikely) or a firmware bug.
  • My device responds to *IDN? command with "KEITHLEY INSTRUMENTS INC.,MODEL 2015,1051478,B15  /A02" for those interested.

Next steps, clean-up the horrendous hacky code and try go make it easy to spit out graphs for a handful of common tasks:
  • Automated FFT spectrum plot with harmonics. First attempt is done as attached
  • Sweep frequencies using internal generator and measure the THD+N at a number of points and plot.  I fear the internal source may not be good enough for devices I want to test.
  • Sweep frequencies using the internal generator to build a frequency response plot.  Would be handy to overlay multiple tests to do channel mapping
  • Measure noise floor.  I don't know how to do this on the Keithley 2015, any ideas?
 
The following users thanked this post: oPossum, thm_w, Muxr, Ash

Offline 1audio

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: us
Re: Keithley 2015 THD with FFT and Harmonic graphs
« Reply #1 on: May 31, 2017, 03:23:49 am »
My 2015 can measure as low as .001% on a really clean sinewave. I'm not sure how much I trust that since its also on the verge of .000% occasionally which is nonsense. Still if you have some code I'm all ears. Are you using serial or GPIB to talk to it?

I have looked around for app to do this and there are few. I can send you code from one effort by another guy for a traditional analyzer (Boonton 1120) that has addressed a lot of the issues of getting useful measurements but doesn't know how to talk to the Keithley. It was written in visual basic so Windows oriented. Let me know if you are interested. It does have routines for THD vs. level and Level vs. frequency. It uses a VB link to Excel for output.

Measuring SNR would be a several stage process. I believe the 2015 has some filters coded into it. (Necessary for the cell phone biz, which is what paid for them). You would need to establish a reference level and then "zero" the input (watch for source Z issues) and then measure the level with the filter for meaningful info.
 

Offline 1audio

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: us
Re: Keithley 2015 THD with FFT and Harmonic graphs
« Reply #2 on: May 31, 2017, 03:25:53 am »
One more thing- displaying discrete harmonics as a bar graph seems easier to grasp. The instruments that can do that graphically all seem to use bar graphs.
 

Offline 2bluescTopic starter

  • Contributor
  • Posts: 16
Re: Keithley 2015 THD with FFT and Harmonic graphs
« Reply #3 on: May 31, 2017, 03:27:05 am »
Yeah, I need to fix the harmonic graph. If I just output a bar graph I'll be upside down. So I need to work on it a bit more. Everything needs more work though.
 

Offline Ash

  • Regular Contributor
  • *
  • Posts: 161
  • Country: au
Re: Keithley 2015 THD with FFT and Harmonic graphs
« Reply #4 on: May 31, 2017, 03:58:45 am »
Nice work, this is one of the items on my list as well. Albeit, quite a ways down the list..   :-//

I'd be interested in the code for sure.. would you publish it on GitHub, that way others can contribute easily.  :-/O  :popcorn:

Thanks
Ash.
 

Offline 2bluescTopic starter

  • Contributor
  • Posts: 16
Re: Keithley 2015 THD with FFT and Harmonic graphs
« Reply #5 on: May 31, 2017, 04:39:47 am »
I'd be interested in the code for sure.. would you publish it on GitHub, that way others can contribute easily.  :-/O  :popcorn:

I'm going to host it on a Github repo after it's more organized.  So far it's a hacked mess to see if the hardware works.  Check it out at this gist.
 

Offline Ash

  • Regular Contributor
  • *
  • Posts: 161
  • Country: au
Re: Keithley 2015 THD with FFT and Harmonic graphs
« Reply #6 on: May 31, 2017, 05:42:34 am »
Hi 2bluesc,

I'm not sure if you have seen it, but a bit of googling and I found a document from Keithley on AC signal analysis that seems to have data on the bin.

https://www.testequity.com/documents/pdf/keithley/2015-2015-P-2016-rg.pdf

On page 16 - I believe that this is #2015-903-01 Rev. A, Dec 2001:
Quote
Frequency bins

In order to get maximum frequency resolution from the FFT calculation, the frequency spectrum
must be separated into 20Hz bins. The example frequency spectrum in Figure 2, shows
the 51 frequencies that can be analyzed for a spectrum from 1kHz to 2kHz.
The following command separates the frequency spectrum into 20Hz bins:

Code: [Select]
:SENS:DIST:FREQ 20 ' Set distortion frequency to 20Hz.

Have you tried this?

This all seems to be designed for the "P" options.. I know mine is a straight 2015 THD, not a "P" variant. I have B17 A02 firmware I believe, so when I get a chance (weekend?) I'll fire it up and see if the commands run for me.

Cheers,
Ash.
 

Offline 2bluescTopic starter

  • Contributor
  • Posts: 16
Re: Keithley 2015 THD with FFT and Harmonic graphs
« Reply #7 on: May 31, 2017, 06:01:57 am »
On page 16 - I believe that this is #2015-903-01 Rev. A, Dec 2001:
Quote
Frequency bins

In order to get maximum frequency resolution from the FFT calculation, the frequency spectrum
must be separated into 20Hz bins. The example frequency spectrum in Figure 2, shows
the 51 frequencies that can be analyzed for a spectrum from 1kHz to 2kHz.
The following command separates the frequency spectrum into 20Hz bins:

Code: [Select]
:SENS:DIST:FREQ 20 ' Set distortion frequency to 20Hz.

Have you tried this?

This all seems to be designed for the "P" options.. I know mine is a straight 2015 THD, not a "P" variant. I have B17 A02 firmware I believe, so when I get a chance (weekend?) I'll fire it up and see if the commands run for me.
Hi Ash,

I did try that and the way it's described seems very confusing, because that document disagrees with the User's Manual definition for the SENSe:DISTortion:FREQuency command.  The command on my meter forces the meter to use the given frequency for the reference magnitude of the FFT, and as a result the rest of the FFT is garbage.  The description sounds like something I want for the smaller bins, but the semantics of the command name and the user manual doc match what it actually appears to do. I suspect it's either a typo, or as you said, only available on the "P" variants.

I'd love to hear what your tests show, the code I have posted thus far can easily be hacked to run the test quickly.  I bet the FFT plot with turn to garbage.  Give it a shot!  :box:

- Kyle
 

Offline 1audio

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: us
Re: Keithley 2015 THD with FFT and Harmonic graphs
« Reply #8 on: May 31, 2017, 03:51:08 pm »
Docs on this stuff always seems to be everywhere and nowhere. There is a Keithley support forum where you may get better answers: https://forum.tek.com/viewforum.php?f=64  and here: https://forum.tek.com/viewforum.php?f=67 Other users have trouble getting good answers from Keithley judging from reading through that forum.

What would be great is 2015-p firmware if anyone has a way to get it. The distortion analysis supposedly is only available on the -p version. keithley says its upgradable (by them for a fee).
 

Offline 2bluescTopic starter

  • Contributor
  • Posts: 16
Re: Keithley 2015 THD with FFT and Harmonic graphs
« Reply #9 on: May 31, 2017, 04:05:15 pm »
Docs on this stuff always seems to be everywhere and nowhere. There is a Keithley support forum where you may get better answers: https://forum.tek.com/viewforum.php?f=64  and here: https://forum.tek.com/viewforum.php?f=67 Other users have trouble getting good answers from Keithley judging from reading through that forum.

Interesting.  Didn't even think to check out a Keithley forum, the 2015 forum looks very quiet, but I think I'll post there when I get a little further along and the code is more presentable.  Thanks for sharing :)

What would be great is 2015-p firmware if anyone has a way to get it. The distortion analysis supposedly is only available on the -p version. keithley says its upgradable (by them for a fee).
This would be an awesome hack.  The distortion analysis is in the 2015, the 2015-P is supposed to add "peak analysis" which appears to be just an easy way to iterate through peak harmonics programmatically, but I haven't studied enough.  I assume the extra ':PEAK" SCPI commands are of particular use for automated factory testing setups and may not provide much more information then downloading the FFT bin output directly.  I to stumbled upon the post that you mentioned where the 2015 could be upgraded to a 2015-P model.  The 2015-P options sound like they are nothing more then software, and may not provide much value, but if the FFT bin size is configurable on the 2015-P, that alone may be worth checking out.   :-/O
 

Offline G0HZU

  • Super Contributor
  • ***
  • Posts: 3015
  • Country: gb
Re: Keithley 2015 THD with FFT and Harmonic graphs
« Reply #10 on: May 31, 2017, 08:57:10 pm »
Quote
After getting my Keithley 2015 THD for some small amplifier projects I was shocked that nobody had put together some tools to automate the beast.

I bought mine a few years ago and created some automated apps for it within a few days of it arriving :)

https://www.eevblog.com/forum/testgear/keithley-2015thd-initial-tests/





All the apps are fairly crude but they work well. I did the THD UI first, followed by a fairly decent 'Toneohm' app where the pitch of the audio from the PC speakers depends on the resistance of the device being measured. It worked quite well as the GPIB interface is quite quick.

I also did a quick and dirty logger program to measure PSU stability. Not exactly modern or pretty but it works.




Quote
I haven't seen anyone share FFT spectrum plots from the device, so I'm hear to share!

Thanks for this. I missed the FFT plot command so I may have a play with this at some point :)  How quickly can it create and refresh the spectrum plots using this command?





« Last Edit: May 31, 2017, 08:59:19 pm by G0HZU »
 

Offline 2bluescTopic starter

  • Contributor
  • Posts: 16
Re: Keithley 2015 THD with FFT and Harmonic graphs
« Reply #11 on: May 31, 2017, 09:17:26 pm »
Thanks for this. I missed the FFT plot command so I may have a play with this at some point :)  How quickly can it create and refresh the spectrum plots using this command?

I stumbled on your app, but saw that it was Windows based and realized that wouldn't work for me on Linux.  :-//  Did you ever release it to the public?

As for the spectrum plots, I'm using the RS232 interface, and the data moves quite slow at 19.2kb/s which seems to be the highest speed (unless a new firmware improves this or there are undocumented features).  I need to explore changing the ':FORMat:DATA` command to transfer the numbers as binary IEE754 floating point which should happen several times faster (think ~14 bytes as ASCII vs 8 bytes for a double).  It takes maybe 5 seconds to just receive the FFT data over serial.  I think the actual conversion time for the internal DSP is the considerably faster, and should be the same as you experience with your app.
 

Offline 2bluescTopic starter

  • Contributor
  • Posts: 16
Re: Keithley 2015 THD with FFT and Harmonic graphs
« Reply #12 on: May 31, 2017, 09:20:37 pm »
After I get done exploring with my THD tests, I'm curious if I can make something like your DMM app.  I'd like to see if it's possible to write a driver for sigrok and pulseview and if the sigrok UI tools like pulseview are useable to justify the effort vs a standalone app that suits my needs.
 

Offline 2bluescTopic starter

  • Contributor
  • Posts: 16
Re: Keithley 2015 THD with FFT and Harmonic graphs
« Reply #13 on: June 01, 2017, 08:55:58 pm »
Played around a bit more with the FFT binning.  It appears the `DIST:FREQ` command does modify the width of the bins on my 2015 as described for the 2015-P.

If I set the 'DIST:FREQ'  (apparently bin width in special cases) to 20 Hz and read all 1023 samples I get the attached plot.  The original plots were with the frequency set to auto acquire and only reading the first 500 samples (at 60Hz bin width). The THD and THD+N numbers appear to be garbage, and this led me to believe it wasn't working earlier as it sets the 0 magnitude reference to whatever noise it reads at 20 Hz.  After some normalization of the FFT plot values I get the attached graph with 20 Hz bandwidth per bin.  I assume that I can easily sum the harmonics and derive my own THD and THD+N values with higher resolution for lower frequencies (there's no data past 20kHz for harmonic calculations).  I will need to test the 20Hz vs automatic 60 Hz bin width and see if they agree for test values of 1kHz.

Seems odd that Keithley wouldn't calculate intelligent THD, THD+N, SINAD values after adding a new SCPI bin width command that doesn't overlap the DIST:FREQ command.

The Harmonics graph is a mess still, please ignore. :)
 
The following users thanked this post: Ash, Octane

Offline 1audio

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: us
Re: Keithley 2015 THD with FFT and Harmonic graphs
« Reply #14 on: September 05, 2017, 06:46:54 pm »
I'm almost done with a VB app for the Keithley that I'll be sharing. If you have the code for the harmonics it would be helpful. That's the next challenge. I'm using GPIB and its pretty quick. Supposedly it can make a lot of measurements very quickly if the internal processor is used to do the sequencing.

One limitation is the internal source. I can't find a schematic to come up with ideas on improving it. I'm sure its the 12 bit DAC but its not a simple DAC upgrade if there's only 12 bits to drive it.
 

Offline dvb

  • Newbie
  • Posts: 9
  • Country: ro
Re: Keithley 2015 THD with FFT and Harmonic graphs
« Reply #15 on: January 11, 2018, 06:41:10 pm »
Hi guys! Any progress in this matter? I bought a 2015 few months ago and I'm still shocked by the lack of apps for this instruments...

Take care!

@GOHZU - I've tried to PM you but no luck, seems your PM service is disabled...
 

Offline frankmhowell

  • Newbie
  • Posts: 9
  • Country: us
Re: Keithley 2015 THD with FFT and Harmonic graphs
« Reply #16 on: May 06, 2019, 11:49:31 pm »
G0HZU has incoming blocked/disabled everywhere...including his YouTube channel.
 

Offline frankmhowell

  • Newbie
  • Posts: 9
  • Country: us
Re: Keithley 2015 THD with FFT and Harmonic graphs
« Reply #17 on: May 06, 2019, 11:51:30 pm »
Any chance of sharing this?

Frank
 

Offline emartine

  • Contributor
  • Posts: 39
  • Country: ar
Re: Keithley 2015 THD with FFT and Harmonic graphs
« Reply #18 on: April 14, 2022, 02:13:29 pm »
I will purchase this meter and upload an app to github, so anyone can use it..
Im already working on it.
This is my github page if you wanna help:
https://github.com/andmarti1424
 

Offline 1audio

  • Frequent Contributor
  • **
  • Posts: 304
  • Country: us
Re: Keithley 2015 THD with FFT and Harmonic graphs
« Reply #19 on: April 15, 2022, 05:21:30 am »
Feel free to use whatever you can from this: https://github.com/1audio/Keithley-Windows-10  Its mostly working. Integrating the harmonics analysis with the rest of the package would make it very useful. Adding control for an external oscillator (the internal source is not very good) would enhance its utility.
 
The following users thanked this post: emartine

Offline emartine

  • Contributor
  • Posts: 39
  • Country: ar
Re: Keithley 2015 THD with FFT and Harmonic graphs
« Reply #20 on: April 15, 2022, 09:10:46 am »
Thanks! Will check it out.
 

Offline emartine

  • Contributor
  • Posts: 39
  • Country: ar
Re: Keithley 2015 THD with FFT and Harmonic graphs
« Reply #21 on: July 25, 2022, 10:44:42 pm »
I have been working on my app lately. In case anyone is interested, you can find it here:
https://github.com/andmarti1424/free_keithley

Any help is always welcome!
Thanks.
 
The following users thanked this post: dvb

Offline dvb

  • Newbie
  • Posts: 9
  • Country: ro
Re: Keithley 2015 THD with FFT and Harmonic graphs
« Reply #22 on: January 27, 2023, 10:59:52 am »
Hi, thanks for sharing!

Now, can you write a few words about hardware setup? What kind of cable, interface, settings... ?

Best regards!
 

Offline emartine

  • Contributor
  • Posts: 39
  • Country: ar
Re: Keithley 2015 THD with FFT and Harmonic graphs
« Reply #23 on: January 27, 2023, 12:31:26 pm »
I dont know what you mean but ask whatever you need.
 
The following users thanked this post: dvb

Offline dvb

  • Newbie
  • Posts: 9
  • Country: ro
Re: Keithley 2015 THD with FFT and Harmonic graphs
« Reply #24 on: January 27, 2023, 01:27:07 pm »
"Is the instrument linked to the computer via serial interface?" sort of thing...

Thanks
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf