Differences

This shows you the differences between two versions of the page.

Link to this comparison view

Both sides previous revisionPrevious revision
Next revision
Previous revision
learn:instrumentation:tutorials:ad2-waveform-generator:start [2016/08/25 21:23] Marthalearn:instrumentation:tutorials:ad2-waveform-generator:start [2021/06/02 23:50] (current) Arthur Brown
Line 1: Line 1:
-====== Analog Discovery 2 - Using the Waveform Generator ====== +====== 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 (AWGthat outputs whatever waveform the user has defined, or you can have a function generator that outputs predefined signals like sine, square, etc. The waveform generator on the Analog Discovery 2 along with WaveForms 2015 software is a combination of both generators. The Analog Discovery 2 is also small, compact, and extremely affordable compared to many generators that can cost hundreds or even thousands of dollars.  +~~REDIRECT>test-and-measurement/guides/waveforms-waveform-generator~~ 
- +~~NOSEMANTIC~~ 
----- +{{tag>redirect}}
- +
-==== Inventory ==== +
-  * 1 [[http://store.digilentinc.com/analog-discovery-2-100msps-usb-oscilloscope-logic-analyzer-and-variable-power-supply/|Analog Discovery 2]] +
-     * You may also use the [[http://store.digilentinc.com/analog-discovery-100msps-usb-oscilloscope-logic-analyzer-limited-time/|Analog Discovery legacy]] or the [[http://store.digilentinc.com/electronics-explorer-all-in-one-usb-oscilloscope-multimeter-workstation/|Electronics Explorer Board]] with WaveForms 2015. There are some slight differences in functionality between the Analog Discovery Legacy, Analog Discovery 2, and the Electronics Explorer Board, but nothing that will prevent you from following along if you have one of the other tools. +
-  * [[http://store.digilentinc.com/waveforms-2015-download-only/|WaveForms 2015 software]] +
-  * 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://www.instructables.com/id/Analog-Discovery-2-Quick-Start/|Instructable collection]]. +
- +
-Once you have your Analog Discovery 2 and WaveForms all set up, open the waveform generator by clicking on the "Wavegen" button. +
-{{ :learn:instrumentation:tutorials:ad2-waveform-generator:wfg.png?700 |Figure 1. Wavegen button highlighted.}} +
- +
-The waveform generator tool will open. +
-{{ :learn:instrumentation:tutorials:ad2-waveform-generator:wfg2.png?700 |Figure 2. Waveform generator tool.}} +
- +
-There are three main areas to pay attention to: +
-  * The control toolbar +
-{{ :learn:instrumentation:tutorials:ad2-waveform-generator:wfg3.png?300 |Figure 3. Control toolbar.}} +
-  * The configuration panels, which will change based on the type of waveform you want to generate. +
-{{ :learn:instrumentation:tutorials:ad2-waveform-generator:wfg4.png?300 |Figure 4. Configuration panels.}} +
-  * The preview plot +
-{{ :learn:instrumentation:tutorials:ad2-waveform-generator:wfg5.png?600 |Figure 5. 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. +
-{{ :learn:instrumentation:tutorials:ad2-waveform-generator:wfg6.png |Figure 6. Control toolbar.}} +
- +
-  * "File" lets you open a **New Wavegen** instance, **Open** or **Save** a project, or **Export** the current wavegen data, either as an image or as a raw data file formatted in *.csv, *.txt, or *.tdms, which is specific to National Instruments.  +
-  * "Control" provides acces to the **Run All** and **Stop All** actions, which will turn on or off all enabled wavegen channels. +
-  * "Edit" lets you copy and swap channels from one to the other. +
-  * "Window lets you switch between different waveforms windows that are open, or access the **Waveforms Help** window.  +
-  * 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 "Enable" box (more on that in the next step). Channels can be opened/closed from the "Channels" drop-down button next to it. All channels that have a check mark have been opened and can be viewed in their own separate pane.  +
- +
-{{ :learn:instrumentation:tutorials:ad2-waveform-generator:wfg7.png |Figure 7. Waveforms new pane.}} +
- +
-Clicking on the "No synchronization" button gives you some synchronization options between the different channels and allows you to edit different trigger options. This is useful when you need to run multiple signals through the same circuit, or have one or both channels trigger at a specific time. For most applications, the default is usually appropriate. +
-{{ :learn:instrumentation:tutorials:ad2-waveform-generator:wfg8.png |Figure 8. No synchronization button.}} +
- +
-In "no synchronization mode, no synchronization or trigger parameters are available.  +
- +
-In "Independent" mode, the channels are working independently. The trigger-wait-run-repeat settings can be independently configured for each channel and opened in each channel's specific pane. If you modify the trigger settings of a channel, its signal generation starts over from the beginning and synchronization with the other channels is lost.  +
- +
-In "Synchronization" mode, the trigger-wait-run-repeat settings are the same for all selected channels within the same instrument instance. Modifying the settings of one of the channels causes both to be restarted. A run time value other than continuous should be used to periodically re-synchronize the channels. This has to be done because the actual frequencies might be approximates of the desired values and small errors accumulate until, after several cycles, the channel's phase will slide.  +
- +
-The "Auto" synchronization mode is similar to the "Synchronized" mode where run time is automatically adjusted to the longest period from all channel's settings (depending on signal frequency sweep/damp time, or AM/FM modulator frequency).  +
- +
-For the trigger settings, the button displayed below in Fig. 9 lets you determine what type of trigger source you want. You can select "none", or use some external signal, or even one of the Waveforms tools, like the Oscilloscope. You can also trigger the signal manually by setting the trigger to "manual" and then clicking on "Manual Trigger" in the bottom left corner of the window. +
-{{ :learn:instrumentation:tutorials:ad2-waveform-generator:wfg9.png |Figure 9. Trigger button.}} +
- +
-{{ :learn:instrumentation:tutorials:ad2-waveform-generator:wfg10.png |Figure 10. Manual Trigger button.}} +
- +
-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 "none" to not wait at all.  +
-{{ :learn:instrumentation:tutorials:ad2-waveform-generator:wfg11.png |Figure 11. Wait time settings. }} +
- +
-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 "continuous" to not have the signal ever reset. Be aware that choosing "continuous" can introduce an accumulated rounding error to the signal output over time, resulting in a phase shift. Setting your run time to some integer multiple of your frequency time base (e.g. for a 1 kHz signal, enter a 1 ms run time) will regularly reset the signal output and any accumulated error will continuously be reset to 0. +
- +
-{{ :learn:instrumentation:tutorials:ad2-waveform-generator:wfg12.png |Figure 12. Setting repeat signals.}} +
- +
-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.  +
-{{ :learn:instrumentation:tutorials:ad2-waveform-generator:wfg13.png |Figure 13. Setting cycles.}} +
- +
-If you check "Repeat Trigger", you will have to trigger the wavegen to output for the number of cycles you entered in the "Repeat" box. For example, if you have "manual" selected, under "5" in the repeat box, and check "repeat trigger", you will have to click the manual trigger button at the bottom five times. The wavegen output will idle and arm between triggers, and then idle and reset to ready state after 5 triggers. By unchecking the box, the wavegen will automatically output the chosen waveform for the set number of cycles without the need of additional trigger instances.  +
- +
-{{ :learn:instrumentation:tutorials:ad2-waveform-generator:wfg14.png |Figure 14. Repeat trigger. }} +
- +
-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.  +
-{{ :learn:instrumentation:tutorials:ad2-waveform-generator:wfg15.png?700 |Figure 15. Example cycle.}} +
- +
-By connecting the Waveforms Oscilloscope, we can verify our settings.  +
- +
-{{ :learn:instrumentation:tutorials:ad2-waveform-generator:wfg16.png?700 |Figure 16. Verifying with 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. +
-{{ :learn:instrumentation:tutorials:ad2-waveform-generator:wfg17.png |Figure 17. Configuration panes.}} +
- +
-There are some functions that are the same regardless of what signal you are generating.  +
- +
-Clicking "Run" will turn on/off only that channel. +
-{{ :learn:instrumentation:tutorials:ad2-waveform-generator:wfg18.png |Figure 18. Run button.}} +
- +
-The "Enable" box can be overridden several different ways, but if disabled it will turn off all outputs from that specific channel, including idle signals. Read on for more clarification about idle state signals.  +
- +
-We'll skip the "Simple" button for just a minute.  +
-{{ :learn:instrumentation:tutorials:ad2-waveform-generator:wfg19.png |Figure 19. Simple button.}} +
- +
-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 "Enable box.  +
-{{ :learn:instrumentation:tutorials:ad2-waveform-generator:wfg20.png |Figure 20. Gear icon.}} +
- +
-The "Simple" drop-down menu has a lot of options, and each of those options has a lot of different settings.  +
-{{ :learn:instrumentation:tutorials:ad2-waveform-generator:wfg21.png |Figure 21. Simple drop-down menu.}} +
- +
-{{ :learn:instrumentation:tutorials:ad2-waveform-generator:wfg22.png |Figure 22. Drop-down options.}} +
- +
-This menu is where there are some major differences, so let's look at those one at a time.  +
- +
- +
----- +
- +
-====== Step 4: The Configuration Pane: Simple ====== +
-The first option is "Simple" and should be the default when you open the wavegen tool. +
- +
-{{ :learn:instrumentation:tutorials:ad2-waveform-generator:wfg23.png?700 |Figure 23. Configuration pane.}} +
- +
-From here you can set the type of signal you want from the "Type" drop-down menu. Figure 24 displays the several options available.  +
-{{ :learn:instrumentation:tutorials:ad2-waveform-generator:wfg24.png |Figure 24. Type drop-down menu.}} +
- +
-{{ :learn:instrumentation:tutorials:ad2-waveform-generator:wfg25.png |Figure 25. Type drop-down menu options.}} +
- +
-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.  +
- +
-{{ :learn:instrumentation:tutorials:ad2-waveform-generator:wfg26.png |Figure 26. Parameters available for editing.}} +
- +
-Most signal types have all parameters available. For a "DC" signal, there is no frequency, amplitude, symmetry, or phase, so you can only change the offset to any value between +/-5V. This can be used to provide additional power supplies, separate from the dedicated power supply pins. For "Noise", "Symmetry" and "Phase" are disabled. For SinePower, "Symmetry" becomes "Power". More on that below.  +
- +
-"Frequency" lets you determine the frequency of your output signal. The units are in Hz, and you can enter any value from 100μHz to 10MHz. You can enter up to 6 decimal places, though some rounding will occur. If you enter a value such as "3001.234567 Hz", WaveForms will trim it to 3.001235 kHz. For a "Noise" signal, frequency determines the DAC update rate.  +
- +
-"Amplitude" tells you how far your signal will travel above and below your offset value. So a 1V amplitude will travel to +1V, and then to -1V, giving a peak-to-peak value of 2V, 1VC in each direction. You can enter any value between +/-5V, but be aware of your offset value in order to prevent clipping.  +
- +
-"Offset" allows you to change where your center value is in relation to 0 V. It imparts a DC bias onto whatever AC signal you are generating. A 1 V offset will move the entire signal up 1 V. -1 V will move it down 1 V. You can enter any value between +/- 5 V, but in order to prevent clipping your signal, you need to make sure that your offset value added with your amplitude value doesn't exceed either +5 V or -5 V. For example, if you give your signal on offset of either +3 V or -3 V, any amplitude value that is greater than 2 V will result in clipping the top or bottom of your signal, respectively. +
- +
-"Symmetry" is an interesting parameter and changes different signals in different ways. I encourage you to play around with this setting with each of the different signals to really get a good idea of what it does. This parameter is turned off for a "Noise" signal. +
- +
-The "Symmetry" parameter becomes a "Power" parameter for a SinePower waveform. If the power value is greater than 0, the sine function outputs sin(x)<sup>)(100 /(100 - power))</sup>. If the power value is less than 0, the function becomes sin(x)<sup>((100 + power) / 100)</sup>+
- +
-"Phase" lets you shift your signal horizontally along the time base, but in units of °. You can enter any value from 0-360°. +
- +
- +
----- +
- +
-====== Step: The Configuration Pane: Basic ====== +
-"Basic" gives you all the same waveform and parameter options as "Simple", but with much more control over each parameter. +
-{{ :learn:instrumentation:tutorials:ad2-waveform-generator:wfg27.png |Figure 27. The configuration pane for Basic.}} +
- +
-On the left you have all of your signal type options. To the right of that, you now have sliders for each parameter.  +
-{{ :learn:instrumentation:tutorials:ad2-waveform-generator:wfg28.png |Figure 28. Sliders for parameters.}} +
- +
-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't enable/disable the parameter, but minimizes the slider and displays the parameter name and value vertically. +
-{{ :learn:instrumentation:tutorials:ad2-waveform-generator:wfg29.png |Figure 29. Frequency button.}} +
- +
-{{ :learn:instrumentation:tutorials:ad2-waveform-generator:wfg30.png |Figure 30. Parameter display name.}} +
- +
----- +
-====== Step 6: The Configuration Pane: Custom ====== +
-"Custom" can be accessed a few different ways. The first is by selecting "Custom" from the drop down menu, at which point you will see +
- +
-{{tag>learn instrumentation tutorial analog-discovery-2 ad2 power-supplies power}}+