How to solve interference in MCU

Discussion in 'Embedded Systems and Microcontrollers' started by raychar, Sep 26, 2012.

  1. raychar

    Thread Starter Member

    Nov 8, 2011
    82
    0
    Hello everybody,

    I am using PIC18F452 to doing timing and displaying 7 segment LEDs, it is being to be located in a very hostile
    condition. Since it needs to position a something like welder, its position to be displayed on LEDs. Wherever the
    welder makes contacting, sparkings' noise-electromagnetic or RF etc. disorder the normal operation of positioning and
    displaying data. Even the program which is stored in MCU are corrupted and needs re-programming.

    After making all metal enclosure for all PC board and all external cables are shielded with going to earth. The problem
    improved a lot with no obivous apparent disorders. However, the displayed data are not correct.

    The MCU operates at 40MHz, together with using of 555 to sending some around 20KHz PWM pulse of 80VDC to the welder.

    Does anybody have recommendation how I can solve it?

    Thanks in advance.
     
  2. MrChips

    Moderator

    Oct 2, 2009
    12,440
    3,361
    Since you are already in a high interference area you have to take a worst case scenario.

    1) Presumably your circuits are powered from AC mains. Begin with a heavy duty AC Line filter. See Corcom:

    http://www.cor.com/

    2) All cables in and out of your metal box must have RF suppressors (toroids) on the signal lines. Make sure you use cables with a proper shielding.

    3) From the LV supply driving the MCU circuit install RF inductors.

    4) Make sure you have ample 0.1μF disc caps and 10μF tantalum electrolytic caps on the power rails.

    5) Replace your 555 circuit with a CMOS version (LMC555 or TLC555).
    Make sure you have a 0.1μF disc cap and 10μF tantalum electrolytic cap at the 555 power rails.

    6) Don't forget the display window. Install proper RF filtering on the display board. You want to avoid RF from feeding back from the display to the MCU.
     
  3. raychar

    Thread Starter Member

    Nov 8, 2011
    82
    0
    Hello,

    Line filter for power inputs, 0.1uf and 10uf caps were installed before.

    What is the RF suppressors (toroids), can you have picture or reference electronic devices that using it? For "RF inductors in LV supply line driving MCU", how thick and many numbers of turn of the coil would you recommend?

    There are three rows of each six 7-segments LEDs in display, of which one row LEDs needs to flick more frequently. MCUs are installed together with them in same enclosure (knowing that it's not a good design but already made). What is "Install proper RF filtering on the display board"? Can you elaborate?

    Knowing that 4 layer-board is solution to interference, however, it is not easy for hobbyist to do it!

    Thanks,
     
  4. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    I do not think a 4 layer board is the solution here at all. But stay on the filtering path laid out by MrChips. Perhaps also use some rugged transient protection diodes to. Like the TRANSIL series from STMicroelectronics. How cables are leaving and going into the shield is important to. Do you know anything about how the noise look like. That is kind of important in order to select the material used in the suppressor cores
     
  5. THE_RB

    AAC Fanatic!

    Feb 11, 2008
    5,435
    1,305
    Post the schematic. And some details about the wires that come out of the metal microcontroller box. Then it should be easier to see where your noise problems are coming from.
     
  6. Ijaz_Ahmed

    New Member

    Sep 28, 2012
    1
    0
    A solid ground plane on the PCB is the solution to this problem.
     
  7. takao21203

    Distinguished Member

    Apr 28, 2012
    3,577
    463
    http://tetsujp.xywe.com/21-782-scrolling-message-led-matrix.zhtml

    See this for an example. The toroid filter coil is required, otherwise the data from the I2C sensor chip becomes corrupted.
     
  8. t06afre

    AAC Fanatic!

    May 11, 2009
    5,939
    1,222
    Clever use of optocouplers may also help.
     
  9. raychar

    Thread Starter Member

    Nov 8, 2011
    82
    0
    Hello,

    1) From the photo of toroid coil, I think it is put in the AC power line, isn't it? I recall that I experienced similiar problem in a project, using I2C for MCU to external EPROM. Due to low profile of power supply construction for cost issue... I ended up solving it with adding a choke coil for Live and Neutral AC inputs..

    2) In my case, all power lines are with metal case type line filters, I checked with scope on +5V MCU voltage and no spike in voltage was found.

    3) Areas like picking voltage to MCU from high voltage souce by voltage divider and etc., already have optocouplers installation.

    4) The two lines of pulses inputing to MCU for increase and decrease a data value, for preventing spikes, I tested by adding 0.01 or 0.001uf caps in them for filtering out unwanted pulses. From scope, I still observed that there are scattered small and narrow spike ~0.7V during the operation, that is, welding arc are going on. I don't know if they are the cause of failure-wrong display data? How can i get rid of them?

    5) As there are many circuits in this project and they are hand-script, it is not easy for me to post them.

    Thanks in advance.
     
  10. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    Do you have optocouplers on the outputs as well? Is the isolated side of the optos powered by a separate transformer?
    Can you sketch some simple diagram, including exact ground connections and power supplies?
     
  11. takao21203

    Distinguished Member

    Apr 28, 2012
    3,577
    463
    It is a blank toroid, to which I added some turns of magnet wire. Just filled the toroid! The magnetic material is important, but for filtering, not really critical.

    It is inlined into the DC supply voltage (3V provided by switcher IC).

    RF coils (or power inductors) also can be used!

    If you have a problem with 50 Hz EMF (or simliar low frequencies), you need relatively large inductance.

    I am mainly dealing with noise in the 50KHz to 200 KHz range + harmonics.

    I suggest to obtain some magnetic toroids, add wire to them, and some RF coils (sortiment on ebay), as well some power inductors. And then experiment which one works best.
     
  12. raychar

    Thread Starter Member

    Nov 8, 2011
    82
    0
    Hello again,

    - the optocouplers did have seperate power suppliers and with their grounds are seperated.

    - here comes an attachment that captured the lines of pulses which are for stepper motor control, and at the same time, they are used for counting the number of pulses for position calculations. Sorry for the readings not clear, the readings' base freq. is 1/500us and vertical scale are 2V/div. The highest pulse was the pulse for stepper control (its duration originally should be somewhat 2ms, I made some change for testing, so it is now smaller..). The tiny spikes or ripples were due to interference that comes from the ongoing of the sparks of welding arcs. Would they contribute to errors? MCU will treat them as countings of pulse but stepper motor control won't because the amplitude is not high enough? how can they be removed?

    Thanks in advance
     
  13. kubeek

    AAC Fanatic!

    Sep 20, 2005
    4,670
    804
    That screenshot is meaningless if you can´t post a circuit diagram and show what exactly did you measure.
    Also I don´t understand why you sense the stepper signals, you should count the pulses somewhere in software, and not measure what is coming back from the steppers. (unless you have some clever circuit that checks for the motor slipping)
     
Loading...