Frequency Response Analyzer with Bode Plots

Post discussions on applications you are writing
Post Reply
zolkow
Advanced
Posts: 0
Joined: Sun Apr 12, 2015 9:36 am
Location: Hungary

Re: Frequency Response Analyzer with Bode Plots

Post by zolkow »

sorry, yes, I was talking about different runs, yesterday I made some attempts again.
The output was set to 1Vpp, and the autorange rised the input range to 1V I think, then said that it reached the 10 steps, like it still wasn't in range, and tried to rise even higher.

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

Re: Frequency Response Analyzer with Bode Plots

Post by hexamer »

I would agree with your assessment. It seems like a problem with sampling. I sent you a modified version that should catch PLplot exceptions (hoping that's what we're still dealing with). If you get a chance to try it, please run on a simple case like the 2:1 divider and report back what the log says. Thanks - your help is much appreciated!

zolkow
Advanced
Posts: 0
Joined: Sun Apr 12, 2015 9:36 am
Location: Hungary

Re: Frequency Response Analyzer with Bode Plots

Post by zolkow »

You mean you'v already sent it? I'm afraid, I haven't got it, could you re-send it? either to my email or in PM (I'm not sure if I can receive it, as I'm freshly registered)
[zolkow/gmail.com]

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

Re: Frequency Response Analyzer with Bode Plots

Post by hexamer »

I thought I posted this earlier my morning, but apparently it didn't post ...

I sent the updated version to your email, but unfortunately it must not have made it. I've now posted it here: https://bitbucket.org/hexamer/fra4picos ... olkow1.zip

You should move or rename the existing executable in your program files directory, then replace it with the one in this zip file. The important part is that the three PLplot support files be in the same directory as the exe. If you want to achieve that by copying those files to a separate directory instead, you can try that.

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

Re: Frequency Response Analyzer with Bode Plots

Post by hexamer »

Posting this quickly since it's getting pretty late where you are ...

That error is that one related to the diag directory not existing. What I said before was probably confusing. By app data directory, I meant the one in your documents folder, not the one in the roaming profile. E.g. c:\Users\Zoltán\Documents\FRA4PicoScope\diag. You should already have a c:\Users\Zoltán\Documents\FRA4PicoScope. It's the place where the app stores exported data and plot images. Sorry for the confusion :(

Edit (reason): still didn't quite have the directory correct.
Last edited by hexamer on Fri Apr 17, 2015 11:48 pm, edited 1 time in total.

zolkow
Advanced
Posts: 0
Joined: Sun Apr 12, 2015 9:36 am
Location: Hungary

Re: Frequency Response Analyzer with Bode Plots

Post by zolkow »

I'm starting to have this diag folder in almost every system folders, but still no visible export :cry:

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

Re: Frequency Response Analyzer with Bode Plots

Post by hexamer »

zolkow wrote:
it's probably a different issue, but I found it interesting, that even if I set the max tries to 1, the autorange kept increasing the input ranges (50-100-200-500 mV). is this on purpose? nevermind, I think it's logical if the first attempt wasn't successful, then next time it tries the next level :)
That sounds like a bug, thanks for reporting. Setting autorangeTriesPerStep to 1 should force it to give up after just one try. I'll have to investigate.
zolkow wrote: Still another opinion, that wasn't is more logical, if the autorange went from upper ranges to lower?
It could be even faster, probably 2 or 3 steps would be enough to determine the right level.
Yes, in fact that is issue #30 in my backlog "Analysis efficiency enhancement" :) I have not thought of any reason that wouldn't work. I could always make it configurable just in case.
zolkow wrote: Not mentioning that good chances are that the input signal would be equal (or very close) to the signal generator's level, so if this setting is for example 2Vp-p, I wouldn't start the autorange with 50 mV.
(I suppose there was a special reason to do that in the opposite way)
That's also a good idea. I'll lump that into issue #30.
zolkow wrote: but back to my original problem: You are helping me at least as much (actually much more) az I do, so thanks for the cooperation!
You're welcome! I really would like to get to the point of supporting all possible PicoScopes and I hope I can get you there without too much more trouble for you. Once we have the diagnostic plots, I'll begin to look more deeply at the code to see if I can spot the problem.
Last edited by hexamer on Sat Apr 18, 2015 1:30 am, edited 1 time in total.

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

Re: Frequency Response Analyzer with Bode Plots

Post by hexamer »

zolkow wrote:it's probably a different issue, but I found it interesting, that even if I set the max tries to 1, the autorange kept increasing the input ranges (50-100-200-500 mV). is this on purpose? nevermind, I think it's logical if the first attempt wasn't successful, then next time it tries the next level :)
OK, taking a closer look at your log, I think I know what you're talking about now. I assume you're answering OK to the "Reached autorange limit. Continue?" dialog. The behavior you're seeing is related to a feature where the code is not completely implemented. For now what the code does is just log a 0/0 result and move on to the next frequency when you click OK. In the future when I address issue #6 "Interactive auto-ranging", the options will be more complete. What I intend to do is allow the user to abort the run, log an undetermined result at that frequency, or take other actions such as switch probe attenuation or turn on an amplifier, etc.

But I also think you've probably spotted a bug too. I don't think it's necessarily a good idea to advance ranges when going to the next frequency in this circumstance. That part is unintentional.

zolkow
Advanced
Posts: 0
Joined: Sun Apr 12, 2015 9:36 am
Location: Hungary

Re: Frequency Response Analyzer with Bode Plots

Post by zolkow »

I really have that diag directory in every FRA folder now :)
But I still have no output file.

I just noticed that I can export the plot data though, so I tried it and it worked, the log shows the correct path, there's a diag folder at that path too. (I mean it matches your suggested path)

I have to read again your instructions about the necessary files for plotting, because now this seems to be a plotting issue, as no plot is shown, but I don't know if it is in correlation with the missing diag files or not.

zolkow
Advanced
Posts: 0
Joined: Sun Apr 12, 2015 9:36 am
Location: Hungary

Re: Frequency Response Analyzer with Bode Plots

Post by zolkow »

Yes, I pressed continue for the autorange limit dialog.
What are the PLplot support files? I have the following in the .exe directory:

plxtnd5.fnt
cmap0_default.pal
cmap1_default.pal


btw. yesterday I got your PM, but I still cannot send any..

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

Re: Frequency Response Analyzer with Bode Plots

Post by hexamer »

zolkow wrote:I really have that diag directory in every FRA folder now :)
But I still have no output file.

I just noticed that I can export the plot data though, so I tried it and it worked, the log shows the correct path, there's a diag folder at that path too. (I mean it matches your suggested path)

I have to read again your instructions about the necessary files for plotting, because now this seems to be a plotting issue, as no plot is shown, but I don't know if it is in correlation with the missing diag files or not.
That PLplot error message (albeit misleading) is telling us that it's having trouble creating the SVG plot files. Some other possibilities would be permissions issues, though that's hard to imagine since that's the Documents directory. You could probably prove that by running the app as Administrator. At this point though, your other diagnostic attempts are probably enough to help me look at the right spots in the code to find the overall issue with the wrong frequency response. The diagnostic plots might just be more of a curiosity.

The patched code I gave you is structured to not even try to draw the Bode plot if the diagnostic plots fail. So what your seeing is "normal/expected" but could be enhanced.
Last edited by hexamer on Sat Apr 18, 2015 10:20 pm, edited 1 time in total.

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

Re: Frequency Response Analyzer with Bode Plots

Post by hexamer »

zolkow wrote:Yes, I pressed continue for the autorange limit dialog.
What are the PLplot support files? I have the following in the .exe directory:

plxtnd5.fnt
cmap0_default.pal
cmap1_default.pal


btw. yesterday I got your PM, but I still cannot send any..
Yes, those are the right files. If those were missing those you might get a different error message, with the patched version (or it might crash/disappear, not sure). With the official 0.3b version, without those files it will definitely crash because of another issue where I didn't install the error handler as early as I should.

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

Re: Frequency Response Analyzer with Bode Plots

Post by hexamer »

zolkow wrote:I really have that diag directory in every FRA folder now :)
But I still have no output file.
Just one more thought here. From some of the screen shots you provided, it looks like you're using Windows 8, is that right? I could try running some tests there to see what the diagnostic plotting issue might be.

zolkow
Advanced
Posts: 0
Joined: Sun Apr 12, 2015 9:36 am
Location: Hungary

Re: Frequency Response Analyzer with Bode Plots

Post by zolkow »

hexamer wrote: Just one more thought here. From some of the screen shots you provided, it looks like you're using Windows 8, is that right? I could try running some tests there to see what the diagnostic plotting issue might be.

Actually it's Windows 10 preview, but at some steps I went and tried the same with my wife's Win7 machine too.
(the behaviour was the same, so I didn't care of it. I repeat the last step on her laptop too, if you want)

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

Re: Frequency Response Analyzer with Bode Plots

Post by hexamer »

One other thing we can try here is to capture PLplots diagnostic messages, which go to stdout and stderr. If you've got the patience to try one more thing it should not take long.

This may be easiest with a copy of the app and its three PLplot support files in a directory you're sure you have write access to. E.g. if, instead, you try this from you program files directory, you'd probably need to supply different output file locations for stdout.txt and stderr.txt

You'll need to launch the app from a command line and redirect the stdout and stderr to files. For example:

FRA4PicoScope.exe > stdout.txt 2> stderr.txt

Run the sequence that causes time domain plots to not be generated. Then close the app and see if there is any content in the stdout or stderr text files.

Post Reply