Page 4 of 15

Re: Sky9x Rotaty Encoder Option

Posted: Wed Aug 15, 2012 12:51 am
by android78
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.

Re: Sky9x Rotaty Encoder Option

Posted: Wed Aug 15, 2012 2:00 am
by Iksbob
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. ^_^

Re: Sky9x Rotaty Encoder Option

Posted: Wed Aug 15, 2012 3:07 am
by android78
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.

Re: Sky9x Rotaty Encoder Option

Posted: Wed Aug 15, 2012 7:21 pm
by MikeB
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.

Re: Sky9x Rotaty Encoder Option

Posted: Thu Aug 16, 2012 3:52 am
by Hippo
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.
Turned out to be easier to make a board than I thought
Turned out to be easier to make a board than I thought
IMG_4021.JPG
IMG_4022.JPG
IMG_4023.JPG

Re: Sky9x Rotaty Encoder Option

Posted: Thu Aug 16, 2012 4:01 am
by Iksbob
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.

Re: Sky9x Rotaty Encoder Option

Posted: Thu Aug 16, 2012 4:07 am
by kaos
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?

Re: Sky9x Rotaty Encoder Option

Posted: Thu Aug 16, 2012 4:36 am
by Hippo
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

Re: Sky9x Rotaty Encoder Option

Posted: Thu Aug 16, 2012 11:22 am
by Rogue3
For some reason I can't PM; so could iksbob (or hippo) count me in for 2?

Re: Sky9x Rotaty Encoder Option

Posted: Thu Aug 16, 2012 12:26 pm
by Kilrah
You should be able now, need at least 2 accepted posts to PM to avoid spamming.

Re: Sky9x Rotaty Encoder Option

Posted: Thu Aug 16, 2012 5:22 pm
by Hippo
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

Re: Sky9x Rotaty Encoder Option

Posted: Thu Aug 16, 2012 6:35 pm
by Iksbob
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.

Re: Sky9x Rotaty Encoder Option

Posted: Thu Aug 16, 2012 8:12 pm
by preston91
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

Re: Sky9x Rotaty Encoder Option

Posted: Thu Aug 16, 2012 8:16 pm
by Kilrah
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?

Re: Sky9x Rotaty Encoder Option

Posted: Thu Aug 16, 2012 8:19 pm
by preston91
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

Re: Sky9x Rotaty Encoder Option

Posted: Thu Aug 16, 2012 8:52 pm
by Crucial
I ordered these for the header pins.

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

Re: Sky9x Rotaty Encoder Option

Posted: Thu Aug 16, 2012 8:53 pm
by Crucial
I'd be down for 2 boards.

Re: Sky9x Rotaty Encoder Option

Posted: Thu Aug 16, 2012 9:00 pm
by PNaz
I would like 2 boards

Paul

Re: Sky9x Rotaty Encoder Option

Posted: Fri Aug 17, 2012 5:49 am
by DHDSP
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$!).

Re: Sky9x Rotaty Encoder Option

Posted: Fri Aug 17, 2012 6:10 am
by Suncoaster
I will take 2 also

David

Re: Sky9x Rotaty Encoder Option

Posted: Fri Aug 17, 2012 3:36 pm
by Hippo
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.

Re: Sky9x Rotaty Encoder Option

Posted: Fri Aug 17, 2012 4:39 pm
by DHDSP
Hi Dan,

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

TIA
Peter

Re: Sky9x Rotaty Encoder Option

Posted: Fri Aug 17, 2012 4:54 pm
by Iksbob
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.

Re: Sky9x Rotaty Encoder Option

Posted: Fri Aug 17, 2012 8:26 pm
by Kilrah
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 :)

Re: Sky9x Rotaty Encoder Option

Posted: Sat Aug 18, 2012 6:47 am
by iwik
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

Re: Sky9x Rotaty Encoder Option

Posted: Sat Aug 18, 2012 10:40 pm
by jhsa
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.

Re: Sky9x Rotaty Encoder Option

Posted: Sat Aug 18, 2012 10:45 pm
by Kilrah
Only sky9x at this point, but Mike had some ideas... 8-)

Re: Sky9x Rotaty Encoder Option

Posted: Sat Aug 18, 2012 10:46 pm
by MikeB
Maybe you can't see the picture, but see viewtopic.php?f=7&t=1084&start=60#p19996.

Mike.

Re: Sky9x Rotaty Encoder Option

Posted: Sat Aug 18, 2012 11:04 pm
by jhsa
thanks Mile, that answers my question i guess. Great news. It seems i'll be in for a couple of boards as well. ;)

Re: Sky9x Rotaty Encoder Option

Posted: Sun Aug 19, 2012 1:37 am
by kaos
jhsa: Your rehab is a total failure. :lol: