Jump to content
  • 0

Raspberry Pi and AD2 || Network Analyzer mode


RajatDas

Question

I have a Analog Discovery 2 and Raspberry pi 4. For connection and package installation I am following this link "https://digilent.com/reference/test-and-measurement/guides/getting-started-with-raspberry-pi". 

In Rpi-4 I have installed Adept and waveform software. Now I want to run Analog Discovery 2 in Network Analyzer mode from Rpi4 with these following specifications :

1. start frequency of 100 KHz

2. stop frequency at 1 MHz

3. no of point around 1 K.  and few others.

Is this kind of control or operation is possible from RPi4 using SDK python ?

For Analog Discovery 2 and Raspberry pi 4 connection what kind of cable/wire I required ?

Link to comment
Share on other sites

13 answers to this question

Recommended Posts

  • 0

Need some help in python programming. The GUI setting I want implement it in python.

Basically in network analyser mode I want to generate sweep sine wave using wavegen1 for circuit excitation and the same sweep signal I want to give it to channel 1 as input for reference. Next the circuit response output I want to give it to channel 2. Finally I want to capture the magnitude response of channel 2.

Need some help.

IMG_20230530_131101.jpg

Link to comment
Share on other sites

  • 0

In AnalogNetwork_Analyzer.py SDK example, 

dwf.FDwfAnalogImpedanceReset(hdwf)
dwf.FDwfAnalogImpedanceModeSet(hdwf, c_int(0)) # 0 = W1-C1-DUT-C2-R-GND, 1 = W1-C1-R-C2-DUT-GND, 8 = AD IA adapter
dwf.FDwfAnalogImpedanceReferenceSet(hdwf, c_double(reference)) # reference resistor value in Ohms
dwf.FDwfAnalogImpedanceFrequencySet(hdwf, c_double(start)) # frequency in Hertz
dwf.FDwfAnalogImpedanceAmplitudeSet(hdwf, c_double(amplitude)) # 1V amplitude = 2V peak2peak signal
dwf.FDwfAnalogImpedanceConfigure(hdwf, c_int(1)) # start

It is in impedance analyzer mode,

but I want it into network analyzer mode as shown in the below figure. Here Filter is our test device. Required your help . 

image.png.8feb81046f85ce8e021e74ae735dba5f.png

 

Edited by RajatDas
explanation
Link to comment
Share on other sites

  • 0

Hi @RajatDas

In AnalogNetwork_Analyzer.py example the following functions return the gain and phase just like in the WaveForms application Network Analyzer.
    dwf.FDwfAnalogImpedanceStatusInput(hdwf, c_int(0), byref(gain1), 0) # relative to FDwfAnalogImpedanceAmplitudeSet Amplitude/C1
    dwf.FDwfAnalogImpedanceStatusInput(hdwf, c_int(1), byref(gain2), byref(phase2)) # relative to Channel 1, C1/C#

In the AnalogImpedance_Analyzer.py and other examples the FDwfAnalogImpedanceStatusMeasure is used which returns further processed data, like in WF app Impedance Analyzer.

Link to comment
Share on other sites

  • 0

Hi @RajatDas

Do not use resistor.
What comes after DUT|Scope2 is not important for network analysis. However, it depends on the DUT, circuit... you might want to inspect a section of the circuit sequence...
Resistor is needed for impedance analysis to serve as a reference for calculating relative impedance.

Link to comment
Share on other sites

  • 0

Ok, Thank you @attila.  So if I want to run the same sweep multiply times, then the below section do I need to execute it in every scan iteration ?

for i in range (noOfScan):

dwf.FDwfAnalogImpedanceReset(hdwf)
dwf.FDwfAnalogImpedanceModeSet(hdwf, c_int(0)) # 0 = W1-C1-DUT-C2-R-GND, 1 = W1-C1-R-C2-DUT-GND, 8 = AD IA adapter
dwf.FDwfAnalogImpedanceReferenceSet(hdwf, c_double(reference)) # reference resistor value in Ohms
dwf.FDwfAnalogImpedanceFrequencySet(hdwf, c_double(start)) # frequency in Hertz
dwf.FDwfAnalogImpedanceAmplitudeSet(hdwf, c_double(amplitude)) # 1V amplitude = 2V peak2peak signal
dwf.FDwfAnalogImpedanceConfigure(hdwf, c_int(1)) # start
time.sleep(2)

 

dwf.FDwfAnalogImpedanceConfigure(hdwf, c_int(0)) # stop
dwf.FDwfDeviceClose(hdwf)

end

Link to comment
Share on other sites

  • 0

Hi I need to do multiple impedance scan and parameters will also be same. So do I need write the following codes in every scan ?

dwf.FDwfAnalogImpedanceReset(hdwf)
dwf.FDwfAnalogImpedanceModeSet(hdwf, c_int(0)) # 0 = W1-C1-DUT-C2-R-GND, 1 = W1-C1-R-C2-DUT-GND, 8 = AD IA adapter
dwf.FDwfAnalogImpedanceReferenceSet(hdwf, c_double(reference)) # reference resistor value in Ohms
dwf.FDwfAnalogImpedanceFrequencySet(hdwf, c_double(start)) # frequency in Hertz
dwf.FDwfAnalogImpedanceAmplitudeSet(hdwf, c_double(amplitude)) # 1V amplitude = 2V peak2peak signal
dwf.FDwfAnalogImpedanceConfigure(hdwf, c_int(1)) # start

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...