Characterizing a Simple Circuit with a Bode Plot
Using a Tektronix oscilloscope and function generator
This is the first in a series on test & measure automation using Flojoy and Tektronix instruments.
Flojoy Introduction
Flojoy is a modern test and measurement (T&M) app that uses Python. Flojoy has the ease of use common with no-code applications. It also offers advanced users the option to create custom Blocks of Python code for specialized applications. Here we show a use case for using Flojoy with Tektronix instruments.
The first step in using T&M with Flojoy is ensuring the instrument can be “seen”. Flojoy has tools to help connect Python to instruments like oscilloscopes. One of the first steps is to ensure Flojoy can “see” your oscilloscope. Clicking on the Hardware Devices tab will show you the available devices.
Here we can see there’s an available Tektronix MSO24 oscilloscope which we’ll be using. You can also see it’s connected using Ethernet (TCPIP). We recommend using Ethernet for VISA devices as it’s the most cross-platform friendly (compared to USB). When you are preparing the app, the correct instruments must be selected for each block.
Characterizing a simple circuit with a Bode plot
Low-pass and high-pass electronic filters are used to filter out select signal frequencies. A low-pass filter allows lower frequencies to pass while blocking higher frequencies (high-pass filters do the opposite). They are used in a variety of circuits, and they can have a variety of characteristic frequencies. Above this frequency a low-pass filter will block, or strongly reduce, the signal. However, these filters are not perfect. Therefore, it is important to characterize them. When testing circuits, oscilloscopes are often used. Here, we demonstrate how to use Flojoy for no-code characterization of a low-pass filter.
For this tutorial you need an AFG (arbitrary function generator) and an oscilloscope (many oscilloscopes have a built-in AFG function). The AFG is used to generate a signal with a variable frequency, and the oscilloscope is used to measure the output signal strength. In this case, a Tektronix AFG 31000 and MSO24 oscilloscope were used. With these you can sweep the frequency across a range and measure the resulting output amplitude. This is called a Bode plot (specifically the Bode magnitude plot).
Let’s take a look at the Bode app (Figure 5). For all of the instrument blocks, ensure the instrument selected in the parameters is the correct one (this may change when you load the app). The instrument parameter should be the top one in the parameter menu. Next set up the FEEDBACK blocks. In Flojoy, feedback blocks load the last output from the selected block. If the selected block has no output yet, the value inputted to feedback will be used. Ensure the correct blocks are selected (this should not change when you load the app). Note that blocks can be renamed for clarity in Flojoy. Here’s a list of the selections for the feedback blocks:
FEEDBACK PREV FREQ – multiply block (x symbol)
FEEDBACK AMPLITUDE – append amplitude
FEEDBACK FREQ LOOP – append freq
FEEDBACK AMPLITUDE PLOT – append amplitude
FEEDBACK FREQ PLOT – append freq
Next, other parameters must be setup according to your specific needs. To vary the frequency, the app multiplies the last frequency by a constant. In Figure 3, the constant is 1.02. The app will loop a number of times defined by the “num_loops” constant in the LOOP block. Here it is set to 250. The starting frequency is defined by the constant placed before FEEDBACK PREV FREQ, as well as the multiplication constant. The starting frequency here is 98000*1.02 = ~10 kHz. The ending frequency is defined by the number of loops as well as the other two constants. The ending frequency here is 98000*1.02250 = ~14 MHz. It is also possible to define these by using a preset CSV, or similar, file with the VECTOR_INDEXING block.
The INPUT PARAM AFG31000 block will change the AFG frequency to the input value for each loop. The TIMER block will delay the app for a set number of seconds (0.05, or 50 ms, here) in order for the measurement value to be more accurate. The MEASUREMENT MSO2X block will extract the amplitude measurement from the oscilloscope. The frequency and amplitudes are appended into a Vector during each loop. These Vectors are extracted after the looping completes with the bottom two feedback blocks. The voltage amplitudes are transformed into dB values, and the two Vectors are turned into an Ordered Pair (i.e. x, y data) for plotting. During the looping, the first value is a placeholder and therefore must be deleted. This is done with the DELETE 1ST ROW block here (a renamed ORDERED_PAIR_DELETE block). The data is then plotted with the line block. Note that you can resize plotting blocks.
Note that the filter does not cause a major decrease in signal strength until >2 MHz. For comparison, the app was repeated without the low-pass filter in place.
Congrats you’ve characterized a simple circuit! If you had any difficulties here, or any comments or suggestions please contact us.