ARDUINO: EMF problems - Page 1
Forum section: electronics / general

author: Brexei
author_rank: Contributor
timestamp: September 26, 2023, 07:24:46 am
content: Hello everyone,In the past year i have managed to build my own CNC, using an Arduino mega + ramps 1.6 shield etc. It works fine, for the moment, but i have a problem with the electronics:When i power on the vacuum cleaner (it is an ac motor, with a triac for controlling speed) the Arduino sometimes looses the connection via usb and i have to reset it to fix the problem. Of course this ruins my projects... I should mention that it works perfectly fine when the ac motor is off.I installed an APC surge protector plug on the Arduino psu and this improved things a lot, but still sometimes i get disconnections when i power on the vacuum or increase speed of the motor.I would like to ask your opinions about what to do. How can i block the back emf from the motor? Should i install a plug on the motor cable, so it blocks the emf from getting to the other components? Unfortunately i only have one wall power plug in the room where the cnc is.And a second question:For powering up the Arduino i am now using a 12 volt led power supply (it is what i had in stock. There is no room for a pc power supply), but i am planning to upgrade to a 19 volt laptop psu, in order to give the stepper drivers more voltage, so they can run faster. I plan to remove diode D1 from the ramps board and power the arduino mega through usb. So, is the laptop psu stable enough for the ramps? (Toshiba brand). Should i put a big >25 volt electrolytic at the input of ramps, for extra filtering and power reserve?Thanks a lot.

author: BrokenYugo
author_rank: Super Contributor
timestamp: September 26, 2023, 03:34:55 pm
content: Possible an interference suppression capacitor has failed/aged out in the vacuum, probable if it has a lot of hours on it.

author: Brexei
author_rank: Contributor
timestamp: September 26, 2023, 03:45:19 pm
content: Thanks, i will try to add some ferrites and see if it solves the problem.However, the back emf from the vacuum cleaner motor also causes the cnc spindle motor controller (inverter) to report an error sometimes! So, the vacuum motor emf also harms other components, apart from the Arduino.Is there a way to block the back emf going back to the plug?Also, do you think that the problem is emf travelling through the air that affects electronics, or emf coming back to the power cables? Difficult to find out...Most probably, there is no interference suppression capacitor in the vacuum cleaner... It was a carpet vacuum cleaner, VERY loud, so i added a triac controller to control the power (and noise). Can i add a suppression capacitor before the triac board, to stop the emf from returning to the plug? If yes, please suggest one.Would a plug filter do the same if i pluged the vacuum on one? I mean, will it back-filter the noise to the plug?

author: Roehrenonkel
author_rank: Frequent Contributor
timestamp: September 26, 2023, 04:00:05 pm
content: Hi Brexei,is the Arduino & Ramps-PCB in a shielded box?How do you drive the triac? Via Optocoupler?Post a picture and wireing-diagram.Additional cap for the steppers is always good.Try feeding vacuum- and spindle-motors through separate line-filters.You may also try shielded cables - ground one end only.Good luck

author: janoc
author_rank: Super Contributor
timestamp: September 26, 2023, 04:10:33 pm
content: These are common problems due to EMI (not EMF) from the various motors and supplies.Common causes and solutions:- Limit switches wiring picking up noise and causing resets/malfunctions - make sure the wires are twisted/shielded, you can put also a ferrite on the cables.- Stepper motor wiring emitting EMI - make sure the wiring is twisted/shielded, you can put also a ferrite on the cables.- Spindle or other motors using commutators (i.e. universal or permanent magnet DC motors) emit EMI because of lack of noise suppression/filters - add them.- Conducted noise trough the power supply rails - add filters, in the worst case you may want to use optoisolated control signals.- Make sure your electronics is in a metal box (shielding)- Make sure everything on the machine is properly earthed - not only for safety but also to provide good return path for the EMI, otherwise it will go through your electronics instead.

author: rteodor
author_rank: Frequent Contributor
timestamp: September 26, 2023, 04:56:59 pm
content: Is there a snubber circuit on the triac ?Also is there any AC filtering ? Like a common mode choke coil and capacitors before the triac, like the ones in power supplies ? And shielded cable after ?

author: Brexei
author_rank: Contributor
timestamp: September 26, 2023, 05:09:44 pm
content: Well, the arduino and ramps are in a plastic box. This is why i wonder if they pick up the noise, or the cables pick up noise...The vacuum cleaner is a single ac motor and i used a simple triac based board to control the rpm. It has a potensiometer. No isolation at all! The board is the following:Nothing special, and probably no filtering at all...The spindle motor is fed through a proper shielded cable and i have grounded one end. This does not cause any trouble while working. Only the vacuum motor is a problem...I have used the cnc without the vacuum and there was no problem at all. Not once!But as soon as i start the vacuum then i have disconnections.So, i should put the vacuum cleaner on a line-filter, and this will back-filter the emi, right?

author: Doctorandus_P
author_rank: Super Contributor
timestamp: September 26, 2023, 06:44:26 pm
content: The real problem here is that neither the "arduino mega" nor the "ramps 1.6 shield" are designed according to "industrial standards". As a result they are much less robust then they could be.On top of that, I suspect you do not have much experience with wiring up a CNC machine, and stacking such things on top of each other makes the stack about as robust as a house of cards.For a properly designed "industrial" application (as a CNC machine is) you would expect:* 4 layer PCB.* EMI filtering for any cable connected to the PCB (from power input to end switches feedback.* Optocouplers for extra EMI hardening, even if they are not strictly needed for voltage isolation.* A proper metal box for all the electronics.* Cable routing which strictly separates all power cables from signal cables.* Shielded cables, in which the shield is directly connected to the metal enclosure at the cable entry.* Extra EMI filters for power supplies, VFD's and such.Those things together are probably much more then you would need, but there is a sliding slope between a robust design and a card house. Things like USB are also not well suited for industrial applications. It's just for consumers.

author: rteodor
author_rank: Frequent Contributor
timestamp: September 26, 2023, 09:03:29 pm
content: Quote from: Brexei on September 26, 2023, 05:09:44 pmYou seem a bit in a hurry to solve this. Sometimes its easy but many times it is not so you might need a more systematic approach.You could try to guess the issue: put a line filter, add shielding, etc and see if it works. But if its not then try first to reliably replicate the issue preferably without ruining machining jobs. E.g.: check if the issue appears in any logs and if it appears as a single type of issue or more. Then how often it appears (like how many times it fails out of say ... ten times).Can you run the cleaner directly, without triac board ?

author: Brexei
author_rank: Contributor
timestamp: September 27, 2023, 07:05:04 am
content: Thank you very much for all your help.Yes, my machine is not at all designed by industrial standards. It only fulfills one of the rules and that is the shielded and grounded cable of the spindle motor (that is why it does not cause problems).The machine was designed in order to be cheap and easy to make, as i am neither a machinist, nor an expert in CNCs (this is my first try).So far i have isolated the problem to the fact that the vacuum cleaner causes all the troubles. I cannot run it without the triac, because it is waaaay too loud and power consuming. But i will try to add some emi plug filters first, and see if the problem persists. Then i can add emi filtering to the endstop cables. Another issue might be the charging of the vacuum tube. I need to add grounding to that...I have also removed the old psu and i will install a Toshiba laptop 19v psu that i have available. This will offer more power, but i plan to put a capacitor right at the power input of the Arduino, for extra stability.

author: TizianoHV
author_rank: Regular Contributor
timestamp: September 27, 2023, 08:29:31 am
content: I had a similar problem and it was just the cheap USB cable with bad shielding (i bought it as shielded but it was unshielded...). What USB cable are you using?If that doesn't work you could try adding an USB isolator (a few $ on aliexpress).

author: Brexei
author_rank: Contributor
timestamp: September 27, 2023, 08:50:38 am
content: mmmm, that is interesting...My usb cable is a generic one... not something special. I have a few spare cables and i will test them for sure!

author: mtwieg
author_rank: Frequent Contributor
timestamp: September 29, 2023, 01:32:37 pm
content: Hard to be confident in any advice without clear description of how the whole system is connected (including signals and power, including earth grounding).A good line filter dedicated to the vacuum motor definitely sounds reasonable (put the triac on the same side of the filter as the motor). Connect the motor chassis directly to the line filter's GND, and then connect the line filter GND to Earth GND (perhaps via a different connection point than your laptop).Is the arduino controlling the vacuum motor at all? Does the triac controller board have a DC power supply?

author: Brexei
author_rank: Contributor
timestamp: October 02, 2023, 09:02:16 am
content: Well, taking into account all your suggestions i removed the electronics and cut diode D1. Then replaced the power supply with a laptop psu (19v) and now the Arduino gets power only from the laptop through usb. I also replaced the usb cable with a better one (i think...). I put the laptop and the ramps PSUs in a line-filter. The vacuum motor is grounded and the ground goes through the cable to the mains plug.Moreover, i changed the firmware. I now use grbl instead of Marlin. It seems more appropriate for CNCs and is more responsive.I did a couple of tests with this new setup and there was no problem with the connection. I was "carving" a project in the air, while powering on the vacuum and changing the rpm of the motor up and down, but no disconnection this time! I tried switching the vacuum motor off and on, but no problem! It looks like there is some improvement with all these changes done.I will test it more in the following days and report back. It was probably related either to the usb cable or to emi noise coming from the psu to RAMPS and then to Arduino. A voltage spike there might cause the Arduino to drop connection. But now power to the Arduino is fed through the laptop, so it is stable.