Sky9x Rotary Encoder Option

ersky9x is a port of er9x for use on the sky9x board.
android78
Posts: 16
Joined: Mon Jan 09, 2012 8:01 pm
Country: -

Re: Sky9x Rotaty Encoder Option

Post by android78 » Wed Aug 15, 2012 12:51 am

MikeB wrote:We should be able to read it every 10mS (100 per second). The encoder in this thread only gives 24 steps per revolution, so we should be able to handle uo to 4 revs/second, can you turn it that fast?

Mike.
The main problem I see with reading the state at discrete times, as opposed to using an interrupt is that at certain speeds, you will miss steps of the quadrature. So the usual steps for three quadrature in one direction are 0,1,3,2,0,1,3,2,0,1,3,2. So you may end up reading 0,3,2,1,2,0,3 (or something similar), and I don't know how the program would interpret this.
My suggestion of using a counter chip, means that it could be read maybe 10 times a second and it would know how many pulses were counted very efficiently. Using a small micro would be just as easy and could be considered part of the hardware addon required for the encoder with a static program that doesn't change, and wouldn't need firmware upgrading once implemented. Lets face it, it would only be a handful lines of code to have two interrupt pins calling an interrupt that either increments or decrements a counter, then outputs this value before resetting to 0 when polled through I2C.

Iksbob
Posts: 121
Joined: Wed Dec 28, 2011 1:06 pm
Country: -

Re: Sky9x Rotaty Encoder Option

Post by Iksbob » Wed Aug 15, 2012 2:00 am

Well, using a quadrature decoder and counter chip could mean it gets read constantly. There would be some speed limitation due to rise/fall times on the wiring and chip IO pins, but that'd probably be a matter of a few uS. The main processor could then periodically check the value on the counter, find the difference between the current and previous values, and apply the delta value as needed. It works great so long as you have a port of I/O pins to dedicate to reading each encoder/counter assembly. An IO expander chip could step in, but we're now talking about 3 ICs with their associated inter-wiring, per encoder. Something smaller and simpler is needed.
The above can be emulated in software on a microcontroller, though you're then introducing polling time limitations - how often can the controller get around to checking the pins while running its program? Giving each encoder its own micro controller would be the closest you could get, as the controller would have nothing else to do but check the pins, until the pin states changed. Rather than send increment/decrement pulses that the main processor might miss, the controller could keep a running tally (just like the counter chip) and send that value to the main processor when requested. Practically speaking, I doubt the encoder could outrun its processor with this kind of setup. The only downsides I see are cost (probably not an issue - SOIC8 ATtiny chips are about $1) and wiring complexity (also probably not an issue - a 4 wire harness to each encoder with power, ground, SCL and SDA signals).

As much as I would like to see a bigger IO expander co-processor type of thing which handles multiple encoders, this simple chip-per-encoder setup makes sense to me. I2C supports multiple addresses, so putting more devices on the same two serial lines is not a problem. Getting I2C set up for the simple encoder chips would leave the door open for future, more complex additions as well. We could put the navigation encoder and 4 trim wheel encoders on the same two serial lines just by giving them different addresses (programmable by jumpers perhaps, so the code on the encoder chip doesn't have to change). Certain addresses could be dedicated to certain functions in the main program, so you get a new encoder unit, set a couple jumpers, and it the main program recognizes it as a navigation wheel, or a rudder trim wheel, or whatever.

I'll stop there before my wall of text gets too high. ^_^

android78
Posts: 16
Joined: Mon Jan 09, 2012 8:01 pm
Country: -

Re: Sky9x Rotaty Encoder Option

Post by android78 » Wed Aug 15, 2012 3:07 am

Iksbob, I think we're on the same page here. Small, cheap micro that essentially just functions as a decoder step counter that can be read at any time. If we were going to do this though, may as well have the micro that can have 5 or 6 encoders and counters. If it's a processor dedicated to this then you wouldn't need to worry about interrupts or anything, just read port and xor each of the pairs of inputs and either increment, decrement or keep the counter associated with each encoder.

User avatar
MikeB
9x Developer
Posts: 14266
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset

Re: Sky9x Rotaty Encoder Option

Post by MikeB » Wed Aug 15, 2012 7:21 pm

Depending on the specific encoder, we don't actually need to read it at the uS speed level. reading every 10mS allows for up to 100 changes per second of the encoder outputs. This worked fine on the ersky9x board with an encoder that changes the state by just 1 step for eack 'click'. It is only the encoder that changes state 4 times for 1 'click' that meant I needed to use an interrupt.
If we are looking at this C&K multi-function enacode/switch, I still reckon polling every 10mS will work fine. If you move it really fast, it may just be possible a step will be mised, but I don't think you will notice it anyway. If you are trying to set a value, you will most likely be moving it relatively slowly when you get close to tthe value you want, so it won't miss anything anyway.

Mike.
ersky9x/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

Hippo
Posts: 48
Joined: Thu Mar 15, 2012 4:37 pm
Country: -

Re: Sky9x Rotaty Encoder Option

Post by Hippo » Thu Aug 16, 2012 3:52 am

I got my board made up today. After setup, it took literally 1 minute on the CNC, (I have a Shopbot, and used a .032 cutter to cut the traces, outlines, and drill the holes in one step) so I would be willing to make a few for people, if it's alright with Iksbob. Of course somebody is gonna have to point me to some 1 sided PCB material. I got 2-sided from radio shack, and I had to sand off the back side. A pain.

Not my neatest soldering job ever, but I made the holes for the posts only go partway through to keep the back side neat.
IMG_4020.JPG
Turned out to be easier to make a board than I thought
IMG_4021.JPG
IMG_4022.JPG
IMG_4023.JPG


Iksbob
Posts: 121
Joined: Wed Dec 28, 2011 1:06 pm
Country: -

Re: Sky9x Rotaty Encoder Option

Post by Iksbob » Thu Aug 16, 2012 4:01 am

Wow... Very clean compared to my Dremel cutting work. Yeah, I'm going to go ahead and declare that design public domain (after all, it's just a glorified jumper board). So anyone that wants to make these PCBs, feel free. Sell em? Go for it. Just don't try to stop others from doing the same.
As for my etched boards, I printed out some additional transparencies so I can expose 4 boards at a time. However, between work, eating, and sleeping, I haven't gotten to actually processing any boards yet. I would do some at work, but I don't think they would appreciate me bringing in containers of hazardous, corrosive chemicals. I'm off tomorrow, so I'll do some if nothing major comes up. I've gotten PMs for 15 or so, but I don't think I have enough single-sided PCB for that. I ordered some more and will send out etched boards in the order they were requested.
Last edited by Iksbob on Thu Aug 16, 2012 4:11 am, edited 1 time in total.

User avatar
kaos
Posts: 3247
Joined: Wed Dec 28, 2011 1:15 am
Country: United States

Re: Sky9x Rotaty Encoder Option

Post by kaos » Thu Aug 16, 2012 4:07 am

Count me in for 3. I don't mind to pay for the wear and tear of your drill bit and other costs. ;)

How about put an engraving on the back with the CNC (if not too much trouble) saying:
designer: Iksbob producer: Hippo
:mrgreen:

question: How do you guys make those soldered pins so accurately to land just right on the board at the same time?

Hippo
Posts: 48
Joined: Thu Mar 15, 2012 4:37 pm
Country: -

Re: Sky9x Rotaty Encoder Option

Post by Hippo » Thu Aug 16, 2012 4:36 am

As for the pins, I sort of cheated. I took the whole double row of pins, and pushed one down so it fit into the hole in the board. The remaining pins rested on the board and kept it straight. After soldering, I pulled the plastic off that pin and did the next one. The depth was constant due to my partially drilled holes and it was straight due to the support.

I thought about making a jig to hold the pins straight but didn't bother. Though I considered it. Trust me, with a cnc, anytime you can make a part instead of doing something by hand it's worth it, even if I only used it once.

I'll see if I can track down some one sided material.

Dan

Rogue3
Posts: 19
Joined: Fri Jul 13, 2012 6:56 am
Country: -

Re: Sky9x Rotaty Encoder Option

Post by Rogue3 » Thu Aug 16, 2012 11:22 am

For some reason I can't PM; so could iksbob (or hippo) count me in for 2?

User avatar
Kilrah
Posts: 9017
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Sky9x Rotaty Encoder Option

Post by Kilrah » Thu Aug 16, 2012 12:26 pm

You should be able now, need at least 2 accepted posts to PM to avoid spamming.

Hippo
Posts: 48
Joined: Thu Mar 15, 2012 4:37 pm
Country: -

Re: Sky9x Rotaty Encoder Option

Post by Hippo » Thu Aug 16, 2012 5:22 pm

Looks like I can fit 44 boards on a 12"x12" sheet that I found on Amazon. So, if there's enough demand to pay for the materials, I'll order the blank board and get started.

It seems there's interest in 5 so far. I'd like to get to 10 before I start cutting. Maybe I should run the whole sheet and send the rest to SkyNorth.

One thing that concerns me. The original switches on the board were being pressed against the face of the board when the buttons were pressed. This setup will be pushing directly against the traces on the backside of the board. If anybody got too enthusiastic about their button presses, it could lift traces off the ersky board. I think we'll have to put a spacer between the two boards to take some of the load off. I was thinking of spongy stryofoam under pressure, but if there's too much pressure then it could rip the traces off the back side of the wheel board. Ideas?

Dan
PCB Layout.jpg

Iksbob
Posts: 121
Joined: Wed Dec 28, 2011 1:06 pm
Country: -

Re: Sky9x Rotaty Encoder Option

Post by Iksbob » Thu Aug 16, 2012 6:35 pm

Hippo wrote:Ideas?
Fill the space with hot glue? ^_^
Liberal application of flux will let the solder run up through the holes on the '9X board (they're through-plated) and cover the pad on the front side, providing support. I kind of doubt it's necessary though. There's 16 posts and the adapter PCB to keep everything square and distribute load. Yes, it may be possible to lift pads, but I expect the forces required would damage or destroy the direction switch/encoder assembly first.

preston91
Posts: 50
Joined: Tue Dec 27, 2011 10:02 pm
Country: -

Re: Sky9x Rotaty Encoder Option

Post by preston91 » Thu Aug 16, 2012 8:12 pm

It seems there's interest in 5 so far. I'd like to get to 10 before I start cutting. Maybe I should run the whole sheet and send the rest to SkyNorth.
Hippo did you get my pm? I'll take 3. I agree with iksbob with 16 pins supporting the pcb, you would have to be very aggressive to lift a trace. and a couple blobs of hot glue wouldn't hurt!!

Paul

User avatar
Kilrah
Posts: 9017
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Sky9x Rotaty Encoder Option

Post by Kilrah » Thu Aug 16, 2012 8:16 pm

Hippo wrote:It seems there's interest in 5 so far.
Add 2 for me.

Any chance you might have extra black encoders available to ship with them?

preston91
Posts: 50
Joined: Tue Dec 27, 2011 10:02 pm
Country: -

Re: Sky9x Rotaty Encoder Option

Post by preston91 » Thu Aug 16, 2012 8:19 pm

anyone got a mouser or digikey PN for the pins??

Hippo, I wouldn't worry about selling the PCB's anyone with an ersky bd will want one of these!

Paul

User avatar
Crucial
Posts: 581
Joined: Tue Dec 27, 2011 6:56 pm
Country: -
Location: SE WI, USA

Re: Sky9x Rotaty Encoder Option

Post by Crucial » Thu Aug 16, 2012 8:52 pm

I ordered these for the header pins.

http://www.digikey.com/scripts/DkSearch ... 18&cur=USD

User avatar
Crucial
Posts: 581
Joined: Tue Dec 27, 2011 6:56 pm
Country: -
Location: SE WI, USA

Re: Sky9x Rotaty Encoder Option

Post by Crucial » Thu Aug 16, 2012 8:53 pm

I'd be down for 2 boards.

PNaz
Posts: 142
Joined: Tue Dec 27, 2011 5:28 pm
Country: -
Location: Kaleden (Twin Lake), British Columbia

Re: Sky9x Rotaty Encoder Option

Post by PNaz » Thu Aug 16, 2012 9:00 pm

I would like 2 boards

Paul

DHDSP
Posts: 62
Joined: Mon Apr 23, 2012 12:48 pm
Country: -
Location: Germany

Re: Sky9x Rotaty Encoder Option

Post by DHDSP » Fri Aug 17, 2012 5:49 am

I'll take 2!

Like some others here, I'd be interested in the rotary enconder itself too.
I tried to find it here in Germany, but the cheapest was 20€ (almost 25$!).

Suncoaster
Posts: 185
Joined: Thu Dec 29, 2011 10:18 am
Country: Australia
Location: Cooloola Cove, Australia

Re: Sky9x Rotaty Encoder Option

Post by Suncoaster » Fri Aug 17, 2012 6:10 am

I will take 2 also

David

Hippo
Posts: 48
Joined: Thu Mar 15, 2012 4:37 pm
Country: -

Re: Sky9x Rotaty Encoder Option

Post by Hippo » Fri Aug 17, 2012 3:36 pm

I got the supplies ordered for the boards. I should be able to ship out mid next week. Depends on when the blank boards arrive. I'm not going to make any money on these, so the price is pretty reasonable.

PM me for PayPal info. (Unless pricing details are okay in this thread)

Thanks!
Dan

P.S. I might just go with Hot Glue. A little masking tape pre-applied will make everything removable in the future.

P.P.S. I don't know if I want to get crazy here, but if I'm already shipping a package, I might be talked into ordering some more wheels from Mouser.

DHDSP
Posts: 62
Joined: Mon Apr 23, 2012 12:48 pm
Country: -
Location: Germany

Re: Sky9x Rotaty Encoder Option

Post by DHDSP » Fri Aug 17, 2012 4:39 pm

Hi Dan,

concerning he P.P.S. : that would be great, I'd take 2 wheels to go with the boards !

TIA
Peter

Iksbob
Posts: 121
Joined: Wed Dec 28, 2011 1:06 pm
Country: -

Re: Sky9x Rotaty Encoder Option

Post by Iksbob » Fri Aug 17, 2012 4:54 pm

Sounds like you have a business opportunity knocking at your door, Hippo. If you can make boards for less than $3 a piece, I don't see why anyone would want unfinished etched boards. Heck, I might even order a few.

User avatar
Kilrah
Posts: 9017
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Sky9x Rotaty Encoder Option

Post by Kilrah » Fri Aug 17, 2012 8:26 pm

Hippo wrote:P.P.S. I don't know if I want to get crazy here, but if I'm already shipping a package, I might be talked into ordering some more wheels from Mouser.
I think we're 2 in the line already? :D

I checked, ordering them "locally" would cost me $20 a piece plus $17 shipping, kinda ridiculous obviously as they're ~$7 in the US. But shipping from Mouser/Digikey would be $35 plus potential customs charges, so just as bad in the end. And stupid, as those things could be shipped in a padded envelope for likely <$10, but those big companies don't care enough to do that...
So yeah, getting them with the boards would be very nice!

SkyNorth should stock the set too, maybe has more resources to do it :)

iwik
Posts: 115
Joined: Fri Feb 17, 2012 6:08 pm
Country: -
Location: NEW ZEALAND

Re: Sky9x Rotaty Encoder Option

Post by iwik » Sat Aug 18, 2012 6:47 am

Kilrah,
Nicely said, my sentiments exactly.
Hippo would not have to outlay to much if he waited till he had the money before buying.
Ive pm Hippo saying im also interested.
Les

User avatar
jhsa
Posts: 16434
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Sky9x Rotaty Encoder Option

Post by jhsa » Sat Aug 18, 2012 10:40 pm

difficult to follow the thread while i'm on holiday, so my question is: is this only for the ersky board or also for the stock board? Thanks.
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

User avatar
Kilrah
Posts: 9017
Joined: Sat Feb 18, 2012 6:56 pm
Country: Switzerland

Re: Sky9x Rotaty Encoder Option

Post by Kilrah » Sat Aug 18, 2012 10:45 pm

Only sky9x at this point, but Mike had some ideas... 8-)

User avatar
MikeB
9x Developer
Posts: 14266
Joined: Tue Dec 27, 2011 1:24 pm
Country: -
Location: Poole, Dorset

Re: Sky9x Rotaty Encoder Option

Post by MikeB » Sat Aug 18, 2012 10:46 pm

Maybe you can't see the picture, but see viewtopic.php?f=7&t=1084&start=60#p19996.

Mike.
ersky9x/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

User avatar
jhsa
Posts: 16434
Joined: Tue Dec 27, 2011 5:13 pm
Country: Germany

Re: Sky9x Rotaty Encoder Option

Post by jhsa » Sat Aug 18, 2012 11:04 pm

thanks Mile, that answers my question i guess. Great news. It seems i'll be in for a couple of boards as well. ;)
My er9x/Ersky9x/eepskye Video Tutorials
https://www.youtube.com/playlist?list=PL5uJhoD7sAKidZmkhMpYpp_qcuIqJXhb9

Donate to Er9x/Ersky9x:
https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=YHX43JR3J7XGW

User avatar
kaos
Posts: 3247
Joined: Wed Dec 28, 2011 1:15 am
Country: United States

Re: Sky9x Rotaty Encoder Option

Post by kaos » Sun Aug 19, 2012 1:37 am

jhsa: Your rehab is a total failure. :lol:

Post Reply

Return to “ersky9x”

Who is online

Users browsing this forum: rsilk49 and 5 guests