3
\$\begingroup\$

Situation: Connecting a motor controller to an MCU. Motor controller is about 50 feet away from MCU. Connected via a single conduit (buried), containing the following cables: (There is no other electrical equipment in the area, and this is outdoors between two weather-proof boxes.)

  • 24VAC power to motor controller (#14/2) (60Hz)
  • Cat5 cable (24AWG copper)

Signals being transmitted to MCU:

  • Motor direction signal. This line is pulled high or low depending on the direction of the motor. No fast changes: motor runs one direction for at least 10 seconds.

  • Motor position indicator. A TTL-level square wave (100Hz to about 1kHZ) outputting a number of pulses per revolution of the motor.

The problem: Signals arriving at the MCU are very noisy - you can see the 60Hz line interference clearly - and you can see crosstalk on the two lines - the Direction signal is pulsing along with position indicator square wave.

Any suggestions how to clean up these signals to be usable?

I could possibly put a second MCU inside the motor controller box, but what protocol could I use to transmit across the existing Cat5 cable that would not be as susceptible to this type of interference? Would prefer I2C... suggestions? Hoping to avoid CAN bus as it adds too much complexity and extra hardware.

Any suggestions appreciated.

\$\endgroup\$
  • 2
    \$\begingroup\$ Have you considered a simple protocol such as RS485? \$\endgroup\$ – Jack Dec 24 '15 at 3:38
  • 1
    \$\begingroup\$ Exactly what wires are being used for exactly what in the cat 5 cable? \$\endgroup\$ – Ecnerwal Dec 24 '15 at 3:51
  • \$\begingroup\$ @Jack - I have considered several protocols but I want to avoid any unnecessary hardware and complexity. Since I'm using Arduino Uno MCUs, I was hoping to use a protocol that's already built in, without the need for extra chips. \$\endgroup\$ – Ryan Griggs Dec 24 '15 at 4:12
  • \$\begingroup\$ @Ecnerwal - The green pair are carrying +5V and GND, and the blue pair are carrying the two signals I mentioned. I bet that's part of the problem, eh? Do I need use one twisted pair per signal? and connect the second wire to ground? \$\endgroup\$ – Ryan Griggs Dec 24 '15 at 4:13
  • 1
    \$\begingroup\$ I suspected as much (two signals on one pair.) Yes, do move the signals onto different pairs, and pair with signal ground. It's not differential but it should be a boatload better. \$\endgroup\$ – Ecnerwal Dec 24 '15 at 4:26
3
\$\begingroup\$

Start with the easy stuff - replace the cat5 UTP with cat 5, 6 or 7 STP - shielded twisted pair. Ground the shield at one end. If that solves it, you're done with little effort. If not, whatever you do next (such as using proper differential line drivers) will work better.

I'm also wondering if you are making ground loop with motor power and signal ground.

Edit: as we elucidated in comments, both signals were running on a single pair, which is about as bad as they could get for cross-coupling the signals.

While differential transmission is what Cat5 is designed to do, simply moving each signal onto separate twisted pairs, with the other half of the pair grounded should make things much better from a cross-coupling point of view, and in fact, did, per further comments. I'd say it still falls under the general heading of this answer, start with the easy stuff, (even easier if you don't the change cables, just how you use the wires) though I hadn't thought of cable-pair mis-use until after I wrote the first form of the answer, and asked the question in comments.

\$\endgroup\$
  • \$\begingroup\$ I have not grounded the signal ground to the motor power. The 24VAC transformer has COM and 24VAC terminals. The controller board rectifies and filters a 5VDC signal for use internally. I'm not sure the two are commonly grounded, but can check. \$\endgroup\$ – Ryan Griggs Dec 24 '15 at 4:17
  • 2
    \$\begingroup\$ @RyanGriggs: If not done already, you might want to consider using underground/outdoor rated cat 5 (shielded as Ecnerwal suggests). This kind of cable is "flooded" with a gel to keep out water. Buried conduit often fills with water, either through small leaks or condensation. This is normal. \$\endgroup\$ – Fred Schleifer Dec 24 '15 at 7:06
  • \$\begingroup\$ Thx for your help! \$\endgroup\$ – Ryan Griggs Dec 31 '15 at 4:03
7
\$\begingroup\$

Single-ended signalling is the source of your troubles. Differential signalling will drastically improve crosstalk and noise. RS-422 would be an appropriate choice.

I2C is not ideal, as its bidirectionality (and, consequently, weakly-driven signals) does not lend itself well to differential signalling. However, it seems you only need one direction. And if you want bidirectional communication, you have extra pairs in your Cat5.

\$\endgroup\$
  • \$\begingroup\$ thanks @uint128_t, does RS-422 require special encoder/decoder chips or can Arduino do it using the existing data pins? \$\endgroup\$ – Ryan Griggs Dec 24 '15 at 4:14
  • \$\begingroup\$ Quick check looks like you'd need hardware. Not checked for quality at all, but RS485 between arduinos (using a little driver board on each side): arduino-info.wikispaces.com/SoftwareSerialRS485Example For rs422 (typoed the search, I guess similar: electronics.stackexchange.com/questions/160551/… \$\endgroup\$ – Ecnerwal Dec 24 '15 at 4:33
  • \$\begingroup\$ I2C-over-differential is possible, using the P82B96 along with appropriate transceivers... \$\endgroup\$ – ThreePhaseEel Dec 24 '15 at 7:08
4
\$\begingroup\$

Building on uint128_t's answer:

You could use RS-422 transceiver chips (single ended to differential converter and differential to single ended converter) at the MCU end and the far end of your cable to convert the existing signals from single ended to differential and back.

This would not require the use of the RS-422 serial transmission protocol, so there is no need for an MCU at the motor end of the cable.

\$\endgroup\$
1
\$\begingroup\$

As you have 2 available conductors, plus GND, I would suggest using them for balanced transmission for the speed sensor signal. YThis will reject the common mode interference quite nicely.

You also need to transmit direction, this could be done by a substantial common mode DC signal . As it is known to be DC except when reversing, interference can be rejected by a low-pass filter.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.