You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
In this example, first we'll demonstrate the I-V curves of the NMOS transistor model.
3
+
First of all, we construct a circuit using the NMOS transistor. We'll need to import ModelingToolkit and the Electrical standard library that holds the transistor models.
4
+
5
+
```@example NMOS
6
+
using ModelingToolkit
7
+
using ModelingToolkit: t_nounits as t
8
+
using ModelingToolkitStandardLibrary.Electrical
9
+
using ModelingToolkitStandardLibrary.Blocks: Constant
10
+
using OrdinaryDiffEq
11
+
using Plots
12
+
```
13
+
14
+
Here we just connect the source pin to ground, the drain pin to a voltage source named `Vcc`, and the gate pin to a voltage source named `Vb`.
Now to make sure that the transistor model is working like it's supposed to, we can examine the plots of the drain-source voltage vs. the drain current, otherwise knowns as the I-V curve of the transistor.
plot(v_cc_list, I_D_lists, title="NMOS IV Curves", label=["V_GS: 1.0 V" "V_GS: 1.4 V" "V_GS: 1.8 V" "V_GS: 2.2 V" "V_GS: 2.6 V"], xlabel = "Drain-Source Voltage (V)", ylabel = "Drain Current (A)")
71
+
```
72
+
73
+
We can see that we get exactly what we would expect: as the drain-source voltage increases, the drain current increases, until the the transistor gets in to the saturation region of operation.
74
+
Then the only increase in drain current is due to the channel-length modulation effect. Additionally, we can see that the maximum current reached increases as the gate voltage increases.
- `use_transconductance`: If `true` the parameter `k_n` needs to be provided, and is used in the calculation of the current
8
+
through the transistor. Otherwise, `mu_n`, `C_ox`, `W`, and `L` need to be provided and are used to calculate the transconductance.
9
+
10
+
- `use_channel_length_modulation`: If `true` the channel length modulation effect is taken in to account. In essence this gives
11
+
the drain-source current has a small dependency on the drains-source voltage in the saturation region of operation.
12
+
13
+
# Connectors
14
+
- `d` Drain Pin
15
+
- `g` Gate Pin
16
+
- `s` Source Pin
17
+
18
+
# Parameters
19
+
- `mu_n`: Electron mobility
20
+
- `C_ox`: Oxide capacitance (F/m^2)
21
+
- `W`: Channel width (m)
22
+
- `L`: Channel length
23
+
- `k_n`: MOSFET transconductance parameter
24
+
25
+
Based on the MOSFET models in (Sedra, A. S., Smith, K. C., Carusone, T. C., & Gaudet, V. C. (2021). Microelectronic circuits (8th ed.). Oxford University Press.)
26
+
"""
27
+
@mtkmodel NMOS begin
28
+
@variablesbegin
29
+
V_GS(t)
30
+
V_DS(t)
31
+
V_OV(t)
32
+
end
33
+
34
+
@componentsbegin
35
+
d =Pin()
36
+
g =Pin()
37
+
s =Pin()
38
+
end
39
+
40
+
@parametersbegin
41
+
V_tn =0.8, [description ="Threshold voltage (V)"]
42
+
R_DS =1e7, [description ="Drain to source resistance (Ω)"]
- `use_transconductance`: If `true` the parameter `k_p` needs to be provided, and is used in the calculation of the current
93
+
through the transistor. Otherwise, `mu_n`, `C_ox`, `W`, and `L` need to be provided and are used to calculate the transconductance.
94
+
95
+
- `use_channel_length_modulation`: If `true` the channel length modulation effect is taken in to account. In essence this gives
96
+
the drain-source current has a small dependency on the drains-source voltage in the saturation region of operation.
97
+
98
+
# Connectors
99
+
- `d` Drain Pin
100
+
- `g` Gate Pin
101
+
- `s` Source Pin
102
+
103
+
# Parameters
104
+
- `mu_p`: Electron mobility
105
+
- `C_ox`: Oxide capacitance (F/m^2)
106
+
- `W`: Channel width (m)
107
+
- `L`: Channel length
108
+
- `k_p`: MOSFET transconductance parameter
109
+
110
+
Based on the MOSFET models in (Sedra, A. S., Smith, K. C., Carusone, T. C., & Gaudet, V. C. (2021). Microelectronic circuits (8th ed.). Oxford University Press.)
111
+
"""
112
+
@mtkmodel PMOS begin
113
+
@variablesbegin
114
+
V_GS(t)
115
+
V_DS(t)
116
+
end
117
+
118
+
@componentsbegin
119
+
d =Pin()
120
+
g =Pin()
121
+
s =Pin()
122
+
end
123
+
124
+
@parametersbegin
125
+
V_tp =-1.5, [description ="Threshold voltage (V)"]
0 commit comments