Pachinko EM to Solid State

This is the story of a little project to convert the electro-mechanical (EM) controller (or brain), for an Americano Pachinko machine, to a solid state design. Why? A friend had a machine with the controller board missing, and had been unable to find a replacement. Fortunately he is a collector and had two such machines, and the other still had the EM controller to reverse engineer. He lives in a remote location so I could not actually access either machine. He specified a few requirements:

1) It had to fit on a circuit board that could be placed in the original position.
2) Solid state was fine, but no software (my friend does not program).
3) No firmware either, so no programmable logic (again, he does not program).
4) He works with EM, but doesn't do digital logic design either, so if it breaks he needs to be able to fix it by replacing chips, and maybe some wiring (so socketed SSI/MSI parts).

Here are some pictures of the machine, the original controller, and where it goes in the machine (click any picture to see a larger view). An outline drawing was produced from the board that holds the motor and relays:

The second machine isn't running due to a power supply issue, so he can't just fire it up to reverse engineer how it works experimentally. From the above, you can see that the motor has notches and lugs that trigger a couple of switches when it rotates. It also has some relays that are likely routing power to something. So we need to figure out what starts and stops the motor and what those switches and relays do to the rest of the machine when they close and open. So my friend was tasked with tracing wires and drawing me a schematic of the motor board. Here is the result:

I used that to reverse engineer how the existing EM circuit controls the machine. This led to some long email exchanges, as I inferred an error or two in the schematic, and in the end my conclusions had some differences from how he thought the machine actually worked. He eventually got the other machine running enough to confirm my reverse-engineered behavior. Since it wasn't what he was expecting, or how he would like to see the game work, we decided to improve on it as long as we were designing a new controller.

After some back and forth on possible behaviors that I could fit in the designed space, I crossed my fingers and hoped that state changes could be clocked by ball transitions over switches, and thus not have to worry about synchronizing a clock with asynchronous switch transitions (which would have driven the circuitry over the size constraint). That was aided with some Schmitt trigger hysteresis along with an RC impedance on the switch closure. It was a gamble that appears to have worked out. The transistors drive small lamps and the SS relay drives a small solenoid). There is bridge rectifier and a regulator to generate local power (a pachinko doesn't generate 5V), and another regulator to provide 12V power for the lamps (the small transistors used to drive the lamps can't deal with 24V AC, but the lamps work fine on 12V DC). There's also a tap for battery backup if he wants the machine state to persist between power cycles.

Building it was of course the tedious part. Here are pictures of the front and back of the end result, and of it sitting in my test fixture (since I didn't have the actual machine to test in).