Page 1 of 3 123 LastLast
Results 1 to 10 of 21
  1. #1
    300+ Forum Addict jmig's Avatar
    Join Date
    Apr 2007
    Location
    Lafayette, LA USA
    Posts
    440
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Can SOIC handle switch bounce?

    I have a micro switch working with a 10" long lever for my canopy switch. In trying to get it to open properly with SOIC I kept running into problems with the opening and closing of the canopy getting out of sequence.

    Using the logging function of SOIC (SOIC Config?) I noticed switch bouncing and multiple contacts at times. The code is set to set and clear the 0 bit of the offset. I think this is screwing up the sequence.

    Is there a way to delay the switch reading for a few milliseconds?
    John

    System:
    ASUS P5Q SE/R
    Intel Q9550 O/C to 3.4 GHz
    4 GB 1066 DDR2 RAM
    300 GB WD 10,000 RPM Raptor SATA Drive
    GeForce 8800 GT 512 KB RAM
    Matrox TH2Go with three 19" Sumsung 940 BX
    IR Track 4

  2. #2
    500+ This must be a daytime job
    Join Date
    Jul 2013
    Posts
    948
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Can SOIC handle switch bounce?

    John

    It could be that the SIOC code is too fast for the hardware. Try inserting a software delay between reading and resetting the offset. There is an example of the SIOC DELAY function on Nicos` site here

    http://www.lekseecon.nl/howto.html

    Regards

    David

  3. #3
    300+ Forum Addict jmig's Avatar
    Join Date
    Apr 2007
    Location
    Lafayette, LA USA
    Posts
    440
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Can SOIC handle switch bounce?

    The DELAY function won't help here. I am getting a manual switch bounce. the long lever and torque created is causing the little micoswitch to open and close two or three times when the handle is moved to close the switch.

    DELAY will only delay the sim action. I need to have a delay between the time the switch closes and SOIC reads it closed. Otherwise, it is redesign the entire mechanism which, of course, is not easy to get to without removing the ejection seat, side panel, etc.

    Ahhhh, such is a sim builder's life.
    John

    System:
    ASUS P5Q SE/R
    Intel Q9550 O/C to 3.4 GHz
    4 GB 1066 DDR2 RAM
    300 GB WD 10,000 RPM Raptor SATA Drive
    GeForce 8800 GT 512 KB RAM
    Matrox TH2Go with three 19" Sumsung 940 BX
    IR Track 4

  4. #4
    2000+ Poster - Never Leaves the Sim kiek's Avatar
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    2,202
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Can SOIC handle switch bounce?

    Hi John,

    The Master Card of OC takes care of de-bouncing, but I assume your switch bouncing is too long stretched in time.

    You can either solve that with extra hardware: http://www.electronixexpress.com/t_bounc.htm

    or you can solve this in SIOC, with the DELAY function and a sempahore, it goes like this:

    Code:
     
    Var 1 Value 0   // semaphore
     
    Var 2 Link IOCARD_SW Input xy   // connected to your switch
    {
      IF v1 = 0
      {
        v1 = 1  // set semaphore
        v3 = DELAY v2 50   // assign v2 to v3 after .5 second
      }
    }
     
    Var 3
    {
      v1 = 0    // reset semaphore
      L0 = v3  // L0 contains the de-bounced input
      // ...
    }
    Regards,
    Nico Kaan

  5. Thanks jmig thanked for this post
  6. #5
    300+ Forum Addict jmig's Avatar
    Join Date
    Apr 2007
    Location
    Lafayette, LA USA
    Posts
    440
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Can SOIC handle switch bounce?

    Thanks Nico! I will try this tonight.
    John

    System:
    ASUS P5Q SE/R
    Intel Q9550 O/C to 3.4 GHz
    4 GB 1066 DDR2 RAM
    300 GB WD 10,000 RPM Raptor SATA Drive
    GeForce 8800 GT 512 KB RAM
    Matrox TH2Go with three 19" Sumsung 940 BX
    IR Track 4

  7. #6
    2000+ Poster - Never Leaves the Sim kiek's Avatar
    Join Date
    Jan 2007
    Location
    Netherlands
    Posts
    2,202
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Can SOIC handle switch bounce?

    Okay, let me know the result.

    I was wondering, maybe it is even more reliable to take v2 as end result so in Var 3 write:

    L0 = v2 // L0 contains the de-bounced input
    Nico

  8. #7
    150+ Forum Groupie
    Join Date
    Aug 2008
    Location
    UK
    Posts
    192
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Can SOIC handle switch bounce?

    Obviously if you can do it in software that would be the easiest route, but if not you could do it in hardware. A simple RC circuit would do it, but you'd need power:

    http://www.electronixexpress.com/t_bounc.htm

    Depends how handy you are with a soldering iron.

  9. #8
    500+ This must be a daytime job
    Join Date
    Jul 2013
    Posts
    948
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Can SOIC handle switch bounce?

    Nico

    Thanks, I knew there would be a way of solving this in SIOC.

    Regards

    David

  10. #9
    300+ Forum Addict jmig's Avatar
    Join Date
    Apr 2007
    Location
    Lafayette, LA USA
    Posts
    440
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Can SOIC handle switch bounce?

    Quote Originally Posted by kiek View Post
    Okay, let me know the result.

    I was wondering, maybe it is even more reliable to take v2 as end result so in Var 3 write:



    Nico
    OK Nico, I have it working and it seems to help some? i am still getting out of sync but it could be something else. Here is my code snippet. See if i manged to code it the way you were thinking.

    I still think I will redesign the switch sometime. It is just too loose with no feel.

    // ************************** Canopy ********************************

    Var 8000, Value 0 // Initialization

    Var 8001, name canopysw, Link IOCARD_SW, Input 7, TYPE I

    {
    IF V8000 = 0
    {
    &canopysw = 1
    &canopy = DELAY &canopysw 50 // assign .5 delay to canopysw
    }
    }

    Var 8002, name canopy, Link FSUIPC_INOUT, Offset $3367, Length 1
    {
    V8000 = 0
    L0 = &canopy
    }
    John

    System:
    ASUS P5Q SE/R
    Intel Q9550 O/C to 3.4 GHz
    4 GB 1066 DDR2 RAM
    300 GB WD 10,000 RPM Raptor SATA Drive
    GeForce 8800 GT 512 KB RAM
    Matrox TH2Go with three 19" Sumsung 940 BX
    IR Track 4

  11. #10
    150+ Forum Groupie pdpo's Avatar
    Join Date
    Nov 2005
    Location
    belgium
    Posts
    280
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Post Re: Can SOIC handle switch bounce?

    Hi,

    Isnt there a mistake in the script, I think it should be like the following :
    Var 8000, Value 0 // Initialization

    Var 8001, name canopysw, Link IOCARD_SW, Input 7, TYPE I

    {
    IF V8000 = 0
    {
    V8000 = 1
    &canopy = DELAY &canopysw 50 // assign .5 delay to canopysw
    }
    }

    Var 8002, name canopy, Link FSUIPC_INOUT, Offset $3367, Length 1
    {
    V8000 = 0
    L0 = &canopy
    }

    another solution is to do the following :
    when the canopy switch changes, the V8000 is set to 1 and the fsuipc offset
    is written immediately but the following updates of the canopysw are not possible
    since V8000 is 1. Only after the delay time the V8000 is reset to 0 allowing further
    updates of the canopysw
    (Niko, correct me if Im wrong here!)

    Var 8000, name canopyUpdate, Value 0 // Initialization

    Var 8001, name canopysw, Link IOCARD_SW, Input 7, TYPE I
    {
    IF &canopyUpdate = 0
    {
    &canopyUpdate = 1
    &canopy = &canopysw
    &canopyUpdate = DELAY 0 50
    }
    }

    Var 8002, name canopy, Link FSUIPC_INOUT, Offset $3367, Length 1
    FS9+PM+AST+opencockpits

  12. Thanks jmig thanked for this post
Page 1 of 3 123 LastLast

Similar Threads

  1. HELP, i am totally lost with SOIC
    By Jasmckee in forum OpenCockpits General Discussion
    Replies: 1
    Last Post: 07-06-2010, 04:21 AM
  2. 737 reverser handle
    By ivar hestnes in forum General Builder Questions All Aircraft Types
    Replies: 0
    Last Post: 04-11-2009, 07:18 PM
  3. Sound for Flaps Handle
    By flightdeck in forum PM General Q & A
    Replies: 2
    Last Post: 02-17-2008, 04:24 PM
  4. How to handle rude passengers
    By ekezz in forum MyCockpit Crew Rest (Off topic chat forum)
    Replies: 5
    Last Post: 05-11-2007, 01:27 AM