Main Restorations Software Audio/Jukebox/MP3 Everything Else Buy/Sell/Trade
Project Announcements Monitor/Video GroovyMAME Merit/JVL Touchscreen Meet Up Retail Vendors
Driving & Racing Woodworking Software Support Forums Consoles Project Arcade Reviews
Automated Projects Artwork Frontend Support Forums Pinball Forum Discussion Old Boards
Raspberry Pi & Dev Board controls.dat Linux Miscellaneous Arcade Wiki Discussion Old Archives
Lightguns Arcade1Up Try the site in https mode Site News

Unread posts | New Replies | Recent posts | Rules | Chatroom | Wiki | File Repository | RSS | Submit news

  

Author Topic: Using inc rotary encoder as a spinner - need help understanding counts  (Read 3209 times)

0 Members and 2 Guests are viewing this topic.

TheManuel

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 825
  • Last login:April 09, 2025, 10:13:43 pm
  • On and off hobbyist
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.
"The Manuel"

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9671
  • Last login:Today at 07:54:39 pm
  • Designated spam hunter
Re: Using inc rotary encoder as a spinner - need help understanding counts
« Reply #1 on: February 19, 2025, 05:39:03 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.
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

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 825
  • Last login:April 09, 2025, 10:13:43 pm
  • On and off hobbyist
Re: Using inc rotary encoder as a spinner - need help understanding counts
« Reply #2 on: February 19, 2025, 05:53:56 pm »
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!
"The Manuel"

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9671
  • Last login:Today at 07:54:39 pm
  • Designated spam hunter
Re: Using inc rotary encoder as a spinner - need help understanding counts
« Reply #3 on: February 19, 2025, 07:18:09 pm »
Glad to assist.   :cheers:

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.
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

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 825
  • Last login:April 09, 2025, 10:13:43 pm
  • On and off hobbyist
Re: Using inc rotary encoder as a spinner - need help understanding counts
« Reply #4 on: February 19, 2025, 07:50:29 pm »
Yes!! Exactly what I need.
Thanks again!

 :cheers:
"The Manuel"

TheManuel

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 825
  • Last login:April 09, 2025, 10:13:43 pm
  • On and off hobbyist
Re: Using inc rotary encoder as a spinner - need help understanding counts
« Reply #5 on: February 19, 2025, 09:00:55 pm »
By the way, would there be any advantage in getting getting the 360p/r variant instead?
They cost the same and I thought better resolution would be better but I ask in case I’m missing anything.
"The Manuel"

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9671
  • Last login:Today at 07:54:39 pm
  • Designated spam hunter
Re: Using inc rotary encoder as a spinner - need help understanding counts
« Reply #6 on: February 19, 2025, 10:13:18 pm »
By the way, would there be any advantage in getting getting the 360p/r variant instead?
Either version should be fine for most games, but low resolution game spinners like Kick (12 count) could be harder to fine tune with the 600p/r version because sensitivity is set in 1% increments in the MAME menu.

The math is a little easier with the 600p/r version -- settings are 1/2 of the commonly available TT2/SpinTrak sensitivity settings.
https://forum.arcadecontrols.com/index.php/topic,164017.0.html
https://wiki.arcadecontrols.com/index.php/Spinner_Turn_Count

Sensitivity = 100 * (Counts_Per_Revolution for game) / (transitions per rotation of your spinner)
- 600p/r sensitivity for Kick = 100 * 12 / 2400 = 0.5%
- 360p/r sensitivity for Kick = 100 * 12 / 1440 = 0.83%


Scott
EDIT: Looking closer at the possible range of sensitivity values, the 360p/r is the better choice of the two.

It will handle the highest value game, Arkanoid - Revenge of Doh (972 count), with about a 68% sensitivity setting (100 * 972 / 1440 = 67.5%) and give you more fine adjustability for the lower value games.

If you can find one, a 240p/r encoder would be even closer to an exact match (100 * 972 / 960 = 101.25%) -- you probably wouldn't want to go lower than that.
« Last Edit: February 19, 2025, 10:58:14 pm by PL1 »

TheManuel

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 825
  • Last login:April 09, 2025, 10:13:43 pm
  • On and off hobbyist
Re: Using inc rotary encoder as a spinner - need help understanding counts
« Reply #7 on: February 19, 2025, 10:25:16 pm »
Man, I did not even think about that.  Really good point!
I think you meant to say "...could be harder to fine tune with the 360p/r version...", based on the rest of the message.

I'll be ordering that 600p/r encoder now.  I'm looking forward to making Arkanoid more playable.  It's nearly impossible with my current one.

Thank you for your help on this and everything else.
"The Manuel"

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9671
  • Last login:Today at 07:54:39 pm
  • Designated spam hunter
Re: Using inc rotary encoder as a spinner - need help understanding counts
« Reply #8 on: February 19, 2025, 11:50:41 pm »
I think you meant to say "...could be harder to fine tune with the 360p/r version...", based on the rest of the message.
No, I meant what I said.

The ideal setting for Kick with a 600p/r encoder would be 0.5%.
- Since the lowest possible setting is 1%, Kick will be at 200% of the ideal sensitivity.

The ideal setting for Kick with a 360p/r encoder would be 0.83%.
- Since the lowest possible setting is 1%, Kick will be at 120% of the ideal sensitivity.

The ideal setting for Kick with a 300p/r encoder would be 1%.
- Since the lowest possible setting is 1%, Kick can be set exactly to the ideal sensitivity.

You can only adjust MAME sensitivity in 1% increments.
- 1% of 2400 (600p/r encoder) = 24 steps.          Bigger # of steps per 1% increment = less able to fine tune.
- 1% of 1440 (360p/r encoder) = 14.4 steps.
- 1% of 1200 (300p/r TT2/SpinTrak) = 12 steps.  Smaller # of steps per 1% increment = more able to fine tune.

Have you ever heard anyone complain that their TT2/SpinTrak (300p/r) can't handle Arkanoid?  I haven't because 300p/r is high enough resolution to handle it just fine.

The higher resolution of that 600p/r encoder is largely wasted because you have to turn the sensitivity way down in MAME.

A 600p/r encoder has so many transitions that the highest count game, Arkanoid - Revenge of Doh (972 count), will only have a sensitivity setting of about 41 percent.  (100 * 972 / 2400 = 40.5%)
- The 360p/r is a better choice with about a 68% MAME sensitivity setting.  (100 * 972 / 1440 = 67.5%)
- A 300p/r encoder would be even better than that.  (100 * 972 / 1200 = 81%)
- A 240p/r encoder (if you can find one) would be about as low as you would want to go.  (100 * 972 / 960 = 101.25%)


Scott
« Last Edit: February 20, 2025, 12:07:12 am by PL1 »

TheManuel

  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 825
  • Last login:April 09, 2025, 10:13:43 pm
  • On and off hobbyist
Re: Using inc rotary encoder as a spinner - need help understanding counts
« Reply #9 on: February 20, 2025, 12:30:36 am »
Duh!!!  What a thick head I have.
Thank you for clarifying all that.
"The Manuel"

delta88

  • I didn't try to trick anyone - Fair warning was given
  • Trade Count: (0)
  • Full Member
  • ***
  • Offline Offline
  • Posts: 657
  • Last login:May 20, 2025, 08:21:05 am
  • This place is still here?
Re: Using inc rotary encoder as a spinner - need help understanding counts
« Reply #10 on: March 06, 2025, 09:52:50 pm »
Very old noob here. Is this going from a typical spinner to like an heavy Barrel type rotating joystick ?

PL1

  • Global Moderator
  • Trade Count: (+1)
  • Full Member
  • *****
  • Offline Offline
  • Posts: 9671
  • Last login:Today at 07:54:39 pm
  • Designated spam hunter
Re: Using inc rotary encoder as a spinner - need help understanding counts
« Reply #11 on: March 07, 2025, 12:03:33 am »
Very old noob here. Is this going from a typical spinner to like an heavy Barrel type rotating joystick ?
No, it's WAY too high resolution for an optical rotary joystick.  There were 5 games (Fighting Soccer, Caliber .50, Exterminator, Touchdown Fever, and Touchdown Fever II) that used an optical rotary joystick like the green-handled Loop-24 stick that is basicly an 8-way stick combined with a 24 pulses per rotation spinner.

 

Heavy Barrel, Ikari Warriors, and similar games used a "clicky" mechanical rotary joystick like a yellow-handled LS-30 with a 12 position rotary switch.


Scott