针对各种不同开关的开关去抖参考轨迹
Switch bouncing reference traces for a variety of different switches

原始链接: https://github.com/gsuberland/switch_bouncing

本仓库提供各种类型开关弹跳行为的示例轨迹,有助于设计稳健的去抖系统。数据涵盖来自Multicomp、Schurter、Schneider、XKB Connection、Dailywell和Lorin等制造商的摇杆开关、按钮开关和按键开关。 数据采集使用5V下拉配置、250MHz探头和PicoScope 3206B示波器,采样率为8.93MSa/s。对于每种开关,都采集了32次开关打开和32次开关关闭的动作,并改变了作用力和速度。双刀开关的常开和常闭触点分别记录数据。 仓库同时提供原始CSV数据(电压随时间的变化,单位毫秒)和PWL文件。PWL文件模拟开关电阻随时间的变化,允许在LTSpice等软件中进行真实的仿真。PWL数据假设关断电阻为100MΩ,导通电阻为1mΩ。所有资源均已进入公共领域。

Hacker News 上的一个讨论围绕着电子系统中可靠信号检测的开关抖动和消抖技术展开。原帖分享了各种开关的参考波形。 评论者讨论了区分真实开关转换与噪声或电磁干扰的挑战。解决方案从简单的RC滤波器到更复杂的软件算法,包括使用多个时间常数和状态机以实现低延迟和高可靠性。文章强调了同时考虑机械抖动和电磁干扰的重要性。 几位参与者分享了他们的经验和轶事,包括涉及弧光灯和CCD阵列的复杂项目。讨论还涉及机械抖动的可预测性与真实世界开关行为的混沌性质之间的区别,后者受接触质量和用户交互等因素的影响。一些人参考了著名嵌入式系统专家 Jack Ganssle 的文章,以获取关于消抖的全面指南。该主题以对嵌入式系统中消抖的复杂性(远超入门教程中通常呈现的简单性)的反思而告终。

原文

This repository contains a collection of example traces showing switch bouncing behaviour. This may be useful if you want some quick reference data for implementing robust debouncing systems in your circuits and firmware.

Device Type Notes
Multicomp MC3813-011-01 (archive, datasheet) Rocker switch, latching, DPST Only one pole tested.
Schurter 1301.9206 (archived catalogue) Rocker switch, latching, SPST Old part, been in my drawer for over ten years.
Schneider XB2-BW31B1C (archive, datasheet) Push button, momentary, NO Very large industrial pushbutton.
XKB Connection TC-1103-B-A (archive, datasheet) Push button, momentary, NO
Dailywell MPS22-A03FP-3-JR-3V (archive, datasheet) Push button, momentary, NO IP67 / IK10 rated
Dailywell KPB22-8000-F10-324-JQ (archive, datasheet) Push button, momentary, SPDT IP65 rated. NO and NC traces recorded.
Lorin IRL-5-M-D-2 (archive, datasheet) Key switch, momentary, DPDT Only one pole recorded, only NO trace recorded as the NC legs were cut off.

The switches were configured as pull-downs, i.e. opening the switch leaves the voltage a +5.0V, and closing the switch pulls the output voltage to ground.

All traces were collected using the same procedure and equipment:

  • Connect 5.0V to one terminal of the switch through a 10kΩ resistor.
  • Connect 0.0V to the other terminal of the switch, directly.
  • Measure voltage across the switch.
    • 250MHz probe (x1)
    • PicoScope 3206B recording at 8.93MSa/s
    • 2V trigger, 1.5% hysteresis, 20% pre-trigger, both edges
  • Press the button 32 times, resulting in 64 total traces (rising/falling edges)
    • Approximately 8 presses in 1 second spacings (holding for momentary).
    • Approximately 8 presses in rapid succession.
    • Approximately 8 presses with light or glancing actuation.
    • Approximately 8 presses with heavy force.
  • If the switch is double-throw, record measurements for both the NO and NC contacts.

These plots show 32 opening and 32 closing actions on top of each other for each device.

Remember that the switches were configured as pulldowns, so high voltage = open, low voltage = closed.

Falling edge (switch closing)

Rising edge (switch opening)

Falling edge (switch closing)

Rising edge (switch opening)

Falling edge (switch closing)

Rising edge (switch opening)

XKB Connection TC-1103-B-A

Falling edge (switch closing)

Rising edge (switch opening)

Dailywell MPS22-A03FP-3-JR-3V

Falling edge (switch closing)

Rising edge (switch opening)

Dailywell KPB22-8000-F10-324-JQ

N/O falling edge (switch closing)

N/O rising edge (switch opening)

N/C falling edge (switch closing)

N/C rising edge (switch opening)

Falling edge (switch closing)

Falling edge (switch opening)

PWL files are available to download under this repository's releases section. These PWL files contain switch resistance values over time, assuming an off-resistance of 100MΩ and an on-resistance of 1mΩ. These allow you to accurately simulate the behaviour of the switch during bouncing, beyond just a simple on/off state.

Here is an example of the PWL data being used in LTSpice:

The PWL file is loaded into a voltage source, and the output of that voltage source is labelled as Vres (you can pick any name). A resistor is added to the circuit and its resistance parameter is set to R={V(Vres)}, matching the voltage source label. This resistor acts like the switch. The rest of the circuit shown is part of a test simulation for hardware debouncing - the voltage source (V3) and resistor (R3) are all you need.

The raw data is available to download under this repository's releases section. The data is formatted as a CSV with a header, with each device in its own directory. For double-throw devices that have both normally-open and normally-closed forms, the device will have two directories suffixed with -NO and -NC respectively.

Voltages are simply in volts. Timestamps are in milliseconds. A timestamp of zero signifies the time at which the oscilloscope was triggered by a rising or falling edge. Negative timestamps are before the trigger, positive after the trigger.

Everything in this repository is released into the public domain.

联系我们 contact @ memedata.com