MEGA 2560 with 0-10V DAC freezes - suspecting electrical noise

Dear forum,

I have a device that controls the speed of a variable speed drive. I use a MEGA 2560 with this 0-10V DAC by ncd.io:

https://store.ncd.io/product/1-channel-0-10v-dac-digital-analog-converter-i²c/

The MEGA is powered from a 220VAC to 12VDC converter (3A rating) and this 12VDC I send through a DC-DC converter down to 7.5V, which goes to the MEGA. I do this in an attempt to clean and steady the DC a bit more.

When I installed the unit the MEGA would freeze immediately when the VSD was powered on. This was fixed by closing one of the pull-up resistor jumpers. The unit worked fine for many months.

Recently it started to freeze up again, so I closed the second pull up resistor jumper too, worked ok for a while and now it is working intermittently. As soon as the VSD is shut down my unit doesn't seem to have any problems.

The unit is mounted about 4 meters away from the VSD. What would be the most likely culprit? Noise through the power supply or noise coming back from the 0-10V line?

And what would the solution be?

Hein

Who knows. Your verbal description is pretty vague. Four meters is a long distance for I2C communication (as your product page says your module uses for communication.)

But really, having bought an expensive device should get you some support from the company you got it from. Have you exhausted that avenue? Otherwise you will need to supply a lot more information to get useful help here. Read the How to use this forum post tofind out what you need to do to accomplish that.

The unit is mounted about 4 meters away from the VSD. What would be the most likely culprit? Noise through the power supply or noise coming back from the 0-10V line?

Invariably, running a microcontroller off the same ac line as a motor you are controlling with the microcontroller leads to ac noise spikes causing the microcontroller to freeze or reset.
There are two possible solutions:
The preferred is don't run the controller off the same ac. Run the controller off a battery and charge the
battery with a charger that runs off the same ac. Preferably have two batteries so you can just swap them
otherwise you have to stop using the controller while you charge the battery. This method makes it impossible for ac motor noise to affect the processor.
The other option is not as elegant because it requires adding layers of isolation.

PRIMARY AC SOURCE (120/220VAC/240VAC etc.) => AC to DC Power Supply 12Vdc

AC to DC Power Supply 12Vdc =>12V DC to 7.5VDC converter

12V DC to 7.5VDC converter => ARDUINO

FILTER CAPS: 1000uF to 3300uF 15V to 25V on 12V dc
1000uF on ARDUINO 5V
470uF on DAC 5V
DECOUPLING CAPS: several 0.1uF caps spread out around the arduino 5V line (wherever you can connect them)

If problem persists, increase ELECTROLYTIC CAPS ON 5V line

Hi,

Can you please post a copy of your circuit, in CAD or a picture of a hand drawn circuit in jpg, png?

Have you got bypass capacitors on the 0-10V lines?
Are they shielded?
How have you routed the cables, away from ALL AC carrying cables, especially the cables from VSD to motor?

Thanks.. Tom.. :slight_smile:

ChrisTenone:
Who knows. Your verbal description is pretty vague. Four meters is a long distance for I2C communication (as your product page says your module uses for communication.)

But really, having bought an expensive device should get you some support from the company you got it from. Have you exhausted that avenue? Otherwise you will need to supply a lot more information to get useful help here. Read the How to use this forum post tofind out what you need to do to accomplish that.

The I2C DAC is not four meters from the MEGA. It’s all enclosed in one enclosure. The AC line that powers the unit and the 0-10V line from the DAC to the VSD input is 4 meters long.

The issue is not with the I2C, you’ll notice I mentioned that the device works well until the VSD is switched on.

raschemmel:
Run the controller off a battery and charge the battery with a charger that runs off the same ac.

This was my first thought also. I'll be doing this when I get back there next week, it's quite far from home so I'm trying to get an arsenal of solutions ready for when I get there.

raschemmel:
PRIMARY AC SOURCE (120/220VAC/240VAC etc.) => AC to DC Power Supply 12Vdc
AC to DC Power Supply 12Vdc =>12V DC to 7.5VDC converter
12V DC to 7.5VDC converter => ARDUINO

Done

raschemmel:
FILTER CAPS: 1000uF to 3300uF 15V to 25V on 12V dc
1000uF on ARDUINO 5V
470uF on DAC 5V
DECOUPLING CAPS: several 0.1uF caps spread out around the arduino 5V line (wherever you can connect them)

If problem persists, increase ELECTROLYTIC CAPS ON 5V line

I'll take all this with me on my next visit.

Thanks!

TomGeorge:
Have you got bypass capacitors on the 0-10V lines?

No. What size do you think would be suitable here?

TomGeorge:
Are they shielded?

Yes

TomGeorge:
How have you routed the cables, away from ALL AC carrying cables, especially the cables from VSD to motor?

No

I'll look again at all these on my next visit.

Thanks

"bypass caps" ARE decoupling caps.
Read my post

VFD just powered on or running the motor? Huge difference there.

Typical problems are caused by poor cabling and grounding practices. VFD’s are great generators of noise due to the PWM output waveform going to the motor. Without proper grounding and shielding, the typical 2 to 8 KHz output switching frequency will spew energy everywhere along the output wiring and if you have non-shielded output wire/cables run together with either input power or even worse, signal wiring, you’ll have major problems.

If the drive lacks galvanic isolation on its analog and digital inputs, ground loops are all too common and must be addressed for proper operation.

Many questions need to be asked, such as:

What make and model VFD? What is the KW or HP?

Is the motor wired with VFD rated shielded cable? Grounded properly at both ends?
Is shielded cable used for the incoming power to the VFD? Is the VFD chassis grounded/bonded to the incoming power source?

This is a not simple issue and you need to approach it from a starting point of best practices. Without proper installation, you’re fighting a multi-headed noise monster that will be very difficult if not impossible to defeat.

I used a Danfoss 38kW VFD at Tesla to drive a 37kW Fakuta servo motor and I used the 0-10V analog input a few times and didn't have any problem, but the VFD was so expensive it had more than enough power supply filtering to be stable.

Its a very good chance electrical spikes are coming in on every wire going in or out or you box.

Assuming your box is metal I would:

  1. Move the 220 to 12 adapter out of your box.

  2. At each wire coming in or out of the box put a 0.1µF cap from that wire to the box. You should use as short a lead as possible. Perhaps a screw and solder lug right at the wires.
    This will be on all 4 wires, the two 12V power and the 2 DAC. Did I mention short, in the ideal condition the capacitors would have no lead at all but go right from the wire to the case.

  3. Internally add 0.1µF in parallel with a 10 to 100µF ***electrolytic capacitors:
    At the input of the setpdown converter very near the board input
    At the output of the stepdown converter, near the Mega power input.

*** the values is not very important at the expected power levels.

Good luck.

John

Hello again, I made a visit to the site in question a few days ago and tried some of what you all suggested here, none of which helped the situation at all. Finally I pulled a 4-20mA transmitter out of my toolbox, took out the 0-10V DAC from the installation and replaced it with the 4-20mA transmitter. The 0-10V DAC that I removed is from NCD (https://store.ncd.io/product/1-channel-0-10v-dac-digital-analog-converter-i²c/) and the 4-20mA transmitter I installed is from MikroE (4-20mA T Click - Add-on board with XTR116 4-20mA transmiter)

I changed the analog input settings on the VSD (ABB ACS580 55kW) from 0-10V to take 4-20mA and there she went, running smoothly without any glitches.

This board from MikroE is an amazing little component, very well isolated from the signal it transmits, the code is fairly simple and its cheaper than the equivalent made by NCD. Very impressed.

So I guess it's problem solved.

Thanks for all your advice.

When did the mikroBUS™ come into the equation. Was that something you mentioned early on ?
So you already had a mikroBUS™ mother board and you added a 4-20mA current loop daughter board ?

Read my first post.

I started off with Mega -> 0-10V DAC -> VSD.

I removed the 0-10V DAC and replaced it with a mikrobus 4-20mA transmitter which solved the problem.

Another case of input impedance to the rescue. When it’s a voltage input, the impedance is greater than 100k, in current mode, it is 100 ohms.

But - FWIW, I had an issue with a batch of 580 I/O boards that had the analog and digital grounds internally tied together incorrectly. This resulted in high levels of analog noise in voltage mode. I had two drives (out of six) with the problem and they replaced them under warranty no questions asked. The two problem units were built in the same week and were older than the other four.

With all I/O disconnected, there should be infinite resistance between digital gnd and analog gnd terminals. On the drives with the noise issue, it was zero ohms.

Your mileage may vary...

I asked about the Mikrobus not the DAC. Your first post doesn't say anything about the Mikrobus 4-10mA current source. That board is a daughter board that plugs into a Mikrobus mother board. My question is when did you get the Mikrobus motherboard that the 4-20mA current source plugs into ? (or are you using it as a standalone board ?)

That's because there was no 4-20mA transmitter when I started off. Only a 0-10V DAC.

Never had a mother board either, this little transmitter plugs directly into a 5 or 3.3V arduino (VCC, GND, MOSI, SCK and CS pins.) You don't even have to power it, it is smart enough to tap its V+ from the voltage coming from the mA source. Only thing you have to do is move a soldered jumper from 3.3v (default) to 5v if you end up using a 5V Arduino.

I use them mostly on long distance pressure transmitters (LoRa) on 3.3V pro-minis and they cooperate very well.

WattsThat:
But - FWIW, I had an issue with a batch of 580 I/O boards that had the analog and digital grounds internally tied together incorrectly. This resulted in high levels of analog noise in voltage mode. I had two drives (out of six) with the problem and they replaced them under warranty no questions asked. The two problem units were built in the same week and were older than the other four.

Interesting on your 580's, I'll definitely keep this in mind in future when I run into them again. Which is bound to happen, they are very popular in our area with irrigation farmers.

heinburgh:
Interesting on your 580’s, I’ll definitely keep this in mind in future when I run into them again. Which is bound to happen, they are very popular in our area with irrigation farmers.

Yes, same here in the US as they are commonly used for single to three phase conversion on irrigation pumps.

I was told that the issue with the analog noise affected a small batch of early release product some two years ago but I thought it worthy of mention as it also shows that should grounds get tied together improperly, it can induce noise. I do know both the digital and analog I/O is galvanically isolated which is important with remotely installed product that may have less than optimal ground impedance due to long cable runs.