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 20:25] – 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. | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | You can adjust the playback frequency, offset,, or amplitude. Don't forget the default playback frequency or you'll never get back to it! Adjusting " | + | |
- | + | ||
- | Clicking on " | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | To remove a file, click on the red subtract button. You can remove one at a time or select " | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | ---- | + | |
- | + | ||
- | ====== Step 8: The Configuration Pane: Sweep ====== | + | |
- | " | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | On the left you have the controls. They are the same as the controls for the " | + | |
- | + | ||
- | "Sweep to" gives you an upper limit for your sweep range, with the lower limit set at the frequency listed in the " | + | |
- | + | ||
- | "Damp to" sets a maximum amplitude that the output can reach. The signal peak will always fall between this value and the " | + | |
- | {{ : | + | |
- | + | ||
- | Clicking on " | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | + | ||
- | ---- | + | |
- | + | ||
- | ====== Step 9: The Configuration Pane: Modulation ====== | + | |
- | " | + | |
- | |here]] for frequency modulation. | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | On the left you have your signal controls. | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | On the right you see the plot of the carrier, AM and FM modulation signals, and the final output signal. | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | By default, the FM and Am signals are the same, so they overlap on the plot and you can only see the trace. The AM signal was decreased to 50Hz to capture it for the image. The " | + | |
- | + | ||
- | The first set of controls is for the carrier wave and they match the controls from the " | + | |
- | + | ||
- | The first parameter is the signal type. You can choose whatever type you want, including any custom signal from " | + | |
- | + | ||
- | Next is the frequency of the signal. Note that by default the carrier is a full order of magnitude higher than either the FM or AM frequencies. Try to maintain this difference between the carrier signal and either modulation signal. If you are using a modulation frequency that varies, like an audio file, set the carrier to at least 10X higher frequency than the highest expected frequency from the file. Setting the carrier to less than 10X higher than the modulation frequency will result in distortion of and loss of data from the modulation signal. | + | |
- | + | ||
- | Below is " | + | |
- | + | ||
- | " | + | |
- | + | ||
- | Once you have it all set, simply click " | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | For a fun application of how to use both frequency and amplitude modulation in a circuit, check out this [[http:// | + | |
- | + | ||
- | + | ||
- | ---- | + | |
- | + | ||
- | ====== Step 10: The Preview Plot ====== | + | |
- | The preview plot is on the right side of the wavegen window and will show the expected waveform output for the current wavegen option chosen. | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | The gear icon at the top right gives you access to the plot window parameters. | + | |
- | {{ : | + | |
- | {{ : | + | |
- | + | ||
- | You can add a label or clear all labels with the respective button. Once you add a label, simply hover your mouse cursor over it and click and drag it where you want it on the plot. Labels will only appear on this plot. | + | |
- | * " | + | |
- | * "Plot width" lets you pick how wide the plot trace is. | + | |
- | * " | + | |
- | * " | + | |
- | * " | + | |
- | * " | + | |
- | + | ||
- | At the bottom of the plot parameters window you will see the " | + | |
- | + | ||
- | {{ : | + | |
- | + | ||
- | The modulation scale adjustment works just like the time or voltage scales, just in units of %. | + | |
- | + | ||
- | + | ||
- | ---- | + | |
- | + | ||
- | ====== Step 11: Now go and Play! ====== | + | |
- | As you can see, the Waveform Generator with the Analog Discovery 2 and WaveForms 2015 software is very versatile. You can generate just about any type if signal you can possibly imagine. | + | |
- | + | ||
- | {{tag>learn instrumentation tutorial analog-discovery-2 analog-discovery ad1 ad2 waveform-generator awg waveforms-2015}} | + |