资讯中心

联系我们

深圳市维立信电子科技有限公司
地址:深圳市福田区红荔路第一世界广场A座8D-E
咨询电话:0755-83766766
E-mail:info@welissom.com

如何通过SCPI命令查询Keysight双向直流电源输出电压下冲时间?

2026-04-02 09:46:58  点击:

  无法直接通过SCPI命令查询Keysight双向直流电源输出电压下冲时间,但可通过结合SCPI命令、示波器及自动化测试脚本实现间接测量与分析。具体操作如下:

  一、硬件准备

  Keysight双向直流电源:如N6700系列、66319B等,支持SCPI命令控制。

  示波器:高带宽(≥电源开关频率的5倍)、高采样率(≥1GS/s),如Keysight DSOX1204G,配备高压差分探头(测量输出电压)和电流探头(或采样电阻)测量负载电流。

  电子负载:支持动态模式(Dynamic Mode),如Chroma 6310A,用于阶跃响应测试。

  函数发生器:如Keysight 33500B,生成正弦波或方波信号(扫频测试)。

  测试线缆:短且对称,减少寄生电感。

  二、测试方法

  阶跃响应测试:

  连接设备:将电源输出端通过测试线缆连接至电子负载输入端,用示波器探头测量输出电压和负载电流。

  设置电源:通过SCPI命令设置电源输出电压序列,模拟阶跃响应条件。例如,设置电压从0V阶跃到12V,再阶跃回0V。

  配置电子负载:设置初始电流(轻载值)和阶跃后电流(重载值),上升时间和下降时间需小于电源闭环带宽的1/10.

  捕获波形:启动电子负载动态模式,用示波器捕获电压和电流波形。

  分析波形:观察示波器捕获的电压波形,分析负载突变时刻的电压波形,测量下冲幅度和调节时间(即下冲时间)。

  扫频测试:

  连接设备:将电源输出端通过测试线缆连接至电子负载(设置为恒流模式),在电源输入端串联函数发生器生成低幅值正弦波。

  设置电源:通过SCPI命令设置电源输出电压。

  配置函数发生器:设置频率范围,从低频到高频逐步增加信号源频率。

  捕获波形:用示波器探头测量输出电压和输入电压,观察输出电压的幅频特性和相频特性。

  分析波形:在特定频率下分析输出电压的下冲特性,测量下冲时间和幅度。

  三、SCPI命令示例(Python脚本)

  以下是一个通过SCPI命令控制Keysight双向直流电源输出电压序列,并结合示波器数据采集与分析的Python脚本示例(需替换为实际地址和参数):

  python

  import pyvisa

  import numpy as np

  import matplotlib.pyplot as plt

  # 连接电源

  rm = pyvisa.ResourceManager()

  power_supply = rm.open_resource("TCPIP0::192.168.1.100::inst0::INSTR") # 替换为实际地址

  # 设置电源输出电压序列(模拟阶跃响应)

  power_supply.write("SYST:REM") # 切换至远程控制模式

  power_supply.write("SOUR:LIST:COUN 3") # 设置3个序列点

  power_supply.write("SOUR:LIST:VOLT 0. 12. 0") # 电压序列:0V → 12V → 0V

  power_supply.write("SOUR:LIST:DWEL 2. 2. 2") # 每段持续时间2秒

  power_supply.write("SOUR:LIST:FUNC ON") # 激活序列功能

  power_supply.write("OUTP:STAT ON") # 开启输出

  # 假设示波器已连接并配置好,捕获电压波形并保存为CSV文件(此处省略示波器控制代码)

  # 实际实现中,需通过SCPI命令控制示波器启动捕获、保存数据等

  # 读取示波器数据文件(示例为模拟数据)

  # 实际实现中,需替换为从CSV文件读取数据的代码

  voltage_data = np.random.normal(loc=12. scale=0.5. size=1000) # 模拟电压数据,均值12V,标准差0.5V

  # 分析下冲时间

  steady_state_voltage = 12 # 稳态电压值

  undershoot_threshold = 0.05 # 稳态值的±5%

  # 找到电压低于稳态值±5%的时间点(此处简化处理,实际需根据波形分析)

  undershoot_times = []

  for i in range(1. len(voltage_data)):

  if (voltage_data[i] < steady_state_voltage * (1 - undershoot_threshold)) and

  (voltage_data[i-1] >= steady_state_voltage * (1 - undershoot_threshold)):

  undershoot_times.append(i / 1000) # 假设采样率为1kHz,转换为时间(秒)

  # 统计下冲时间分布

  if undershoot_times:

  mean_undershoot_time = np.mean(undershoot_times)

  std_undershoot_time = np.std(undershoot_times)

  max_undershoot_time = np.max(undershoot_times)

  min_undershoot_time = np.min(undershoot_times)

  print(f"下冲时间均值: {mean_undershoot_time:.4f}秒")

  print(f"下冲时间标准差: {std_undershoot_time:.4f}秒")

  print(f"下冲时间最大值: {max_undershoot_time:.4f}秒")

  print(f"下冲时间最小值: {min_undershoot_time:.4f}秒")

  # 绘制下冲时间分布直方图

  plt.figure(figsize=(10. 6))

  plt.hist(undershoot_times, bins=20. density=True, alpha=0.6. color='b')

  plt.xlabel('下冲时间(秒)')

  plt.ylabel('概率密度')

  plt.title('输出电压下冲时间分布')

  plt.grid(True)

  plt.show()

  else:

  print("未检测到下冲事件")

  # 关闭电源输出

  power_supply.write("OUTP:STAT OFF")

  power_supply.close()