Test and Measurement Forum

Frequency Response Analyzer with Bode Plots

Post discussions on applications you are writing

Re: Frequency Response Analyzer with Bode Plots

Postby hexamer » Thu Nov 19, 2015 11:23 pm

Gary,

Here is a link to a new version that I hope will fix the error code 269 you experienced:

https://bitbucket.org/hexamer/fra4picos ... 0.5.2b.msi

Thanks,

Aaron.
hexamer
Advanced User
Advanced User
 
Posts: 62
Joined: Tue Aug 12, 2014 10:09 pm

Re: Frequency Response Analyzer with Bode Plots

Postby garya » Fri Nov 20, 2015 1:41 am

Hi Aaron,
you are right that my 'scope has a 20MHz band limiter tick-box

It also has low pass filtering settable to a particular frequency if that helps in the scheme of things.

'tis I who thanks you - a handy looking little tool you're working on!
garya
Newbie
 
Posts: 0
Joined: Mon Nov 16, 2015 10:02 pm

Re: Frequency Response Analyzer with Bode Plots

Postby garya » Sun Nov 22, 2015 11:25 pm

Yes, that fixes the problem :) It runs and gets a plot.
I just have to get a sensible one.
garya
Newbie
 
Posts: 0
Joined: Mon Nov 16, 2015 10:02 pm

Re: Frequency Response Analyzer with Bode Plots

Postby hexamer » Mon Nov 23, 2015 11:46 pm

garya wrote:Yes, that fixes the problem :) It runs and gets a plot.
I just have to get a sensible one.


Hey, that's good news! If you are not able to get plots that look sensible based on the circuit you're measuring, there are a couple of ways to debug:

1. First is the log created in the lower left section of the main window. It can tell us about the auto-ranging status and selected output and sampling frequencies, which can give a clue as to what kinds of problems were experienced.
2. There is a diagnostic mode we can turn on which will spit out files with time domain plots of all the waveforms captured.

Obviously one of the easiest circuits to measure for testing purposes is an RC filter. You could measure a resistor divider, but the default plot will look noisy because the gain and phase are so constant - the default plot zooms in on the data and so even small variations will look noisy. But that can be addressed by setting the plot axis ranges: just single click on the plot and you'll get a plot settings dialog.
hexamer
Advanced User
Advanced User
 
Posts: 62
Joined: Tue Aug 12, 2014 10:09 pm

Re: Frequency Response Analyzer with Bode Plots

Postby garya » Fri Nov 27, 2015 2:59 am

Yes, that's good with RC
Only niggle is 20000000 Hz faults, can get around 18999999

Fatal error: Failed to start channel data capture: 14

but not with all 9s. And at those high values, 50 samples starts to fault at end with
too long to download data - or some such fault.
Clipboard01.jpg
18R and 10nF
garya
Newbie
 
Posts: 0
Joined: Mon Nov 16, 2015 10:02 pm

Re: Frequency Response Analyzer with Bode Plots

Postby hexamer » Fri Nov 27, 2015 3:56 pm

garya wrote:Yes, that's good with RC
Only niggle is 20000000 Hz faults, can get around 18999999

Fatal error: Failed to start channel data capture: 14

but not with all 9s. And at those high values, 50 samples starts to fault at end with
too long to download data - or some such fault.
Clipboard01.jpg


Gary,

I'm glad you tested at the limits to expose these issues. I have a strong suspicion that the code 14 failure has to do with this statement in the PS6000 datasheets: "*To achieve the best sampling rate across two channels, choose one channel from A or B, and one from C or D". I noticed this while researching the earlier issues you found, then logged it in the issue tracker, but didn't explore where it might become an issue. I can see now that this would be an issue above 19,531,250 Hz. If you were to try channels A and C the issue might go away. In the mean-time I'll think of some way to encode this in the app.

On the timeout issue, I'm not really sure. I applied a fix in v0.5b for a similar issue affecting low frequencies on other scopes. Maybe I broke something else. 50 samples seems strange, so i'm also wondering if it's a side effect of the issue above. I'll explore further.

Thanks,

Aaron.
hexamer
Advanced User
Advanced User
 
Posts: 62
Joined: Tue Aug 12, 2014 10:09 pm

Re: Frequency Response Analyzer with Bode Plots

Postby klauss » Tue Dec 15, 2015 3:36 pm

Dear Aaron,

Thanks for your software! It's really great!
I am using it to measure resonance frequency of special piezo scanners.

Unfortunately due to the automatic input / output range and the short sinus bursts I get weird results:
resonance_.png


Could you please make a option for
- output range automatic / fixed to .....
- input range automatic / fixed to .....
- adjustable sample length ...

Best regards,
Klaus
klauss
Newbie
 
Posts: 0
Joined: Tue Dec 15, 2015 3:08 pm

Re: Frequency Response Analyzer with Bode Plots

Postby hexamer » Tue Dec 15, 2015 10:37 pm

klauss wrote:Dear Aaron,

Thanks for your software! It's really great!
I am using it to measure resonance frequency of special piezo scanners.

Unfortunately due to the automatic input / output range and the short sinus bursts I get weird results:
resonance_.png


Could you please make a option for
- output range automatic / fixed to .....
- input range automatic / fixed to .....
- adjustable sample length ...

Best regards,
Klaus


Thank you for your feedback, Klaus. I would like to learn more to try to help resolve this.

First, do you have any reference plots (perhaps from a datasheet) to compare against? I agree that these plots look noisy, but I'm not sure what they should look like.

Have you tried to get the application to output time domain diagnostic plots? Those can be helpful to determine what's going on. E.g. they could show you if there is noise present, or if there is a DC offset. An alternative to this is to use the PicoScope software to inspect what's happening in the time domain with the same circuit setup.

Do you believe the issue is settling time of the circuit? There is a provision for a feature to insert more settling time between turning on (or adjusting) the signal generator and taking the measurement. But I don't think it's fully implemented.

I can't imagine how autoranging would have a negative impact that could lead to the noise you see. It should always help dynamic range and minimize quantization error. But maybe I'm missing something?

The sample length strategy is a bit of a complex topic. It's something I'm considering modifying (logged as Bitbucket issue 63). For low noise mode, which is what you're currently using, it will capture 16 stimulus cycles at a minimum of 64x over sampling. That has the effect that the filter bandwidth tracks the stimulus signal. That's not necessarily desirable, especially in a situation with lots of noise. In "noise reject" mode the program will sample at a high rate (at least 2x above the band limiter) and take as many samples as necessary to meet a minimum and maximum number of stimulus cycles (currently 16 and 100 respectively). This also has an effect of the filter bandwidth being variable. What I'm considering is letting the user specify a fixed (or maximum) bandwidth.
hexamer
Advanced User
Advanced User
 
Posts: 62
Joined: Tue Aug 12, 2014 10:09 pm

Re: Frequency Response Analyzer with Bode Plots

Postby gvaglia » Tue Mar 22, 2016 12:47 pm

Dear Hexamer,
I am trying using your software with a 3203D-MSO PicoScope but I am getting the following error

Status: 3203DMSO S/N: CO837/079 successfully initialized.
FRA execution error: Error in function boost::math::round<double>(double): Value 1.#INF can not be represented in the target integer type.
Fatal error: Failed to setup stimulus signal: 46
Error: Failed to disable signal generator.

I am using windows 10 64bit.

Regards
Guido
gvaglia
Newbie
 
Posts: 0
Joined: Tue Mar 22, 2016 12:43 pm

Re: Frequency Response Analyzer with Bode Plots

Postby hexamer » Tue Mar 22, 2016 5:48 pm

gvaglia wrote:Dear Hexamer,
I am trying using your software with a 3203D-MSO PicoScope but I am getting the following error

Status: 3203DMSO S/N: CO837/079 successfully initialized.
FRA execution error: Error in function boost::math::round<double>(double): Value 1.#INF can not be represented in the target integer type.
Fatal error: Failed to setup stimulus signal: 46
Error: Failed to disable signal generator.

I am using windows 10 64bit.

Regards
Guido


Guido,

Thank you for the detailed report. I will take a look at the code tonight and see if I can come up with an explanation and fix. I appreciate your patience ... unfortunately I can't address these things ahead of time since I don't have very many scopes for testing :) So, thank you for providing a new test report on this scope - I'm pretty sure it's the first one I've seen for the 3000D series.

Aaron
hexamer
Advanced User
Advanced User
 
Posts: 62
Joined: Tue Aug 12, 2014 10:09 pm

Re: Frequency Response Analyzer with Bode Plots

Postby hexamer » Wed Mar 23, 2016 2:20 am

gvaglia wrote:Dear Hexamer,
I am trying using your software with a 3203D-MSO PicoScope but I am getting the following error

Status: 3203DMSO S/N: CO837/079 successfully initialized.
FRA execution error: Error in function boost::math::round<double>(double): Value 1.#INF can not be represented in the target integer type.
Fatal error: Failed to setup stimulus signal: 46
Error: Failed to disable signal generator.

I am using windows 10 64bit.

Regards
Guido


Guido,

I'm pretty sure I've located the issue you've encountered. When I added the PS3000D/MSO scopes I failed to properly initialize a variable. That variable's default initialization is 0.0, which lead to a divide by 0 issue. The last two error messages are due to a known issue (topic14569.html) and a fix I tried to resolve that issue, which didn't really work for all scopes. Those errors will appear at the end of every FRA run, but are harmless (despite the ominous message).

If you could, please tryout version 0.5.3b where I applied a fix that should get you past the FRA execution error:

https://bitbucket.org/hexamer/fra4picos ... 0.5.3b.msi

You may need to uninstall the existing version first.

Thanks,

Aaron.
hexamer
Advanced User
Advanced User
 
Posts: 62
Joined: Tue Aug 12, 2014 10:09 pm

Re: Frequency Response Analyzer with Bode Plots

Postby ibdami21 » Sat Mar 26, 2016 3:41 am

Hi Aaron,

Nice concept here for the bode plot analyser. I've got a 5442B and have tried this out just now with a simple RC network of a 1uF cap and 6.8k resistor to form a high pass filter. For me, using Windows 10 with this I don't get good data but a flat line in the graph. Exported to excel I get this:

Frequency Log(Hz) Gain (dB) Phase (deg)
3.000003307 -nan(ind) 0
3.49999747 -nan(ind) 0
3.999999262 -nan(ind) 0
4.301030269 -nan(ind) 0

One other note is this scope I don't need to use the AC adapter for channels A+B+ the wave generator to work. I was at first stumped why it wouldn't find a device until reading on the forums you check for the DC adapter.

Hopefully this is something easy I can address as this would come in handy.

Thanks!
-Mitch
ibdami21
Newbie
 
Posts: 0
Joined: Sat Mar 26, 2016 3:11 am

Re: Frequency Response Analyzer with Bode Plots

Postby ibdami21 » Sat Mar 26, 2016 12:44 pm

Hey Aaron,

I was able to get it: I had the 64 bit SDK installed. Once I also installed the 32 bit SDK everything seems to be working.

I have a switching power supply I'd like to do a stability test on and will use a small isolation transformer from the picoscope to the feedback loop and see if this can enable the device to be a sort of network analyser. Kind of like the setup TI shows here: www.ti.com/lit/an/snva364a/snva364a.pdf . But with your program this should now be very easy to make a proper bode plot without manually collecting data points.

I know you're working on it and I'll provide one wishlist feature:
-Upon a new run, update the display as data is acquired. I know this will have averse effects to auto-ranging. Perhaps have this option for manual window setup only? For all the work I do I'd be fine without autoranging since I know what to expect from the system at the frequencies being swept, plus if there is any data out of range I won't care about it with the window selected.

Thanks again for making this. Too bad I am just a HW engineer with basic programming skills else I would see about helping this project :).

-Mitch
ibdami21
Newbie
 
Posts: 0
Joined: Sat Mar 26, 2016 3:11 am

Re: Frequency Response Analyzer with Bode Plots

Postby hexamer » Sat Mar 26, 2016 2:55 pm

ibdami21 wrote:Hi Aaron,

Nice concept here for the bode plot analyser. I've got a 5442B and have tried this out just now with a simple RC network of a 1uF cap and 6.8k resistor to form a high pass filter. For me, using Windows 10 with this I don't get good data but a flat line in the graph. Exported to excel I get this:

Frequency Log(Hz) Gain (dB) Phase (deg)
3.000003307 -nan(ind) 0
3.49999747 -nan(ind) 0
3.999999262 -nan(ind) 0
4.301030269 -nan(ind) 0

One other note is this scope I don't need to use the AC adapter for channels A+B+ the wave generator to work. I was at first stumped why it wouldn't find a device until reading on the forums you check for the DC adapter.

Hopefully this is something easy I can address as this would come in handy.

Thanks!
-Mitch


Hi Mitch!

Thanks for trying out the application and reporting your results. Since I have such a similar scope and am also using Windows 10, I'm sure we can figure out what's going on.

First question is what version are you using? You can look in the Help->About dialog box

Based on the data you exported, it looks like you're sweeping from 1,000 Hz to 20,000 Hz. Is that correct? If so ... Based on my calculations, the cutoff frequency for that filter is about 23 Hz, so you would be in a very flat region of that filter. It should be 0dB and 0 degrees phase shift. Depending on the graph range settings this may or may not look flat. Does the graph show both gain and phase at 0? If you can, please post the graph.

As to why the exported data shows -nan(ind), I'm not sure yet. Maybe it's a bug. Could you open the CSV file in a text editor and share the plain text contents (or attach the file if you can)? I'll see if I can reproduce this.

On the topic of power requirements, I don't completely remember why I chose to to require the DC adapter. In my earlier post it seems I thought it was because 2 channels + SigGen would not work without it. But in reading the documentation again, I can't find anything that supports that. So, perhaps there was some other reason. I agree that it would be nice if the application didn't require it, so I'll enter an enhancement request and look into it again.

Thanks,

Aaron.
hexamer
Advanced User
Advanced User
 
Posts: 62
Joined: Tue Aug 12, 2014 10:09 pm

Re: Frequency Response Analyzer with Bode Plots

Postby hexamer » Sat Mar 26, 2016 3:47 pm

ibdami21 wrote:Hi Aaron,

Nice concept here for the bode plot analyser. I've got a 5442B and have tried this out just now with a simple RC network of a 1uF cap and 6.8k resistor to form a high pass filter. For me, using Windows 10 with this I don't get good data but a flat line in the graph. Exported to excel I get this:

Frequency Log(Hz) Gain (dB) Phase (deg)
3.000003307 -nan(ind) 0
3.49999747 -nan(ind) 0
3.999999262 -nan(ind) 0
4.301030269 -nan(ind) 0

One other note is this scope I don't need to use the AC adapter for channels A+B+ the wave generator to work. I was at first stumped why it wouldn't find a device until reading on the forums you check for the DC adapter.

Hopefully this is something easy I can address as this would come in handy.

Thanks!
-Mitch


I tried to replicate this with a 6.8k resistor and two 0.47 uF caps in parallel. The results I get don't match yours, but did remind me of something. While you should get a relatively flat response in that region, if everything were working properly, due to noise and measurement error it should be virtually impossible for you to get exact 0 values. Here's what I get:

Frequency Log(Hz), Gain (dB), Phase (deg)
3.00000330702098, -0.0396715509823624, 1.45006002832991
3.49999746978964, -0.0443591327897204, 0.196438667893659
3.99999926235039, -0.00849332783292806, 0.101382321193946
4.30103026918555, -0.00614564243257526, -0.0110180367776741

You see that they are close to 0, but not exact. So I think we'll need to take some more diagnostic steps. Here are the options:

Leaving the circuit and oscilloscope attachments exactly as they are ...

1) Run the PicoScope Application and see what the signals look like in the time domain. Do they match what you expect? If not then check your attachment points (the circuit itself dead simple!). If it's not the circuit/probing, then run some other scope diagnostics.
If that doesn't reveal anything ...
2) Turn on time domain diagnostic plots in the FRA application. Close the application, set <timeDomainPlots> to true in FRA4PicoScopeSettings.xml, then relaunch the application. Run the same FRA, and inspect the time domain plots. Let me know if you'd like more details on this.
hexamer
Advanced User
Advanced User
 
Posts: 62
Joined: Tue Aug 12, 2014 10:09 pm

PreviousNext

Return to Applications

Who is online

Users browsing this forum: No registered users and 0 guests