Main > Main Forum

Trackball Resolution

Pages: (1/5) > >>

Ropi Jo:

I'm trying to calculate the resolution needed for a trackball in Mame.

My spinners are 1200ppr which I'm sure I read somewhere was correct, or close enough.

The trackball however has a 2 1/4" diameter pool ball, turning against a 5mm shaft, so there's a big ratio.

Some basic maths will tell me the ratio, and I'm assuming 1200 is the target.

Am I correct in thinking that as it will be quadrature each hole in the wheel will actually be 2 pulses?

This will be fed into the optopac, same as the spinners.

Am I on the right track or miles off?

This is all being 3D printed so I can trial and error but I'd like to be fairly close to start with.

PL1:


--- Quote from: Ropi Jo on October 17, 2022, 03:45:15 pm ---I'm trying to calculate the resolution needed for a trackball in Mame.

--- End quote ---
That can be a difficult thing to wrap your head around and work through.

The wiki entry is not as clear as it could be regarding trackballs, but near the top there are links to three related threads that provide more info.

http://wiki.arcadecontrols.com/index.php/Spinner_Turn_Count


--- Quote from: Ropi Jo on October 17, 2022, 03:45:15 pm ---My spinners are 1200ppr which I'm sure I read somewhere was correct, or close enough.

--- End quote ---
That is the resolution of the TT2 and SpinTrak spinners.
- Unless you're using those spinners to generate your trackball X- and Y-axis quadrature waveforms that fact isn't relevant to what you are trying to do.


--- Quote from: Ropi Jo on October 17, 2022, 03:45:15 pm ---The trackball however has a 2 1/4" diameter pool ball, turning against a 5mm shaft, so there's a big ratio.

--- End quote ---
Yeah, that's almost double the ratio of the standard Happ 2-1/4 trackball with a 0.362 inch (9.1948 mm) roller and a 24 tooth encoder wheel.

One thing to watch out for is if that ratio gets too high, the encoder wheel might turn so fast that you get backspin.
- See post here for more detailed info about backspin.


--- Quote from: Ropi Jo on October 17, 2022, 03:45:15 pm ---Some basic maths will tell me the ratio, and I'm assuming 1200 is the target.

--- End quote ---
Don't assume that 1200 is the target.

AFAIK that's the resolution chosen for the TT2 and SpinTrak spinners so they would be be a suitable replacement for all spinners including the geared ones for Arkanoid.

Most spinners and trackballs are much lower resolution.


--- Quote from: Ropi Jo on October 17, 2022, 03:45:15 pm ---Am I correct in thinking that as it will be quadrature each hole in the wheel will actually be 2 pulses?

--- End quote ---
Assuming you have a properly paired encoder wheel and opto spacing, quadrature waveforms have 4 phases per tooth/gap.
- The good spacing image shows the encoder wheel at the left edge of Phase 1.
- Data line A is transitioning from high (not blocked) to low (blocked) and data line B is in the middle of being blocked.
- As you rotate the encoder wheel clockwise, the blocking and un-blocking of the optos will produce the quadrature waveforms shown.


--- Quote from: Ropi Jo on October 17, 2022, 03:45:15 pm ---This is all being 3D printed so I can trial and error but I'd like to be fairly close to start with.

--- End quote ---
Get the encoder wheel and opto spacing right then you can adjust the sensitivity in MAME.
- I'm guessing you plan to use Happ Red Boards instead of trying to design your own optical circuit, right?



To work out the correct opto spacing and encoder wheel measurements:

- Calculate the number of degrees for each tooth/gap on your encoder wheel.  For example, a 24 tooth encoder wheel ==> one 360 degree rotation of the wheel is divided into 24 teeth + 24 gaps ==> each tooth and each gap is 7.5 degrees wide. (360/48 = 7.5)

- How many teeth gap between optos?  The image above shows a 2.5 tooth gap. (2.5 * 7.5 = 18.75 degree gap angle)
-- More info about this gap value here.

- Use the known distance between the optos and the gap angle to calculate the radius from the center of the shaft to the opto position.
-- Split the triangle defined by the two optos and center of the shaft into two right triangles.
-- You know the gap angle and the distance between optos so divide those values by two and apply them to the angle (θ) and "opposite" of one of the right triangles then use the sine trigonometic function to solve for the hypotenuse which is the radius from the center of the shaft to the opto position.




Scott

Ropi Jo:

That is brilliant Scott.

Thanks for taking the time to include so much detail.

PL1:

Glad to assist.   :cheers:


Scott

Ropi Jo:

Get the encoder wheel and opto spacing right then you can adjust the sensitivity in MAME.
- I'm guessing you plan to use Happ Red Boards instead of trying to design your own optical circuit, right?

I was planning to simply run optos directly to the opti pac with a current limiting resistor on each opto.

Is this not such a good idea?

Pages: (1/5) > >>

Go to full version