Integrator Example

This topic is designed for the new user. If you know how to use ADS for Analog/RF Systems design, read quickly through this chapter noting the differences to ADS Ptolemy, such as the use of sinks, Data Flow controller, and Interactive Controls and Displays components.

To learn how to use ADS Ptolemy, let's load a simple integrator example. We will add a source, an output display item, and a controller, then simulate and view the results.

Copying and Opening Example Project

First, we will copy an example project.

Note
On UNIX platforms, you must copy an example project to a directory for which you have write permission.

On Windows platforms, while you can work in the Example directories, it's better to copy the examples to another directory.

Copy the Project

  1. From the Main window, choose File > Copy Project. A dialog box appears.
  2. In the From Project field, click the Example Directory button, and then the Browse button. The Copy From File Browse dialog box appears with the examples directories listed.
  3. Scroll down the Directories list and double-click Tutorial (directory).
  4. Select the project you want to copy:
    In Windows: Select integrator_prj from the list of projects, and click OK.
    In UNIX: Select integrator_prj from the list of files in the Files list, and click OK.
  5. In the To Project field, click the Startup Directory or Working Directory button (depending on where you want to copy the project) or choose the Browse button to select another directory.
  6. Choose Copy Project Hierarchy to ensure that all appropriate directories and files will be copied. Choose Open Project After Copy if you want to work with the project now.
  7. Click OK to copy the project and close the dialog box.

Open the Project

  1. If you did not choose to automatically open the project after the copy, from the Main window, choose File > Open Project. When the Open Project dialog box appears, select <the directory you copied the example to> in the Directories list:
    In Windows: Then select integrator_prj in the list of projects, and click OK. The project will appear in the File Browser field of the Main window. Also, an empty schematic window opens.
    In UNIX: Then double-click integrator_prj in the Files list, and click OK. The project will appear in the File Browser field of the Main window. Also, an empty schematic window opens.
  2. Under the integrator_prj project directory, double-click the networks subdirectory to list the various schematics within this project. These will all have the extension .dsn.
  3. Double-click integrator1.dsn. In the Design Information field at the right, one item appears.
  4. Double-click integrator1 (Schematic). A schematic window opens with the design.

    Integrator Design

Selecting and Placing Components

We will add a sine wave source, an output display item, and a controller to the integrator schematic. There are two ways to choose components:

Add a Source

  1. We will use the Palette List method first. Since the component we want is in the default library, called Common Components, simply click the SinGen icon (near bottom of list). Crosshairs and a ghost image of the component appear as you move the pointer over the design area.
  2. Move the crosshairs to the upper left part of the schematic (to the left of the Fork2 component), then click once. A symbol representing the source component is placed in the design area. Beneath the symbol is a block of information with the component name and editable parameters. We will accept the default values.
  3. When all components are placed, click the End Command arrow on the toolbar, or press Escape. The crosshairs disappear.
    Note
    If you continue to click without deselecting, you will place a new component with each click.

Add an Output Display

We will continue by adding the output display item. But this time we will use the Library method of selecting components.

  1. Choose Insert > Component > Component Library. A dialog box appears that displays components in each component library. From the Libraries list box, select Interactive Controls and Displays (resize the dialog box to show long names).
  2. From the right side, select TkPlot. Crosshairs and a ghost image of the component appear as you move the pointer over the design area. (Another TkPlot item is already in the schematic to display the input signal.)
  3. Move the crosshairs to the upper right part of the schematic (to the right of the Fork2 component), then click once. A symbol representing the TkPlot display component is placed in the design area.
  4. Click the End Command arrow on the toolbar, or press Escape. The crosshairs disappear.
  5. Close the Component Library dialog box.

Modify Component Parameters

We will modify two parameters for this item. There are several ways to edit parameters:

We will use the dialog box method.

  1. Double-click the TkPlot item. A dialog box appears.
  2. Select the xRange parameter (left side). On the right side, backspace over the 100 and type 400.
  3. Select the yRange parameter (left side). On the right side, backspace over the -1.5 1.5 and type 0 32.
  4. Similarly, select the Persistence parameter and change the value from 100 to 300.
  5. Type Output in the Label field (top of list) so we can keep track of the input and output plots.
  6. Choose OK.

Connect Components with Wires

  1. Choose Insert > Wire or click the Insert Wire button on the toolbar (bottom row). Connect a wire from the port on the SineGen source to the input port on the Fork2 component. When a port is successfully connected, its color changes from red to blue.
  2. Connect a wire from the top port of the Fork2 component to the port on the TkPlot display component.
    Note
    Wires must connect ports in pairs, and you must place at least two components before you can add a wire. You cannot add a wire to a component port first, and then add a second component to that wire.

Add a Controller

Controllers are used to specify the type of simulator you want to use and simulation parameters.

  1. From the Palette List under Common Components, select the Data Flow Controller icon (right, near top). Crosshairs and a ghost image of the component appear as you move the pointer over the design window.
  2. Move the crosshairs to the lower left part of the schematic, then click once.
  3. A schematic representation of the controller component is placed in the design window. Controllers are not connected or wired to other components. We will accept the default values.
  4. Click the deselect arrow, or press Escape. The crosshairs disappear.

There are several types of controllers, the one we have chosen is called the Data Flow controller, which is used to run mixed numeric and timed signal processing simulations.

At this point, your example should look similar to the following figure.


Integrator Design with Source, Display, and Controller Items

If you have had difficulty building the design, you can select the completed schematic from your directory you copied the example project to earlier. Select integrator1_complete.dsn.

Starting Simulation

Now that we have a completed schematic, we're ready to start a simulation. ADS provides flexibility in this task. In our example, we have placed an interactive display item called TkPlot. This item quickly displays the results of your simulation. Later we will substitute a Sink item in the schematic that will save the simulation results to a file. We will then use the Data Display to review our results.

Simulate and Display Data Directly

  1. Choose Simulate > Simulate. The simulation begins. A status window appears that provides information on your simulation or reports errors.
  2. Two TkPlot windows appear showing you an animated display of both the sine wave input and the simulation results of the output.

    Integrator Output Simulation Results

In this simple example, the sine wave source has been changed to a cosine wave (offset by 90 degrees) by the integrator.

The simulation must be stopped manually. Choose Quit from the Ptolemy dialog box when you are done reviewing the animated plots.

Simulate and Save Data

Now we will use the alternate approach where we substitute a Sink component in the schematic and save the data.

  1. Click the output TkPlot item in your schematic to select it.
  2. Press the Delete key or choose the Delete (trash can) icon from the toolbar.
  3. From the Common Components Palette List, select the Numeric icon (NumericSink). Crosshairs appear.
  4. Place the NumericSink where the TkPlot item was originally.
  5. Double-click the NumericSink to edit the sink parameters.
  6. Accept the Start default of DefaultNumericStart.
  7. Select Stop and change the value to 200. Here we show that a sink can override the Data Flow controller's Stop value. Typically, a sink can be left at its default and you can control simulation from the Data Flow controller.
  8. Choose OK.
  9. Choose Simulate > Simulation Setup. The Simulation Setup dialog box appears where you can explicitly name a dataset.
  10. In the Dataset field, type myresults. This becomes the filename of your simulation results. Accept the other defaults.
  11. Choose the Simulate button. The simulation begins. A status window appears that gives information on your simulation or reports errors.

This time, your data is saved to disk where it can be used to display results in a variety of formats, or be used in post-processing procedures. In addition, the input TkPlot displays an animated plot for the input. Click Quit to dismiss this display.

  1. Choose Window > New Data Display. The Data Display window opens.
  2. From the drop-down list, select myresults. This list is called the Default Dataset list.
  3. Click Rectangular Plot in the Plot Types palette list. A ghost rectangular frame appears.
  4. Click once to place the frame in the Data Display window. The Plot Traces & Attributes dialog box appears:
  5. Choose OK. Your data is plotted in the Data Display window.

To resize a plot, use the various zoom buttons in the toolbar, or drag a corner outward. A large variety of graphing, annotation, and post-processing tasks can be done from this window. Giving the data a unique name allows it to be archived as a reference in a suite of simulations.

We have seen two methods for displaying data, both of which start with the placement of an output item in your schematic: TkPlot (one of several interactive display items), which does not store data to disk; Data Display window, which uses stored data and displays it in a variety of formats.

 

Privacy Statement  | Terms of Use  | Legal | Contact Us  | © Agilent 2000-2008 

Contents
Additional Resources