I decided to connect my recently acquired Imperial 3-inch trackball to my MAME cabinet via a mouse hack. I did not want to alter the trackball circuit in any way so I designed my mouse hack to utilize the existing 6 pin Molex connector. The trackball is left completely stock so that it can be used with dedicated video game boards if desired.
I looked at the single sheet of documentation that came with the trackball and decided that I would have to produce my own circuit diagram if I wanted to adapt a mouse to the trackball. There are 2 circuit boards inside the Imperial trackball. Each board connects with 4 wires and has a 74HC14N hex schmitt trigger inverter, 2 optical switches and 3 resistors. Each board is connected to +5V and Gnd and produces a phase 1 and phase 2 signal. There is one board for the vertical and one for the horizontal. These signals are brought out to the 6 pin Molex connector and the +5V and Ground.

After looking at the circuit it did not seem to matter that the schmitt trigger inverted the signal because both the phase 1 and phase 2 signals would keep the proper relationship because they are both inverted. The phase 1 and phase 2 signals are square waves which are produced by the chopping action of the wheel on the end of the trackball bearings. The schmitt triggers clean up the signals from the optical switches to produce a cleaner square wave.
Almost any mouse will suffice but in this case I was trying to save money so I used a PS/2 three button Belkin mouse that cost about $9.00 Cdn. If you want a USB interface then you will have to use a USB mouse. I looked at some wheel mice but the additional circuitry for the wheel just complicates the hack. All that is required from the mouse is the main circuit board. The case and other mechanical parts were removed to leave a circuit board with a PS/2 connector. The wheels and rollers are not used.
The mouse circuit board has IR transmitters and receivers, which perform the same function as the optical switches in the trackball. I identified the receivers, which have 3 pins and the transmitters, which have 2 pins. In some mice there may be 2 separate receivers for each axis but in most cheap mice the receivers are combined in a 3 pin black device that looks a bit like a transistor. There is one of these black plastic dual receivers for each axis. To identify the power pin I traced back the circuit traces on one receiver and found that the 2 outside pins went to the integrated circuit on the mouse circuit board. The middle pin went to +5V power.
The horizontal and vertical receivers were removed from the mouse circuit board using a soldering iron and copper braid to wick up the solder off the 3 pins. After the horizontal receiver was removed 2 wires were soldered to where the outside pins of the receiver were soldered. This gives a horizontal phase 1 and phase 2 connection. The vertical receiver was removed and 2 wires were soldered to the outside pads to give a vertical phase 1 and phase 2 connection.

The transmitters (IR leds) can be removed to slightly reduce the power consumption of the circuit board. They do not have to be removed as they do not affect the operation of the circuit. I left mine on the circuit board because it was the easiest thing to do.
(blk) Gnd 1 4 Vdir (green)
(red) +5V 2 5 Hclk (blue)
(yellow) Vclk 3 6 Hdir (brn)
The Vclk and Vdir correspond to Vertical phase 1 and phase 2 from the mouse.
The Hclk and Hdir correspond to Horizontal phase 1 and phase 2 from the mouse.
The wires from the PS/2 connector were traced to verify the +5V and Gnd connections to the mouse circuit board. We now have 6 wires, which correspond to the 6 pins in the Molex plug attached to the trackball. These can be connected to the Molex plug and we have a mouse interface for the trackball. The trackball looks like a mouse to the computer and 2 buttons may also be added to complete the mouse hack. To connect the 2 mouse buttons the switches that activate these functions may be removed and 2 wires for each switch can be soldered in place or the wires may be soldered to the bottom of the circuit board where the switches are soldered in place. The ground and power wires are already run to the trackball so only 2 actual wires from the circuit board need to be run
Mouse Circuit Board Molex Connector
GND Pin 1 GND
+5V Pin 2 +5V
Vertical phase 1 Pin 3 Vclk
Vertical phase 2 Pin 4 Vdir
Horiz phase 1 Pin 5 Hclk
Horiz phase 2 Pin 6 Hdir
Switch 1 TB Switch 1 (NO PB switch installed on trackball)
Switch 2 TB Switch 2 (NO PB switch installed on trackball)
The mouse circuit board was housed in a small plastic project box with the PS/2 cable at one end and the trackball cable entering at the other. Two extra wires were run from the circuit board to the trackball to allow for the installation of 2 mouse buttons on the trackball assembly. Only 2 wires are required as the ground is already available at the trackball. Holes were drilled in the top corner of the trackball to install 2 small momentary contact n.o. buttons.
There are 2 additional wires on the trackball that do not go through the Molex connector. These wires are connected to grounding tabs on the horizontal and vertical bearings supports. This can be taken to frame ground and are not part of the active circuit. I think that the bearing ground is there to prevent a static build up from the spinning ball.
When the computer was powered up with the mouse hack attached to the trackball the left and right were reversed but the up and down were OK. This meant that the phase 1 and phase 2 wires for the horizontal axis had to be switched. Depending on the orientation of your trackball you can reverse the direction of either the horizontal or vertical or even switch the horizontal and vertical axis at the Molex connector. To switch the axis the phase 1 and phase 2 for the horizontal would be switched with the phase 1 and phase 2 for the vertical. You can keep careful track of the trackball rollers and mouse rollers and try to figure it out before hand or you can switch the wires to make it right when you connect.
Once the trackball is functioning it can be adjusted. To increase the response of the trackball the mouse pointer speed can be increased in the control panel. Each MAME game that supports a mouse as can also be adjusted via the individual game settings to fine tune the trackball action.
The finished product.

If you have any questions I can be contacted at bakaye@shaw.ca
Thanks
Bob Akaye