如何使用 UliEngineering 在 Python 中计算迟滞阈值电压

你可以使用 UliEngineering Python 库轻松计算迟滞阈值电压:

hysteresis_threshold_voltages.py
from UliEngineering.Electronics.Hysteresis import hysteresis_threshold_voltages
from UliEngineering.EngineerIO import *

# 计算 5V 基准电压、10% 迟滞时的阈值电压
low_v, high_v = hysteresis_threshold_voltages("5V", 0.10)
print(f"低阈值 (5V, 10% 迟滞): {format_value(low_v, 'V')}")
print(f"高阈值 (5V, 10% 迟滞): {format_value(high_v, 'V')}")

# 计算 12V 基准电压、20% 迟滞时的阈值电压
low_v, high_v = hysteresis_threshold_voltages("12V", 0.20)
print(f"低阈值 (12V, 20% 迟滞): {format_value(low_v, 'V')}")
print(f"高阈值 (12V, 20% 迟滞): {format_value(high_v, 'V')}")

示例输出

hysteresis_threshold_voltages_output.txt
低阈值 (5V, 10% 迟滞): 2.25 V
高阈值 (5V, 10% 迟滞): 2.75 V
低阈值 (12V, 20% 迟滞): 4.80 V
高阈值 (12V, 20% 迟滞): 7.20 V

迟滞阈值电压表示比较器或开关电路实际改变状态的电压电平。这些阈值以基准电压的百分比形式计算,形成一个死区,可防止因噪声或信号波动引起的不必要切换。

阈值电压通过以下公式计算:$V_{low} = V_{ref} \times \frac{1 - h}{2}$ 和 $V_{high} = V_{ref} \times \frac{1 + h}{2}$,其中 $V_{ref}$ 为基准电压,$h$ 为迟滞百分比。下阈值设定在中点以下,上阈值设定在中点以上。

相关文章


Check out similar posts by category: Electronics, Python