Main > Main Forum

Using inc rotary encoder as a spinner - need help understanding counts

(1/3) > >>

TheManuel:
Hello, all.

My cab currently has an old spinner comprised of a 72-tooth wheel, a hard drive spindle, and an optical sensor that I think I got from Oscar controls back in the olden days (2003, maybe). 

I want to upgrade it using this incremental rotary encoder, which will be connected to the spinner terminals of my Ultimarc I-PAC 2.  I am a bit confused about the pulse-per-revolution count. The encoder is advertised as 600 P/R, but I have read that this number needs to be multiplied by 4 because both leading and trailing edge of each slot in the wheel is counted, and because it is a 2-phase encoder.

However, I don't know if the product description already considers one or both of these features.
Will MAME see 600x4=2,400 counts per revolution, or 1,200 or 600?

I'd like to know so that I can later make the proper sensitivity adjustments in MAME for each game, and because I'd like to have at least a 1,200 final pulse count to work with.

PL1:

--- Quote from: TheManuel on February 19, 2025, 02:02:40 pm ---Hello, all.

My cab currently has an old spinner comprised of a 72-tooth wheel, a hard drive spindle, and an optical sensor that I think I got from Oscar controls back in the olden days (2003, maybe). 

I want to upgrade it using this incremental rotary encoder, which will be connected to the spinner terminals of my Ultimarc I-PAC 2.  I am a bit confused about the pulse-per-revolution count. The encoder is advertised as 600 P/R, but I have read that this number needs to be multiplied by 4 because both leading and trailing edge of each slot in the wheel is counted, and because it is a 2-phase encoder.

However, I don't know if the product description already considers one or both of these features.
Will MAME see 600x4=2,400 counts per revolution, or 1,200 or 600?

I'd like to know so that I can later make the proper sensitivity adjustments in MAME for each game, and because I'd like to have at least a 1,200 final pulse count to work with.

--- End quote ---
Ran a quick test comparing a TT2 (1200 transitions per revolution) on the X-axis to a 600 P/R encoder similar to yours on the Y-axis using StefanBurger's illuminated spinner firmware on an Arduino Pro Micro.

In Windows, the cursor movement appeared to be 1:1.

In MAME Cameltry with the dipswitch set to cocktail, P1 on X-axis, P2 on Y-axis, and analog sensitivity set to the same value for P1 and P2, it only took about 5/8ths of a rotation on Y-axis (yours) to move the same distance as 5/4ths rotation on X-axis (TT2) -- one full rotation of the playfield.

It looks like the value to use for the calculations on your rotary encoder is 2400, but double-check in Cameltry to confirm because some quadrature waveform encoders use different encoding techniques.

The usual technique for the optical circuits in a spinner/trackball/mouse is that each pulse on a data line is broken into 4 phases and each phase is one step.

For example:
Last read was A=1 and B=1, your starting point is Phase 3.

Next read
- A=1 and B=1, you are still on Phase 3 ==> no change, no movement.
- A=0 and B=1, you've changed to Phase 2 ==> one step counter-clockwise
- A=1 and B=0, you've changed to Phase 4 ==> one step clockwise



One potentially difficult thing about that type of rotary encoder is the mount so here's a post containing two types of 3d printable mounts -- you'll need to download/print the nut and your choice of either the roundover or chamfer mount.
https://forum.arcadecontrols.com/index.php/topic,152421.msg1740629.html#msg1740629

   


Scott

TheManuel:
This is amazing, Scott!  More detailed info than I would have hoped for.  I appreciate you taking the time to do this.  It gives me the confidence that the encoder will have plenty of resolution, and the means to verify it.

Nice bonus also with the printable mounting socket.  It makes for a very compelling case of making another hole on the panel to replace the tiny one I have for the old spinner, where only the shaft comes through.

Thank you, very much!

PL1:
Glad to assist.   :cheers:


--- Quote from: TheManuel on February 19, 2025, 05:53:56 pm ---Nice bonus also with the printable mounting socket.  It makes for a very compelling case of making another hole on the panel to replace the tiny one I have for the old spinner, where only the shaft comes through.

--- End quote ---
If you want an undermount version, try this one.
- If you have a wood panel, you'll probably also need a 6mm shaft extender.
https://www.thingiverse.com/thing:545842




Scott

TheManuel:
Yes!! Exactly what I need.
Thanks again!

 :cheers:

Navigation

[0] Message Index

[#] Next page

Go to full version