I'm opening this thread to discuss the spinner controller discussed in a few other topics.
After more reading, quadrature encoders are much simpler than it sounds. I've started to look for some with a decent resolution. Sees most cheap one are all mechanical with under 20 steps. I would think that something at least 200 would be required for smooth play. I've ordered some rotary encoders on AliExpress advertised at 400 pulses for 12$. Though I think I went overboard since they are actually quite big! Those are optical though, so better quality and longer life. I've also ordered a mechanical one at 36 steps from digikey.
Spinner controller (Rotary encoder)
Re: Spinner controller (Rotary encoder)
Awesome. In addition to the rotary encoder taking the place of the d-pad, will the normal remaining buttons be used? Most games that would benefit from the encoder also use a limited number of buttons.
-
- Posts: 1445
- Joined: Mon Feb 11, 2013 8:08 am
- Location: Brisbane, Australia
Re: Spinner controller (Rotary encoder)
The big reason you NEED optical not mechanincal is because the mechanical ones have drag. You are meant to be able to SPIN a tempest control knob and it just keeps spinning.
Old mechano-optical mice are the easiest source for all the electronics you need on the cheap for it.
If you want the more "ready made" solution then yes optical encoders meant for the back of servo motors are your answer. That is probably what you got from Ali Express.
The ones I have/use for the back of motors are 500 slot discs which equates to 2000 transitions per revolution.
You can never have too much resolution. The ATTiny45 in the
UZE<->ATTiny<->Encoder_buttons
setup can just scale it back to what ever you want. If you want to experiment with different chip then the ATXmegae5 has hardware quadrature encoder built in (for $2.50 for the chip)
Old mechano-optical mice are the easiest source for all the electronics you need on the cheap for it.
If you want the more "ready made" solution then yes optical encoders meant for the back of servo motors are your answer. That is probably what you got from Ali Express.
The ones I have/use for the back of motors are 500 slot discs which equates to 2000 transitions per revolution.
You can never have too much resolution. The ATTiny45 in the
UZE<->ATTiny<->Encoder_buttons
setup can just scale it back to what ever you want. If you want to experiment with different chip then the ATXmegae5 has hardware quadrature encoder built in (for $2.50 for the chip)
Re: Spinner controller (Rotary encoder)
Seems the 400 steps will be the one then. The actual decoding seems simple enough for attiny and there's arduino code already out there to get started.
The actual design of the controller bugs me a bit since unless I make it bulky like a arcade style lap controller, you can't have many buttons. Is two buttons enough to play all spinner games?
The actual design of the controller bugs me a bit since unless I make it bulky like a arcade style lap controller, you can't have many buttons. Is two buttons enough to play all spinner games?
-
- Posts: 1445
- Joined: Mon Feb 11, 2013 8:08 am
- Location: Brisbane, Australia
Re: Spinner controller (Rotary encoder)
The easiest way I think to decode quadrature is to have a timer interrupt happening FASTER than the fastest rate you expect the signals to change.
Then have the two A/B signals and the two LAST-A/B (<<2 or'd) together for 16 states. Have a 16 entry lookup that has -1,0 or 1 as the result. Add that to a counter.
two buttons should be OK.
The only variant I think is the push/pull controller used in the "discs of tron" game. Does anyone feel like porting that to the Uzebox?
Then have the two A/B signals and the two LAST-A/B (<<2 or'd) together for 16 states. Have a 16 entry lookup that has -1,0 or 1 as the result. Add that to a counter.
two buttons should be OK.
The only variant I think is the push/pull controller used in the "discs of tron" game. Does anyone feel like porting that to the Uzebox?
-
- Posts: 1445
- Joined: Mon Feb 11, 2013 8:08 am
- Location: Brisbane, Australia
Re: Spinner controller (Rotary encoder)
OK - now I have been feeling better again for a little while - I am trying to get as much done as possible.
What would be the prefered way to interface the spinner controller?
Should I just use the SNES mouse protocol ?
I will use an ATTiny2313 just because that is what I have around that is more than 4 pins. Code should be portable to the cheaper Tiny24.
What would be the prefered way to interface the spinner controller?
Should I just use the SNES mouse protocol ?
I will use an ATTiny2313 just because that is what I have around that is more than 4 pins. Code should be portable to the cheaper Tiny24.
Re: Spinner controller (Rotary encoder)
I'd suggest to use the same base protocol I made for the keyboard. The only major thing I think that was missing was to return a device id when sending an initialization command to know what is plugged in. That would be important to have only one way of communicating with external devices.
I have received 2 encoders a while ago, but not managed to find enough motivation to work on that. But I could help finish the protocol.
I have received 2 encoders a while ago, but not managed to find enough motivation to work on that. But I could help finish the protocol.
-
- Posts: 1445
- Joined: Mon Feb 11, 2013 8:08 am
- Location: Brisbane, Australia
Re: Spinner controller (Rotary encoder)
Your two encoders are just standard A/B[/X] quadrature things ?
Re: Spinner controller (Rotary encoder)
We've made a rotary encoder for other purposes with magnetic sensor ICs from AMS:
http://ams.com/eng/Products/Position-Sensors
It works with an magnetic field (permanent magnet) and gives you the actual position (angel) of the wheel.
http://ams.com/eng/Products/Position-Sensors
It works with an magnetic field (permanent magnet) and gives you the actual position (angel) of the wheel.
Life's too short to remove usb safely
Web: www.hwhardsoft.de
http://www.facebook.com/hwhardsoft
YouTube: http://www.youtube.com/user/hwhardsoft
Web: www.hwhardsoft.de
http://www.facebook.com/hwhardsoft
YouTube: http://www.youtube.com/user/hwhardsoft
Re: Spinner controller (Rotary encoder)
I think so, it's those: http://www.aliexpress.com/item/Free-Shi ... 73280.htmlCunningFellow wrote:Your two encoders are just standard A/B[/X] quadrature things ?