跳至內容
測試伺服器
開發伺服器

Line Debouncer#

Line Debouncer 相機功能可讓您過濾掉不需要的短暫硬體輸入訊號。

只有足夠長的訊號才被允許傳遞至攝影機並發揮作用。

此功能與 Input Filter 功能,該功能僅適用於 ace 2、boost 及 dart R 相機。

使用功能#

運作原理#

線路去抖動器會過濾來自輸入硬體觸發訊號上升沿與下降沿的不需要的短暫訊號(接觸抖動)。為達成此目的,線路去抖動器會評估硬體訊號邏輯狀態的所有變化及其持續時間。

此評估期的最長持續時間由 LineDebouncerTime 參數。線路除抖器的作用類似於時鐘,透過測量訊號的持續時間來辨識有效的訊號。

每當硬體訊號的邏輯狀態發生變化(由高電平轉為低電平,或反之)時,計時器便會開始計時:

  • 若新邏輯狀態的持續時間短於指定的線路去抖動時間,則該新邏輯狀態將被視為無效,且不產生任何效果。
  • 若新邏輯狀態的持續時間等於 或長於線路去抖動時間,則該新邏輯狀態將被視為有效,並允許在攝影機中生效。

資訊

設定線路去抖動時間,會在有效觸發訊號傳抵攝影機,與相關邏輯狀態變化傳遞至攝影機之間,引入一段延遲。

延遲的持續時間至少等於 LineDebouncerTime 參數。這是因為相機會等待指定的時間,以判斷該訊號是否有效。同樣地,線路去抖動器會延遲有效觸發訊號的結束時間。

下圖說明了線路去抖動器如何過濾硬體觸發訊號上升沿與下降沿中的無效訊號。允許攝影機邏輯狀態發生變更的線路去抖動器時序標示為「OK」。圖中亦標示了相對於硬體觸發訊號的延遲時間。

Line Debouncer 對輸入訊號的影響

啟用Line Debouncer#

  1. 確保相機已針對 硬體觸發進行設定。
  2. 將相機中的 LineSelector 參數設為所需的輸入線路,例如: Line1.
  3. 為 LineDebouncerTime 參數中選擇性地指定 HTML 記錄檔 (*.html) 的路徑與檔名。

選擇去抖動電容的值#

  • 選擇一個 LineDebouncerTime 該數值即為 過低 導致系統接受無效的訊號及訊號狀態。
  • 若選擇的數值過高,將會導致有效訊號及訊號狀態被誤判為無效。

Basler 建議選擇的線路去抖動時間,應略長於預期最長無效訊號的持續時間。

雖然存在微小風險會誤判並忽略短暫的有效訊號,但在大多數情況下,此方法應能帶來良好的效果。請密切監控您的應用程式,若發現被誤判的有效訊號過多,請視需要調整該數值。

範例程式碼#

ace Classic/U/L GigE 相機#
// Select the desired input line
camera.LineSelector.SetValue(LineSelector_Line1);
// Set the parameter value to 10 microseconds
camera.LineDebouncerTimeAbs.SetValue(10.0);
INodeMap& nodemap = camera.GetNodeMap();
// Select the desired input line
CEnumParameter(nodemap, "LineSelector").SetValue("Line1");
// Set the parameter value to 10 microseconds
CFloatParameter(nodemap, "LineDebouncerTimeAbs").SetValue(10.0);
// Select the desired input line
camera.Parameters[PLCamera.LineSelector].SetValue(PLCamera.LineSelector.Line1);
// Set the parameter value to 10 microseconds
camera.Parameters[PLCamera.LineDebouncerTimeAbs].SetValue(10.0);
/* Macro to check for errors */
#define CHECK(errc) if (GENAPI_E_OK != errc) printErrorAndExit(errc)
GENAPIC_RESULT errRes = GENAPI_E_OK;  /* Return value of pylon methods */
/* Select the desired input line */
errRes = PylonDeviceFeatureFromString(hdev, "LineSelector", "Line1");
CHECK(errRes);
/* Set the parameter value to 10 microseconds */
errRes = PylonDeviceSetFloatFeature(hdev, "LineDebouncerTimeAbs", 10.0);
CHECK(errRes);
# Select the desired input line
camera.LineSelector.Value = "Line1"
# Set the parameter value to 10 microseconds
camera.LineDebouncerTimeAbs.Value = 10.0
其他相機#
// Select the desired input line
camera.LineSelector.SetValue(LineSelector_Line1);
// Set the parameter value to 10 microseconds
camera.LineDebouncerTime.SetValue(10.0);
INodeMap& nodemap = camera.GetNodeMap();
// Select the desired input line
CEnumParameter(nodemap, "LineSelector").SetValue("Line1");
// Set the parameter value to 10 microseconds
CFloatParameter(nodemap, "LineDebouncerTime").SetValue(10.0);
// Select the desired input line
camera.Parameters[PLCamera.LineSelector].SetValue(PLCamera.LineSelector.Line1);
// Set the parameter value to 10 microseconds
camera.Parameters[PLCamera.LineDebouncerTime].SetValue(10.0);
/* Macro to check for errors */
#define CHECK(errc) if (GENAPI_E_OK != errc) printErrorAndExit(errc)
GENAPIC_RESULT errRes = GENAPI_E_OK;  /* Return value of pylon methods */
/* Select the desired input line */
errRes = PylonDeviceFeatureFromString(hdev, "LineSelector", "Line1");
CHECK(errRes);
/* Set the parameter value to 10 microseconds */
errRes = PylonDeviceSetFloatFeature(hdev, "LineDebouncerTime", 10.0);
CHECK(errRes);
# Select the desired input line
camera.LineSelector.Value = "Line1"
# Set the parameter value to 10 microseconds
camera.LineDebouncerTime.Value = 10.0

您也可以 use the pylon Viewer 來輕鬆設定參數。