Noise from Inductive Loads

Discussion in 'Embedded Systems and Microcontrollers' started by signalflow, Feb 27, 2015.

  1. signalflow

    Thread Starter Member

    Mar 12, 2014
    50
    0
    Hi, I have a PIC microcontroller. I have several chips on the board. I communicate with them all through the same SPI lines (SCK, MO, SO, but each has its own CS line).

    I have a MCP23S17 I/O expander chip reading several switches (contact closure) (either open or closed). Basically they are pulled high with a 20K-ohm resistor if open to read a 1 otherwise they are shorted if switch is closed.

    There are some inductive loads (pumps, etc.) that are totally separate from the circuit, but the lines run bundled together with the wires going into the I/O expander reading the contact closure (I know that is bad practice, but I can't prevent that right now - I need it to be more robust anyway).

    The pump and other motors have separate switches to turn those off and on. When I turn those off and on, I get erratic behavior on my other chips such as a MAX7221 7-segment display driver, etc. If I disconnect the contact closure lines going into the MCP23S17 I/O expander chip, then I do not get the erratic behavior on my other chips.

    I know it is due to inductive kickback and coupling between the inductive load (e.g. pump) wiring and the low voltage wiring reading the contact closures. I have ferrite beads on each digital input and a 5.1V Zener diode on each digital input to gnd (for the contact closure reading). I have TVS diodes on my 5V and 3.3V power lines to GND. I also have a NUP4302 schottky diode array on each digital input line.

    Is there any other way of filtering this noise or preventing this?
    My PIC has the two SPI blocks, so I thought about using 1 SPI block for just the MCP23S17 that is connected to the outside world and then using the other SPI block for all other chips. But they would still share a GND and 5V power.


    Thanks.
     
    Last edited: Feb 27, 2015
  2. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,541
    2,369
    All power carrying conductors should also be tightly twisted, LV input lines that run with them should ideally be screened.
    Max.
     
  3. MikeML

    AAC Fanatic!

    Oct 2, 2009
    5,450
    1,066
    The only place the controller board 0V line should touch the oV line going to the inductive load, is at the power supply, assuming they are running on a single power supply. (Single point ground)

    If using two supplies, then tie the 0V from the controller supply to the 0V only in one place, external to the controller. (Single point ground)

    Best bet is to run the inductive loads on its own power supply where opto-isolation is used to go from the controller to the high-current switches that turn the inductive loads on/off. (No common ground connection between the controller and inductive loads)

    Use snubbers on all the inductors. Bypass the power wires right where they feed the controller.
     
  4. ErnieM

    AAC Fanatic!

    Apr 24, 2011
    7,387
    1,605
    A schematic would help see problems.

    Offhand just try making that 20K as small as you can tolerate (limited by both switch current and power supply draw). The stiffer point the harder it is to inject noise.
     
  5. signalflow

    Thread Starter Member

    Mar 12, 2014
    50
    0
    The board is powered through a 240Vac-to-24Vac transformer, then down to 5V and 3.3V. The inductive loads are running on the 240 Vac lines turned on by a manual toggle switch by hand. So no shared GND lines.
     
  6. signalflow

    Thread Starter Member

    Mar 12, 2014
    50
    0
    I even grabbed a 120V-to-24Vac transformer and powered my board off of a different outlet (120V), so the only thing input to the board is the contact closure lines that are bundled with the high voltage lines for the inductive loads. They have RC snubbers on them.
     
  7. signalflow

    Thread Starter Member

    Mar 12, 2014
    50
    0
    The SPI communication lines are running from one board to the next via a 6" ribbon cable (IDC cable). The 2nd board has a MAX7221 7-segment display driver on it that uses SPI to talk to the PIC uC on the main board. If I place the board with the 7-segment and MAX7221 chip near the L1 and N power line and turn on/off a contactor or motor or some inductive load, the 7-segment display turns off (usually) or puts some garbage on the display. I am thinking it's just not possible to use SPI communication from one board to another in an industrial setting unless I put an RS-485 chip on each board to convert from SPI to differential signalling. Or convert from SPI to LVDS.

    Do yo think this is the best next step? I have tried caps to ground, TVS diodes, diode arrays, ferrite beads, and nothing works to fix the SPI communication. Too bad there isn't any error correction with SPI.
    Assuming the LVDS or RS-485 works, I still have a chip select (slave select) line for each SPI chip that is referenced to GND, so if the GND gets noise on it, the SPI comms will still be bad even if the SCK, MO, and SO are differential.
     
  8. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,541
    2,369
    I agree with the R/C snubbers needed, like this or equivalent.
    Right at the device.
    Max.
     
  9. signalflow

    Thread Starter Member

    Mar 12, 2014
    50
    0
    I have a contactor in the system with an RC snubber on it right at the contactor. If I flip the manual switch to turn the contactor ON/OFF, the 7-segment display driven by the MAX7221 goes blank about about 7 out of 10 times. The SPI has no error control so if any bit gets messed up with noise, then the MAX7221 receives that bad command or sees it as a DISPLAY OFF command. Anyone used SPI over ribbon cable in industrial setting?
     
  10. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,541
    2,369
    SPI is a short distance only communication method, if I use any significant length of ribbon in a industrial environment, I always use the foil-shielded variety.
    But I try and stay away from using it if at all possible.
    Max.
     
  11. signalflow

    Thread Starter Member

    Mar 12, 2014
    50
    0
    The 2nd board is only 1 inch away (stacked on top of each other). I could probably use a 3" ribbon cable. Just can't believe the noise is killing the SPI so badly.
     
  12. signalflow

    Thread Starter Member

    Mar 12, 2014
    50
    0
    Just another clue...

    Testing at my desk. If I connect the earth ground to my board gnd and flip a contactor on/off, the 7-segment display driven by the MAX7221 will blank out almost everytime. I have my boards mounted to a piece of sheet metal but that metal is not connected to my board electrically. If I connect earth ground to the sheet metal and flip a contactor on/off, the MAX7221 will blank out. If I disconnect the earth gnd, then it works fine.

    So I haven't figured out why connecting earth gnd to my board gnd would cause this and I haven't figured out why connecting earth gnd to the sheet metal that the board is mounted on which is electrically isolated from the board ground, why that would act like they are connected.
     
  13. signalflow

    Thread Starter Member

    Mar 12, 2014
    50
    0
    Another update:

    The 2nd board with the 7-segment display and the MAX7221 LED driver chip has a ground plane on the bottom layer. I am using aluminum standoffs to mount to a piece of sheet metal that then mounts to a chassis. Underneath the aluminum standoff is the ground plane with the soldermask on top of it (so it is electrically isolated). I know that I tie earth gnd directly to my board gnd, then my 7-segment will go blank if contactors are turned OFF and ON. I tried just putting 1 standoff and tying that standoff to earth gnd, then switch the contactor off/on. What happens is the 7-segment display blanks out. I am now thinking that since the only thing separating my board gnd from the earth gnd in this case is the thin solder mask, so there is a lot of capacitive coupling allowing the currents to flow just as if the earth gnd was tied directly to the board gnd.

    What I still haven't figured out is why does tynig earth gnd to my board gnd cause my 7-segment display to blank out when the contactor is switched on/off.
     
  14. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,541
    2,369
    Normally in industrial equipment where there is a mix of logic circuitry and power devices and there is a desire to bond both systems to earth ground, a earth ground star point is set up consisting of a copper bar or strip with terminations and all common ground references are taken to this central point, including the service ground conductor.
    I have designed and installed PC based industrial systems and so far using this technique has resulted in no noise problems.
    The PC power supply is customarily connected to earth ground by default.
    Max.
     
  15. MaxHeadRoom

    Expert

    Jul 18, 2013
    10,541
    2,369
    Just to add, make sure all your AC or inductive loads have a ground wire conductor, although a little on a larger scale, this is a little info on grounding industrial equipment and equi-potential bonding.
    The current practice is to now ground both ends of shielded cable, see Ch6.
    http://www.automation.siemens.com/doconweb/pdf/840C_1101_E/emv_r.pdf?p=1
    Max.
     
Loading...