Monthly Archives: June 2013

Heartbeats and not melting solenoids

One of the most worrying problems with pinball systems is that your software will crash, hang, or fall into some horrible infinite loop that leave a solenoid on long past it’s duty cycle, resulting in a nice melty pile of goo.

So what can we do about it? Well, first we need to identify the cases that are likely to result in a locked coil.

1) A variable hold solenoid (such as a diverter or magnet) is on and the C# controller crashes. The arduino doesn’t monitor these solenoids (as we can hold flippers forever!) so bad things can happen. Luckily only a few of these solenoids aren’t full duty cycle.

What we need to know here is if the C# controller is still alive. To do this the arduino watches for heartbeats in the solenoid line. If the PC misses 10 heartbeats (about one second of non-stop failures) the arduino will shut down all power to the pinball machine and wait for a “Power on” signal before continuing.

2) Something goes horribly wrong in the arduino code, while a solenoid is active. This can happen to any solenoid, momentary or otherwise; so this one is a bit scarier.

The solution is however nearly identical to the previous. The C# controller monitors the heartbeats from the arduino and if it doesn’t see any for a long enough period (about 1 second) it uses serial to force a reset. This is possible due to the mega’s 2 chip design, where the serial montior chip is able to watch for the reset command and pull the reset pin on the main ATMega. This case does not however handle a case where the serial monitor chip fails; though this is hopefully a rare case.

3) A transistor shorts.

It’s possible to solve this with hardware but I took the “Use really big transistors that can take the abuse” route instead. A later design may include the ability to detect the state of all transistors and cut power if one is bad, but that’s a lot of engineering for a fairly rare problem.

The heartbeat system itself is fairly simple. There is a timer on the arduino that sends the e_HEARTBEAT signal every 100 ms. When the C# controller gets this signal, it sends it back. This allows the C# side to know if the arduino is dead (No heartbeats being sent) and the arduino to know the same (How many heartbeats we’ve sent since the last time we got a response), which is hopefully a fairly durable system.

Trough swap complete

This is one of those things that just went a bit too well.

To be fair, it was almost a catastrophe as the trough almost didn’t fit. It’s practically friction fit in against the flipper base. However even with such a narrow margin, everything lines up OK. I was even able to re-install the old back plate around the new assembly so the ball doesn’t fall through the back of the PF. It’s insane how well this all worked out, given how drastically different the old two solenoid williams design is from this modern Stern assembly.

IMG_20130607_193643 IMG_20130607_193709


IMG_20130607_193719 IMG_20130607_193759

IMG_20130607_214331 IMG_20130607_214341

As you you can see, even the old skirt fit back in with zero modifications. It looked like the outhole was going to clip a bit but it clears just fine. I’ve not figured out what to do with the old second solenoid yet (Maybe a flash lamp?), and I haven’t found a good hole in the matrix to squeeze in the jam opto; but it’s not super critical.