I find the hardware / software discussion very interesting..
Yes, either CAN fail, but they don’t have the same failure modes at all.
Once code is “stable” it can be tested thoroughly, and it’s behavior should be
as predictable as that testing was thorough. As long as the definition of “code”
is the complete package, MIOS, application, and settings, and the testing includes
all variations of MIDI input, valid and invalid.
I’d LOVE to say that tested code never fails, but I have had bit errors in the
program storage of PIC chips.. Does that count as software error or hardware error?
But the code will always be subject to the hardware it is running on. No matter how
well the code is written, a power failure, loose connection, or blown fuse can always
bring the software down. A great mind in a frail body will soon perish.
Getting back to the discussion at hand, I suggest the following considerations:
A stuck output may burn a solenoid, but it will not put life or limb in peril, so there is
no need for “extraordinary” safety measures. Another reason to avoid explicit hardware
timers for each output are that they would complicate the option of letting note velocity
control pulse duration.
I think a reasonable protection level could be reached with slow-blow fuses, either
at the power supply or maybe for each separate solenoid if you want overkill.
Another option could be polyfuses, as they are self resetting. This has the advantage
of reducing service visits, but can give a bad reputation for intermittent reliability
if nobody fixes the root cause of the overcurrent problem.
As technology becomes more accessible, better ways become available if we want
take it that far. A simple current monitor reading back to an analog input would allow
the PIC to monitor current usage while operating, and then establish a “baseline” of
current consumption while it operates. Now we can be smart enough to know when
one (or all) the outputs are drawing more current than they used to.
It sounds “over the top”, but it’s neither difficult nor expensive to do. Just a good
challenge to teach our machines to do self-diagnosis. Any abnormal readings could
be transmitted by SysEx messages that describe the variance.
Finally, from a failure analysis perspective it’s important to consider, a bad solenoid
can destroy the driver transistor, and a shorted driver transistor can overheat and destroy
a solenoid. I’m not the only tech here who has a background in pinball machine repair.
Fun to think about, I hope I didn’t get too far off-topic.
Have Fun,
LyleHaze