Page 1 of 3 123 LastLast
Results 1 to 10 of 25
  1. #1
    75+ Posting Member
    Join Date
    Jun 2012
    Location
    New Orleans, LA
    Posts
    130
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Rotary Encoder Double 'clicking'

    I'm hooking up the Rotary Encoders on my ProSimParts comm panels and finding they are 'double clicking' when I turn them. In other words, when I turn the dial one click, the radio digit jumps two, instead of one.

    I have them connected directly to a master card. Is there anything SIOC that can slow it down? I'm thinking maybe I need one of opencockpits encoder cards so it reads the turns correctly?

  2. #2
    25+ Posting Member
    Join Date
    Dec 2008
    Location
    Poland
    Posts
    30
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Rotary Encoder Double 'clicking'

    Hi there,

    I've had maybe not exactly the same problem you experience, but please take a look on my post on Opencockpits forum: OpenCockpits

  3. #3
    Our new friend needs to reach 10 posts to get to the next flight level
    Join Date
    Aug 2012
    Location
    United States
    Posts
    8
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Rotary Encoder Double 'clicking'

    I'm new to the SIOC and MC myself but There isn't enough information in your original post to help you.

    1) What is the SIOC MONITOR reporting? Is it the rotary switch working correctly? Do you have the wires connected correctly to a consecutve input (example: 20,21 or 36,37 or any thing as long as first switch is even I think. You can't connect 25,26 for example, it must be 26,27)

    2) what script are you using for your comm radio? I just made a comm1 yesterday and used this script by Nico. only changes I made were to the inputs and outputs. You may have to enter device to both inputs and outputs and you'll have to make sure switch numbers are correct. that's about it, works flawlessly.

    // *****************************************************************************// * Config_SIOC ver 1.98 - By Manolo Vélez - OpenCockpits
    // *****************************************************************************
    // * FileName : Comm1.txt
    // * Author Nico Kaan
    // * Date : 10/11/2007
    // * modified by Nico Kaan, April 18th, 2008
    // * also incorporates a display test function - KB
    //


    //*********************************************
    //***** COMM 1 ********************************
    //*********************************************




    Var 1000 name Com1_act


    Var 1002 name FS_C1_SB_BCD Link FSUIPC_INOUT Offset $311A Length 2 // FS COM1 standby frequency in BCD format
    Var 1003 name FS_C1_ACT_BCD Link FSUIPC_INOUT Offset $034E Length 2 // FS COM1 active frequency in BCD format
    {
    &Com1_act = FROMBCD &FS_C1_ACT_BCD
    CALL &OutCom1_Act
    CALL &C1_LH_ROT_VAL // Align rotary with new C1 SB integer val
    CALL &C1_RH_ROT_VAL // Align rotary with new C1 SB decimal val
    CALL &C1_UPDATE_LHS
    CALL &C1_UPDATE_RHS
    CALL &OutCom1_SB
    }


    Var 1004 name FS_C1_SWAP Link FSUIPC_OUT Offset $3123 Length 1 // FS COM1 active standby swap


    Var 1005 name C1_SB_AS_DEC // COM1 standby frequency in decimal format
    Var 1006 name C1_SB_LHS // COM1 standby frequency integers
    Var 1007 name C1_SB_RHS // COM1 standby frequency decimals
    Var 1008 name C1_RHS_ROT_VAL // COM1 right hand rotary encoder ref value
    Var 1009 name C1_LHS_ROT_VAL // COM1 left hand rotary encoder ref value


    Var 1010 name ROT_C1_LHS Link IOCARD_ENCODER Input 18 Aceleration 1 Type 2
    {
    L0 = &ROT_C1_LHS * -1
    &C1_LHS_ROT_VAL = ROTATE 18 36 L0
    CALL &C1_UPDATE_LHS
    CALL &SET_FS_C1_SB
    CALL &OutCom1_SB
    }


    Var 1011 name ROT_C1_RHS Link IOCARD_ENCODER Input 20 Aceleration 1 Type 2
    {
    L0 = &ROT_C1_RHS * -1
    &C1_RHS_ROT_VAL = ROTATE 0 39 L0
    CALL &C1_UPDATE_RHS
    CALL &SET_FS_C1_SB
    CALL &OutCom1_SB
    }


    Var 1012 name SW_C1_SWAP Link IOCARD_SW Input 26 Type 1 // Active/Standby swap button
    {
    &FS_C1_SWAP = TOGGLE 3
    }


    Var 1015 name SW_C1_TEST Link IOCARD_SW Input 33 // COMM TEST button sends 8's to Displays
    {
    IF &SW_C1_TEST = 1
    {
    &DISP_C1_ACT = 88888
    &DISP_C1_SB = 88888
    }
    ELSE
    {
    CALL &OutCom1_Act
    CALL &OutCom1_SB
    }
    }


    Var 1020 name DISP_C1_SB Link IOCARD_DISPLAY Digit 1 Numbers 5 // Standby decimals
    Var 1021 name DISP_C1_ACT Link IOCARD_DISPLAY Digit 7 Numbers 5 // active display
    Var 1022 name C1_DP Link IOCARD_OUT Output 15 // Decimal Point


    Var 1030 name C1_LH_ROT_VAL Link SUBRUTINE // Aligns LH rotary ref with COM1 SB freq
    {
    L0 = FROMBCD &FS_C1_SB_BCD
    L1 = L0 / 100
    &C1_LHS_ROT_VAL = TRUNC L1
    }


    Var 1031 name C1_RH_ROT_VAL Link SUBRUTINE // Aligns RH rotary ref with COM1 SB freq
    {
    L0 = FROMBCD &FS_C1_SB_BCD
    L1 = &C1_LHS_ROT_VAL * 100
    L2 = L0 - L1
    &C1_RHS_ROT_VAL = L2 / 2.487179
    }


    Var 1032 name C1_UPDATE_LHS Link SUBRUTINE // Update COM1 stanby integers
    {
    &C1_SB_LHS = &C1_LHS_ROT_VAL
    }


    Var 1033 name C1_UPDATE_RHS Link SUBRUTINE // Update COM1 standby decimals
    {
    L0 = &C1_RHS_ROT_VAL * 2.5
    &C1_SB_RHS = TRUNC L0
    }


    Var 1034 name SET_FS_C1_SB Link SUBRUTINE // Update COM1 standby frequency in FS
    {
    L0 = &C1_SB_LHS * 100
    L1 = L0 + &C1_SB_RHS
    &FS_C1_SB_BCD = TOBCD L1
    }


    Var 1040 name OutCom1_Act Link SUBRUTINE
    {
    //IF &MAST_SW = 1 // Section for use with a master switch. Not yet implemented
    //{
    L0 = &Com1_act
    &DISP_C1_ACT = L0 + 10000
    }
    //ELSE
    //{
    //&DISP_C1_ACT = -999999 // blank
    //}
    //}


    Var 1041 name OutCom1_SB Link SUBRUTINE
    {
    //IF &MAST_SW = 1
    //{
    &C1_DP = 1
    L0 = &C1_SB_LHS * 100
    L1 = L0 + &C1_SB_RHS
    &DISP_C1_SB = L1 + 10000
    }
    //ELSE
    //{
    //&C1_DP = 0
    //&DISP_C1_SB = -999999 // blank
    //}
    //}

  4. #4
    75+ Posting Member
    Join Date
    Jun 2012
    Location
    New Orleans, LA
    Posts
    130
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Rotary Encoder Double 'clicking'

    [QUOTE=n19htmare;134227]1) What is the SIOC MONITOR reporting? Is it the rotary switch working correctly? Do you have the wires connected correctly to a consecutve input (example: 20,21 or 36,37 or any thing as long as first switch is even I think. You can't connect 25,26 for example, it must be 26,27)

    SIOC Monitor shows the rotary's are functioning. The Comm rotary for example is connected as follows:

    Freq: 5,6
    Decimal: 7,8


    Quote Originally Posted by n19htmare View Post
    2) what script are you using for your comm radio? I just made a comm1 yesterday and used this script by Nico. only changes I made were to the inputs and outputs. You may have to enter device to both inputs and outputs and you'll have to make sure switch numbers are correct. that's about it, works flawlessly.
    The script I'm using looks similar to yours. I actually found it on kennair.com via google. here's my Comm script:

    Code:
    //*********************************************
    //***** COMM 1 ********************************
    //*********************************************
    
    
    Var 1000 name Com1_act 
    
    Var 1002 name FS_C1_SB_BCD Link FSUIPC_INOUT Offset $311A Length 2 // FS COM1 standby frequency in BCD format 
    Var 1003 name FS_C1_ACT_BCD Link FSUIPC_INOUT Offset $034E Length 2 // FS COM1 active frequency in BCD format 
    { 
    &Com1_act = FROMBCD &FS_C1_ACT_BCD 
    CALL &OutCom1_Act 
    CALL &C1_LH_ROT_VAL // Align rotary with new C1 SB integer val 
    CALL &C1_RH_ROT_VAL // Align rotary with new C1 SB decimal val 
    CALL &C1_UPDATE_LHS 
    CALL &C1_UPDATE_RHS 
    CALL &OutCom1_SB 
    } 
    
    Var 1004 name FS_C1_SWAP Link FSUIPC_OUT Offset $3123 Length 1 // FS COM1 active standby swap 
    
    Var 1005 name C1_SB_AS_DEC // COM1 standby frequency in decimal format 
    Var 1006 name C1_SB_LHS // COM1 standby frequency integers 
    Var 1007 name C1_SB_RHS // COM1 standby frequency decimals 
    Var 1008 name C1_RHS_ROT_VAL // COM1 right hand rotary encoder ref value 
    Var 1009 name C1_LHS_ROT_VAL // COM1 left hand rotary encoder ref value 
    
    Var 1010 name ROT_C1_LHS Link IOCARD_ENCODER Device 1 Input 5 Aceleration 0 Type 2
    {
    L0 = &ROT_C1_LHS
    &C1_LHS_ROT_VAL = ROTATE 18 36 L0 
    CALL &C1_UPDATE_LHS 
    CALL &SET_FS_C1_SB 
    CALL &OutCom1_SB 
    } 
    
    Var 1011 name ROT_C1_RHS Link IOCARD_ENCODER Device 1 Input 7 Aceleration 0 Type 2 
    { 
    L0 = &ROT_C1_RHS
    &C1_RHS_ROT_VAL = ROTATE 0 39 L0 
    CALL &C1_UPDATE_RHS 
    CALL &SET_FS_C1_SB 
    CALL &OutCom1_SB 
    } 
    
    Var 1012 name SW_C1_SWAP Link IOCARD_SW Device 1 Input 11 Type 1 // Active/Standby swap button
    { 
    &FS_C1_SWAP = TOGGLE 3 
    }
    
    Var 1015 name SW_C1_TEST Link IOCARD_SW Device 1 Input 10 // COMM TEST button sends 8's to Displays
    {
    IF &SW_C1_TEST = 1
       {
        &DISP_C1_ACT = 88888
        &DISP_C1_SB = 88888
       }
    ELSE
       {
        CALL &OutCom1_Act
        CALL &OutCom1_SB
       }
    }
    
    
    Var 1020 name DISP_C1_SB Link IOCARD_DISPLAY Device 1 Digit 5 Numbers 5 // Standby decimals
    
    Var 1021 name DISP_C1_ACT Link IOCARD_DISPLAY Device 1 Digit 11 Numbers 5 // active display 
    
    Var 1022 name C1_DP Link IOCARD_OUT Device 1 Output 20 // Decimal Point
    Var 1023 name C1_DPS Link IOCARD_OUT Device 1 Output 21 // Decimal Point
    
    Var 1030 name C1_LH_ROT_VAL Link SUBRUTINE // Aligns LH rotary ref with COM1 SB freq 
    { 
    L0 = FROMBCD &FS_C1_SB_BCD 
    L1 = L0 / 100 
    &C1_LHS_ROT_VAL = TRUNC L1 
    } 
    
    Var 1031 name C1_RH_ROT_VAL Link SUBRUTINE // Aligns RH rotary ref with COM1 SB freq 
    { 
    L0 = FROMBCD &FS_C1_SB_BCD 
    L1 = &C1_LHS_ROT_VAL * 100 
    L2 = L0 - L1 
    &C1_RHS_ROT_VAL = L2 / 2.487179 
    } 
    
    Var 1032 name C1_UPDATE_LHS Link SUBRUTINE // Update COM1 stanby integers 
    { 
    &C1_SB_LHS = &C1_LHS_ROT_VAL 
    } 
    
    Var 1033 name C1_UPDATE_RHS Link SUBRUTINE // Update COM1 standby decimals 
    { 
    L0 = &C1_RHS_ROT_VAL * 2.5 
    &C1_SB_RHS = TRUNC L0 
    } 
    
    Var 1034 name SET_FS_C1_SB Link SUBRUTINE // Update COM1 standby frequency in FS 
    { 
    L0 = &C1_SB_LHS * 100 
    L1 = L0 + &C1_SB_RHS 
    &FS_C1_SB_BCD = TOBCD L1 
    } 
    
    Var 1040 name OutCom1_Act Link SUBRUTINE 
    { 
    &C1_DP = 1 
    L0 = &Com1_act 
    &DISP_C1_ACT = L0 + 10000 
    } 
    
    Var 1041 name OutCom1_SB Link SUBRUTINE 
    { 
    
    &C1_DPS = 1 
    L0 = &C1_SB_LHS * 100 
    L1 = L0 + &C1_SB_RHS 
    &DISP_C1_SB = L1 + 10000 
    }

  5. #5
    75+ Posting Member
    Join Date
    Jun 2012
    Location
    New Orleans, LA
    Posts
    130
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Rotary Encoder Double 'clicking'

    Tried that script from Nico but had the same result. I'll need to email ProSimParts but I'm starting to think maybe the encoders are not the "gray" type and I will need an encoder board for them.

  6. #6
    500+ This must be a daytime job



    Join Date
    Jan 2007
    Location
    NEW ZEALAND
    Posts
    867
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Rotary Encoder Double 'clicking'

    Hi nolatron,
    Opencockpits M/C inputs for encoders are very fussy. Best to use here are the CTS288 .Anything else very questionable.
    Even the encoders card can be funny also.
    Les

  7. #7
    Our new friend needs to reach 10 posts to get to the next flight level
    Join Date
    Aug 2012
    Location
    United States
    Posts
    8
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Rotary Encoder Double 'clicking'

    I have lots of encoders laying around. Even cheap 40 cent ones. None of them work with the Master Card. Only one that works are the CTS288.

    However, ALL my encoders work with the Leo Bodnar input card. Even the cheap 40 cent ones.

    I myself was looking into prosimparts set (comm, Nav, ADF, transponder) but if they are not using cts2888, I'm not so sure.

  8. #8
    10+ Posting Member
    Join Date
    Sep 2010
    Location
    USA
    Posts
    23
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Rotary Encoder Double 'clicking'

    Oh, I have had so many problems with encoders. 1/2 clicks, double clicks, random clicks, too fast, too slow, etc. Even one PCB to the next sometimes act differently. I had enough so I designed my own "encoder decoder" that has solved this seemingly never-ending headache (for me at least). Now I have reliable outputs both at faster and slow rates, true and inverted logic, and buffered in and out drive. If anyone is interested, I sell a small PCB or can even sell the chip itself. See my website under products:

    ATSimulation » Page 1 of 7

    But here is my advice through trail and error with these @@#$%! devices.

    1. Not all manufacturers make great encoders. Some are noisy suckers.
    2. Some are really unreliable and improper soldering will warp the internal wipers just enough to make you nuts.
    3. Filtering. It's all about the filtering. Your code has got to properly filter the inputs. All switch contacts "bounce".
    4. XORing the logic can create false outputs especially if you use interrupts. You have to trap error states.
    5. Signal integrity. Long wires from the encoder to the decoder can be a bad thing. They will pickup noise if you are not careful.
    6. Finally, you have to know the output codes for each switch transition and "click".

  9. #9
    Our new friend needs to reach 10 posts to get to the next flight level
    Join Date
    Aug 2012
    Location
    United States
    Posts
    8
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Rotary Encoder Double 'clicking'

    Pilotgil, is that $29 PER Encoder? seems like it would get pricey............fast.

    To Nolatron. I wonder if you can use something like the Leo Bodnar input card ($50) for the Encoders only. It will handle 16 Encoders.
    Then you can use a script for displays and button inputs. I know it sucks to add even more input cards but it might be what's needed.

  10. #10
    10+ Posting Member
    Join Date
    Sep 2010
    Location
    USA
    Posts
    23
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Re: Rotary Encoder Double 'clicking'

    In my opinion, it all depends on your design objectives. For example, if you are designing an integrated radio stack, it makes sense to buy an integrated card to handle the various encoders. However, I found that what I usually ended up with was with cards with unused inputs, a rats nest of wires running from one side of the sim to the other, in order to use some unused input. Also, I found with the long wires, besides wires everywhere, noise problems, reliability problems, and general frustration. This was my experience and yours may be different. I really dislike wires and my objective is to have a processed, clean, low impedance signal to a local interface card.

    Good luck!

Page 1 of 3 123 LastLast