Differences
This shows you the differences between two versions of the page.
Both sides previous revisionPrevious revisionNext revision | Previous revision | ||
learn:instrumentation:tutorials:ad2-waveform-generator:start [2016/08/26 19:36] – Martha | learn:instrumentation:tutorials:ad2-waveform-generator:start [2021/06/02 23:50] (current) – Arthur Brown | ||
---|---|---|---|
Line 1: | Line 1: | ||
- | ====== | + | ====== Using the Waveform Generator (REDIRECT) ====== |
- | Waveform generators are used to test circuits by generating defined signals that are then fed into the circuit under analysis. You can have an arbitrary waveform generator | + | ~~REDIRECT>test-and-measurement/guides/ |
- | + | ~~NOSEMANTIC~~ | |
- | ---- | + | {{tag>redirect}} |
- | + | ||
- | ==== Inventory | + | |
- | * 1 [[http:// | + | |
- | * You may also use the [[http:// | + | |
- | * [[http:// | + | |
- | * A computer with USB port to run the software | + | |
- | + | ||
- | ---- | + | |
- | ====== Step 1: The Waveform Generator | + | |
- | There isn't much to cover as far as background material for a waveform generator, so let's get started. If you want some help getting your device calibrated, or installing WaveForms 2015, check out this quick start [[http:// | + | |
- | + | ||
- | Once you have your Analog Discovery 2 and WaveForms all set up, open the waveform generator by clicking on the " | + | |
- | {{ : | + | |
- | + | ||
- | The waveform generator tool will open. | + | |
- | {{ : | + | |
- | + | ||
- | There are three main areas to pay attention to: | + | |
- | * The control toolbar | + | |
- | {{ : | + | |
- | * The configuration panels, which will change based on the type of waveform you want to generate. | + | |
- | {{ : | + | |
- | * The preview plot | + | |
- | {{ : | + | |
- | + | ||
- | Let's take them one at a time, starting with the control toolbar. | + | |
- | + | ||
- | ---- | + | |
- | ====== Step 2: The Control Toolbar ====== | + | |
- | There are only a few controls associated with the control toolbar. | + | |
- | {{ : | + | |
- | + | ||
- | * " | + | |
- | * " | + | |
- | * " | + | |
- | * " | + | |
- | * Below that, you will find the "Run All" button. This will control the function generation on all channels that have been turned on, even overriding the " | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | Clicking on the "No synchronization" | + | |
- | {{ : | + | |
- | + | ||
- | In "no synchronization mode, no synchronization or trigger parameters are available. | + | |
- | + | ||
- | In " | + | |
- | + | ||
- | In " | + | |
- | + | ||
- | The " | + | |
- | + | ||
- | For the trigger settings, the button displayed below in Fig. 9 lets you determine what type of trigger source you want. You can select " | + | |
- | {{ : | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | The button in Fig. 11 below lets you set a wait time. Once the trigger condition has been met, the signal will enter the idle condition, outputting the offset value for that amount of time. Once that time has expired, the output will then be the selected waveform type. Any time from 20ns to 24 hours is valid, or you can select " | + | |
- | {{ : | + | |
- | + | ||
- | The button displayed in Fig. 12 lets you set how long the signal will run once the Wavegen has been triggered and any wait time has expired. Any time from 20 ns to 24 hr can be selected, or you can choose " | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | The button in Fig. 13 lets you set how many times you want the set signal to repeat before returning the output to idel state. You can set this to any value between 1 and 30,000 cycles, or choose infinite. | + | |
- | {{ : | + | |
- | + | ||
- | If you check " | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | The following example involves some details from the next step, but demonstrates the trigger functionality well. The settings will produce a 1kHz signal at 1V offset and 1V amplitude. The trigger is set to manual, and once triggered, the output will wait for 500μs, then output for 2ms. This cycle will automatically repeat 2 times, then the output will enter idle state, outputting 1V DC. The whole thing will take 5ms to happen. | + | |
- | {{ : | + | |
- | + | ||
- | By connecting the Waveforms Oscilloscope, | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | The scope window settings have been adjusted to make the signal more obvious. The signal is idle until triggered, at which point it enters the first wait time at -0.6ms, waits for 500μs, then completes that first cycle at 1.9ms. The second cycle begins its wait period at the same time, waits for 500μs, and then completes at 4.4ms. The output is then in idle, which is the offset value of 1V. | + | |
- | + | ||
- | + | ||
- | ---- | + | |
- | + | ||
- | ====== Step 3: The Configuration Panes ====== | + | |
- | There are several different configuration panes depending on which type of signal you want to generate. | + | |
- | {{ : | + | |
- | + | ||
- | There are some functions that are the same regardless of what signal you are generating. | + | |
- | + | ||
- | Clicking " | + | |
- | {{ : | + | |
- | + | ||
- | The " | + | |
- | + | ||
- | We'll skip the " | + | |
- | {{ : | + | |
- | + | ||
- | Clicking the top gear icon allows you to determine what the wavegen channel will output while in an idle state. You can choose either the initial value or the offset. For many signals this will be the same value, but if you change the phase for example, these values will be different. Be aware that stopping the waveform output does not disable the idle output, so if you turn it off but have changed the offset of initial values to something not 0V, there will still be a DC signal on the wavegen channel even when you have turned it off. The only way to fully disable this idle output and prevent shorting is either keep the offset or initial values at 0V or uncheck the " | + | |
- | {{ : | + | |
- | + | ||
- | The " | + | |
- | {{ : | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | This menu is where there are some major differences, | + | |
- | + | ||
- | + | ||
- | ---- | + | |
- | + | ||
- | ====== Step 4: The Configuration Pane: Simple ====== | + | |
- | The first option is " | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | From here you can set the type of signal you want from the " | + | |
- | {{ : | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | Once you choose a waveform type, you have several editable parameters below that. Any edits you make will update on the plot to the right. | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | Most signal types have all parameters available. For a " | + | |
- | + | ||
- | " | + | |
- | + | ||
- | " | + | |
- | + | ||
- | " | + | |
- | + | ||
- | " | + | |
- | + | ||
- | The " | + | |
- | + | ||
- | " | + | |
- | + | ||
- | + | ||
- | ---- | + | |
- | + | ||
- | ====== Step: The Configuration Pane: Basic ====== | + | |
- | " | + | |
- | {{ : | + | |
- | + | ||
- | On the left you have all of your signal type options. To the right of that, you now have sliders for each parameter. | + | |
- | {{ : | + | |
- | + | ||
- | You can hard set the range of each slider, with the slider itself determining the actual value. For example, if you are trying to find the exact cutoff frequency of a specific filter, you can set your top bottom frequency values to just above and below your calculated value. Then use the slider to adjust the frequency within that window to pinpoint the cutoff exactly. Sliders can be adjusted in real time while the Wavegen is running and while the output is connected to any other Waveforms tool or a circuit. | + | |
- | + | ||
- | Above each slider you can click on the Frequency button to open or close the slider. It doesn' | + | |
- | {{ : | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | ---- | + | |
- | ====== Step 6: The Configuration Pane: Custom ====== | + | |
- | " | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | Click on " | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | " | + | |
- | {{ : | + | |
- | + | ||
- | From " | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | However you choose to open the custom waveform editor window, you have the same options from there across the top of the window. | + | |
- | * " | + | |
- | {{ : | + | |
- | * " | + | |
- | {{ : | + | |
- | * "Undo/Redo" lets you undo or redo any changes made. | + | |
- | {{ : | + | |
- | * " | + | |
- | {{ : | + | |
- | + | ||
- | In the middle you see the plot of the current custom waveform. You can add/remove labels and change the width of the plot trace by clicking on the gear icon. The plot axes are listed in terms of percentage. When you edit and save your waveform, whatever you have on the plot becomes one complete cycle for the new waveform. You can later change the frequency of the waveform, but more on that later. | + | |
- | {{ : | + | |
- | + | ||
- | On the right side you have the " | + | |
- | + | ||
- | On the left side you have multiple tabs available that you can use to define your waveform (the tabs are described in the sections below). This is where the magic happens! Note that until you click " | + | |
- | {{ : | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | ---- | + | |
- | + | ||
- | ==== Function ==== | + | |
- | The " | + | |
- | {{ : | + | |
- | + | ||
- | * " | + | |
- | * " | + | |
- | * " | + | |
- | * " | + | |
- | * " | + | |
- | * " | + | |
- | + | ||
- | Now, for an example, make the following edits: | + | |
- | * 25% in " | + | |
- | * 50% for " | + | |
- | * 75% for " | + | |
- | * Uncheck " | + | |
- | {{ : | + | |
- | * Click on " | + | |
- | {{ : | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | If you leave " | + | |
- | + | ||
- | Now the interesting part! We don't want to overwrite the sine wave, but let's add a triangle wave. Make the following edits: | + | |
- | * 25% for " | + | |
- | * 50% for " | + | |
- | * Select " | + | |
- | * 50% " | + | |
- | * 180° " | + | |
- | * Click on " | + | |
- | + | ||
- | {{ : | + | |
- | {{ : | + | |
- | + | ||
- | Let's add one more piece to the plot before saving it. Edit as follows: | + | |
- | * 66% " | + | |
- | * 34% " | + | |
- | * Select " | + | |
- | * 75% " | + | |
- | * -25% " | + | |
- | * Click on " | + | |
- | {{ : | + | |
- | {{ : | + | |
- | + | ||
- | Once you have your waveform defined, click on " | + | |
- | {{ : | + | |
- | {{ : | + | |
- | + | ||
- | Be aware that once you save your custom signal, it will also appear in the " | + | |
- | + | ||
- | On the far left you will see all of your custom signals. You can add as many as you want. Next to that you can edit the wavegen output parameters like frequency or amplitude. | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | The frequency defaults to 1kHz, so whatever waveform you design will complete one full cycle in 1ms by default. Below that you have the sample rate, which defaults to 4.096MHz. Remember the " | + | |
- | + | ||
- | ==== Math ==== | + | |
- | Now let's take a look at the " | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | You can simply type in whatever math function you want using JavaScript syntax. | + | |
- | + | ||
- | The " | + | |
- | + | ||
- | "X from" and " | + | |
- | + | ||
- | Checking " | + | |
- | {{ : | + | |
- | + | ||
- | Let's make some edits to define our own signal. | + | |
- | * Change " | + | |
- | * Edit the default function script to be " | + | |
- | * Uncheck " | + | |
- | {{ : | + | |
- | * Click on " | + | |
- | {{ : | + | |
- | {{ : | + | |
- | + | ||
- | It looks alright, but click on " | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | ---- | + | |
- | + | ||
- | + | ||
- | ==== Values ==== | + | |
- | Next is the " | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | This option is really good for building step functions. You can have up to 100 values in the table on the left. The " | + | |
- | {{ : | + | |
- | + | ||
- | With " | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | The final wavegen output will simply be a square wave, not a step like before. | + | |
- | + | ||
- | ---- | + | |
- | + | ||
- | ==== File ==== | + | |
- | The next option is " | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | You can import a saved waveform file, and by adjusting the " | + | |
- | + | ||
- | A copy of the default | + | |
- | + | ||
- | + | ||
- | {{ : | + | |
- | + | ||
- | The first three steps import, and then are normalized to the size of the plot window. Once " | + | |
- | + | ||
- | + | ||
- | {{ : | + | |
- | + | ||
- | From here you can take any function you've already designed and alter it with another function. When you click "Alter with", a second custom window will open. You can generate another signal, including using the " | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | Let's use the " | + | |
- | * Start in the " | + | |
- | * Make sure " | + | |
- | * Generate a sine waveform by using the function " | + | |
- | * **DON' | + | |
- | {{ : | + | |
- | * Then from the " | + | |
- | {{ : | + | |
- | + | ||
- | In the new window that opens, click the " | + | |
- | {{ : | + | |
- | + | ||
- | Click "Alter with" again, and repeat the process with " | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | Adding " | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | Repeating this process to the 20th iteration (sin(2*PI*X*39)/ | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | Once you click " | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | + | ||
- | ---- | + | |
- | + | ||
- | ==== Free Hand ==== | + | |
- | The actual last custom option is the ability ti just free hand whatever custom waveform you feel like making. Once you open the custom edito window, no matter which tab you have selected, you can simply click on the plot in the middle of the window and start drawing. Standard Cartesian plot rules apply, so only one y value per x value. Otherwise, go nuts. | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | If you don't like what happens, simply click " | + | |
- | + | ||
- | + | ||
- | ---- | + | |
- | + | ||
- | ====== Step 7: The Configuration Pane: Play ====== | + | |
- | " | + | |
- | + | ||
- | On the left side of the " | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | Click on " | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | On the left are some options that can be edited. " | + | |
- | + | ||
- | The Channel column in the middle is a table of every single sample. These values cannot be adjusted. | + | |
- | + | ||
- | On the right you will see a plot of the waveform of your file. | + | |
- | + | ||
- | Click " | + | |
- | + | ||
- | Once you have a file imported, the file appears on the left, the waveform appears on the plot, and the playback control options unlock. | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | + | ||
- | + | ||
- | + | ||
- | {{tag>learn instrumentation tutorial analog-discovery-2 analog-discovery ad1 ad2 waveform-generator awg waveforms-2015}} | + |