Frequency Response Analyzer with Bode Plots

Post discussions on applications you are writing
Post Reply
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 »

Akram wrote:
Wed May 06, 2020 10:11 am
Dear hexamer,

I have a question (I precise I am a newbie), i want to add in the interface some button and box, and those buttons and boxes will be used to make some new mathematical calculation according to the measurement of the signal get it.

I am using VS 2019, I downond all the files, but i do not well understand how can I add extra button and boxes to the interface, please could you give some explanation, indication, links, document or any thing else that may help me.

Thank you for your help in advance.
Best regards.
Akram
Hi Akram,

As mentioned by mnni, the code is well documented and pretty straightforward to adapt. However, if you are more comfortable using a language other than Native C++, and you don't mind making your GUI from ground up, you could tryout the API version of FRA4PicoScope.

Thanks,

Aaron.

albertomora1
Newbie
Posts: 0
Joined: Wed Jul 15, 2020 5:27 pm

Re: Frequency Response Analyzer with Bode Plots

Post by albertomora1 »

Hi,
first of all, thanks for your incredible tool. I spent many hours computing FRF "by hands" loading tons of data in MATLAB and computing over there my FRF. Your tool is great.

Just a question: I did not found the possibility to display the coherence plot (quite usefull plot to check the goodness of the frequency response). Is it possible to get such information from the software?

Thanks,
Alberto

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 »

albertomora1 wrote:
Fri Jul 17, 2020 12:52 pm
Hi,
first of all, thanks for your incredible tool. I spent many hours computing FRF "by hands" loading tons of data in MATLAB and computing over there my FRF. Your tool is great.

Just a question: I did not found the possibility to display the coherence plot (quite usefull plot to check the goodness of the frequency response). Is it possible to get such information from the software?

Thanks,
Alberto
Hi Alberto,

I appreciate your kind feedback. Since I'm not very familiar with modal analysis, my answer may be a bit off base. I assume since you're using the FRA tool, you're using a method that has single input actuator and a single output accelerometer and you sweep across the spectrum of interest - as opposed to an impulse hammer method.

To compute the frequency response at a single frequency (step), the FRA tool is using a single point DFT method, instead of a full spectral analysis. So, computing functions like coherence would require additional processing for the constituent functions such as cross-spectral density and autospectral density, which is currently beyond the scope of the software.

I have a couple ideas that might be of interest to you.

1) The application does compute a purity value for both input and output at each frequency step. If both input and output are pure (near 1.0) then you'd have reasonable confidence that there was no noise influencing the measurement. If the input was pure and the output was impure, then you'd know that noise may have affected the measurement quality. If both I&O were impure, you may or may not be able to make a determination. If both I&O were very impure (i.e. near 0), then the low SNR probably resulted in a poor quality measurement. If both the I&O were only moderately impure, all the input impurities could have transferred in an LTI way to the output, the measurement would be fine, and you wouldn't know.

2) If you really needed a true coherence function, I could think of a couple ways to get it:
a) While I can't attest to its applicability to your use case, I see that there are free toolboxes to automate vibration analysis in Matlab: e.g. http://www.abravibe.com/toolbox.html
b) There is an API version of the FRA tool that you could develop your own add-on computations. I'd have to add an API to get the raw time domain data, but that's pretty simple. There are examples using Excel VBA and C

Rumpel
Newbie
Posts: 0
Joined: Wed Jun 10, 2020 8:52 pm

Re: Frequency Response Analyzer with Bode Plots

Post by Rumpel »

hexamer wrote:
Sat Jul 11, 2020 8:12 pm
Very well done and thank you for sharing your data analysis tools! If you like programming with Excel, there is an API version of the FRA application along with a VBA application example which you might find useful.
I saw that there was API version for Excel usage, but it is actually more convenient for me to simply save data to CSV files during experimenting and analyse/compare selected data files later. (Also I'm not that experienced in Excel to write applications there :) ). I wrote this tool mainly to compare different configurations on a single chart.

hexamer wrote:
Sat Jul 11, 2020 8:12 pm
If this data is based on a commercially available PSU, would you mind sharing what it is? If it's a proprietary design, I understand if you can't share. I'm mainly interested in comparing to any published stability plots.
This PSU is part of the control panel for locomotive and is not sold separately. I can't share schematics because it's a commercial secret but can describe what it is. It's a simple isolated flyback converter based on UCC28C45 controller. 24V input, 12V 2.5A output. Schematics is basicaly the same as in datasheet for this PWM controller except some efficiency improvements and failure protections added, also based on planar transformer and ceramic capacitors.

hexamer wrote:
Sat Jul 11, 2020 8:12 pm
Also, did you need to use adaptive stimulus mode? If you did, how did you find it to use? (easy/hard? effective/ineffective?)
These graphs were measured with fixed stimulus. I have made an injection transformer from what was left in a junk box and tried adaptive stimulus but it failed. Thought it was because of a bad transformer. It was my first experience of measuring control loop and I was quite in a hurry to finish the project so I didn't have time to figure out how it should work. Thus I used fixed stimulus and it worked (and surprisingly good I must say).

Now I made a way better transformer with flat responce from about 1.2Hz to 700kHz and searched explanation on how adaptive stimulus works. It still don't work for my case though but now I understand why :) I have too high gain in low frequencies and too high attenuation in high frequencies so it fails to find a solution.
The big drawback is when the step fails this datapoint is failed completely (no data at all at this step) instead of getting what have been measured with maximum stimulus amplitude. Also it slows the process a lot by asking for action on a failure - you can't press GO and leave for other tasks. So maybe it's a good idea to add these options in case of step failure: 1. Use data from maximum stimulus 2. Automatically continue to the next step.

I think in this case a more useful approach for SMPS will be user-defined piecewise linear variable stimulus as was already mentioned.
Attachments
fixed stimulus 1Vpp
fixed stimulus 1Vpp
adaptive stimulus 0.001V
adaptive stimulus 0.001V

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 »

Rumpel wrote:
Mon Jul 20, 2020 4:39 pm
These graphs were measured with fixed stimulus. I have made an injection transformer from what was left in a junk box and tried adaptive stimulus but it failed. Thought it was because of a bad transformer. It was my first experience of measuring control loop and I was quite in a hurry to finish the project so I didn't have time to figure out how it should work. Thus I used fixed stimulus and it worked (and surprisingly good I must say).

Now I made a way better transformer with flat responce from about 1.2Hz to 700kHz and searched explanation on how adaptive stimulus works. It still don't work for my case though but now I understand why :) I have too high gain in low frequencies and too high attenuation in high frequencies so it fails to find a solution.
The big drawback is when the step fails this datapoint is failed completely (no data at all at this step) instead of getting what have been measured with maximum stimulus amplitude. Also it slows the process a lot by asking for action on a failure - you can't press GO and leave for other tasks. So maybe it's a good idea to add these options in case of step failure: 1. Use data from maximum stimulus 2. Automatically continue to the next step.

I think in this case a more useful approach for SMPS will be user-defined piecewise linear variable stimulus as was already mentioned.
Thank you very much for the specific feedback. There is definitely room for improvement on adaptive stimulus mode and your recommendations make a lot of sense. I agree that a piecewise approach would be helpful in cases where it just won't work or requires too much tuning. I started working on it (https://bitbucket.org/hexamer/fra4picos ... h/issue-72) and need to get back to it!

Your plots look like they're in good agreement with those shown in the datasheet (Figures 34 and 35), but I didn't see anywhere in the datasheet where they specify the load conditions for those plots. Good luck on your project!

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 am happy to announce a new release of FRA4PicoScope: https://bitbucket.org/hexamer/fra4picos ... 0.7.0b.msi

The primary new features are:
  • Custom Plan mode for SMPS measurements (as originally proposed by Roland van Roy, and recently reinforced by user Rumpel)
  • Modular Support for External Signal Generators - Caveat: you'll have to create a DLL Plugin to make it useful
  • Support for new PicoScope 5000D models
Full details can be found here: https://bitbucket.org/hexamer/fra4picos ... %20History

DASHTIG
Newbie
Posts: 0
Joined: Wed Sep 23, 2020 3:51 pm

Re: Frequency Response Analyzer with Bode Plots

Post by DASHTIG »

2204a on windows 10 ..
Excellent..
Great bit of software..use it to repair pedals for guitar.
Once again...excellent

chienmort
Newbie
Posts: 1
Joined: Wed Jun 20, 2018 9:43 am

Re: Frequency Response Analyzer with Bode Plots

Post by chienmort »

This looks like great software but I am having problems. I am trying to do a loopback test but it is not working. I have connected the scope probe directly from Channel A to the AWG output but I seem to be just getting noise at around -90db and lower. Am I doing something wrong?

Incidentally I have checked that the AWG and standard Sig Gen are working on Picoscope.

chienmort
Newbie
Posts: 1
Joined: Wed Jun 20, 2018 9:43 am

Re: Frequency Response Analyzer with Bode Plots

Post by chienmort »

Just to add a little info. I have tried instaling the 64 bit SDK and the 32 bit SDK, no difference. With no SDK it does not work. The scope (2206B) is working well with Picoscope 6. I am measuring audo amps so the sweep range is 10Hz to 20Hz.

I also have some questions,

How do I use the calibrate function on the Tools Menu?
Do I need a probe on both input and output?

In the meantime I will trawl through al 33 pages to see if I have missed something.

chienmort
Newbie
Posts: 1
Joined: Wed Jun 20, 2018 9:43 am

Re: Frequency Response Analyzer with Bode Plots

Post by chienmort »

RTFM....I reread the wiki and took the advice from earlier in the thread and using a simple RC filter it all worked. Npw to try it on the amp...

I also saw that Calibrate is on the list of features to add.

mnni
Newbie
Posts: 1
Joined: Mon Oct 09, 2017 7:33 am

Re: Frequency Response Analyzer with Bode Plots

Post by mnni »

Hey Aaron

I found an error! I believe its related to the setting of the sigGenerator frequency I use an PS5442B scope, the error may not be related to the FRA software but not 100% sure, more on that later.

The error reveals itself when running in noise Reject mode with a narrow bandwidth close to the frequency resolution of the scope generator in my case 200e6/2^32 ~ 46.5mHz (I use this mode when generating some Calibration files I want to be best as possible)
Below I was running a loop back test were the generator is connected directly to ChA and ChD
and with DftBW = 0.1 Hz
It tracks fine all the way up to 46566.175308Hz where it looks like the generator is set at a frequency 1 freqResolution step below the setpoint, I tested this by looking for the

Code: Select all

”currentFreqHz - ps->GetSignalGeneratorPrecision()
” with the Goertzel algorithm and that gives a purity close to 1.0 in the Plot below its seen the inaccurate measurement of the voltage above 46566.175308Hz dropping from 1Volt to below 0.7Volt

Note Highest frequency with correct frequency setting of Generator and Goertzel 46566.128742Hz Trying to set 46566.175308Hz is when it goes wrong.
So first I thought it could be a rounding issue in the App but that looks fine to me and I even tried with the double precision SetSigGenBuiltInV2 function and keep the freqInHz in double all around and it all looks fine.
But now I think it may be my scope or the driver perhaps that rounds down in some odd way ?.

Insert picture see Attached picture

anyway
my work around thought:
1. is sweeping over the side bands of the currentFreqHz +-1Step GeneratorPrecision looking for the highest Purity as I think I have seen it stepping up 1 GeneratorPrecision but not sure as I did not log it while debugging but if the generator is really not accurate the sampling should be adjusted to the real frequency to reduce leakage.
also was wondering if this scanning approach looking for greatest signal could lead to better accuracy in case the side band steps was set smaller than GeneratorPrecision and we say the Scope timebase and Generator was inaccurate of the SetPoint but at a constant error/precision was thinking this perhaps could lead to less noise on the spectrum in case with a fairly good SNR – but will have to put some more thoughts into this.

2.

Code: Select all

If (currentFreqHz > 46566.128742Hz)  do { currentFreqHz - ps->GetSignalGeneratorPrecision()  } // implemented but may only be my scope that do this so methode 1 is better for now.
anyway I would like not to have to scan for the correct frequency even it is not that much of processing time but if you got an idea of what it could be ?.


or if anybody else would like to test this issue in the default version of the app

Just connect the generator directly to 1 or 2 channels and turn on the LogVerbosity->DFT diagnostics = ON set noise reject bandwidth to 0.1Hz and adjust timebase till it stops complaining 😉
Run it and start look for odd values of purity in the log
Attachments
ScopePictureError.png

mnni
Newbie
Posts: 1
Joined: Mon Oct 09, 2017 7:33 am

Re: Frequency Response Analyzer with Bode Plots

Post by mnni »

So today i did a test with the picoScope 6 software and DeepMeasurement + averaging the frequency column as i do not have an accurate frequency counter

i entered the generator value 46566.128742 -> was rounded to 46.56613KHz and took the average value over 9310 cycles = 46566.13577 Hz

then i entered 46566.175308 -> gui rounded to 46.56618 kHz measured average value = 46566.13325Hz so looks to me like it has been rounded down by 1 freqResolution step

46.56619 kHz = 46566.1366 measured
46.5662 kHz= 46566.18119 measured

so i guess it is the scope driver i assume that do some strange rounding down

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 »

mnni -

I am able to replicate your findings on a PS5444A - purity drops from near 1 to 0.46 around 46kHz. For a while I was also thinking that the use of SetSigGenBuiltIn (and the explicit truncation to floats in PicoScopeFRA::StartCapture) was the problem since a single precision float only has ~6-7 decimal digits of precision. But I fixed that and the problem still persists.

In my test, 46995.888 was the first problematic frequency. I traced to the call SetSigGenBuiltInV2 and it was passed 46995.887543772318 - which is the DDS precision times 1,009,229.

I tried to do more diagnosis with my DC509 frequency counter. It's unfortunately a digit or two shy of the precision to definitively tell and has a 5e-6 error. But there is a definite unexpected shift in expected frequency of around 40 mHz near 46 kHz.

Hopefully we can get this diagnosed and fixed soon. Thank you for finding this as it's not as easily seen in a channel to channel gain calculation.

Aaron.

mnni
Newbie
Posts: 1
Joined: Mon Oct 09, 2017 7:33 am

Re: Frequency Response Analyzer with Bode Plots

Post by mnni »

Hi Aaron

! I do not have permission to write private messages and there is also some validation delay on my forum posts

This is just guessing ! :)
As the freq shift do not accrue at the same frequency makes me think this it is not a driver rounding issue
But was wondering if the scope do the conversion of floating point value to integer using an instrument calibrated signalGeneratorPrecision value using a measured DDS clock other than the 200e6.

Anyway i find it strange the scope driver is not offering a GetSignalGeneratorPrecision function or a getSigGeneratorFrequency that could be called after issuing a new sigGenFrequency setPoint

I posted a question regarding this issue in the programming forum - hope to get an answer soon :)

avi.patel001
Newbie
Posts: 0
Joined: Fri Oct 30, 2020 9:44 pm

Re: Frequency Response Analyzer with Bode Plots

Post by avi.patel001 »

Hello Folks

First of all, Aeron, it's really great work. I am new to picoscope and FRA4scope software; I don't know how to use the FR4Scope, My main goal is to Analyze the Impedance; can you please guide me on how to do this and how to use the FRA4scope software.

Regards
Avi

Post Reply