Page 2 of 3 FirstFirst 123 LastLast
Results 11 to 20 of 23
  1. #11
    75+ Posting Member cscotthendry's Avatar
    Join Date
    Dec 2006
    Location
    Russell Island Australia
    Posts
    127
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Hi guys:

    Just thought I'd weigh in with my 2 cents worth. Rotary encoders can be a bit tricky to interface if you're writing the microcontroller code yourself. Check out Mike Powell's book or website for some tips about them.

    With rotary encoders there are two types that I call dynamic and static. The dynamic types give multiple waveform edges per detent and the static ones give one waveform step per detent. Your interfacing code will need to be written a to suit the type you have.

    Nigel: Here's a tip that may help you with your soldering. Put a bit of wet (very wet) sponge in a tray near where you keep your soldering iron. Then just before you do a joint, give the iron tip a wipe on the sponge and you should see the tip become bright and shiny. This will help transfer the heat from the iron tip to the solder. Then, when you're soldering the joint make sure you have the iron in contact with both items being soldered. Wait a second or so for the heat to transfer and then apply the solder where all three things (Iron, board and component lead) meet. The main thing is speed. Get in get the solder flowing on the joint and get out. Most things that are solderable will tolerate some heat, but not forever.

    If you clean the tip of the iron before every joint, you'll probably get a lot better results and more quickly.

    Great work with the rotary encoders.
    Regards: Scott Hendry
    www.scotthendry.com

  2. #12
    500+ This must be a daytime job



    Join Date
    Jul 2013
    Posts
    917
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Darryl

    You are correct that the microprocessor code on your I/O reads the direction of the encoder turns and according to your software will pass the parameters to FS through FSUIPC. I believe it is also possible to code it such that large movements will provide a greatre inc/dec.

    Encoders with integral push switches are readily available from mouser.com or the Opencockpits sites

    Just one word of caution - make sure that the detents/cycle of your encoders is suitable for your controller, especially if you use the Opencockpits master boards.

    Regards

    David

  3. #13
    Our new friend needs to reach 10 posts to get to the next flight level
    Join Date
    Feb 2009
    Location
    uk
    Posts
    6
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Talking

    Quote Originally Posted by fordgt40 View Post
    Darryl

    You are correct that the microprocessor code on your I/O reads the direction of the encoder turns and according to your software will pass the parameters to FS through FSUIPC. I believe it is also possible to code it such that large movements will provide a greatre inc/dec.

    Encoders with integral push switches are readily available from mouser.com or the Opencockpits sites

    Just one word of caution - make sure that the detents/cycle of your encoders is suitable for your controller, especially if you use the Opencockpits master boards.

    Regards

    David


    David I'll most likely be using the Atmel range of processors but haven't determined which ones will be suitable. I'll have to have a bit of a google search and find out which ones are, I'm guessing it comes down to the resolution of the inputs. Oh and I won't be using FSUIPC at this stage as my project is with X-Plane

    At a later date once I get a project completed I might try porting what I do to FS.

    Darryl

  4. #14
    1000+ Poster - Fantastic Contributor
    Join Date
    Nov 2008
    Location
    Europe
    Posts
    1,934
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Can i just ask how you 'pass through' a rod through another encoder? is there a hole already there for you to pass it through, or is there drilling involved as, from the pic on ebay, everything seems to be solid and sealed.

    Any suggestions on this?

    Cheers guys!

    Alex

    P.s.... do you just wire the encoders to your card (i have the bu0836 (not x))
    i dont understand this code business and run it through FSUIPC?

    Again many thanks!
    GA or the Highway!

  5. #15
    500+ This must be a daytime job



    Join Date
    Jul 2013
    Posts
    917
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Alex

    There are at least 4 ways of getting a dual encoder:-

    1. Buy one
    2. Carefully dissamble the encoder and drill through the shafts
    3. Buy encoders without shafts and make your own to fit
    4. Use gears being driven off concentric shafts.

    With regard to connecting them up via Leo Bodnar`s card, I suggest you refer to Ian Sissons site, where he also shows how to adapt rotary switches to simulate encoders.

    Reference to I/O software and FSUIPC is where you wish to pass h/w information deriving from the actions of encoders eg heading, nav freq etc to FS. I am not versant with the facitlities of Leo Bodnars card, as in my case, I am using the SIOC software and FSUIPC to interface my h/w with FS.

    Regards

    David

  6. Thanks No Longer Active thanked for this post
  7. #16
    300+ Forum Addict


    brianwilliamson's Avatar
    Join Date
    Oct 2005
    Location
    Gold Coast-AUSTRALIA
    Posts
    455
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Just found this turorial which is very good for those wishing to make their own duals.
    http://air-cockpit.superforum.fr/aut...deurs-t680.htm
    Regards...............Brian W.

  8. Thanks wannabeaflyer thanked for this post
  9. #17
    1000+ Poster - Fantastic Contributor
    Join Date
    Nov 2008
    Location
    Europe
    Posts
    1,934
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Cheers Brian!

    Thats an excellent tutorial!

    Alex
    GA or the Highway!

  10. #18
    25+ Posting Member
    Join Date
    Nov 2008
    Location
    Leeds, England
    Posts
    33
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Hi Guys.
    That is a very nice tutorial, never seen that before.
    That's a very tidy piece of engineering but a bit too complicated for me.
    I just need it to work for now.
    I just carefully drilled a 2.5mm hole through the entire encoder with a cordless drill.
    I took one to pieces first to make sure I wasn't going to damage anything.
    The encoders I use have a plastic shaft so, they are very easy to drill.
    Then I just pass a 2mm brass rod through the top encoder into the bottom one.
    It takes about 5 minutes to make each unit.

    As for the earlier questions about code and things, I don't know anything about code. I intend to learn but for now, anything I make has to fit into an interface of some sort and work straight away.

    Thanks.
    Paul.

  11. #19
    Our new friend needs to reach 10 posts to get to the next flight level
    Join Date
    Feb 2009
    Location
    uk
    Posts
    6
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    I placed an order for the 10 encoders that are on eBay that Colaboy recommended. At the moment I'm still waiting on my encoders to arrive and should be here this week. I've also found my STK500 Atmel Dev Kit and got that up and running via USB to Serial (my laptop has no serial interface). So I have no practical experience with encoders (both absolute and relative types). What I would like to know is how many positions do the encoders that Colaboy mentioned have? From what I can gather from the technical information on the listing is that they're a 2bit Graycode, does that mean they're only a 4 position encoder or am I missing something here?

    Colaboy have you actually got these encoders working with an LCD display so that when you rotate the encoder it adjusts an angle from 1-360deg with 1deg increments? As I was looking at using encoders for making an MCP to adjust course, heading, altitude, vs, ias etc. Although for altitude, vs, ias I'd most likely use an incremental/relative encoder.

    Anyway if you could get back to me on this it'd be greatly appreciated as I'm trying to get my head around them before I get a hold of one to play with.

  12. #20
    75+ Posting Member cscotthendry's Avatar
    Join Date
    Dec 2006
    Location
    Russell Island Australia
    Posts
    127
    Contribute If you enjoy reading the
    content here, click the below
    image to support MyCockpit site.
    Click Here To Contribute To Our Site

    Hi:

    With encoders, the information you get is whether the encoder is being turned clockwise or counterclockwise rather than the absolute position. In response to that, the software increments or decrements something, say the heading degrees.

    Some encoders give the full 4 step grey code for one "click" position and some give only one state transition. The ones that give the full 4 steps are pretty easy to spot if you hook up an ohmmeter to them (if they're mechanical contacts) you'll see an open circuit between the "A" side and the common as well as between the "B" side and the common. The ones that give only one step per click will have a connection between the A side or the B side when not being moved.

    If they're optical encoders, you may have to do a little circuit with some resistors to see what the encoder is doing.

    In either case the grey code does this

    A 0 0 1 1 0
    Common
    B 0 1 1 0 0

    Where a "1 in the table means that side is connected to the common. The thing that makes the grey code special is that between any two states, only one bit changes. This is different from normal binary.
    Grey code________ Binary
    A B_____________ A B
    0 0_____________ 0 0 State 0
    0 1_____________ 0 1 State 1
    1 1_____________ 1 0 State 2 (2 bits change with binary)
    1 0_____________ 1 1 State 3
    0 0_____________ 0 0 State 0 (2 bits change with binary)

    (Sorry bout the underlines, the text editor stripped out my spacing)

    If you look at the grey code table and imagine proceeding in one direction or the other, you can tell from the bit changes which way you are going through the table, and consequently which way the encoder is being turned. For example: If the current state is 01 and the previous state was 00, then you're moving down the table. If the previous state was 11 then you're moving up the table.

    You just need to figure out the correlation between the grey code sequence and the direction of the encoder.

    BTW (warning: shameless plug) there's a really good writeup about encoders and some example PIC code in Mike Powell's book.
    Regards: Scott Hendry
    www.scotthendry.com

Page 2 of 3 FirstFirst 123 LastLast

Similar Threads

  1. Dual Rotary Encoder in SIOC
    By 737dragon in forum OpenCockpits General Discussion
    Replies: 0
    Last Post: 09-13-2010, 05:01 AM
  2. I can't remember where I saw a dual rotary encoder
    By Doon1 in forum General Aviation (GA) Builder Disccusion
    Replies: 0
    Last Post: 04-15-2010, 07:35 PM
  3. Dual encoder rotary pins
    By Fliegerbenny in forum Westozy's Mechanical Engineering
    Replies: 15
    Last Post: 11-16-2009, 01:28 PM
  4. Turning a Rotary encoder with a pushbutton into a dual rotary encoder
    By snizbatch in forum I/O Interfacing Hardware and Software
    Replies: 2
    Last Post: 05-11-2009, 02:57 AM
  5. Dual Rotary Encoder
    By Algarve737NG in forum General Builder Questions All Aircraft Types
    Replies: 6
    Last Post: 01-27-2009, 12:52 PM