Chapter 6

Stimulus Editor

Abstract

The Stimulus Editor is a graphical tool to help users define transient analog and digital sources. The sourcestm library contains three source parts each of which provides the interface with the defined stimulus in the Stimulus Editor. When users first place one of the sources from the sourcestm library, the implementation property is displayed in the schematic. This property refers to the name of the stimulus which is defined in the Stimulus Editor. Users can either enter a name of the stimulus on the schematic to start with, or get prompted for the stimulus name in the Stimulus Editor when started. When the Stimulus Editor starts, the New Stimulus window appears. The New Stimulus window allows users to define analog and digital signals, and prompts users to enter the stimulus name if they have not already defined the name in Capture. Stimulus editor transient sources include exponential (Exp) source, pulse source, VPWL, SIN (Sinusoidal), and SSFM (Single-frequency FM). Users can also use the waveforms generated by a transient analysis in Probe as a time-voltage source. An alternative method to create a time-voltage text file is to select the trace name in Probe, select copy, and paste the data into a text file. From version 16.3 onwards, the stimulus file is associated with the current active simulation profile and can be accessed via the simulation profile under the Configuration Files tab. In previous versions, there were separate tabs for Stimulus, Library, and Include options.

Keywords

Stimulus; Voltage; Transient; Pulse; Simulation; Library; Piecewise linear

The Stimulus Editor is a graphical tool to help you define transient analog and digital sources. The sourcestm library contains three source parts, shown in Fig. 6.1, each of which provides the interface with the defined stimulus in the Stimulus Editor.

Fig. 6.1
Fig. 6.1 Stimulus Editor, transient analog and digital sources.

When you first place one of the sources from the sourcestm library, the implementation property is displayed in the schematic. This property refers to the name of the stimulus which is defined in the Stimulus Editor. Either you can enter a name of the stimulus on the schematic to start with, or you will be prompted for the stimulus name in the Stimulus Editor when started.

To start the Stimulus Editor, highlight a sourcestm source, rmb > Edit PSpice Stimulus.

When the Stimulus Editor starts, the New Stimulus window will appear as shown in Fig. 6.2. Note that the stimulus file name in 16.3 has taken on the name of the PSpice simulation profile, in this case, transient.stl. In previous versions, the stimulus name takes on the name of the project name.

Fig. 6.2
Fig. 6.2 Stimulus Editor started.

The New Stimulus window allows you to define analog and digital signals and prompts you to enter the stimulus name if you have not already defined the name in Capture.

6.1 Stimulus Editor Transient Sources

6.1.1 Exponential (Exp) Source

Figs. 6.3 and 6.4 show the two possible exponential waveforms which can be defined for a voltage or a current using VSTIM or ISTIM sources, respectively.

Both exponential waveforms start after a time delay (td1) and then exponentially rise or fall, using a time constant (tc1) between two voltages V1 and V2 up to a time td2. The waveform then decays or rises after td2, using a time constant (tc2).

For example, in Fig. 6.3, the voltage is V1 (0 V) up to td1 (10 μs); then the voltage increases exponentially with a time constant given by tc1 (10 μs) towards V2 (10 V). The time for the exponential rise is defined by td2-td1 as 30 μs (40 − 10 μs), after which the voltage decreases exponentially with a time constant given by tc2 (5 μs) back towards V1.

Fig. 6.3
Fig. 6.3 Exponentially rising voltage waveform.

Fig. 6.5 shows the attribute settings for the waveform in Fig. 6.3, where:

Fig. 6.4
Fig. 6.4 Exponentially decreasing voltage waveform.
Fig. 6.5
Fig. 6.5 Exponential attributes.

V1—initial starting value at time 0 s

V2—value that voltage rises or falls to

td1—start time (delay) of exponential rise (or fall)

tc1—time constant of rising (or falling) waveform

td2—start time (delay) of exponential fall (or rise)

tc2—time constant of falling (or rising) waveform

Fig. 6.3 was defined using V1 = 0 V, V2 = 10 V, td1 = 10 μs, tc1 = 5 μs, td2 = 40 μs and tc2 = 5 μs.

Fig. 6.4 was defined using V1 = 10 V, V2 = 0 V, td1 = 10 μs, tc1 = 5 μs, td2 = 40 μs and tc2 = 5 μs.

Now the exponential voltage is defined by:

vt=V2V11etimetimeconstant

si1_e

So between 0 s and td1 the voltage is a constant:

vt=V1

si2_e

Between td1 and td2:

vt=V1+V2V11etimetd1tc1

si3_e

and for the time between td2 and the stop time, the voltage is given by:

vt=V1+V2V11etimetd1tc11etimetd2tc2

si4_e

6.1.2 Pulse Source

Fig. 6.6 shows the definition for a voltage pulse waveform, where:

Fig. 6.6
Fig. 6.6 Pulse waveform specification.

V1—low voltage

V2—high voltage

TD—the time delay before the pulse starts

TR—rise time specified in seconds, defined as the time difference between V1 and V2

TF—fall time specified in seconds, defined as the time difference between V1 and V2

PW—pulse width of the pulse

PER—period of the pulse, i.e. the pulse frequency

Similarly, current pulses can be defined using the ISTIM part as shown in Fig. 6.7.

Fig. 6.7
Fig. 6.7 Using ISTIM to define a current pulse waveform.

When you first place a VSTIM, ISTIM or DigSTIM part, the implementation property name and value are shown. You only need to display the name of the stimulus, so double click on the Implementation =, which will open up the Display Properties dialog box, and select Value Only (Fig. 6.8).

Fig. 6.8
Fig. 6.8 Making the Implementation = invisible.

Fig. 6.9 shows the ISTIM part with the defined current stimulus, Ipulse displayed. As before, to start the Stimulus Editor, rmb and select Stimulus Editor and then select PULSE for New Stimulus. Fig. 6.10 shows the pulse attributes defined for a current pulse using the ISTIM part. The resulting current waveform is shown in Fig. 6.11.

Fig. 6.9
Fig. 6.9 ISTIM part with defined current stimulus, Ipulse displayed.
Fig. 6.10
Fig. 6.10 Current pulse attributes.
Fig. 6.11
Fig. 6.11 Current pulse waveform using the attributes in Fig. 6.10.

6.1.3 VPWL

Piecewise linear (PWL) is where you actually draw the voltage or current waveform. You define the time and voltage (or current) axis and then use a cursor to draw the waveform. An example is given in the exercise at the end of the chapter.

6.1.4 SIN (Sinusoidal)

Fig. 6.12 shows the attributes for a sinewave. The complete definition includes attributes for a damped sinewave, with a phase angle and an offset value. Offset value is the initial voltage or current at time 0 s, Amplitude is the maximum voltage or current, Frequency (Hz) is the number of cycles per second, Time delay (s) is the start delay, Damping factor (1/s) is the exponential decay, and Phase angle (degrees) is the phase angle (Fig. 6.13).

Fig. 6.12
Fig. 6.12 Sinewave attributes.
Fig. 6.13
Fig. 6.13 Frequency modulated sinewave.

6.1.5 SSFM (Single-Frequency FM)

This source generates frequency-modulated sinewaves as shown in Fig. 6.14, which shows the modulation of a carrier frequency. The sinewave is given by:

Fig. 6.14
Fig. 6.14 Single-frequency FM attributes.

vt=Voff+Vampl×sin[(2πfct+mod×sin2πfmtime)]

si5_e

where Voff is the offset voltage, Vampl is the maximum value of voltage, mod is the modulation index, fc is the carrier frequency, and fm is the modulation frequency.

6.2 User-Generated Time-Voltage Waveforms

You can also use the waveforms generated by a transient analysis in Probe as a time-voltage source. In Probe, select File > Export, which gives the options shown in Fig. 6.15.

Fig. 6.15
Fig. 6.15 Exporting time-voltage data.

An alternative method to create a time-voltage text file is to select the trace name in Probe, select copy and paste the data into a text file.

6.3 Simulation Profiles

Prior to version 16.3, when you launch the Stimulus Editor, a stimulus file with the name of the project is created; for example a project named stimulus will create a stimulus.stl. All the stimuli you create are saved in the stimulus.stl file and so in order to select a different stimulus, all you need to do in the schematic is to change the name shown on the VSTIM, ISTIM or DigSTIM source.

From version 16.3 onwards, the stimulus file is associated with the current active simulation profile and can be accessed via the simulation profile under the Configuration Files tab. In previous versions, there were separate tabs for Stimulus, Library and Include options.

Under configured files you will see the stimulus.stl file (see Fig. 6.23). If you do not see the stimulus file then you can browse for the Filename. You can then add the stimulus file to the profile (Add to Profile). However, there are other options:

 Add as Global: all designs will have access to the stimulus file.

 Add to Design: only the current design will have access.

Adding the stimulus file as Global is useful if you have created a standard set of stimuli to test all your circuits. You can add several stimulus files and arrange the order by clicking on the up and down arrows. The red cross deletes the selected file.

6.4 Exercise

Note

From release 16.3 onwards, there are some differences compared to previous versions. When you first create a new project in any release, a PSpice bias simulation profile is created by default. This can be seen in the Project Manager under PSpice Resource > Simulation Profiles. In order to keep compatibility between releases, delete the bias simulation profile in the Project Manager.

1. Create a project called stimulus.

2. In the Project Manager, expand PSpice Resources > Simulation Profiles as shown in Fig. 6.16 and delete the SCHEMATIC1-Bias profile.

Fig. 6.16
Fig. 6.16 Bias simulation profile in Project Manager.

3. Draw the circuit diagram in Fig. 6.17. The VSTIM source (V1) is from the Sourcestm library.

Fig. 6.17
Fig. 6.17 VSTIM 100 Hz sinewave generation.

4. Highlight VSTIM and rmb > Edit PSpice Stimulus. In the New Stimulus window, name the source as sin100Hz and select a SIN source (Fig. 6.18).

Fig. 6.18
Fig. 6.18 New sinewave source.

5. Create a 100 Hz sinewave with no offset and amplitude of 1 V. Leave all the other values at their default value of 0 (Fig. 6.19). Click on OK and save the stimulus source and Update Schematic when prompted and exit the Stimulus Editor.

Fig. 6.19
Fig. 6.19 Creation of a 100 Hz sinewave source.

6. In Capture, the name of the stimulus is now shown on V1. Double click on Implementation = sin100Hz and select Value Only (Fig. 6.20).
Only the name of the stimulus will be displayed, as seen in Fig. 6.21.

Fig. 6.20
Fig. 6.20 Making the implementation name invisible.
Fig. 6.21
Fig. 6.21 Displaying only the stimulus name.

7. Create a PSpice simulation profile (PSpice > New Simulation Profile) and call it transient. In the Analysis type: pull-down menu, select Time Domain (Transient) and set the Run to time: to 20 ms (Fig. 6.22). Click on Apply but do not exit the profile.

Fig. 6.22
Fig. 6.22 Simulation settings.

8. Select Configuration Files > Category > Stimulus and you should see the stimulus.stl file listed (Fig. 6.23).
Highlight the stimulus.stl file and click on Edit. The Stimulus Editor will launch showing the sin100Hz stimulus. This is a quick way to see what stimuli are available in stimulus files. Close the simulation profile.

Fig. 6.23
Fig. 6.23 Stimulus files listed in Simulation profile.

9. Place a voltage marker on node out (Fig. 6.24), run the simulation (PSpice > Run) and confirm that a sinewave voltage appears across the resistor.

Fig. 6.24
Fig. 6.24 Placing a voltage marker.

Note

If you see a flat voltage line in the Probe window, then you may have not deleted the default bias.stl file. See note at the beginning of the exercise. The Stimulus Editor was then invoked with the default bias.stl as the active simulation profile. If you do not see the stimulus file in the simulation profile (Fig. 6.23) then Browse for the file, which can be found in the bias folder, and then select Add to Design.

10. In the Project Manager, expand PSpice > Resources > Stimulus Files and you should see the transient.stl stimulus file as shown in Fig. 6.25. You can double click on the file here to open the Stimulus Editor to check the stimulus.

Fig. 6.25
Fig. 6.25 Location of stimulus file, transient.stl.

11. Highlight VSTIM in Capture and launch the Stimulus Editor. In the Stimulus Editor the previous SIN Attributes will be displayed. Click on Cancel.

12. Create a pulse source named Vpulse (Stimulus > New) with an initial value of 0 V, an amplitude of 1 V, no initial delay, a rise time of 500 μs, a fall time of 1 ms, a pulse width of 2 ms and a period of 10 ms (Fig. 6.26). Click on OK and save the stimulus but do not Update Schematic when prompted. Exit the Stimulus Editor.

Fig. 6.26
Fig. 6.26 Vpulse attributes.

Note

When entering attribute values, press the TAB button on the keyboard to move down to the next attribute box.

Note

The stimulus is already named as sin100Hz in Capture and cannot be updated from the Stimulus Editor. In previous software releases, if you say yes to Update Schematic, the cursor will change to an hourglass and just sit there. You will need to switch to Capture, where you will see the dialog box in Fig. 6.27. Just click on OK.

Fig. 6.27
Fig. 6.27 Stimulus name change warning.

13. In Capture, double click on the stimulus name, sin100Hz, and change it to Vpulse as shown in Fig. 6.28.

Fig. 6.28
Fig. 6.28 Using the Vpulse source.

14. Run the simulation. PSpice > Run or click on the blue play buttonImage 5.

15. Confirm that a voltage pulse waveform appears across the resistor.

16. In Capture, highlight VSTIM and rmb > EditStimulus Editor. In the Stimulus Editor the previous PULSE Attributes will be displayed. Click on Cancel.

17. Create a new stimulus, Stimulus > New. Name the stimulus Vin and select PWL (piecewise-linear).

Note

You may be asked if you want to change the axis settings.

18. From the top toolbar, select Plot > Axis Setting. Set the waveform drawing resolution to that shown in Fig. 6.29.

Fig. 6.29
Fig. 6.29 Axis settings.

19. A pen cursor will appear. Draw a corresponding piecewise linear graph approximating the PWL voltage shown in Fig. 6.30. The first point at (0,0) has already been selected. The accuracy does not matter as long as there are three peaks defined. This stimulus will be used in Chapter 7 on transient analysis. Press escape to exit draw mode.

Fig. 6.30
Fig. 6.30 Piecewise linear waveform.

20. If you want to delete or move a point, press escape out of draw mode and place the cursor on a point, which will turn red, and then delete or move the point. To return to draw mode, select Edit > Add or select the icon Image 8 or Image 8.

Note

Prior to release 16.3, you can only place points forward in time; you cannot go backwards. If you want to delete or move a point, press escape out of draw mode and place the cursor on a point, which will turn red, and then delete or move the point.

21. Save the stimulus file and exit the Stimulus Editor but do not Update Schematic.

22. Change the name of the stimulus from Vpulse to Vin and simulate, and confirm that the piecewise voltage waveform appears across the resistor.

Note

The Vin source will be used in Chapter 7.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
18.117.159.229