Enhancing MCU Stability in Industrial Power Environments - Page 1
Forum section: electronics / projects

author: QWERTYQWQ
author_rank: Contributor
timestamp: February 17, 2025, 09:00:33 am
content: Hello,We are designing a custom card for a factory. The card includes an MCU and a standard voltage transformer. The transformer specifications are 230V/9V, 1.5VA. The 9V AC output is rectified and converted via a DC-DC converter to supply the MCU and other components. The maximum observed current consumption is between 40-60mA, so the transformer is more than sufficient.However, I am facing an issue with the factory power line where the card is connected. The MCU experiences power cycles and resets due to two possible reasons:1. When an external load in the factory is switched on, either the neutral voltage rises momentarily or the phase voltage drops, causing the MCU to reset.2. This issue does not occur when testing in the office but happens intermittently in the factory environment after installation.My question is: What improvements can be made to the design to make the card more resilient in such environments? I would appreciate your insights on this matter.

author: SteveThackery
author_rank: Super Contributor
timestamp: February 17, 2025, 09:47:46 am
content: Are you sure it is "brown-outs" that are causing the resets? You could mitigate this with a large electrolytic across the DC lines.I ask because it could also be spikes - on the power lines or radiated - causing the MCU to crash.

author: QWERTYQWQ
author_rank: Contributor
timestamp: February 17, 2025, 10:18:33 am
content: Thanks, Steve.I just ran a test and completely forgot that the MCU's IWDG was active. I disabled it and ran the test again, which led me to an even more interesting point. Now, the MCU sometimes freezes and sometimes resets, but in a completely unpredictable manner. There is no clear pattern—it happens occasionally when a machine starts running or when a running machine is turned off.

author: Siwastaja
author_rank: Super Contributor
timestamp: February 17, 2025, 11:16:49 am
content: Voltage dip seems the most unlikely cause. This is probably EMC issue. In the widest sense of the word.Your question is just huge. Books have been written about it. In order to legally sell your thing to said factory, you should have done compliance testing*. If this is some sort of hobby project in a friend's factory, or if "no one cares" in where you live, then it's still a good idea to start learning about electronics design and EMC now. It is impossible to give any simple suggestion what exactly could be wrong.But photographs of device, pictures of PCB layout and schematics give good starting points. Sometimes some obvious shortcoming pokes an eye of any experienced designer on this forum.*) in most parts of the world, this is

author: PartialDischarge
author_rank: Super Contributor
timestamp: February 17, 2025, 11:25:18 am
content: Quote from: QWERTYQWQ on February 17, 2025, 09:00:33 amBesides the typical good regulation of the secondary voltage via linear regulators and capacitors you will need a metal shield (can) that covers the MCU and all related electronics. Lines that go in/out should have RC as filters inside the metal shield.

author: coromonadalix
author_rank: Super Contributor
timestamp: February 17, 2025, 11:33:17 am
content: a simple test is : supply your mcu system on batteries where it is supposed to be finally installed, if the problem does not occur, or very few time(s) you already now it's ac basedspike, transients, unregulated, radiation of frequencies, the mcu can ou could pick some of them .... use ac power bars with line filtering, upgrade you ac supply with line filters, yes shielding play an important roleyou need to analyze your ac main to see whats going wrong with itneed to upgrade the board inputs outputs with transients supressorsif the factory has voltage instabilities, you must get an master electician to do checkups, check the earth / grounding

author: jonpaul
author_rank: Super Contributor
timestamp: February 17, 2025, 12:12:32 pm
content: use high quality power supply, with shielded transforer, UL/CE approved EMI filter, etc. not cheap chinese junkj

author: Siwastaja
author_rank: Super Contributor
timestamp: February 17, 2025, 12:17:50 pm
content: Quote from: coromonadalix on February 17, 2025, 11:33:17 ammeaning - something that enters through power lines. Can be much more than just out-of-spec mains voltage. Some high frequency interference in common mode.If the thing fails even when powered from battery, then that leaves either radiated immunity, or conducted immunity through whatever other interfaces there are to the box.

author: xvr
author_rank: Frequent Contributor
timestamp: February 17, 2025, 12:59:39 pm
content: There is a simple test can be taken: Bring your device to fabric but power it from battery. If stall/reset still intact - you have a case of radiated immunity. Sheiding of device could help (if you will be lucky enough).If it works fine - connect one power line (all of them in order), but still power from battery. If now device starts to fail - you have a case of conducted immunity. In general it solved by redesigning of PCB.If it still works fine than you probably have a case of direct power outage. Bigger capacitors (and may be filters) on PSU could help.

author: tggzzz
author_rank: Super Contributor
timestamp: February 17, 2025, 01:11:39 pm
content: Quote from: QWERTYQWQ on February 17, 2025, 09:00:33 amThere aremanyother possible reasons. Why have you discounted those?Whatevidencedo you have that the problem is on the power line?Nobody canbeginto give an answer without knowing howalllines entering/exiting the MCU are protected, your circuit's protection against EMI, the transients on the mains lines, the details of how it is connected to the rest of the installation, and then probably more.A couple of questions that might help us understand your understanding:what EMI/EMC compliance tests have been successfully passed?what do you believe "earth" and "ground" conductors do and don't mean and guarantee?

author: coppice
author_rank: Super Contributor
timestamp: February 17, 2025, 01:15:42 pm
content: Quote from: QWERTYQWQ on February 17, 2025, 09:00:33 amWhat level of EMI and EMC, both radiated and conducted, has your product been tested to? Industrial environments are generally brutal. What is good enough for consumer goods is rarely adequate for an industrial environment.

author: mtwieg
author_rank: Frequent Contributor
timestamp: February 17, 2025, 02:07:39 pm
content: Seconding tggzzz's post above. There are numerous possible explanations for what you're seeing, and standards exist for testing each of them:1. Mains supply issues (dips, interrupts, etc, see IEC 61000-4-11, also surges with IEC 61000-4-5)2. Conducted RF immunity (IEC 61000-4-6)3. Fast transient/burst immunity (similar to conducted RF immunity, but with different waveforms, see IEC 61000-4-4)4. Radiated RF immunity (IEC 61000-4-3)5. ESD immunity (IEC 61000-4-2)I'm not telling you to immediately buy and read all those standards, just trying to make it clear how many aspects there are to just the immunity side of EMC.Power supply issues are probably the easiest to rule out, as others have suggested just power it with a battery and see if the problem goes away. However that wouldn't prove what about the power supply is actually the problem, could be a brownout or it could be acting as a path for conducted emissions...Basically if you're serious about this, what you do it remove every connection between your system and the outside world, but retain a means of determining if it's functioning or not (like an LED). If the problem still happens in that state, then it's radiated emissions. If not, you restore its connections one by one until the problem surfaces again. Then you have identified a conducted emissions path and can start troubleshooting that.

author: coppice
author_rank: Super Contributor
timestamp: February 17, 2025, 02:11:09 pm
content: Quote from: mtwieg on February 17, 2025, 02:07:39 pmThose standards are based mostly around what is adequate for consumer environments. In industrial environments you will usually need to go well beyond what they say to achieve rock solid results. On the other hand, if you fail any of those tests your product is REALLY not going to cut it in industrial use.

author: QWERTYQWQ
author_rank: Contributor
timestamp: February 17, 2025, 02:41:55 pm
content: I’m incredibly grateful for all the wonderful responses and tips.The tests you mentioned regarding my card have not been carried out. Only debugging on the application and microprocessor side has been heavily focused on. Unfortunately, only very basic tests were applied. The card is completely user-specific, and since it is not mass-produced, I wanted to avoid creating a heavy workload. It wasn't a project I paid much attention to. In fact, I was quite confident it would work and wouldn’t cause any issues. But now, I’m absolutely shocked.The biggest piece of evidence that leads me to believe there might be an issue with the power lines is, as I mentioned at the beginning, that my card started showing abnormal responses simultaneously with machines that were either started in a remote corner of the factory, shut down, or exposed to heavy loads.Tomorrow, the first thing I will do is power the MCU externally with a battery. After that, I will start connecting the machine cables to the card, section by section. This way, I plan to debug the issue.However, it looks like this is going to cost me a fortune. I will try to convince the factory owner to hire a good electrician. Hopefully, the problem is related to the power supply on the factory line. If that’s the case, I might be able to get my payment without further hassle.

author: coppice
author_rank: Super Contributor
timestamp: February 17, 2025, 03:04:47 pm
content: Quote from: QWERTYQWQ on February 17, 2025, 02:41:55 pmIf you are fairly confident the problem is through the power line, rather than the air, you can try temporary battery power, as others suggested. If that confirms the power line hypothesis, you can try putting the mains cable to your device though a ferrite ring. Those things often fail, but often work wonders, and are quick and cheap to try.

author: PartialDischarge
author_rank: Super Contributor
timestamp: February 17, 2025, 03:28:24 pm
content: Quote from: QWERTYQWQ on February 17, 2025, 02:41:55 pmWhen you do electronics for industrial applications expect common mode noises, overvoltages(this is common), diff mode noises, radiated EMI, ESD, humidity... so you need to be prepared. Don't get into this kind of designs if you're not confident about it.The minimum that would solve your problem as I suggested is: linear regulators with big capacitors and shielded electronics with RC filters for any filter going in/out. For any long cable (signal/control) either use isolators or strong noise filtering.

author: Siwastaja
author_rank: Super Contributor
timestamp: February 17, 2025, 04:01:47 pm
content: Yeah. Before starting to throw in ferrite beads however, do post photos, schematics, layout pictures. Let's check if it has some abomination which easy slips in but is also easy to fix once recognized by more experienced folks.For example: lack of ground planes. Use of split planes or USB "grounding" with magical components. Lack of bypass capacitors. Long wires to external IO with no protection or filtration... Long PCB traces crossing split planes and other similar antennae. Fix them first. Then shield with external box. Then filter IO with most suitable components (RC filters, ESD protection/clamp diodes, common mode chokes...) - only after that start adding ferrite beads on cables.Ferrite beads are used mostly for reducing emissions (also for immunity) when high-speed signals are involved: e.g. VGA cables, USB cables. They are rarely useful on mains power cable. If you see one used, it could be because the DUT almost passes without but needs another 1 or 2 dB of margin. Here I suspect more serious failure.

author: tggzzz
author_rank: Super Contributor
timestamp: February 17, 2025, 05:16:38 pm
content: Quote from: QWERTYQWQ on February 17, 2025, 02:41:55 pmWith heavy machinery transients you have to realise that there's no such thing as "ground" or "earth", that interconnecting wires are antennas, and that different machines may be on different phases.Hence it is wise to be paranoid about isolating inputs and outputs.