Arbitrary Waveform Generator (AWG): Difference between revisions

From LabNation Wiki
Jump to navigation Jump to search
m (JamesNewton moved page Arbitraty Waveform Generator (AWG) to Arbitrary Waveform Generator (AWG): Misspelling of Arbitrary as Arbitraty in page name.)
No edit summary
 
(17 intermediate revisions by 4 users not shown)
Line 1: Line 1:
'''!!! NOTE: The Generator menu entry will only show up when a genuine SmartScope has been attached !!!'''
The SmartScope has an Arbitrary waveform generator, capable of generating signals between the [0V, 3.3V] voltage range at a sample rate of 100MS/s.
The SmartScope has an Arbitrary waveform generator, capable of generating signals between the [0V, 3.3V] voltage range at a sample rate of 100MS/s.
= AWG pin location =
= AWG pin location =
The signal generated by the AWG is presented on the 3rd-left pin on the bottom row of the '''AUX connector''', as shown in the following image:<br>
The signal generated by the AWG is presented on the 3rd-left pin on the bottom row of the [[AUX_connector_pinout|'''AUX connector''']], as shown in the following image:<br>
[[File:AWGoutput.png|400px]]<br>
[[File:AWGoutput.png|400px]]<br>
Please keep in mind that you always should bridge 2 wires between 2 separate devices. In this case:
Please keep in mind that you always should bridge 2 wires between 2 separate devices. In this case:
Line 7: Line 9:
* The ground, so both devices have the same reference voltage. (0V means the same on both devices)
* The ground, so both devices have the same reference voltage. (0V means the same on both devices)
In the image above, you can see the AWG pin is surrounded by 2 ground pins, either of which you can use to connect to the other device.
In the image above, you can see the AWG pin is surrounded by 2 ground pins, either of which you can use to connect to the other device.
= Configuring the AWG using pre-defined waves =
= Configuring the AWG using pre-defined waves =
You can define your own waveforms (see below), or you can use one of the built-in signals which have been predefined in the SmartScope app. In order to do so, first open up the main menu by tapping on the LabNation logo at the bottom-left of the screen, and expand the Generator menu.
<br>[[File:Generator.png]]<br><br>
Next, open up the Analog submenu and select the type of predefined waveform you want the AWG to generate:
<br>[[File:Sawtooth.png]]<br><br>
Configure the amplitude, offset and frequency of the wave to be generated.
<br>'''TIP''': Double-tapping the value will bring up the Numpad, which makes it much easier to specify accurate values
<br>'''NOTE''': At this point the AWG output is not yet active.  You have to use the 'Upload function' button and check the Analog checkbox to activate the output (see further).<br>
<br>
The AWG is configurable within these limits:
{| class="wikitable"
|-
! Parameter
! Minimum value
! Maximum value
|-
| Amplitude
| 0V
| 3.3V
|-
| Offset
| 0V
| 3.3V (max amplitude will decrease accordingly!)
|-
| Frequency
| 191Hz
| 781kHz
|}
<br><br>
When you're done, hit the 'Upload' button, which will transfer the data to the SmartScope the AWG output. The Upload button will be highlighted while the data is being sent to the SmartScope.
<br>'''NOTE''': At this point the AWG output is not yet active.  You still have to check the Analog checkbox to activate the output (see further).<br>
<br>[[File:GenUpload.png]]<br><br>
<br><br>
With everything prepared, make sure to check the checkbox next to the Analog entry to enable the AWG output buffer:
<br>[[File:EnableAnalog.png]]<br><br>
= Configuring the AWG using csv files =
= Configuring the AWG using csv files =
'''NOTE''': This only works with a SmartScope connected. Otherwise, the side menu won't contain an AWG item
'''IMPORTANT''': The app expects the CSV file to use a '''semicolon''' (;) as a field separator and a '''comma''' (,) as decimal symbol. Download one of the samples below to make sure your CSV works.
<br>'''NOTE1''': The CSV file '''may''' contain more than the number of samples specified in the parameters. Further samples will simply be ignored
<br>'''NOTE2''': This only works with a SmartScope connected. Otherwise, the side menu won't contain the Generator entry
If you haven't used dropbox with the SmartScope
If you haven't used dropbox with the SmartScope
# Tap sidemenu > AWG > Upload from dropbox
# Tap sidemenu > Generator > Analog > Upload from dropbox
# The app will tell you it doesn't have permission to dropbox and ask for it by sending you off to the dropbox website
# The app will tell you it doesn't have permission to dropbox and ask for it by sending you off to the dropbox website
# Grant access and return to the app
# Grant access and return to the app
Line 21: Line 62:
#In the app, tap sidemenu > AWG > Upload from dropbox
#In the app, tap sidemenu > AWG > Upload from dropbox
#You should now be able to choose the CSV file
#You should now be able to choose the CSV file
== Under the hood ==
The AWG is driven by a 100MHz clock, reading out a memory containing ''up to'' 2048 samples.
== Define arbitraty waveform in Excel (.csv file upload) ==
{| class="wikitable"
|-
! Parameter
! Range
! Description
|-
| DataIsBytes
| 0 or 1
| Indicates if the data should be interpreted as bytes (for the 4 digital outputs). If '0', it will be interpreted as voltages (for the analog output).
|-
| Samples
| 1-2048
| The number of samples used. The AWG loops on these samples. (< 0.0.8.4 had a minimum of 128 samples)
|-
| SampleStretch
| 0-255
| The number of cycles to repeat each sample
|-
| BeginData
|
| Field to indicate that from here on the sample voltage levels follow
|}
The [[Media:awg_worksheet.xlsx|AWG excel worksheet]] contains examples of how to compute these parameters.
=== Sample CSV ===
<pre>
Value;Field;Description
8;Samples;The number of samples to use (later samples are ignored)
244;SampleStretch;The number of times to repeat a sample
0,1;BeginData;Data begins here
0,2;;
0,3;;
0,4;;
0,3;;
0,2;;
0,1;;
0;;
</pre>
In case you want to upload data as bytes (i.e. for digital output)
<pre>
Value;Field;Description
1;DataIsBytes;Set to 1 to interpret the data as bytes, otherwise interpreted as voltages
8;Samples;The number of samples to use (later samples are ignored)
244;SampleStretch;The number of times to repeat a sample
0;BeginData;Data begins here
1;;
2;;
4;;
8;;
4;;
2;;
1;;
</pre>
=== Detailed discussion ===
For more information, you can read [https://www.lab-nation.com/forum/software/topics/how-to-reduce-the-duty-cycle-below-12 this forum thread] which discusses AWG operation in more detail through a practical use-case.

Latest revision as of 12:06, 21 August 2017

!!! NOTE: The Generator menu entry will only show up when a genuine SmartScope has been attached !!!

The SmartScope has an Arbitrary waveform generator, capable of generating signals between the [0V, 3.3V] voltage range at a sample rate of 100MS/s.

AWG pin location

The signal generated by the AWG is presented on the 3rd-left pin on the bottom row of the AUX connector, as shown in the following image:
AWGoutput.png
Please keep in mind that you always should bridge 2 wires between 2 separate devices. In this case:

  • The AWG output signal
  • The ground, so both devices have the same reference voltage. (0V means the same on both devices)

In the image above, you can see the AWG pin is surrounded by 2 ground pins, either of which you can use to connect to the other device.


Configuring the AWG using pre-defined waves

You can define your own waveforms (see below), or you can use one of the built-in signals which have been predefined in the SmartScope app. In order to do so, first open up the main menu by tapping on the LabNation logo at the bottom-left of the screen, and expand the Generator menu.
Generator.png

Next, open up the Analog submenu and select the type of predefined waveform you want the AWG to generate:
Sawtooth.png

Configure the amplitude, offset and frequency of the wave to be generated.
TIP: Double-tapping the value will bring up the Numpad, which makes it much easier to specify accurate values
NOTE: At this point the AWG output is not yet active. You have to use the 'Upload function' button and check the Analog checkbox to activate the output (see further).

The AWG is configurable within these limits:

Parameter Minimum value Maximum value
Amplitude 0V 3.3V
Offset 0V 3.3V (max amplitude will decrease accordingly!)
Frequency 191Hz 781kHz



When you're done, hit the 'Upload' button, which will transfer the data to the SmartScope the AWG output. The Upload button will be highlighted while the data is being sent to the SmartScope.
NOTE: At this point the AWG output is not yet active. You still have to check the Analog checkbox to activate the output (see further).

GenUpload.png



With everything prepared, make sure to check the checkbox next to the Analog entry to enable the AWG output buffer:
EnableAnalog.png

Configuring the AWG using csv files

IMPORTANT: The app expects the CSV file to use a semicolon (;) as a field separator and a comma (,) as decimal symbol. Download one of the samples below to make sure your CSV works.
NOTE1: The CSV file may contain more than the number of samples specified in the parameters. Further samples will simply be ignored
NOTE2: This only works with a SmartScope connected. Otherwise, the side menu won't contain the Generator entry If you haven't used dropbox with the SmartScope

  1. Tap sidemenu > Generator > Analog > Upload from dropbox
  2. The app will tell you it doesn't have permission to dropbox and ask for it by sending you off to the dropbox website
  3. Grant access and return to the app
  4. The app now creates the AWG folder and will inform you that this new folder is empty.


  1. Generate a CSV file using the AWG excel worksheet. A sample CSV can be found for a sine and block wave.
  2. Drop your CSV file in the AWG folder (<dropbox>/Apps/LabNation SmartScope/AWG) using a file manager
  3. In the app, tap sidemenu > AWG > Upload from dropbox
  4. You should now be able to choose the CSV file

Under the hood

The AWG is driven by a 100MHz clock, reading out a memory containing up to 2048 samples.

Define arbitraty waveform in Excel (.csv file upload)

Parameter Range Description
DataIsBytes 0 or 1 Indicates if the data should be interpreted as bytes (for the 4 digital outputs). If '0', it will be interpreted as voltages (for the analog output).
Samples 1-2048 The number of samples used. The AWG loops on these samples. (< 0.0.8.4 had a minimum of 128 samples)
SampleStretch 0-255 The number of cycles to repeat each sample
BeginData Field to indicate that from here on the sample voltage levels follow

The AWG excel worksheet contains examples of how to compute these parameters.

Sample CSV

Value;Field;Description
8;Samples;The number of samples to use (later samples are ignored)
244;SampleStretch;The number of times to repeat a sample
0,1;BeginData;Data begins here
0,2;;
0,3;;
0,4;;
0,3;;
0,2;;
0,1;;
0;;

In case you want to upload data as bytes (i.e. for digital output)

Value;Field;Description
1;DataIsBytes;Set to 1 to interpret the data as bytes, otherwise interpreted as voltages
8;Samples;The number of samples to use (later samples are ignored)
244;SampleStretch;The number of times to repeat a sample
0;BeginData;Data begins here
1;;
2;;
4;;
8;;
4;;
2;;
1;;

Detailed discussion

For more information, you can read this forum thread which discusses AWG operation in more detail through a practical use-case.