Voltecx 目前為測試版。macOS 版先推出,Windows 與 Linux 安裝包仍在測試中。測試版。macOS 版先推出,Windows 與 Linux 版仍在測試。⁠最新消息
文件

電壓表 (voltmeter)

把 p 與 n 之間的電壓,以訊號從 out 輸出。

voltmeter

元件參考 · English

分類: 量測 · 種類: {"kind":"meter","quantity":"voltage"}

何時使用

用於把電壓送進控制方塊或放到示波器上。要量電流時用電流表。

接腳

接腳 訊號域 意義
p 電氣 正的感測端;讀取 v(p) - v(n)
n 電氣 負的感測端
out 訊號 輸出訊號,內容是以伏特計的電壓

常用參數

  • bandwidth: How fast the measurement can follow (預設值: 選填(預設關閉))
  • gain: Scale error of the reading (預設值: 1)
  • offset: Fixed error added to the reading (預設值: 0)
  • delay: Delay before the reading appears (預設值: 0)

參數

鍵 單位 預設值 典型範圍 說明
bandwidth Hz 選填(預設關閉) 1k – 20meg Hz How fast the measurement can follow
delay s 0 0 – 10u s Delay before the reading appears
gain — 1 900m – 1.1 Scale error of the reading
offset — 0 Fixed error added to the reading
sensitivity — 1 1m – 100 Output change per unit measured
vref V 0 100m – 15 V Output voltage when the input is zero
outMin V 選填(預設關閉) Lowest voltage the sensor can output
outMax V 選填(預設關閉) Highest voltage the sensor can output
noise V 0 1u – 100m V Random noise added to the output
seed — 1 Number that picks the noise pattern

參數說明在兩種語言中都是英文。

適用於: 電壓回授 · 示波器訊號 · 實際感測器模型

不適用於: 量測電流 → ammeter · 隔離式電壓感測 → isolatedVoltageSensor

公式

公式 方程式 出處
頻率 f 下的增益 abs(H) = gain / √(1 + (f/bandwidth)²) Hayt, Kemmerly & Durbin, Engineering Circuit Analysis, 8th ed. (2012), ch. 16 (Bode diagrams)
頻率 f 下的相位落後 φ = −atan(f/bandwidth) − 360·f·delay Ogata, Modern Control Engineering, 5th ed. (2010), ch. 7 (first-order factor and transport lag)

快速驗算

輸入:

  • x: 量測電壓 = 400 V
  • gain: 增益 = 1 —, gain
  • bandwidth: 頻寬 = 10k Hz, bandwidth
  • delay: 延遲 = 1u s, delay
  • f: 訊號頻率 = 1k Hz

輸出:

  • out: 穩態讀值 = gain*x V
  • mag: f 下的增益 = gain/sqrt(1 + (f/bandwidth)^2) —
  • phase: f 下的相位 = -atan(f/bandwidth)*180/pi - 360*f*delay °

模型邏輯

  • 電壓表不蓋印任何東西:不汲取電流也不對電路造成負載,因此讀值就是精確的 v(p) − v(n)。
  • 輸出為 vref + sensitivity·gain·x + offset,再經過頻寬 bandwidth 的一階低通、延遲、雜訊與 outMin、outMax 限幅。
  • 只加入有設定的級,全部未設定時輸出即為瞬時電壓;bandwidth 未設定表示沒有濾波。
  • noise 是由 seed 產生的高斯雜訊,每個值保持 1 µs,因此同一個整數 seed 每次執行都得到相同的雜訊。

模型

量測元件的輸入電阻無限大,不取電流,也不在電路中加入任何東西。輸出先取 x = v(p) - v(n),再成為 out = vref + sensitivity * gain * x + offset,接著依序經過頻寬為 bandwidth 的一階低通、純延遲、有效值為 noise 伏特的固定種子高斯雜訊,最後限制在 outMin 到 outMax。都不設定時,輸出就是瞬時電壓。

常見錯誤

  • 一個訊號節點只能有一個寫入者,所以把 out 接到已有其他方塊驅動的節點會出錯。把 out 接到功率節點也會被提醒。
  • 過低的 bandwidth 或過長的 delay 會為所供應的控制迴路增加相位落後。典型值為 1k 到 20M Hz 與最多 10u s,gain 超出 0.9 到 1.1 會被提醒。

Problems 規則: compile.error, pin.domain_mismatch, param.out_of_range

規格書與來源

預設值是理想量測。要模擬真實感測器時,bandwidth 取其 -3 dB 頻寬,delay 取其傳遞延遲,gain 與 offset 取其增益與偏移誤差。

範例

以指令 file.openExample 開啟範例,名稱為 demo:voltmeter.


由 cargo xtask reference 依使用說明文字與參數規格產生,請勿手動編輯。