Sure thing! The PC first sends the warden some configuration commands so it knows how to control the flippers, so during gameplay, it's all handled by the warden; no waiting on the relatively slow serial connection to the PC. The switches are all monitored by a system of I/O expander chips which use interrupts to "instantly" alert the warden that a switch state has changed. The warden checks if it's related to flipper control, and sends a command to update the drive strength of a coil, if necessary. Total time between switch hit and coil activation/deactivation should all happen in under 1 millisecond (actually less than ~100 *micro*seconds I think (2x 4 microsecond interrupt stages, and 3x I2C transactions at ~1M baud (I2C bus runs at 1MHz IIRC, but there's a few microseconds between each transaction too) though thinking about it more, it's possible I actually left the bus speed lower (400kHz or 100kHz), but either way, I think that still works out to sub millisecond response time)).
As for the actual control logic, as soon as a flipper button is pressed, the warden will enter the "flip" stage, and activate both the high power, and low power flipper coils at specific power levels, controlled by setting the duty cycle of the PWM signal that drives them. From here, one of three things can happen next: the flipper button could be released, which will instantly deactivate both coils, the end-of-stroke switch could close, indicating the flipper is all the way up, in which case both the high and low power coils switch to their "hold" state power levels, which is just a lower power setting that can be held indefinitely, or, if for some reason the EOS never triggers, an internal timer will trigger the hold state after some set amount of time (on the order of milliseconds). While the flipper is in the hold state, if the flipper button is released, both coils deactivate, or, if the flipper button is still pressed, and the EOS opens (likely caused by a fast ball return knocking the flipper down) the flipper will basically re-flip to keep itself up, again switching back to the hold state as soon as the EOS closes again, or deactivating if the flipper button is released. Basically, it is designed to behave exactly like a dual-coil EM system would, with the added benefit of being able to use both coils in both the hold and flip stages, and having a time limit on the flip stage in case of EOS failure.
And it works quite well! This system allows you to perform micro-flips and tap passes with a little practice! That was really my main focus for the flipper system; make it as responsive as possible, so you can achieve these more advanced techniques. I love being able to tap pass on my older games; it can be a very useful technique, safer than a post pass (some games didn't even have posts to pass with!), and feels really d*** good when you pull it off. I could tap pass for days on mushy gottlieb flippers haha. Much more difficult to pull off on more modern machines, probably due to lighter/higher power/snappier flippers, too much software debounce, or potentially some amount of delay, depending on how the system monitors switch inputs.
The upper flippers really work the same way, just with a single coil wired up, which works out well since they don't need to be as powerful as the main flippers, and likewise, don't see as fast of ball returns.
That reminds me, I owe y'all some files. The next code update is wrapping up, so I had some downtime to upload the schematics and a closeup shot of the warden for those interested last week.
Here's a link to the schematic.
Here's a link to the image.
Cheers! Back to coding for me.
coding.gif
How I eat cheese balls without getting the keyboard dirty