Shop OBEX P1 Docs P2 Docs Learn Events
How to run longer cable lengths — Parallax Forums

How to run longer cable lengths

On a BLDC motor that has an encoder and 3 hall sensors, I run 25' easily with no issues on unsheilded CAT5 single ended. This needs to be reconfigured to get up to 150'. I can buy differential options for the encoder from US Digital but I thought I'd find a solution that would be a plug in module inserted in the CAT5 cable. This will mean adding an extra CAT5 but thats OK. If this were using RS485 IC's like my go to MAX3430 these are $7 each. So for 5 signals that is 5x2 IC's = 10 X $7 = $70 just in RS485 IC's. Maybe there is a better idea to extend 5 single ended signals?

The images show the current scheme that I use for up to 25' and then the concept for inserting a module at the motor and at the main box.

Comments

  • Clock LoopClock Loop Posts: 2,069
    edited 2018-11-30 01:47
    T Chap wrote: »
    $70 just in RS485 IC's.

    No shield?

    If you do that, just go optical.
    https://www.amazon.com/Mediabridge-Toslink-Cable-25-Feet/dp/B005MR73X8

    Can you use the TOS link emitter/recievers? Fiber Optic General Data Transfer 16Mbps -27dBm 2.4 V ~ 5.5 V 12mA

    2$ transmitter. x 3 = 6$
    https://www.digikey.com/product-detail/en/everlight-electronics-co-ltd/PLT133-T6A/1080-1434-ND/2693983
    or
    https://www.digikey.com/products/en/optoelectronics/fiber-optics-transmitters-drive-circuitry-integrated/115?k=photolink&k=&pkeyword=photolink&pv1989=0&sf=0&FV=ffe00073&quantity=&ColumnSort=0&page=1&stock=1&pageSize=25

    2$ reciever x 3 = 6$
    https://www.digikey.com/products/en/optoelectronics/fiber-optics-receivers/117?k=photolink&k=&pkeyword=photolink&pv1989=0&sf=0&FV=ffe00075&quantity=&ColumnSort=0&page=1&stock=1&pageSize=25

    11$ cable x3 = 33$
    https://www.amazon.com/Mediabridge-Toslink-Cable-25-Feet/dp/B005MR73X
    or
    You can choose a different cable (non tos link) and get different emitters and recievers if you like start with the cable to find premade affordable optical cable in your length.
    https://www.digikey.com/products/en/cable-assemblies/fiber-optic-cables/449?k=&pkeyword=&pv1989=0&sf=0&FV=ffe001c1&quantity=&ColumnSort=0&page=1&stock=1&pageSize=25

    I wouldn't mess around with anything but optic for motor control at long distances... personally..
    Thats how i'd try to do it... since its so easy to do 3 cables with 3 emitters and 3 recievers.

    33$ + 6$ + 6$ = 46$ digikey shipping is 10$ = 56$.
    And you have signal isolation. And no shield.


    Oh oops you need 5. $87 with shipping.

    Well i guess adding on two more gets you above the 70$
    But I would do it that way because of the isolation alone.. its like gold, esp in motor control.
  • Since this is essentially one direction I would use high speed serial perhaps using shift registers but personally I would just press a small 8-pin micro into service for this. If it is with a 30 cent micro I would put all 5 inputs into an 8-bit character that is sent via a high speed UART as you can easily run up to 3M baud for this. No need for protocol, just keep sending and on the other end the same chip is outputting that as 5 signals. My RS485 chips are quite a bit cheaper (Maxim are way overpriced) and the code is trivial so I would do this for under 5 dollars worth of parts.

    Then there is the shift register approach but you still need to be able to load and clock it so that that complicates things.

    I wonder about your 5V though over that distance, as long as you don't need 5V itself but regulate down, that should be ok. Normally I would feed a much higher voltage into switching regs as that requires less current at the higher voltage and therefore less voltage drop which over a higher voltage results in less losses.
  • jmgjmg Posts: 15,140
    T Chap wrote: »
    On a BLDC motor that has an encoder and 3 hall sensors, I run 25' easily with no issues on unsheilded CAT5 single ended. This needs to be reconfigured to get up to 150'.

    That's quite a jump. How much current at 5V, and how tolerant is each end to voltage shifts, and voltage spikes ?
    Google says " Cat5 wire gauge is usually 24 AWG which would be 2.567 ohms per 100 feet" - so just 65mA will drop 250mV on each wire, and becomes 4.5V at the far end.

    What is the count rates of the encoder & Hall devices ?

    Peter may be onto something with a small MCU with serial link. If your system is ok with ~ 2us toggle rates (or slower), simple fast serial might work.

    RS485 parts start under $1, for 10Mbd
  • T ChapT Chap Posts: 4,198
    edited 2018-11-30 02:20
    Interesting ideas. I don't like to figure out new micros. What about a Prop at the motor, sending an 8 bit value as fast as PASM can send over 1 RS485 pair. Then at the other end a Prop decoding the serial and output the result over 8 pins. I can send 12V to the motor and switch it down to 5. The encoders and halls run on 5. This can be done with 1 CAT5 unshielded carrying the power and RS485 pair.

    This is pretty slow stuff. I don't have any rates just yet but assume a 400 line encoder (1600 counter per rev) at not even 1 rev per second. More like 1 rev every 3 seconds. But with a cheaper than MAX RS485 that works but means 1 more CAT5, not a big deal.

    The Hall is 3 phases per revolution, very slow stuff.

    I can't use optical, any electrician or low voltage guy needs to be able to service this. Adding fiber means the potential for headaches if it gets cut and needs repair.
  • kwinnkwinn Posts: 8,697
    You might want to consider using 20mA current loops for those signals. Even with using optoisolators (which may not be needed) only 2 chips are needed.
  • jmgjmg Posts: 15,140
    T Chap wrote: »
    Interesting ideas. I don't like to figure out new micros. What about a Prop at the motor, sending an 8 bit value as fast as PASM can send over 1 RS485 pair. Then at the other end a Prop decoding the serial and output the result over 8 pins.
    If this is one off, then sure, use whichever micro you have available, and are used to using.

    With software at either end, you could send redundant mirrored bits for fast but simple noise immunity. ie Start.5b,!5b.StopW
    StopW can adjust to suit your RX software speed. eg a 15T frame has 4 stop bits.

  • Noise immunity by sending a byte, then the inverted version, then on receive flip the inverted byte and compare? Reject if not equal and continue?
  • Clock LoopClock Loop Posts: 2,069
    edited 2018-11-30 02:41
    T Chap wrote: »
    I can't use optical, any electrician or low voltage guy needs to be able to service this. Adding fiber means the potential for headaches if it gets cut and needs repair.

    Thats why I like this method, you can buy a 25' audio toslink cable at best buy, in the audio/video cable section.
    (which is why the parts are toslink) I would have liked it when I had to do retrofit cnc jobs. Making those optical cables SUX.

  • jmgjmg Posts: 15,140
    T Chap wrote: »
    Noise immunity by sending a byte, then the inverted version, then on receive flip the inverted byte and compare? Reject if not equal and continue?

    Pretty much, yes. You likely need some form of glitch suppression.
    Another approach is to take the 5 data bits and add 3 error check bits via a table, then check that for valid on receive.
    That has more software overhead than flip and compare, but needs fewer bits to send.
  • Peter JakackiPeter Jakacki Posts: 10,193
    edited 2018-11-30 03:18
    Anyway, I'd use a micro but I think you should just use 5+5 of those cheap low-power RS485 chips dedicated as transmitters and receivers and you can do this for under $10.
    Maxim parts are always expensive and the spec sheet doesn't show any good reason to pay the extra so try TI or Exar etc. Here's a quick Mouser search where you can buy 10 chips for the grand sum total of $8.36.


    But yes, use 2 Props if you want to keep it to one cable plus you can multiplex other signals as well which might be useful.
  • kwinnkwinn Posts: 8,697
    Using Octopatrt to search for "RS485 drivers I find Quad units for as little as $5.77 Canadian, and Quad receivers for $1.94. That was without hunting for the lowest price. Your problem can be solved for under $20 with two simple perf board circuits and 4 chips. No fuss, no muss, no programming, and 3 spare driver/receivers.
  • kwinnkwinn Posts: 8,697
    BTW, using current loop comms is even simpler. Five small signal transistors and 5 resistors on the transmit end and five optoisolators and resistors on the receiving end. Only caveat is that the opto's have to be fast enough for the signals.
  • I looked at the current loop ic. At first glance i don’t understand it but I’ll dig deeper tonight.
  • kwinnkwinn Posts: 8,697
    edited 2018-11-30 19:24
    T Chap wrote: »
    I looked at the current loop ic. At first glance i don’t understand it but I’ll dig deeper tonight.

    By current loop I do not mean the 0 to 20mA analog current loop that is used in some instrumentation systems. I mean the old teletype serial communication style of current loop where the current was either zero or 20mA. The low impedance and high current required makes this relatively immune to EM noise. The current also does not have to be 20mA. It can be 5 to 10mA as long as that drives the optoisolator led hard enough for the transistor to turn fully on. Typically 5mA is enough for a lot of optoisolators.
  • If you go the current-loop route, be sure to dedicate a wire pair to each signal, rather than using a common ground return. A good option for the opto-receiver is the H11L1. Here's a schematic:

    H11L1_receiver.GIF

    -Phil
    407 x 154 - 2K
  • T ChapT Chap Posts: 4,198
    edited 2018-12-01 01:31
    Thanks for the input. For a pair per signal I may just use some cheap quad RS485 tranceivers. Still looking over the ideas.


    1$
    Driver

    https://www.digikey.com/products/en?keywords=AM26C31CDR

    Receiverhttp://www.ti.com/lit/ds/symlink/sn75lbc175a.pdf
  • jmgjmg Posts: 15,140
    T Chap wrote: »
    Thanks for the input. For a pair per signal I may just use some cheap quad RS485 tranceivers. Still looking over the ideas.

    Those are simple to apply, and should work well.
  • jmg wrote: »
    T Chap wrote: »
    Thanks for the input. For a pair per signal I may just use some cheap quad RS485 tranceivers. Still looking over the ideas.

    Those are simple to apply, and should work well.

    Even the high-end off-the-shelf motion controllers do this.

    BTW, $70? That can get gobbled up in time, REALLY quick!
  • T Chap wrote: »
    On a BLDC motor that has an encoder and 3 hall sensors, I run 25' easily with no issues on unsheilded CAT5 single ended. This needs to be reconfigured to get up to 150'.

    150 feet between motor and motor controller? Why? Is there any way to avoid this?
  • Sometimes the client tells you whats the condition. Often the motor is not easily accessible.
  • Mark_T wrote: »
    T Chap wrote: »
    On a BLDC motor that has an encoder and 3 hall sensors, I run 25' easily with no issues on unsheilded CAT5 single ended. This needs to be reconfigured to get up to 150'.

    150 feet between motor and motor controller? Why? Is there any way to avoid this?

    That's quite a distance....I would consider a distributed system. There some very compact intelligent servo drives around:

    https://www.a-m-c.com/products/?page=product&cid=servo-drives&id=DZCANTE-025L200
Sign In or Register to comment.