Author Topic: solenoids causing IC to malfunction  (Read 3506 times)

0 Members and 1 Guest are viewing this topic.

Offline zacajTopic starter

  • Contributor
  • Posts: 12
solenoids causing IC to malfunction
« on: January 23, 2015, 02:05:42 am »
The setup:
I'm trying to build a pinball machine, powered by a STM32F3DISCOVERY.  I'm using some TLC5916IN (http://www.farnell.com/datasheets/1831407.pdf) to control the lights.  I took a 30V DC power supply from an old machine to use.  The flippers are wired with one side connected to the +30V, and the other side connected to the buttons (just a regular set of contacts) in the cabinet, which is then connected to the ground.  I have new 1n4007 flyback diodes across all of the solenoids, and a 47uF electrolytic capacitor across the power supply (69K7949, http://www.illinoiscapacitor.com/pdf/seriesDocuments/CKH_CKE%20series.pdf).  My LEDs and the TLC5916INs run off a 3V wall plug, which I have put 0.1uF and 0.01uF ceramic capacitors across, in addition to the ones in the plug itself.  The 3V ground of the LED controllers (open drain) connects to the 30V ground (I need a common ground because I also have MOSFETS controlling some other solenoids), and then I have ~1' wires running from there to each of the power supply grounds (which I believe is how a 'star ground' should be?).   

What happens:
I have the 3V and 30V on, but the CPU isn't connected, so the LED controllers don't receive any signals, and all the LEDs stay off.  When I flip, very often, some of my LEDs will randomly turn on (or sometimes off, once they're already on).  With the CPU on, I occasionally get random 'phantom' input firings while flipping, on inputs that are connected directly to the CPU, even when I verify 100% that my input's contacts are open.  This only happens when I activate coils like the flippers or bumpers that are controlled just by switches to ground.  When I fire solenoids via MOSFETs with the CPU, I don't have any issues.   

I also have some input shift registers, that I use to periodically check switches that aren't momentary.  I was getting phantom inputs very occasionally from them too, so I put decoupling capacitors across their power pins, which 'seems' to have fixed that.  I do not have any decoupling capacitors on my LED chips currently, but I have been hesitant to just do that, because that wouldn't address my phantom direct input problem (not  like I can put more capacitors across my CPU).  Getting random fake pulses makes me suspect that something is wrong with my protection, it seems to me that it shouldn't be happening if I've designed everything right, and it may be causing other damage I'm not seeing, so even though I could just decouple the LED chips and buy some more shift registers to use instead of direct inputs, I'd rather solve the problem, unless it turns out that this is normal...
 

Offline Paul Price

  • Super Contributor
  • ***
  • Posts: 1419
Re: solenoids causing IC to malfunction
« Reply #1 on: January 23, 2015, 08:50:39 am »
You've answered your own question; the mechanical switches are causing the problem.

You need to quiet them down. The arcing in the mechanical switches needs to be silenced by diodes, snubber cap-resistor circuits, or just use the mechanical switches to turn on/off a MOSFET like you are activating the other quieted solenoids.
 

Offline zacajTopic starter

  • Contributor
  • Posts: 12
Re: solenoids causing IC to malfunction
« Reply #2 on: January 23, 2015, 06:30:55 pm »
I've been searching for how to calculate the resistor and capacitors needed,  I haven't found any sure formulas. Is that any go-to formula/procedure, given voltage, resistance of the coils, etc?
 

Offline free_electron

  • Super Contributor
  • ***
  • Posts: 8517
  • Country: us
    • SiliconValleyGarage
Re: solenoids causing IC to malfunction
« Reply #3 on: January 23, 2015, 07:54:56 pm »
series resistor, clip and clamp into a hard source , ferrite to get rid of rf crap , rc filter followed by schmitt-trigger.

make sure your 'dirty' signals don't shoot into system ground.

Professional Electron Wrangler.
Any comments, or points of view expressed, are my own and not endorsed , induced or compensated by my employer(s).
 

Offline Paul Price

  • Super Contributor
  • ***
  • Posts: 1419
Re: solenoids causing IC to malfunction
« Reply #4 on: January 23, 2015, 08:12:32 pm »
Snubbing on a pinball machine doesn't have to be rocket science.

If you've not already put a diode across the inductive coils activated by the mechan. sw's , do this first.
A simple snubber circuit that will probably work across a switch contact would be a 10 to 22-ohm resistor in series with a .1uF cap.  The higher the voltage you are switching, the higher the resistance, for <50 volts something like these values would be just fine if the current capability of the switch contacts are >1 amp range.

The resistor can be qw as small as 1/4W and the snubber cap working voltage must be greater than the supply voltage.

An oscilloscope peek at each side of the switch after attaching a snubber will tell you quick if you've quenched the glitcher. The proof of the pudding is also in the tasting..the machine will start consistently to be working right.
« Last Edit: January 23, 2015, 08:28:27 pm by Paul Price »
 

Offline zacajTopic starter

  • Contributor
  • Posts: 12
Re: solenoids causing IC to malfunction
« Reply #5 on: January 23, 2015, 11:54:08 pm »
Snubbing on a pinball machine doesn't have to be rocket science.

If you've not already put a diode across the inductive coils activated by the mechan. sw's , do this first.
A simple snubber circuit that will probably work across a switch contact would be a 10 to 22-ohm resistor in series with a .1uF cap.  The higher the voltage you are switching, the higher the resistance, for <50 volts something like these values would be just fine if the current capability of the switch contacts are >1 amp range.

The resistor can be qw as small as 1/4W and the snubber cap working voltage must be greater than the supply voltage.

An oscilloscope peek at each side of the switch after attaching a snubber will tell you quick if you've quenched the glitcher. The proof of the pudding is also in the tasting..the machine will start consistently to be working right.

Would it hurt to go 'bigger' to be safe, or is there some sweet spot I'm aiming for?  I don't have an scilloscope to test with, so I'd prefer to get it 'right' on the first try, if possible
 

Offline Paul Moir

  • Frequent Contributor
  • **
  • Posts: 926
  • Country: ca
Re: solenoids causing IC to malfunction
« Reply #6 on: January 24, 2015, 04:21:48 am »
I've had this app note from TE bookmarked for years, has a good quick guide:
http://www.te.com/commerce/DocumentDelivery/DDEController?Action=srchrtrv&DocNm=13C3236_AppNote&DocType=CS&DocLang=EN
Over on about page three.

 

Offline zacajTopic starter

  • Contributor
  • Posts: 12
Re: solenoids causing IC to malfunction
« Reply #7 on: January 27, 2015, 03:09:43 am »
I bought some 0.1uF, 50V capacitors and 15ohm, 3W resistors at the local electronics store, and they fixed three of my flippers, but one still is causing problems, even after I replaced the flyback diode
 

Offline Kjelt

  • Super Contributor
  • ***
  • Posts: 6460
  • Country: nl
Re: solenoids causing IC to malfunction
« Reply #8 on: January 27, 2015, 08:21:34 am »
Quote
I have the 3V and 30V on, but the CPU isn't connected, so the LED controllers don't receive any signals, and all the LEDs stay off.  When I flip, very often, some of my LEDs will randomly turn on (or sometimes off, once they're already on). 
Do you have all the inputs of the led driver esp. the clock pulled down? Doesn't sound like it, otherwise you might have a grounding issue.
Look at how the "old school" end of the 80's Bally flippers are built as guidance, with their metal groundplane at the back of the cupboard, seperate powersupply board and how they have "routed" all the interconnection wires and laid out the solenoid board.
If nothing else works out you can try a final dirty solution, let the switch not directly drive the solenoid it self but another FET that drives it.
 


Share me

Digg  Facebook  SlashDot  Delicious  Technorati  Twitter  Google  Yahoo
Smf