The SPICE deck listed on my web page should actually work as it is (previously it was lacking a probe command, but has now been added). However, there are some other things you will have to modify - but it is probably a good idea to verify it works first before spending a lot of time modifying it.
If the simulation fails with the error message "No Devices Found" This can occur if you have edited the file with Notepad or some other editor. You must make sure you edit the file directly from within PSPICE, then save the file as a .cir file. Do *NOT* edit with Notepad or other editor.
The design is built for power supply of 15V and center frequency of about 1 MHz. So, you will have to change the power supply voltage, and the components which determine the bias levels and the frequency of oscillation. However, with the above correction to the SPICE deck you should be able to run it and get the result. Also, to see a smoother curve, you could use more points in the .AC command - it is now set at 41 points, there would be nothing wrong with 401 points or even way more to give you a smooth frequency response curve. In the transient response, it often plots fewer points than you ask for - you can force it to use all points by adding two more numbers behind your transient command as follows:
* Transient sweep *.TRAN[no-print value] * [step ceiling value]][SKIPBP] * Note - Need step ceiling value otherwise it may use the default * step time which may be too large .TRAN 10n 100u 0 10n
So, what do you need to do? Copy the spice file from the web page into your own file (you can use "file-->save page, then select directory, change the name to something appropriate with a .cir extension rather than .txt for example, filename.cir.
To run, open PSPICE-AD (it might be part of EVAL 8, but this can change from year to year) then file --> open, find the dirctory, change the type to .cir, then load the file. You should be able to run the file directly by clicking on the little blue "run" arrow next to the file name. The file should run almost instantaneously, and Probe should be opened automatically, showing an empty plot with frequency along the bottom. To see the results click on trace --> add trace --> v(3) --> OK and you will have a plot of output voltage as a function of frequency, showing a peak voltage of about 96V at about 980 kHz. Note you can pick voltages, currents from the list, and you can add dB from the menu. Using dB, 96V becomes about 39.6 dB. If you don't like your choice, from the plot window you can double click on the label at the bottom, e.g., V(3) and the Modify Trace window pops up and you can edit, or select another trace etc. Instead of selecting from the menu, you can type directly in the "Trace Expression" part of add or modify trace window. For example, vdb(3),vp(3) will result in node 3 voltage in dB or the phase of the voltage on node 3 in degrees.
if you are typing directly try:
dB vdb() phase vp() magnitude vm() real vr() imaginary vi()
You can also have PSPICE do more complex calculations. For example, to find input impedance, you need vin/iin and you can select this from the menu, or type in directly. For example vin/iin is V(6)/I(RIN) which you could ask for directly and ask for the real part, imaginary part, etc using equation functions
Some functions For equations:
magnitude M() phase, P() real R() imaginary IMG()
Thus to get real and imaginary of the input impedance you can specify
R(V(6)/I(RIN)),IMG(V(6)/I(RIN)).
Alternatively you can select "Examine Output file" which will open filename.out. You will need to do this to find errors, to see detailed operating point information (voltages, currents) or to do the noise analysis.
DC Bias: Calculate resistors in Emitter, estimate input base current, choose bias current through R1 and R2 to be 10 times, knowing DC voltage on base and current through these resistors, calculate R1 and R2.
Bypass and coupling capacitors: knowing resistance you are bypassing or driving, choose C big enough so impedance is R/10 or preferably R/20. Bigger C is better, but in real life in the lab, a bigger C usually does not operate to as high frequency. Note that CE is bypassing re which is small, so CE will have to be quite large. CIN sees mainly R1 parallel with R2 parallel with rpi.
AC Components: Choose L in the required range, Find C to give the right frequency, find Rload to give the right bandwidth.
Simulate first to check DC levels, bias points. The easiest way is to check output file which lists DC voltages, currents through transistors. If DC is correct (and only if DC is correct) plot gain, find input impedance and noise figure. Note noise figure can be found from output listing (see comments on SPICE deck for more info.).
Then, match circuit, verify that matching is correct, then find gain, bandwidth, noise figure and compare to unmatched case.
Frequency Multiplier requires that you have harmonics, normally referred to as harmonic distortion. Normally, you would try to avoid distortion, but if you are designing the circuit to be frequency multiplier, then these harmonics are wanted. With a large input signal, the amplifier has enough distortion that it will work as it is (that is with no changes, except with a bigger input voltage) as a frequency multiplier. However, to enhance the nonlinearity, you could remove R2 and ground the emitter of the transistor. This will bias the base at 0 V, and only if a big input signal is applied (bigger than 0.7V) will current flow.
To see frequency multiplication, you need to run time domain simulations. This means you have to comment the .AC command and un-comment the .TRAN command. As well, you have to select the correct time-domain source (comment out the AC source, un-comment the sin source). And finally, you will need to change the input frequency such that it is a sub-multiple of the resonant frequency.
Assuming the tuned circuit is resonant at 6 MHz, if a large input is applied at 3 MHz, then its second harmonic will happen at 6 MHz, and this frequency will be amplified by the tuned amplifier, while other harmonics and the fundamental at 3 MHz will be attenuated. If the Q is low, the fundamental may still be quite large though. To see this better, it is possible to increase the Q by increasing the load resistor, for example by 10 times. Similarly, if the input is at 2 MHz, the third harmonic will occur at 6 MHz, so it will be amplified. For FFT information, see below.
Example Default command is: .TRAN 10n 100u 0 10n. This shows a start time of 0. You could examine the time domain output to see where to start, but with a narrow band amplifier, with a center at 1 MHz, it might take 20 usec, or even more to settle. As a futher check, you can run an FFT of your input sine wave. A pure sine wave should have a fundamental frequency, no harmonics, and a noise floor well below the fundamental. To start the transient and hence the FFT at 20us, would change the .TRAN commant to .TRAN 10n 100u 20u 10n. A further observation is that a 1 MHz signal has a period of 1usec, thus with a step size of 10nsec, there are 100 points per period. Often more points work better, so could go to 1000 points per period to give a smoother output and a better looking FFT. To do this, the .TRAN command is changed .TRAN 1n 100u 20u 1n. Of course having step size of 1/10 results in a simulation that takes 10 times longer to run, but it should still just be a few seconds.
Possibly more to come later. Comments, questions welcomed.
email to: cp@doe.carleton.ca