Tuesday, December 30, 2014

Of(f) course...

As always, just when things are moving forward they turn to a screeching halt again.

For some time the MP3-triggers has behaved badly and "misfired" when playing MP3's. I thought this could be due to the solenoid-interrupt stepping in and messing with the communication. Should be easy to check, just remove the interrupts temporarily, right?

Wrong. 

What happened was that I've coded the solenoids to fire right away (for speed) and be turned off in the... that's right, the interrupt function. This lead to the solenoid being stuck in active and took me a while to notice since I was debugging code on the computer at the same time. Things that happen when you leave a project for some time, it's almost impossible to remember all decisions that were taken and for what reason. After that I heard what almost sounded like gravel dropping on the floor and thought "what the hell is that?".

Then came the smoke.

I moved faster than Mick Jagger on speed and shut off the machine, threw the glass front off and pulled the board up. I expected to see fire, but there were just one sizzling solenoid. I had to keep it cool by blowing air on it for a good long time. Phew.

Damage control.

1) Sizzling solenoids, anyone? I've heard they're all the rage...
The first thing was obvious. The drain kick solenoid was more fried than a bucket of KFC. Clocking in at almost 0Ω it was basically a short circuit.

Next thing - not a single solenoid worked after the incident. They seemed fine resistance-wise and didn't feel warm, so I suspected the power supply and check the voltage. It read 6V... not good. Should be 48V. After unplugging the short circuit solenoid the voltage went up to 48V again. Thank you, China manufacturer, for voltage limiting when shorting instead of blowing up!

2) New. Crispy.
I replaced the solenoid with a spare one I just happened to have in my "garbage" pile. (An exact match too. Seriously!?). Still no tango....

3) Spot the burnt MOSFET....

...because of course, the solenoid driver board MOSFET was blown as well.
I looked high and low for a replacement, but could only find IRF640's. I used these in the past and they worked, but kind of slow for the flippers so I scrapped them. They also became quite hot due to not opening fully when activated (not really a low-level voltage MOSFET).

The board seemed fine, so I soldered a IRF640 on there and included a heat shield. How about now?
4) Surely this has got to be it, right?

Nope.

Nothing.

Crap.

My theory is that the last time I used them was with the Ardunio Mega, which runs at 5V 40mA per output. The Chipkit has 3V and 20mA, if I'm not mistaken. This is simply to weak to open the gate at all. I raised the on-time with 10x and it still didn't work, so I once again scrapped the idea of using them.

I've now ordered a new power driver board (just in case) and a bunch of replacement MOSFET's (RFP30N06LE). It GOT to work.

On the plus side...
I've created the Atlas, Big Daddy and Upgrade game modes now, along with additional tweaks and things (like user selectable background music before launching the ball). Just got to get the MP3's to trigger reliably, as said, but Big Daddy is even now a treat to shoot at! :) 

5) Junkyard/graveyard. I've grown used to stuff not working, but this is getting ridiculous. 


Sunday, December 28, 2014

Merry Christmas, Mr Bubbles!

With the holiday spirit still in mind, I've treated the pinball machine with some respect and love and gave it a few gifts - in the shape of additional game programming features!

I've detoured from "creating the most advanced and deep ruleset the world has ever seen (tm)" and instead focused on getting basic functionality in place. I figure I can always flesh out the features every now and then instead. A strategy that proved to be most effective. I've added basic functionality for most major game play features including:

* Little Sisters
* Rescue / Harvest (videomode)
* Steinman multiball ("Ugly ugly ugly!")
* DNA / ADAM Frenzy
* Photo targets
* Drones
* Plasmids / "Plasmirage" multiball
* Rapture multiball

The features are pretty much stand-alone at the moment, as I've mostly skipped the planned interleaved parts. I've got a lot of sound effects in place as well as generic "hurry up" quotes. The game is now playable and enjoyable, which is a good thing! Next I aim to get the following features in place:

* Mr Bubbles / "Big Rage" multiball
* Splicers
* New Years Eve
* The Masterpiece  
* The rest... 

The biggest challenge so far has been to do "timed" events properly, or rather events that keeps running and doing things over several cycles, as it includes using a lot of counters and variables to keep track of various states and what not. I've found myself having to deal with, and code, a large number of different interconnecting functions simultaneously, for instance with the Little Sister mode. It's easy to get side tracked and think "oh, right - I also need this!" while doing something completely different.

Even the most basic function needs a menu setting, a start and stop state, it's own variables (which is unique to each player), an update loop and rule set for interacting with other functions etc. The list goes on and increases as the complexity of the function/mode grows. It's rather easy to miss things, for instance - one time I stared myself blind on the code for a mode and couldn't figure out why the frak it didn't work. Turned out I missed to run the update-function for the mode completely...

The plan is to at least have something in place for every switch and lane, even if it means just getting points and getting a message displayed. I've skipped almost all videos at the moment (this can be added quite easily in the future) - I just really want the machine to be in an alpha or beta state at the very least, which seems plausible at the moment, thankfully. 

1) Old rubbers. Hard to see in the picture
but when stretched this rubber is
visibly cracked almost everywhere.
I had to do the first routine maintenance of the machine, which included new rubbers for flippers and slingshots! It's mostly because of air and sun exposure as it hasn't really been played a lot. I've also wiped and cleaned the playfield, as well as adjusting some hardware (including the drain, which sometimes failed to kick the ball, resulting in multiple drain registrations and thus ending multiballs prematurely...).

Felt a little weird to perform maintenance before it's even completed, but hey, it sure feels like a proper machine now. The future for the machine looks promising - 2015 will most likely be the year I'll finish it! ;)