跳转到内容

Input Filter#

相机的 Input Filter 功能使您可以滤掉硬件输入信号中的噪声、干扰或触点颤动。

此功能类似于 Line Debouncer 功能,仅适用于 ace Classic/U/L 相机。

该功能的使用#

运作原理#

您可以通过配置以下一项或全部相机设置来控制输入滤波:

Input Filter Time#

数字输入信号到达相机时,其格式通常不尽理想。它们会吸收来自周围电磁场的噪声和干扰,尤其是在使用长 I/O 线缆或附近有电源设备的情况下。同样,切换输出也会引起串扰。

电平从“低”到“高”的变化(反之亦然)可能要花费几微秒时间,因此,逻辑电平在转换期间处于不确定状态。

指定输入滤波时间可以消除大多数此类问题。

The input filter evaluates all changes and durations of logical states of the input signal. The duration of this evaluation period is defined by the BslInputFilterTime parameter.

在评估过程中,相机会计算一段时间内的平均值,并将阈值函数应用于结果以重建数字信号。这样可以消除噪声、干扰等,还能消除短于滤波时间的信号脉冲。

信息

如果指定输入滤波时间,并且在原始转换后输入信号不稳定,则传输延迟会增加。

这意味着从模拟 I/O 信号更改到相机内部状态更改之间的时间间隔将更长。

输入延迟时间#

如果要避免由于多个触发信号快速连续到达(触点颤动)而引起的错误触发,设置输入延迟时间非常有用。

如果设置了输入延迟时间并且有输入触发信号到达,则相机会接受该信号,并停止接受任何其他触发信号或信号变化,直到经过延迟时间为止。

For example, if you set the BslInputHoldOffTime parameter to 10 and apply a trigger signal to the camera, the camera accepts the signal and stops accepting any further trigger signals or signal changes for 10 milliseconds.

输入延迟时间:时序图

信息

输入滤波时间不同,指定输入延迟时间不会增加传输延迟。

配置 Input Filter#

  1. 确保将相机配置为进行硬件触发
  2. Set the LineSelector parameter to the desired input line, e.g., Line1.
  3. If you want to configure the input filter time, enter a value for the BslInputFilterTime parameter.
  4. If you want to configure the input hold-off time, enter a value for the BslInputHoldOffTime parameter.

选择 Input Filter 和输入延迟时间#

  • 选择过低的输入滤波时间或输入延迟时间会导致接受无效信号和信号状态。
  • 选择过高的输入滤波时间或输入延迟时间会导致拒绝有效信号和信号状态。

Basler 推荐以下方法:

  • 选择一个输入滤波时间,该时间比无效信号的最长预期持续时间稍长。
  • 选择一个输入延迟时间,该时间比两个有效信号之间的最短预期间隔稍短。

拒绝有效短信号的风险很小,但是在大多数情况下,这种方法应能产生良好的结果。因此应监视您的应用,并在发现有过多有效信号被拒绝时,视需要调整值。

示例代码#

// Select the desired input line
camera.LineSelector.SetValue(LineSelector_Line1);
// Set the input filter time to 10 microseconds
camera.BslInputFilterTime.SetValue(10.0);
// Set the input hold-off time to 20 microseconds
camera.BslInputHoldOffTime.SetValue(20.0);
INodeMap& nodemap = camera.GetNodeMap();
// Select the desired input line
CEnumParameter(nodemap, "LineSelector").SetValue("Line1");
// Set the input filter time to 10 microseconds
CFloatParameter(nodemap, "BslInputFilterTime").SetValue(10.0);
// Set the input hold-off time to 20 microseconds
CFloatParameter(nodemap, "BslInputHoldOffTime").SetValue(20.0);
// Select the desired input line
camera.Parameters[PLCamera.LineSelector].SetValue(PLCamera.LineSelector.Line1);
// Set the input filter time to 10 microseconds
camera.Parameters[PLCamera.BslInputFilterTime].SetValue(10.0);
// Set the input hold-off time to 20 microseconds
camera.Parameters[PLCamera.BslInputHoldOffTime].SetValue(20.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 input filter time to 10 microseconds */
errRes = PylonDeviceSetFloatFeature(hdev, "BslInputFilterTime", 10.0);
CHECK(errRes);
/* Set the input hold-off time to 20 microseconds */
errRes = PylonDeviceSetFloatFeature(hdev, "BslInputHoldOffTime", 20.0);
CHECK(errRes);
# Select the desired input line
camera.LineSelector.Value = "Line1"
# Set the input filter time to 10 microseconds
camera.BslInputFilterTime.Value = 10.0
# Set the input hold-off time to 20 microseconds
camera.BslInputHoldOffTime.Value = 20.0

您也可以使用 pylon Viewer 轻松设置参数。