PDA

View Full Version : £3 Dual Rotary Encoder



colaboy
01-02-2009, 04:03 PM
Hi everyone.
Just made my first dual rotary encoder for £3.
Works perfectly with my BU0386X.
This might not mean much to most but, on a tight budget, this is a bit like winning the lottery!
One down, seven to go.

Thanks.
Colaboy.

NigelD
01-02-2009, 06:04 PM
Hi Colaboy,
Well done on the dual encoder. I've been watching some of your threads with great interest as we seem to betackling similar problems at the same time.

I cannot get a SINGLE encoder sorted as yet! Went out today after I got home from Ireland and raided Maplin for a soldering iron and a few bits. It's rubbish. Won't even melt solder on direct contact with the tip, never mind solder anything TO anything else. I'm a bit depressed about it as I will have to wait until 20JAN before I can get a better one and have another crack at the encoders.

Oh well, 2009 is in with a predictable start!

Nigel.

fordgt40
01-02-2009, 07:33 PM
Colaboy

A neat practical solution, presumably using a cut off from an aluminium box section - I wish I had seen this earlier!! I made mine using plasticard and stand off pillars, however, your solution takes some beating

Well done and I know how you feel when it all works out

Regards

David

Hessel Oosten
01-03-2009, 04:31 AM
As an addendum on the remark about using a short part of an (aluminium) profile.
See pic's. This profile is 3 cm. Look also to the cuts in the aluminium to let the second "rotary" inside, (otherwise it will not fit).

Hessel

colaboy
01-03-2009, 08:45 AM
Hi guys, thanks for the comments.

Nigel.
Tough luck mate, frustrating isn't it.
I strugled with soldering for three years or more, just because I was doing it wrong.
Keep checking the Maplin website for this part number N78AR Looks expensive at the moment but every couple of months or so, they sell it for £9.99. If your soldering skills are a bit short of the mark as mine are, it's a very flexible unit.

David.
Thanks for that.
I was looking for a cheap source of ali box section and I suddenly had a brain wave.
A spirit level from a pound shop!!!
Just cut 25mm pieces of the ends with a hack saw. Doesn't get much simpler than that does it?
I'm really pleased with how they turned out.

Hessel.
I'm using encoders rather than switches, so not a problem for me.
Good advice none the less though.
Thanks man.

Again, thanks to everybody for the comments and feedback.

Cheers.
Colaboy.

NigelD
01-03-2009, 10:47 AM
Hi Colaboy (and friends),
Well, after more than a few attempts and a bit more research (why do I always do the research last?!?) I managed to do a spot of soldering. I don't know why it's working intermittently for me - guess the technique still needs a lot of refinement!

But I have made a working encoder and connected it to my BU0836X card. This for me is a BIG step forward! Need to work on the soldering a bit now, but the trepidation I have felt so far has faded a little.

Small victories, people!

Nigel.

colaboy
01-03-2009, 06:17 PM
Hi Nigel.
Nice work my friend.
Small victories they may be, but they all add up. :-D
I'm going to crack on with my radio panel next, then a replica 737NG throttle quad.
It's going to take for ever but it'll be worth it when it's finished.

Cheers.
Colaboy.

raster74
02-18-2009, 01:30 PM
Hi everyone.
Just made my first dual rotary encoder for £3.
Works perfectly with my BU0386X.
This might not mean much to most but, on a tight budget, this is a bit like winning the lottery!
One down, seven to go.

Thanks.
Colaboy.


Was that £3 the costs just to convert two single encoders into dual or the total cost including the two single encoders? If it's the total costs could you tell us where you got hold of the encoders for so cheap.

Cheers
Darryl

colaboy
02-21-2009, 09:15 AM
Hi Darryl.
That was including the encoders.
I got them from ebay.
Here is the item number 180330342489
Hope that works.
They work out at £1 each.
They work really well with the Leo Bodnar BU0836X.
I use them for my MCP and EFIS as well.
They take a couple of weeks to get here from china but they are well worth the wait at that price.

Thanks.
Paul.

raster74
02-21-2009, 07:31 PM
Hi Darryl.
That was including the encoders.
I got them from ebay.
Here is the item number 180330342489
Hope that works.
They work out at £1 each.
They work really well with the Leo Bodnar BU0836X.
I use them for my MCP and EFIS as well.
They take a couple of weeks to get here from china but they are well worth the wait at that price.

Thanks.
Paul.

Thanks Paul for getting back to me. These encoders are amazingly good price, at first I thought it was one for 9.99 and then it clicked it was for multiple.
I'll definately be looking at ordering some of these and attempting to get them working with my Atmel STK500 kit.

I'm new to the use of encoders but understand they're used for setting the heading bug, whole number/decimal frequency adjustments for nav/com/adf etc.
I know there are all diferent types such as mechanical absolute, incremental etc. I believe the ones for sale on this website are mechanical absolute and provide
a set number of detents/pulses per revolution (usually something such as 10, 30, 60, 100 etc). So if there are 30 detents/pulses per revolution that means each detent is 12deg.
However as you know the heading bug is an angle and that will be from 0-360deg. So don't we need an encoder that has 360 detents/pulses per revolution or am I missing something here?
Do we overcome this by writing code in a microprocessor that monitors the encoder and depending on the RPM that it is turned at increments the associated variable at a faster speed (eg. instead of 1deg it changes at 10deg).
Or am I missing something here?

Also what do you do for the heading dials on an MCP such as that on a 737 where it has a selector switch for bank angle, encoder for direction and I believe a push button to set (not 100% on the button)? Most threads that I've seen so far look at making dual encoders and not an encoder + selector switch.

Something I was looking at making was something similar to the new Saitek Instrument Panels that are coming out. OLED displays are quite cheap to purchase and these encoders would be great to use with them.

Regards
Darryl

cscotthendry
02-22-2009, 02:30 AM
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.

fordgt40
02-22-2009, 04:46 AM
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

raster74
02-22-2009, 07:08 AM
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 :twisted:

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

Darryl

No Longer Active
02-22-2009, 08:07 AM
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!

fordgt40
02-22-2009, 08:22 AM
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

brianwilliamson
02-22-2009, 07:08 PM
Just found this turorial which is very good for those wishing to make their own duals.
http://air-cockpit.superforum.fr/autres-f10/tutoriel-concernant-la-realisation-de-double-encodeurs-t680.htm
Regards...............Brian W.

No Longer Active
02-23-2009, 08:54 AM
Cheers Brian!

Thats an excellent tutorial!

Alex

colaboy
02-23-2009, 03:12 PM
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.

raster74
03-01-2009, 09:41 AM
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.

cscotthendry
03-01-2009, 04:11 PM
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.

raster74
03-02-2009, 01:27 PM
Well I've just pulled apart my old Alpine fascia as I no longer have the base unit (wrecked in a car accident). Looking at stripping out the decoder, illuminated momentary pushbuttons (SMC), and the LCD display. Unfortunately it's not a graphical LCD/OLED and is proprietary as you can see all of the radio related parts of it (eg. DX, NEWS etc). However the alphanumeric part of it might come in hand for experimenting with ideas (if I can figure out the pin configuration).

raster74
03-02-2009, 06:43 PM
The encoder and smc pbs are salvagable but the LCD I think cannot as it seems integrated with the PCB.

P1IC
03-13-2009, 05:52 PM
This may be a bit late, but you can get rotary encoders, complete with integral push switch and a knob, on eBay for £1 each, delivered, from Sure Electronics.