keirf / flashfloppy

Floppy drive emulator for Gotek hardware
Other
1.35k stars 194 forks source link

Rotary encoder - either requires 2 "clicks" or skips by 2 positions #130

Closed TzOk83 closed 6 years ago

TzOk83 commented 6 years ago

Maybe it is my specific issue, but I've got rotary encoder (EC12 clone, 30 imp.), which either moves 1 position, every two clicks (simple), or skips by 2 positions (Gray). Actually - when Gray pattern is chosen it moves 1 position every 1/2 click - if I stop in between clicks it moves only 1 position, but when I allow it to click, it moves to the next position.

keirf commented 6 years ago

Does it have a green base by any chance?

TzOk83 commented 6 years ago

Yest it has... I've just found another closed issue concerning this one.

keirf commented 6 years ago

Buy another rotary encoder. Maybe I can support this type if I'm sent one. But it's easy enough to find cheap ones that do work.

RetroClinic commented 6 years ago

I just did a search for "green encoder" and didn't find any results? I've been sent some of these from the same seller that was supplying blue ones, I thought they were the same, but I presume from reading this that they're electrically different somehow?

keirf commented 6 years ago

The green base isn't a selling point, it's just an observation that these incompatible encoders seem to all have a green base rather than blue. Maybe the green ones can be supported but I'd need one to test with.

RetroClinic commented 6 years ago

Ok, I'll give one a try on the next set of builds I do, see if I can see a difference in the waveform output. Happy to send you a couple if it helps?

keirf commented 6 years ago

Yes that would be helpful thanks. I guess confirm yours don't work, first.

raybellis commented 6 years ago

Even within a single manufacturer's range of encoders you can find models that do one full quadrature cycle per detent and others that do only a quarter cycle. For example most E-Mu synths use a Bourns ECW0D-C24-BD0009 where the D0009 indicates 36 quarter cycle detents but there's also an E0036 variant which has 36 full cycle detents. (see https://www.mouser.co.uk/datasheet/2/54/CW1J-777413.pdf)

I'm guessing somewhat, but your encoder sounds like it's a half cycle per detent, whereas FF is expecting a quarter cycle per detent. Do you have the exact part number?

keirf commented 6 years ago

The trace posted in the second half of ticket #50 seems to show a full cycle per detent, but inconsistent phase difference between the encoder pins. So I'm reluctant to spend time on this unless I receive an encoder to test myself.

EDIT: OTOH the issue in #50 sounds different -- always one direction, or detent missed entirely. Different than this issue or issue #119

keirf commented 6 years ago

Okay could you please try the following firmware, requiring rotary = half in FF.CFG:

ff_130_1.zip

TzOk83 commented 6 years ago

Works perfect!

keirf commented 6 years ago

That's great! I will test on my basic full-cycle encoder tomorrow (I changed round the whole rotary encoder logic to make it more straightforward and logical). If it works okay I will commit the patch to master and it will get rolled into next release 0.9.22a.

tkurbad commented 6 years ago

@keirf Thanks for implementing this. I bought another encoder meanwhile but it does not fit my 3d printed external case so well as the 'half' cycle encoder I designed it for. I just thought, I'd have to live with that. It's nice to see that I can put the original encoder back now! By the way, the new encoder also has a green base, but did just work with the 'simple' setting. So, there seems to be a lot of scattering in this area...

RetroClinic commented 6 years ago

Hi.

Yes, I the green encoders that I was sent seem to work in exactly the same way as the blue base ones, so not sure what’s going on with these el-cheapo suppliers, but either way the firmware works. I think it’s even better responsiveness now as well.

Thanks, Mark.

From: Torsten Kurbad Sent: Sunday, June 17, 2018 8:16 PM To: keirf/FlashFloppy Cc: RetroClinic ; Comment Subject: Re: [keirf/FlashFloppy] Rotary encoder - either requires 2 "clicks" or skips by 2 positions (#130)

@keirf Thanks for implementing this. I bought another encoder meanwhile but it does not fit my 3d printed external case so well as the 'half' cycle encoder I designed it for. I just thought, I'd have to live with that. It's nice to see that I can put the original encoder back now! By the way, the new encoder also has a green base, but did just work with the 'simple' setting. So, there seems to be a lot of scattering in this area...

— You are receiving this because you commented. Reply to this email directly, view it on GitHub, or mute the thread.