adccommunitymod (AutomationDirect) asked a question.

Switch DeBounce logic for Click PLC

Created Date: July 26,2010

Created By: rbroders

**** This post has been imported from our legacy forum. Information in this post may be outdated and links contained in the post may no longer work.****

In my shade controller (discussed in the "How Do You Implement ELSE " thread), I discovered a problem which appears to be due to switch bounce. My PLC loop is so fast (~1ms), that sometimes (5-10%) the system behaves strangely. I finally traced it down to switch bouncing! The RC input circut should eliminate bouncing, but perhaps it is tuned for speed, and my switch has a slow bounce or something. Anyway, the incredibly simple fix was to Enable Fixed Scan Mode with a 20ms iteration time. Works perfectly! Also, now that I know the scan time is fixed, I can calculate current shade position with a simple up/down counter, and leave timers out... --Bob P.S. So much for my obsession with speed.


  • adccommunitymod (AutomationDirect)

    Created Date: July 28,2010

    Created by: Adisharr

    In my shade controller (discussed in the "How Do You Implement ELSE " thread), I discovered a problem which appears to be due to switch bounce. My PLC loop is so fast (~1ms), that sometimes (5-10%) the system behaves strangely. I finally traced it down to switch bouncing! The RC input circut should eliminate bouncing, but perhaps it is tuned for speed, and my switch has a slow bounce or something.

    Anyway, the incredibly simple fix was to Enable Fixed Scan Mode with a 20ms iteration time. Works perfectly! Also, now that I know the scan time is fixed, I can calculate current shade position with a simple up/down counter, and leave timers out...

    --Bob

    P.S. So much for my obsession with speed.

    Hey that's a good way to do it - I think the Click also has input filters you can enable in the CPU set-up for de-bounce but I'm not sure (software not installed on this PC).

    Expand Post
  • adccommunitymod (AutomationDirect)

    Created Date: July 26,2010

    Created by: rbroders

    In my shade controller (discussed in the "How Do You Implement ELSE " thread), I discovered a problem which appears to be due to switch bounce. My PLC loop is so fast (~1ms), that sometimes (5-10%) the system behaves strangely. I finally traced it down to switch bouncing! The RC input circut should eliminate bouncing, but perhaps it is tuned for speed, and my switch has a slow bounce or something.

    Anyway, the incredibly simple fix was to Enable Fixed Scan Mode with a 20ms iteration time. Works perfectly! Also, now that I know the scan time is fixed, I can calculate current shade position with a simple up/down counter, and leave timers out...

    --Bob

    P.S. So much for my obsession with speed.

    Expand Post