Scoping a mains powered switched inductive load - Page 1
Forum section: electronics / projects

author: Truglodite
author_rank: Newbie
timestamp: June 01, 2019, 01:13:39 am
content: Hello all,I hope I don't sound like the guy who's smart enough to get in trouble, and too dumb to avoid it...I am troubleshooting a problem I'm having with a microcontroller operated relay that switches a small mains powered shaded pole motor on/off (110VAC... I'm in the US). In particular, when the uC turns the relay off, transients disturb the DC side enough to where I am seeing false button presses executed. I've researched a bit on fixing the problem using an RC snubber to absorb the transients. I could measure the motor current with low bandwidth using a clamp, but don't think I have the correct equipment to measure the inductance of the motor (suggestions how to do this with an average hobbyist's tools are welcome).So to optimize the RC values I figured I could capture the voltage across the relay with my scope (1054z w/ 2150 probes) as I adjust R to minimize spikes when the relay is switched (w/ sort of 'standard' C values for this application of 0.1uF and 0.2uF). The probes can handle the 110VAC sure, but I worry exactly what voltages the probe would have to deal with across that relay when the motor is switched off. It's just a small shaded pole motor in a food dehydrator... much like a desk fan motor... probably 50W or less. So I am guessing transients are not going to hit ~10kV/1kA, but I just got my scope and destroying it would be a disaster for me (I'd rather guess and test over the next few months than do that lol).So if I was to do this, would I need 100x probes to be safe? ...or given the specs would it be ok to probe it with my stock 10x probes?Since I mentioned mains work, and probably sound like a total noob... I also will mention I've worked in the construction industry doing electrical for a while, and have plenty of experience (30+yrs) with lower voltage measurements and design... just want to avoid having to spend on 100x probes since I probably wouldn't use them often... and the motor seems too small to have transients that really bite... but that's where my experience falls short. I could probably like I said just guess and test, but my plan is to share the snubber specs with others that have the same dehydrator. I figured one of those glass passivated paper impregnated RC snubber units would be perfect, but I don't want to tell a bunch of ppl to get a part that is far from optimal, and end up having issues with it.Thanks in advance,Kevin

author: T3sl4co1l
author_rank: Super Contributor
timestamp: June 01, 2019, 02:04:34 am
content: 300V 10x probes are fine. Don't leave them connected forever, a surge could take them out (has to do with the CAT rating), but that's unlikely just for a look.Don't use the ground clip, however -- you have some chance of clipping it to the wrong line, which will obviously not be pretty*. The scope is already grounded (assuming the mains outlet is), so you have some reference to the line already. (The neutral may also have a few volts on it, even though it's [supposed to be] grounded at the panel.)*The scope may survive, maybe even the probe. It's a lot of noise and smoke (and a blown fuse/breaker) for a simple mistake though.You will likely see a nice spike coincident with turn-off, and maybe some rapid-fire spikes as the contacts open up and the motor inductance discharges across the gap. Don't discount the rising edge at turn-on either -- it comes with a very small spark as the wires are charged up; this happens in mere nanoseconds, and can disrupt susceptible circuits just the same.Note you'll have to flip the switch a few times to get a good trigger. Turn-off current is maximum near zero-crossing. Turn-on rise is worst at peak voltage.Products are normally tested for EFT (electrical fast transients) and ESD, and filtered and shielded to prevent upsets due to these, which can come from within (like your relay contacts) or from anything nearby. Best practice is to use a circuit board with ground plane, filtering on external connections, and preferably a metal (shielded) enclosure.Tim

author: bdunham7
author_rank: Super Contributor
timestamp: June 01, 2019, 04:09:14 am
content: I have one of these and it is actually pretty good. It is not a huge investment and you may find it useful in the future--I sure have, and not just for high voltage work. Just read the instructions and pay attention to the V-Hz derating curve.https://www.ebay.com/itm/300MHZ-Oscilloscope-clip-probes-100X-up-to-5KV-for-Tektronix-HP/183013764876?hash=item2a9c786f0c:g:69YAAOSwWEZaWFJzYou are right to address your RFI issues in the mains with X and Y capacitors, but I don't know that you need to do that much research. Just do your best to capture the biggest spikes you can, put some X and Y caps in and then see if they go away. I don't think fine tuning is all that important. However, I don't think you should overlook the frailty of your low voltage control circuits--they should have their own EMI filtering and shouldn't freak out so easily. You need to spend some time with the scope on the low voltage side. I have some experience with this, and my only advice would be to not be surprised when you see very powerful but very short spikes--you may need to use the full bandwidth of your scope and the peak detect function.

author: Truglodite
author_rank: Newbie
timestamp: June 01, 2019, 03:54:41 pm
content: Thank you both for the very useful replies. I had a feeling it would be OK since the probes are CAT2 rated and this is technically speaking a CAT2 situation. I won't be hooking up a ground strap since the scope is referenced to mains earth; didn't plan to but thanks for the healthy reminder. I do plan to sit down and play with it for a while to get some good triggers and a chance of capturing max Vpp for both on and off. That said, I wouldn't leave it hooked up unless I'm there using it... and I'll make sure this testing isn't done on a day with thunderstorms hehe. I like the mention of zero crossing vs peak in the on vs off situations. It will likely take a many tries to get close to the full picture. While I'm at it I'll be sure to have a look at the low volt side as well.I understand that researching this is a bit overkill, but that is my nature LOL. This is partly to satisfy my (perhaps unhealthy) drive for perfection, and another part for me is academic (observing EM theory in action). It feels like it would be at least a minor failure on my part to not at least try and characterize the transients with various RC snubber values while I'm in there having fun... and I've already got the parts to run a small test matrix on it.bdunham7, thanks for the link to the Tek HV probes! Heck $40 isn't much I'll grab a set for that. I was looking at some Caltest stuff that was more in the $100 range.Now that I'm thinking about it, I'd like to probe the low volt side at the same time if possible. The 5V is supplied right now by a wall wart... and of course that makes me pause for a second with the probes. I'm not sure how the wallwart was designed, but I'm guessing it's isolated as it doesn't have an earth pin. I'm overthinking that one I think... should be fine if I just verify the 5V gnd is either isolated or tied to earth (using perhaps low impedance measurement), correct?Thanks,Kevin

author: bdunham7
author_rank: Super Contributor
timestamp: June 01, 2019, 04:21:33 pm
content: Just to be clear, those are generic probes, not Tek branded. Still, my example seems pretty good--and I've used it on a 4kVp-p 20kHz power supply (o-scope CRT HV driver). Hands-off, of course--you should always be nervous at those levels!As for your wall wart, while there may be some leakage current, you can still use the ground lead on either side and the leakage current will just go to ground. All mains-powered systems have at least some such leakage current--as long as it is very low, there are no safety or ground current issues. You would need to test it in various configurations, grounded and ungrounded, to find your interference.

author: Truglodite
author_rank: Newbie
timestamp: June 02, 2019, 03:02:40 pm
content: Well, all of my equipment (and myself) survived the acid test yesterday, but the test did not go as planned. The scope read 360Vppdue to capacitive coupling (ghost voltage). To elaborate... the scope and DUT (dehydrator) were plugged into the same GFCI protected mains branch. Since the DUT is ungrounded (2 prong plug), I didn't connect the probe ground to DUT neutral (GFI may disagree anyways). So the DUT was left floating. I initially thought the ground return path (scope ground to panel and back to DUT neutral, no conduit) wasn't long enough to act up, but it obviously is creating performance issues.I know for sure the real voltage is 120VAC verified with my fluke 113 low-z mode. So now I have 2 questions before I continue.1) What is the accepted best practice to probe a non-grounded mains powered device... iso transformer and/or differential probes? Both routes are pricey, so...2) In my situation, would it be an acceptable solution if connect my fluke in parallel to the scope probe, and use it's lo-z mode to 'preload' the test point? ...hopefully removing the high impedance source voltage leaving only the 'real stuff' on my scope display?3)If 2 is OK, is there a DIY load that folks like to use that works like fluke lo-z? I figured a thermistor in series with a 1W 10K should work, but wanted to ask in case there is already a tested project out there I could look at. The idea is my Fluke is for my work, and I like to forget things. Having a lo-z circuit that stays with my scope would mean my fluke is always in my work bag when I leave for work.Doesn't solve the floating issue anyways. Any other suggestions?Kevin

author: techman-001
author_rank: Frequent Contributor
timestamp: June 02, 2019, 04:22:06 pm
content: Quote from: Truglodite on June 01, 2019, 01:13:39 amHi Kevin,I'm wondering if the problem is with the micro software or switch operation detection circuit rather than the release of the relay ?So I have some questions you may like to ask yourself ?Is the micro controller a new device or a old one that used to run fine until recently ?Is the switch old and possibly dodgy perhaps briefly activated by vibration from the relay or motor turning off ?I assume the relay has a reverse polarity diode across its coil ?Is the switch detector circuit low impedance for spike rejection?Does the micro firmware have decent switch debounce rejection ?Is there sufficient separation of the mains and micro wiring so spikes aren't picked up ?If you're getting spikes that are upsetting the micro, is it resetting or other undefined behavior as well, or is it only related to spurious 'switch' detection ?Does the switch problem only occur when the relay is de-energized ?Is there local bulk capacitance at the micro Vcc pins ?Is the lead to the wall wart running parallel to mains leads,perhaps the motor wires ?Just my 2c

author: Truglodite
author_rank: Newbie
timestamp: June 02, 2019, 05:59:53 pm
content: techman, I appreciate your good list of items to go over:Quote from: techman-001 on June 02, 2019, 04:22:06 pmIt is a new device, and I've swapped it out with a couple other known working devices with the same result.Quote from: techman-001 on June 02, 2019, 04:22:06 pmThe switches are all brand new, and this happens even if I physically remove them from the vibrating chassis.Quote from: techman-001 on June 02, 2019, 04:22:06 pmYes, I'm using a well designed relay module that has an isolated input (opto-iso+driver). So the uC shouldn't be seeing spikes from the coil.Quote from: techman-001 on June 02, 2019, 04:22:06 pm4k7 pullups, and I've even tried 1k with the same resultQuote from: techman-001 on June 02, 2019, 04:22:06 pmYes I did implement software debounce... IIRC ~100msec, and scoping the buttons they settle <5msec max.Quote from: techman-001 on June 02, 2019, 04:22:06 pmHere is where I may start running into problems. There was only so much room to pass the mains/motor lines and uC logic lines. The bundles do touch as they go through a hole, but the "parallel length" is just 1" or so. I didn't think that would result in much capacitance, but maybe it's enough?Quote from: techman-001 on June 02, 2019, 04:22:06 pmIt is always a behavior defined by code... literally as if I hit an up/down/select button right when the motor shuts off. No undefined states, no reset, no crashes etc. That's what led me to try the 1k pullups at first.Quote from: techman-001 on June 02, 2019, 04:22:06 pmYes, so far no issues switching on, and no issues while running or while off. Only issues when the motor relay is opened.Quote from: techman-001 on June 02, 2019, 04:22:06 pmYes, on top of the built in decoupling caps in the pro-mini, I also added 0.1uF and 1nF ceramics to the uC Vcc pins.Quote from: techman-001 on June 02, 2019, 04:22:06 pmSimilar to the above question, yes for a short length it is parallel.To extend what you were getting at to my application... yeah I probably should redesign the enclosure and wire routing to minimize/eliminate mains || TTL routing. Since it is a publicly available design, I will do this, but that said, my haphazard testing has shown a major spike when the fan relay opens, and already a significant increase in the rise time (and of course reduction in peak Voltage) of the transient when I added a random valued snubber in parallel (using parts I had on hand, 0.33uF/X2+200ohm/1W). Rerouting wires might help, but rerouting and adding a snubber would be even more reliable I think. I plan to give the circuit with random snubber a more thorough run just to see if the snubber stops the phantom button presses (like 100 cycles... without my scope attached... the floating issue turns me off). If that doesn't work, I'll have time before more assortment of snubbers arrives to redesign the enclosure.Diverting back to the topic of measuring inductive loads... I should add "on a floating circuit"... with this exercise I realized that such measurements will require either an iso transformer or diff probes. I think the transformer route will be adequate for most of my needs. Then, if I find myself having to probe more energetic transients than my probes can handle, I'll consider investing in 100x HV probes. Diff probes are nice, but decent ones cost more than my scope lol!Kevin

author: techman-001
author_rank: Frequent Contributor
timestamp: June 05, 2019, 12:16:59 pm
content: Quote from: Truglodite on June 02, 2019, 05:59:53 pmHi Kevin, making any headway with that problem ? Your answers indicate the project is in good hands!Whilst I agree a snubber is a good idea, what happens if something else generates a similar spike on your local mains power ?I wonder if testing the problem switch line by adding some jumpers right at the MCU which totally disconnect all problem switch wiring and short out the GPIO pins concerned (so they can't change state), then turning the motor on and off separately while observing what the controller does might be useful data?

author: Truglodite
author_rank: Newbie
timestamp: June 06, 2019, 12:05:27 am
content: @techman-001I haven't given much thought about spikes on the mains causing an issue like this, but I suppose it wouldn't hurt to add an MOV in case. I do have a few extras laying around so it wouldn't be difficult to do. Do you think that would be adequate?I did do some testing, and found the hardest part was triggering the relay off at the right time... not that my cheap oscope's poor response helped much. Using slope triggers was not working well given the somewhat random waveforms involved. I ended up doing most of the testing with a pass/fail mask at 10ms/div. That seemed to capture more than other configurations, but even then only 1 out of 4 events showed usable data; the other 3 would be useless flat line waveforms.I figure the rigol 1104z just can't keep up with the task at hand (too much 'time off screen' if you will). It got the job done, but I'm definitely not looking forward to researching AC transients with it in the future.When I did get a strong transient to display near zero cross without a snubber, it was impressive/scary to see the slew rates and peak voltages involved as the contacts were arcing. The first 3 images show no-snubber at various zooms. Compare that to the last image from one of the better snubbers I tested (Kemet 0.22uF/220ohm X2). So far so good in limited real world testing.

author: techman-001
author_rank: Frequent Contributor
timestamp: June 07, 2019, 10:57:17 am
content: Quote from: Truglodite on June 06, 2019, 12:05:27 am

author: T3sl4co1l
author_rank: Super Contributor
timestamp: June 07, 2019, 08:07:14 pm
content: Hi,Can you edit your quote markup to be readable?If in doubt, hit previewTim