4rd Laboratory Session ~1 meeting
Oscillator is an electronic circuit that produces an oscillating electronic signal. Oscillators are widely used in radio and television signal broadcasting, regulating computer clocks and sound producing. In this session we will simulate a behaviour of an oscillator, based on tunnel diode (additional source). This is a special type of semiconductor, capable of very fast switching. We will learn to setup SPICE in order to fully simulate such an oscillator.

* Tunneling diode oscillator
* 2026-11-10
.include 'tdmodel.cir'
* Diode characteristics measuring setup
*---------(1)-----------*
vd (10 0) dc=0
xd (10 0) td
*-----------------------*
*---------(2)-----------*
* Oscillator circuit *
* BIAS
v1 (1 0) dc=5
r1 (1 2) r=280
r2 (2 0) r=40
* Tunneling diode
x1 (2 3) td
* (R)LC tank
r3 (3 0) r=10k
c1 (3 0) c=10n
l1 (3 0) l=1u
ipulse (3 0) dc=0 pulse=(0 100u 1u 1u 1u 1u)
*-----------------------*
.control
*---------(1)-----------*
* Diode characterisation:
dc vd 0 0.6 0.01
plot -i(vd) title "Diode Characteristics"
* Calculate the derivative of the I(V) characteristics
* result will be a "conductance" for every vd voltage
let gd = deriv(-i(vd))
*plot gd title "Differential conductivity" yl -40m 20m
* Middle of the neg. resistance region is 0.367+0.05)/2=> 0.21 V
*-----------------------*
*---------(2)-----------*
* Let us observe the operating point of tunneling diode:
op
print v(2,3)
* tunn. diode is not biased to the middle of neg. res. region.
* Let us find out, how to set the voltage divider R1/R2 to get v(2,3) to have 0.21 V
* We will sweep R2 until we find the right resistance of R2
* sweep R2 from 10 to 1k with step of 1 ohm
dc @r2[r] 1 15 1
*plot v(2,3)
let c=0
cursor c right v(2,3) 0.21
* When cursor c stops at v(2,3)==0.21 I will check at what resistance (sweep) was that
print sweep[%c]
* it reads 13.1 ohms
* Let us set R2 to 13.1 ohms
let @r2[r]=13.1
op
echo "This is our new operating point:"
print v(2,3)
* Let us analyse the oscillator
* We estimate the f0 = 1.6e6 Hz that is t0 = 0.628 us
tran 1n 30u
plot v(3)
* Frequency is?
let c1=0
* set c1 to the END of the existing time axis
cursor c1 right time
print c1
let c2=c1
cursor c1 left v(3) 0 1 rising
cursor c2 left v(3) 0 2 rising
let per=time[%c1]-time[%c2]
let f=1/per
print per
print f
fourier {f} v(3)
.endc
.end