Sky9x Rotary Encoder Option

ersky9x is a port of er9x for use on the sky9x board.
User avatar
cre8tiveleo
Posts: 1434
Joined: Tue Dec 27, 2011 6:13 pm
Country: -
Location: Ontario,(GTA North)
Contact:

Re: Sky9x Rotaty Encoder Option

Post by cre8tiveleo » Sat Aug 11, 2012 10:11 am

I'm interested in a few etched boards. :)

Nice work!

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

Re: Sky9x Rotaty Encoder Option

Post by Iksbob » Sat Aug 11, 2012 3:41 pm

Alright. I'll have to look at actual material costs, but I don't expect it to be more than a buck or three per board, plus shipping. Everyone that wants etched but otherwise unfinished PCBs, PM me how many you want so I can get an idea of how many I need to make.

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 » Sun Aug 12, 2012 2:30 pm

I have 2 rotary encoders coming for Digikey. I would buy two boards from you if offered.

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

Re: Sky9x Rotaty Encoder Option

Post by preston91 » Sun Aug 12, 2012 11:15 pm

Iksbob
I'll take 3 of the pcb's I can drill and cut them out. Where can I get a header for the pins? radio shack?

Paul

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

Re: Sky9x Rotaty Encoder Option

Post by Iksbob » Mon Aug 13, 2012 12:13 am

Sadly, radio shack doesn't sell them. Most major mail-order electronics suppliers carry them, but they can be hard to find among the clutter on the really big sites (ahem... mouser, digikey).
For those that have asked or are curious, I'm using GC brand positive sensitized boards I picked up through Jameco electronics.


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

Re: Sky9x Rotaty Encoder Option

Post by Rogue3 » Mon Aug 13, 2012 11:14 am

As for production, I'll etch boards if people want them. On the other hand, cutting them out, drilling, soldering and such is looking like more work than I'm really interested in doing at this point...
I am interested in a 2 x pcb . Any ideas on timing?

Other
- Is there any interest on packaging a rotary encoder also? Shipping from digikey to Australia is around $35 which sort of makes this fairly expensive.
- for the avoidance of doubt, does this effective replace the separate rotary encoder?

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

Re: Sky9x Rotaty Encoder Option

Post by MikeB » Mon Aug 13, 2012 11:24 am

You got Farnell (Element14) in Aus? Try the part number TSWB-3N-CB222 there.

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

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

Re: Sky9x Rotaty Encoder Option

Post by android78 » Mon Aug 13, 2012 9:49 pm

That's a really nice job with the PCB. I was thinking just using some double sided tape and routing some thin wires to where they need to go.
How much space do you have between the sky9x board and the PCB for the encoder? Do you think that some of that 1mm thick double sided tape would be about right (or two layers), or does it need more then that?
Also, is this supported in the current firmware?

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

Re: Sky9x Rotaty Encoder Option

Post by MikeB » Mon Aug 13, 2012 10:03 pm

Provided the encoder connections are wired to the header on the ersky9x board, it should work fine.

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

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

Re: Sky9x Rotaty Encoder Option

Post by android78 » Mon Aug 13, 2012 10:49 pm

Thanks for the reply Mike.
So how is the input mapped to the settings? Is it used for menu navigation (as in mapped to scrolling up and down through the menu), or just for changing the settings?
Has anyone implemented rotary encoders for trim adjustments? I was thinking the best implementation would have them disabled by default and enabled by pressing them in. A single press would activate with a large change mode, double click for fine tuning mode. If not altered in 10 seconds, it would auto-disable.

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

Re: Sky9x Rotaty Encoder Option

Post by MikeB » Mon Aug 13, 2012 11:23 pm

The encoder does do certain menu selections, as well as value changes. A short press of the encoder switch is like the MENU button, a LONG press is like the EXIT button. Still a work in progress though.

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

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

Re: Sky9x Rotaty Encoder Option

Post by Iksbob » Tue Aug 14, 2012 4:28 am

android78 wrote:How much space do you have between the sky9x board and the PCB for the encoder?
About a centimeter. I took some pics last I had it all apart, but they're on my computer at home (at work right now ^_^). I'll post one up later, along with the quick vid of operation (though the encoder/center button isn't hooked up yet).
android78 wrote:Has anyone implemented rotary encoders for trim adjustments? I was thinking the best implementation would have them disabled by default and enabled by pressing them in. A single press would activate with a large change mode, double click for fine tuning mode.
I was thinking of having them on fine adjust by default, while pressing & turning a notch would make the trim move in that direction until the wheel-press is released (sort of the way the trim switches do now when you hold them down).

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

Re: Sky9x Rotaty Encoder Option

Post by android78 » Tue Aug 14, 2012 5:47 am

Thanks for the reply, I look forward to pictures.
Regarding trims, the reason that I think the default or easy trim setting (single click) should be a large change and the double click for fine tuning is because, when trimming a new model, you want to be able to trim approximately first so you don't have to take your thumb off the stick for long. Once it's about right, it doesn't matter if you take your thumb off for a bit while you fine tune it.

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

Re: Sky9x Rotaty Encoder Option

Post by Iksbob » Tue Aug 14, 2012 7:20 am


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

Re: Sky9x Rotaty Encoder Option

Post by Kilrah » Tue Aug 14, 2012 7:36 am

I sooo want one... too bad it's of no use on the stock board.

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

Re: Sky9x Rotaty Encoder Option

Post by preston91 » Tue Aug 14, 2012 4:07 pm

very nice Iksbob looks like an easy way to install. good job!

User avatar
cre8tiveleo
Posts: 1434
Joined: Tue Dec 27, 2011 6:13 pm
Country: -
Location: Ontario,(GTA North)
Contact:

Re: Sky9x Rotaty Encoder Option

Post by cre8tiveleo » Tue Aug 14, 2012 4:15 pm

Awesome! veddy nice. Now , if they had that encoder wheel with led lighting... it would look so cool... like my keyboard...

Image

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

Re: Sky9x Rotaty Encoder Option

Post by MikeB » Tue Aug 14, 2012 4:18 pm

Kilrah wrote:I sooo want one... too bad it's of no use on the stock board.
As I said somewhere else, maybe with the TelemetrEZ board to provide the extra inputs and do the processing.

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

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

Re: Sky9x Rotaty Encoder Option

Post by Kilrah » Tue Aug 14, 2012 5:06 pm

Yeah, but I wouldn't want to add a TelemetrEZ on a radio that's already telemetry enabled just for the encoder. I'd just jump on a sky9x board at this point.

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

Re: Sky9x Rotaty Encoder Option

Post by kaos » Tue Aug 14, 2012 6:01 pm

Looks great. Can't wait to get it on my ersky9x. :P
production date/price set yet for the board? Like mentioned early, it would be great if those pins are included too (save some hunting). :mrgreen:

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

Re: Sky9x Rotaty Encoder Option

Post by MikeB » Tue Aug 14, 2012 6:03 pm

I think I'm going to regret this (too much else to do), but I have an idea!
For the encoder, we need a couple of extra inputs. So how about using a couple of the LCD data lines, wired like this:
Encoder.png
Encoder.png (1.74 KiB) Viewed 2656 times
Each LCD data line has 15K1 of pulldown resistors on it. We add the 3K9 to an encoder switch. While the LCD signal is an output, the 3K9 is just an added load when the LCD signal is low and the switch is ON. If we turn the LCD pin round to an input, then if the encoder switch is off, we get 0 volts from the pulldown, if the encoder switch is ON we get just under 4 volts at the CPU pin, which is a logic 1 as it is above 3.5 volts (0.7 VCC).

We already have code to allow access to the LCD data as they are used for the voice mod.

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

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

Re: Sky9x Rotaty Encoder Option

Post by Kilrah » Tue Aug 14, 2012 6:21 pm

Hmm that should work indeed!
But the potential problem I see is the readout speed. A rotary encoder is great if we can turn it like crazy to go from -100 to +100 in a second, but if it misses half the pulses and you have to be careful not to turn it too quickly it's frustrating more than anything. Any chance the stock board firmware could use pin change interrupts without messing everything up, or poll both encoder pins fast enough (likely 100Hz or more?) to allow for "satisfactory" operation?

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

Re: Sky9x Rotaty Encoder Option

Post by android78 » Tue Aug 14, 2012 9:21 pm

That's a really neat implementation there, Iksbob.
I would assume that the encoder center button should connect and duplicate the functionality of the select button, so not sure why you need an extra input, unless it's for the encoder bit lines. Maybe we need to add one of these http://www.usdigital.com/products/inter ... s/lfls7183 and a counter so we don't miss any pulses? That way, a periodic read won't cause an issue.

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

Re: Sky9x Rotaty Encoder Option

Post by MikeB » Tue Aug 14, 2012 9:58 pm

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.
ersky9x/er9x developer
The difficult we do immediately,
The impossible takes a little longer!

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

Re: Sky9x Rotaty Encoder Option

Post by Iksbob » Tue Aug 14, 2012 10:09 pm

android78 wrote:Maybe we need to add one of these http://www.usdigital.com/products/inter ... s/lfls7183 and a counter so we don't miss any pulses?
While that's an interesting idea, I suspect that in practice, the converter and counter ICs together would cost more than an ATmega168 ($2), ATtiny or similar low-end controller. A dedicated processor could surely keep up with state changes on one or more quadrature encoders (navigation jog wheel, edge-drive trim wheels or what ever else we can find to use them for). The trick is getting that information back to the main processor via a fast (so as to minimize processor load and control latency), and preferrably low pin-count (free up pins for other stuff) interface. This is going into the co-processor topic, but I2C/TWI seemed like a good option to me. The 'mega64 has hardware support for it, the associated I/O pins being occupied by trim switches which could be moved over to the coprocessor. The only question in my mind is how much load TWI would put on the main processor.

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

Re: Sky9x Rotaty Encoder Option

Post by MikeB » Tue Aug 14, 2012 10:23 pm

IF you are going to put a processor in between the encoder and the Mega64, then why not:
1) Connect the 4 direction switches to this processor.
2) Connect the encoder and its switch to this processor.
3) Use the 4 connections that were the 4 direction switches to connect this new processor to the M64.
4) The M64 then asks this processor for all the switch and encoder information when it is ready to ask.

However, remember, the program for this new processor will need to be developed, and will users be able to update it if necessary?

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

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

Re: Sky9x Rotaty Encoder Option

Post by Kilrah » Tue Aug 14, 2012 10:29 pm

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?
OK, all good for me! Looks like we'll never exceed ~3 revs/sec unless really trying to! :)

Irish Steve
Posts: 149
Joined: Thu Dec 29, 2011 10:04 pm
Country: -
Location: Ashbourne Co Meath

Re: Sky9x Rotaty Encoder Option

Post by Irish Steve » Tue Aug 14, 2012 10:47 pm

The one thing I will throw into the pot here is that it might be better to keep the original menu button and the new centre button on separate pins, so that there is the possibility to use them for different functions at the same time, rather than the new centre button just becoming an easier to use replacement for the right hand one. As a thought, one possibly use for the original button would be a toggle switch for the backlight on the screen.

That said, there might be some other extremely helpful use for that button, maybe like a fast screen switch from present menu or whatever to (say) the telemetry screen, or even use the 2 on that side for a scroll up/down for the menu screens rather than the individual options on the screen.

Any of all of the above might be possibles.
Irish Steve

If it was easy, shure, would't we all be doin it?

_

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

Re: Sky9x Rotaty Encoder Option

Post by Iksbob » Tue Aug 14, 2012 11:18 pm

MikeB wrote:IF you are going to put a processor in between the encoder and the Mega64, then why not:
1) Connect the 4 direction switches to this processor.
2) Connect the encoder and its switch to this processor.
3) Use the 4 connections that were the 4 direction switches to connect this new processor to the M64.
4) The M64 then asks this processor for all the switch and encoder information when it is ready to ask.
1: Yes, you could do that. However, the alternative functions of pins PB3-PB6 (the directional buttons) don't seem particularly useful (well, PB3 [down] is MISO for SPI, but the rest of the bus is elsewhere). As such, the pins are effectively only useful as general-purpose I/O. In that case, why bother moving them to GPIO pins on the coprocessor? Also, the solder pad locations are awefully convenient for creating a mounting/adapter PCB the way I did. ^_^
2: Yep, I'm with you there.
3: See (1). Those pins don't have any useful communications functions. You could bit-bang SPI or something, but that would be rather time intensive on the main processor. Using the I2C pins could (as I understand it) offload that communication work to hardware that's currently unused in the 'mega64.
4: Right. Or if latency and/or main CPU time is important, one of the other trim switch inputs could trigger an interrupt routine that cues the main program to read those coprocessor inputs (via TWI). This interrupt input would be driven by the coprocessor when one or more of its inputs change state (or scroll wheel count changes or some other arbitrary event occurs in its program). The interrupt line would just be the coprocessor's way of asking for attention... The main program could pretty much ignore the coprocessor until the interrupt kicks in.
MikeB wrote:However, remember, the program for this new processor will need to be developed, and will users be able to update it if necessary?
True. If a 'mega168 is used, it shouldn't be any more difficult to program than the main 'mega64. Easier in some respects, as a dedicated ISP header could be included on the coprocessor board, so soldering would be unnecessary. Those using smartyparts boards would need to purchase a $5 programmer dongle.
One could conceivably program a bootloader on the coprocessor that lets the main processor re-write it, but that seems like way more work than I expect anyone here would want to take on.

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

Re: Sky9x Rotaty Encoder Option

Post by MikeB » Tue Aug 14, 2012 11:49 pm

If we only need to read data from this processor, then bit-banging a simplified SPI actually won't take a lot of the MEGA64's time. Just read 8/16 bits every 10 or 20mS should be sufficient. The co-processor could use hardware support to output the data. The SPI clock can be as fast as half the co-processor's main clock.

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

Post Reply

Return to “ersky9x”

Who is online

Users browsing this forum: No registered users and 1 guest