#qi-hardware IRC log for Wednesday, 2015-01-28

--- Wed Jan 28 201500:00
whitequarkhey wpwrak_ DocScrutinizer05 03:25
whitequarkso there's a circuit like this: https://pbs.twimg.com/media/B8aAls9CEAIlrhs.png:large03:25
whitequarkwhen SW1 is closed, the MCU input connected to SW2 (normally open) trips spuriously03:25
whitequarkthe solenoid at the right is actually a pinball machine flipper03:29
DocScrutinizer05(sorry, sick. maybe there's some old slivers where my brain should be)03:29
whitequarkwhat I don't really understand is,03:29
whitequarkeven if the high transient currents in the wiring to the solenoid induce voltage elsewhere03:29
DocScrutinizer05ooh pinball, now you got my full attention03:29
whitequarkit shouldn't happen to a wire that is essentially floating03:29
whitequarkand pulled down on the MCU side (10k on-chip resistor)03:30
DocScrutinizer05it will03:31
whitequarkhow'd that even work? you do not have a closed path03:31
whitequarki mean, there's probably some parasitic capacitance between that wire and MCU ground03:32
whitequarka few dozen pF at most03:32
whitequarkand it IS pulled down, not just floating03:32
DocScrutinizer05actually EOS is to force high current through solenoid until it moved to end position. Then the contact opens to reduce current flowing through solenoid03:32
whitequarkyep, that much I gathered03:32
whitequarkit should consume 8A@30V for a few ms03:32
DocScrutinizer05(unrelated mostly to the problem here)03:33
whitequarkthe layout is03:33
whitequarkbut i guess that's inevitable03:34
whitequarkso, any ideas what can be done to fix the spurious SW2 trips?03:36
DocScrutinizer05have the pair(!) of wires from MCU to sw2 twisted, keep them away from other high current wires. Increase load (inside MCU) to 1k or less, add a RF capacitor and naybe a ferrite bead03:37
whitequarkok, so what i suggested to her wasn't wrong...03:38
DocScrutinizer05that's RF interference, not capacitive phantom current03:38
DocScrutinizer05SW1 creates lots of RF noise03:38
DocScrutinizer05actually EOS switch, not sw103:38
whitequarkputting a snubber on EOS switch also didn't do anything to mitigate this03:39
whitequarkRF capacitor where?03:40
whitequarkacross the solenoid?03:40
DocScrutinizer05bead and 47pF on MCU input03:41
DocScrutinizer05also consider the magnetic field of solenoid03:42
DocScrutinizer05whitequark: what is sw1?03:53
DocScrutinizer05I assumed it was related/mounted to flipper solenoid. Maybe it's not at all?03:54
DocScrutinizer05err sw2, sorry03:54
whitequarksw2 is a button on the photo03:54
whitequarkso it's not mounted on solenoid03:55
DocScrutinizer05which button?03:55
whitequarksee the red wire at bottom?03:55
DocScrutinizer05well, "wire"03:57
whitequarkit closes red/green (ignore blue, it doesn't exist)03:57
whitequarkand so switches on the solenoid03:57
whitequarksw2 yes03:58
DocScrutinizer05and what's sw1 then?03:58
whitequarkanother unrelated switch elsewhere 03:59
DocScrutinizer05so how does sw2 switch on the solenoid?04:00
whitequarki mixed these up04:00
whitequarkSW1 is the red button on the photo04:01
whitequarkSW2 is a switch elsewhere04:01
DocScrutinizer05make sure neither of both contacts of SW2 has connection to any GND or huge metal area04:02
DocScrutinizer05make sure the wiring from MCU to SW2 is twistet pair04:03
whitequarkDocScrutinizer05: so, this is zacaj's pinball machine04:04
DocScrutinizer05also make sure MCU and solenoid don't share GND wiring04:05
whitequarkzacaj: where's SW1 located?04:05
whitequarker SW204:05
whitequarkthe one connected to MCU input04:05
zacajthere's a whole bunch,\ all over the playfield04:06
DocScrutinizer05roll over buttons?04:06
zacajmy MCU and my solenoids need to share GND at some point so that I can control them via MOSFETs04:06
DocScrutinizer05or taget or sth04:06
zacajyes, rollovers, targets, etc04:07
DocScrutinizer05sure connect GND, but don't share wiring04:07
zacajI have them connected at one point near the PSUs04:07
DocScrutinizer05star topology04:07
zacajno, not shared04:07
zacajjust wanted to clarify/make sure04:07
DocScrutinizer05you built MCU?04:08
DocScrutinizer05or at least know it?04:08
zacajit's an STM32F3DISCOVERY (http://www.st.com/web/catalog/tools/FM116/SC959/SS1532/PF254044)04:08
DocScrutinizer05what's the input ?04:08
zacajwhat do you mean?04:08
DocScrutinizer05GPIO with nothing else? opto coupler? relay coil?04:09
DocScrutinizer05GPIO with added pull down resistor?04:09
zacajit's just the wire running from the switch to the GPIO, with an internal pulldown04:10
zacajI tried adding a 10k external pulldown, and it didn't affect it at all04:10
DocScrutinizer05add a 500R pulldown, and proper clamping diodes to + and GND, and from that a 10k to GPIO04:11
DocScrutinizer05or 4k704:12
DocScrutinizer05GPIO are not made for that sort of input signals, really04:12
DocScrutinizer05you need to add some protective and impedance matching gear04:12
DocScrutinizer05ideally use opto couplers04:13
DocScrutinizer05actually the contacts of SW2 *need* a certain minimum current to keep them clean04:14
zacajso this level of spikes and interference from the coils is standard, (eg best I'm going to get) and I should be attempting to smooth it off in various ways at the inputs, instead of trying to lower the source of the interference?04:14
zacajalright..  some of my inputs go through a shift register, and they seem to work fine, so for the inputs I guess I could just re-route all my GPIO ones through that.04:16
DocScrutinizer05honestly I strongly recommend using opto couplers for this. Particularly for this environment04:16
DocScrutinizer05otherwise I wouldn't take bets on how long your chip will live04:17
zacajI'm also having trouble with my LED driver chips 'randomizing' sometimes when I flip, is there anything besides sticking some decoupling capacitors on I could do for that?04:17
DocScrutinizer05it deteriorates from the harsh input signals you encounter in a high current + solenoids environment like this one04:17
DocScrutinizer05generally try going low impedance design04:18
DocScrutinizer05use capacitors everywhere to clamp high frequencies (on digital signals)04:18
DocScrutinizer05use termination resistors in the range <1k on all inputs04:19
DocScrutinizer05design for mechanical switches like SW2 at least dealng with 20mA load04:20
DocScrutinizer05i.e. even lower termination resistors 04:20
whitequarkhm, clever04:24
zacajalright, thanks.  I'll give some of that a shot04:25
DocScrutinizer05and check about "self cleaning current" of contacts. I dunno if I vcan find the right wiki article right away. generally open contacts need a certain minimum current they have to switch, so any oxide etc will "burn away". Otherwise they eventually start failing04:28
DocScrutinizer05"open" as in "not sealed"04:29
DocScrutinizer05a reed contact in a glass tube with inert gas has few requirements like those. The contacts you deal with in your pinball cabinet need some tens of mA at least to stay "fresh"04:30
DocScrutinizer05oooh, btw: those glitches on sw2 even might be triggered by mechanical vibration, particularly when the contacts have insufficient load as elaborated in lines above. This would be a typical problem of contacts building up issues without self cleaning04:34
DocScrutinizer05you might test the conductivity (Ohms) of SW2 and see if it has some increased R_closed already04:35
DocScrutinizer05this would be a noisy effect seen every now and then, so a single short time test may not tell much, you need to probe the thing several times, opening and closing it slowly and gently. Ideally using a scope to see excessive bouncing etc04:37
zacajI tested with SW2 disconnected completely from the GPIO and I'd still get glitches04:38
DocScrutinizer05((trouble with my LED driver chips 'randomizing')) use proper 47pF 22nF supply voltage buffering next to the chips. Consider shielding of the whole circuit, eg. with a alu coated carton you place on the soldering side of PCB and connect the ALU to GND04:40
DocScrutinizer05((still glitches)) ooh on MCU?04:40
DocScrutinizer05i.e. the MCU glitches even on GPIO that are not connected to any wires?04:41
DocScrutinizer05if yes, you need to test of it still does when you short the input to GND04:41
DocScrutinizer05and you should consider proper shielding of your MCU PCB04:42
zacajshort the switch, or the GPIO?04:42
DocScrutinizer05and make sure your power supply is clean: place some huge ferrite bead on VDD wire, next to the MCU, and a buffer capacitor behind that04:43
DocScrutinizer05you said the GPIO is not connected to any wires and still gets glitches. So short to GND the PCB connection point where wire would go04:44
DocScrutinizer05that's the brute force low inpedance design ;-) When it still sees glitches even when GPIO grounded, we face another problem04:46
DocScrutinizer05if grounding fixes the problem, it's clearly cause by electromagnetic interference and can get fixed by appropriate measures04:47
DocScrutinizer05like low impedance termination, i.e. a 470R from GPIO input to GND04:47
DocScrutinizer05220R maybe, to give the contacts something to work with (self cleaning)04:48
DocScrutinizer05assuming this 3.3V in that drawing is correct04:49
zacajyeah, 3.3v04:49
DocScrutinizer05in addition you want a 47pF and a 100nF parallel to that 220R. And optimum would be a 10kR from all that to the real GPIO04:50
DocScrutinizer05hmm, rather place the 100nF parallel to SW204:51
DocScrutinizer05close to sw204:52
DocScrutinizer05iow at far end of the twisted pair wire04:53
zacaj'real GPIO'?04:54
DocScrutinizer05but still such design has a lot of "antennas" feeding all sort of noise to your MCU GND04:54
DocScrutinizer05CHIP GPIO <-10kR-> C-toGND, R-to-GND <---wire------04:55
DocScrutinizer05(noise to MCU GND) or to VDD 3V3 in your case04:56
zacajk, that's what I thought04:56
DocScrutinizer05opto couplers are a sure bet to fix all issues of such design04:57
DocScrutinizer05just use "separate" GND and VDD for external side of couplers04:58
whitequarkand same solution for MOSFETs04:59
DocScrutinizer05ideally yes04:59
zacajk, thanks.  I'm off to bed05:01
nicksydneywhitequark & wpwrak_ :  https://www.kickstarter.com/projects/1133560316/black-swift-tiny-wireless-computer10:42
wpwrak_nicksydney: cute ;-) and even open hw. btw, you should make a kickstarter project to create a taxonomy of all those little boards :)12:49
nicksydneywpwrak_: heheheh.....no need http://www.cnx-software.com/ already have the list :)12:50
wpwrak_but you could format it nicely :) break it down into tables comparing features, etc. that's more work that one may think12:52
nicksydneywpwrak_: maybe i should start a wiki page for that13:14
nicksydneywill do that in qi-hardware website later 13:14
kristianpaulsb0 15:43
sb0"optionally, could support a Si Avalanche Photo-Diode (APD)"15:44
sb0are those going to be less expensive?15:44
kristianpauldont know15:47
--- Thu Jan 29 201500:00

Generated by irclog2html.py 2.9.2 by Marius Gedminas - find it at mg.pov.lt!