回路の素101 051 ウィンドウ・コンパレータ
入力信号と2つの基準電圧を比較することができる
回路図作成
- 基本的な構成
入力電圧を、2つのコンパレータで基準電圧と比較している
コンパレータの出力がオープンコレクタ(ONの場合は浮いて、OFFの場合はGND接続)の場合、
2つの出力を短絡して、プルアップ抵抗で釣ることで、アンド処理ができる
今回の場合、抵抗分圧で、閾値電圧を、下側を2V、上側を4Vにしている
応答性確認
シミュレーションを tranモード(デフォルト) で実行し、応答を見る
import matplotlib.pyplot as plt import numpy as np from PyLTSpice import RawRead fig = plt.figure(figsize=(6, 3)) ax1 = fig.add_subplot(1, 1, 1) fname = 'PrimaryCircuit5-051.raw' LTR = RawRead(fname) x = LTR.get_trace('time').get_time_axis(0) tmp1 = LTR.get_trace('V(vin+)').get_wave(0) ax1.plot(x * 1000, tmp1, label='Vin+') tmp1 = LTR.get_trace('V(vout)').get_wave(0) ax1.plot(x * 1000, tmp1, label='Vout') ax1.legend(); ax1.grid() ax1.set_xlabel('[ms]'); ax1.set_ylabel('[V]') ax1.set_ylim(-0.2, 5.2) fig.tight_layout() fig.savefig('PrimaryCircuit5-051_Graph1.png')
閾値電圧の 2V-4V の間の時だけ、出力が Hi になる
改良された回路1
コンパレータ(オペアンプ)をプッシュプル式に変更する
import matplotlib.pyplot as plt import numpy as np from PyLTSpice import RawRead fig = plt.figure(figsize=(6, 3)) ax1 = fig.add_subplot(1, 1, 1) fname = 'PrimaryCircuit5-051-2.raw' LTR = RawRead(fname) x = LTR.get_trace('time').get_time_axis(0) tmp1 = LTR.get_trace('V(vin+)').get_wave(0) ax1.plot(x * 1000, tmp1, label='Vin+') tmp1 = LTR.get_trace('V(vout)').get_wave(0) ax1.plot(x * 1000, tmp1, label='Vout') ax1.legend(); ax1.grid() ax1.set_xlabel('[ms]'); ax1.set_ylabel('[V]') ax1.set_ylim(-0.2, 5.2) fig.tight_layout() fig.savefig('PrimaryCircuit5-051_Graph2.png')
オペアンプの出力で、アンド処理ができないため、
片方がOFFの場合に、 Lo(0V) に下がり切らない
改良された回路2
コンパレータ(オペアンプ)がプッシュプル式の場合に、
ダイオードでアンド処理を追加する
import matplotlib.pyplot as plt import numpy as np from PyLTSpice import RawRead fig = plt.figure(figsize=(6, 3)) ax1 = fig.add_subplot(1, 1, 1) fname = 'PrimaryCircuit5-051-3.raw' LTR = RawRead(fname) x = LTR.get_trace('time').get_time_axis(0) tmp1 = LTR.get_trace('V(vin+)').get_wave(0) ax1.plot(x * 1000, tmp1, label='Vin+') tmp1 = LTR.get_trace('V(vout)').get_wave(0) ax1.plot(x * 1000, tmp1, label='Vout') ax1.legend(); ax1.grid() ax1.set_xlabel('[ms]'); ax1.set_ylabel('[V]') ax1.set_ylim(-0.2, 5.2) fig.tight_layout() fig.savefig('PrimaryCircuit5-051_Graph3.png')
ダイオードのアンド処理によって、Lo の電圧が、順方向電圧降下 ( = 0.6V) まで下がるようになる
改良された回路3
コンパレータ入力を逆にして、出力側もダイオードのオア処理に変更し、逆論理にする
import matplotlib.pyplot as plt import numpy as np from PyLTSpice import RawRead fig = plt.figure(figsize=(6, 3)) ax1 = fig.add_subplot(1, 1, 1) fname = 'PrimaryCircuit5-051-4.raw' LTR = RawRead(fname) x = LTR.get_trace('time').get_time_axis(0) tmp1 = LTR.get_trace('V(vin+)').get_wave(0) ax1.plot(x * 1000, tmp1, label='Vin+') tmp1 = LTR.get_trace('V(vout)').get_wave(0) ax1.plot(x * 1000, tmp1, label='Vout') ax1.legend(); ax1.grid() ax1.set_xlabel('[ms]'); ax1.set_ylabel('[V]') ax1.set_ylim(-0.2, 5.2) fig.tight_layout() fig.savefig('PrimaryCircuit5-051_Graph4.png')
ダイオードのオア処理により、 Hi の電圧が、電源電圧 - 順方向電圧降下 になっている
参考文献
この記事は以下の書籍を参考にしましたが、
私の拙い知識で書いておりますので、誤り等ありましたらご指摘ください