サイトマップ

回路の素101 001 アンプ:ボルテージフォロア

回路の素101 001 アンプ:ボルテージフォロア

オペアンプを使用して、信号をバッファリングを行うことができる
入力インピーダンスが非常に高いため、出力インピーダンスが高い信号を受信することができる
また出力インピーダンスも低くすることができる

回路図作成

以下の3条件の回路を作成する

  • 基本的な構成
  • 容量性負荷が追加された状態
  • 容量性負荷対応で、抵抗を追加した状態

この回路で周波数特性のシミュレーションを実施する

周波数特性結果の読み込み

シミュレーション結果のrawファイルの中身を読み込む

import matplotlib.pyplot as plt
import numpy as np

from PyLTSpice import RawRead

#.rawファイルを読み込む。
LTR = RawRead('PrimaryCircuit1-001_1.raw')

#LTspiceで使っているラベル類を抜きだす。
print(LTR.get_trace_names())
['frequency', 'V(vout1)', 'V(vin)', 'V(+vcc)', 'V(-vcc)', 'V(vout2)', 'V(vout3)', 'V(n001)', 'V(n002)', 'I(Cload2)', 'I(Cload3)', 'I(Rload1)', 'I(Rload2)', 'I(Rload3)', 'I(R5)', 'I(R6)', 'I(V1)', 'I(V2)', 'I(V3)', 'Ix(u1:1)', 'Ix(u1:2)', 'Ix(u1:3)', 'Ix(u1:4)', 'Ix(u1:5)', 'Ix(u2:1)', 'Ix(u2:2)', 'Ix(u2:3)', 'Ix(u2:4)', 'Ix(u2:5)', 'Ix(u3:1)', 'Ix(u3:2)', 'Ix(u3:3)', 'Ix(u3:4)', 'Ix(u3:5)']

周波数特性の結果を読み出す

V(vout1) に入っているが、下記のように複素数になっている

print(LTR.get_trace("V(vout1)").get_wave(0))
[0.99995007-9.72061981e-08j 0.99995007-9.89053325e-08j
 0.99995007-1.00634167e-07j ... 0.15596236+3.19764828e-01j
 0.16087773+3.22124172e-01j 0.16096084+3.22165197e-01j]

ゲインを算出するには、numpyのabs関数を使う

Vout  = LTR.get_trace("V(vout1)").get_wave(0)
print(np.abs(Vout))
[0.99995007 0.99995007 0.99995007 ... 0.35577212 0.36006336 0.3601372 ]

位相を算出するには、numpyのangle関数を使用する

print(np.angle(Vout))
[-9.72110522e-08 -9.89102715e-08 -1.00639193e-07 ...  1.11700406e+00
  1.10760668e+00  1.10745112e+00]

さらに可視化する際には、ゲインを dB に、位相を degree に変換すると一般的で見やすくなる

周波数軸のデータもなぜか複素数で入っているので、abs関数で実数化する

print(LTR.get_trace('frequency').get_wave(0))
[1.00000000e+00+0.j 1.01747969e+00+0.j 1.03526492e+00+0.j ...
 9.82531279e+07+0.j 9.99705623e+07+0.j 1.00000000e+08+0.j]
print(np.abs(LTR.get_trace('frequency').get_wave(0)))
[1.00000000e+00 1.01747969e+00 1.03526492e+00 ... 9.82531279e+07
 9.99705623e+07 1.00000000e+08]

データ可視化

3個の回路の周波数特性をグラフ化する

fig = plt.figure(figsize=(6, 4))
ax1 = fig.add_subplot(2, 1, 1)
ax2 = fig.add_subplot(2, 1, 2, sharex=ax1)

freq  = np.abs(LTR.get_trace('frequency').get_wave(0))

#グラフのプロット
Vout  = LTR.get_trace("V(vout1)").get_wave(0)
ax1.plot(freq, 20*np.log10(np.abs(Vout)),    label="Vout1")
ax2.plot(freq, np.angle(Vout) / np.pi * 180, label="Vout1")

Vout  = LTR.get_trace("V(vout2)").get_wave(0)
ax1.plot(freq, 20*np.log10(np.abs(Vout)),    label="Vout2")
ax2.plot(freq, np.angle(Vout) / np.pi * 180, label="Vout2")

Vout  = LTR.get_trace("V(vout3)").get_wave(0)
ax1.plot(freq, 20*np.log10(np.abs(Vout)),    label="Vout3")
ax2.plot(freq, np.angle(Vout) / np.pi * 180, label="Vout3")

ax1.legend(fontsize=9)
ax1.set_xlabel("[Hz]")
ax1.set_ylabel("Gain[dB]")
ax1.set_xscale('log')
ax1.legend()
ax1.grid()

ax2.legend(fontsize=9)
ax2.set_xlabel("[Hz]")
ax2.set_ylabel("Phase[deg]")
ax2.set_xscale('log')
ax2.grid()

fig.tight_layout()

基礎的な状態だと、オペアンプの性能で 30~40MHz がカットオフ周波数になっている
容量性負荷が追加されると、ゲインにピークが発生し、不安定になる
出力抵抗を追加すると、高域のゲインが下がるが、ピークはなくすことができる

単電源オペアンプ

おまけで、単電源オペアンプを使った、半波整流回路を紹介する

ちなみに、単電源オペアンプは、両電源としても使用できる
この回路でもシミュレーションを実施しrawファイルを生成して、可視化する

from PyLTSpice import RawRead

LTR = RawRead('PrimaryCircuit1-001_2.raw')

fig = plt.figure(figsize=(6, 3))
ax = fig.add_subplot(1, 1, 1)

x    = LTR.get_trace('time').get_time_axis(0)
Vout1 = LTR.get_trace("V(vout1)").get_wave(0)
Vout2 = LTR.get_trace("V(vout2)").get_wave(0)

ax.plot(x * 1000, Vout1, '-',  label="Vout1")
ax.plot(x * 1000, Vout2, '--', label="Vout2")

ax.legend(fontsize=9)
ax.set_xlabel("[ms]")
ax.set_ylabel("[V]")
ax.grid()

fig.tight_layout()

単電源で、正電圧のみ発生する

参考文献

この記事は以下の書籍を参考にしましたが、
私の拙い知識で書いておりますので、誤り等ありましたらご指摘ください