Shop OBEX P1 Docs P2 Docs Learn Events
long distance programming issue — Parallax Forums

long distance programming issue

JonathanJonathan Posts: 1,023
edited 2013-07-09 22:43 in Propeller 1
Hi All,

I am programming a Prop from 100' away, via a usb-ethernet- ethernet-usb dongle pair. Usually works fine. On my latest project, a water system controller, the USB port gets stuffed when the pressure pump kicks on. I have to unplug everything and plug it back in. The Prop itself is not rebooting, just the programming port has problems. If I disconnect the power to the laptop it is fine when the pump starts. If I use my netbook it is fine even with the power plugged in. This points to some kind of grounding issue. I tried tying the Prop power supply ground to the earth ground, no help.

Any advice on how to solve this? I guess I can just use the netbook, but the tiny screen is a drag for programming.

Thanks!

Jonathan
«13

Comments

  • kwinnkwinn Posts: 8,697
    edited 2013-06-09 20:13
    It certainly sounds like it could be a ground (or ground loop) problem. I am assuming that you mean the PC USB port when you say "the USB port gets stuffed". Rather than adding a ground you may want to isolate the PC power adapter using an isolation transformer and see if that solves the problem. Quite a few of the communications problems I see are caused by having signal cables grounded at both ends or in multiple locations.
  • JonathanJonathan Posts: 1,023
    edited 2013-06-09 20:24
    Ahh, an isolation xfrmr, good idea. I'll see if I have something kicking around. Any ungrounded 1:1 ought to workm right? Or I could back to back a couple of step down xfrmrs. At least I can see if that works.

    Thanks!

    Jonathan
  • JonathanJonathan Posts: 1,023
    edited 2013-06-09 20:32
    Another thought, I wonder if I could get a new power supply for the laptop that is isolated. I'm guessing the netbooks is. I'll test that tomorrow and see if there is a connection between the Vss of the laptop/netbook and the earth grounds. That would point towards isoaltion being the culprit.

    Any way to tell if a power supply is isolated?

    Jonathan
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-06-09 20:35
    Jonathan,

    USB extenders may use CAT5 cable, but they are not Ethernet devices. As such, an isolation transformer will block any signaling, not to mention the DC power that the cable also carries for its remote head and anything connected to it.

    -Phil
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-06-09 20:37
    Jonathan wrote:
    Any way to tell if a power supply is isolated?
    Look for the UL and/or CE label. :)

    Seriously, no computers sold today use non-isolated power supplies.

    -Phil
  • JonathanJonathan Posts: 1,023
    edited 2013-06-09 20:39
    Hmm, that's too bad. If the isolation xfrmr won't work, why does it work when running the laptop on batteries but not when power is connected? Just trying to understand.

    Also, if it makes any differnece, I live off the grid and am on a modified sine wave inverter.

    Jonathan
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-06-09 21:25
    Oh. I thought you intended to isolate the CAT5 cable. In any event, however, isolating the PC's power supply won't likely help, since it's already isolated.

    My suspicion is that the pump starting is causing a surge that the inverter isn't handling very well which, in turn, causes an issue with your PC's power supply. A powerline filter/surge suppressor at the PC may help.

    BTW, are you using an optically-isolated solid-state relay to turn on the pump? If not, you should be.

    -Phil
  • JonathanJonathan Posts: 1,023
    edited 2013-06-10 07:34
    Phil,

    Yes, the SSR's are optoisolated. I'm going to bust out the 'scope and snoop around and see what I can see with my power supply and on the programming line.

    Jonathan
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-06-10 07:46
    Rather than jumping on the Ethernet for a 100 feet and jumping off again, you might just pull 100 feet of shield twisteded pair telephone wire and use RS485 transcievers. You might need more than one at each end for programing the Propller (that RTS line).

    In that way you much tighther control of your environmental issues. The Ethernet has to chop all and everything into packets and reassemble it. And if the electrical problems of your Etherenet to USB are exotic it might be a merry chase.

    There are RS485 with builtin isolation transformers if that is really what you need. But the differential transmission is very noise immune.

    One USB to RS485, then the cable, and a RS485 to TTL will do all this more cleanly. And it should do distances 50x the 100 feet.
  • JonathanJonathan Posts: 1,023
    edited 2013-06-10 07:56
    Hmm, that's another idea. Can you recommend any particular brand of dongle? A brief search it seems that like usb/serial adapaters, some work on some things and some don't.

    Jonathan
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-06-10 09:01
    Rather than jumping on the Ethernet for a 100 feet and jumping off again, you might just pull 100 feet of shield twisteded pair telephone wire and use RS485 transcievers.
    As I stated in my post above, it's very doubful that the USB extender uses Ethernet, even though it connects via CAT5 cable. I have such an extender, and it does not use Ethernet. It simply signals via RS485-type diffenential transmission over the CAT5's twisted pairs. It also boosts the USB supply voltage at the host end and reregulates it at the client end to accommodate cable losses. But, again, Ethernet is not involved.
    There are RS485 with builtin isolation transformers if that is really what you need.
    Unlikely, since RS485 is NRZ, which will not pass through a transformer. What you're referring to is probably what's known as a "short-haul modem." But that would be overkill for a 100-foot transmission link.

    Jonathan, what you already have is probably good enough. The problem needs to be attacked from the power supply side, not the USB extension side.

    -Phil
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-06-10 09:25
    Go with what Phil is suggesting. I got misled by the 'ethernet' mentioned. If you already have RS-485, you could change your receiver at the Propeller end to eliminate the USB interface and directly connect RS486 to TTL. That might eliminate the piece of hardware that is blocking communications.

    What you are doing at the Propeller end is converting RS-485 to USB and the then USB to TTL. The conversion to USB can be bypassed and would simplfy trouble-shooting.

    http://cds.linear.com/docs/en/datasheet/1535fb.pdf

    The above link appears to be one of many isolated RS485 drivers that are supposed to resolve ground loop problems. And there are more of them...
    Just Google 'isolated RS485 drivers'
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-06-10 09:33
    What you are doing at the Propeller end is converting RS-485 to USB and the then USB to TTL
    No, the USB comes from his PC. The Propeller is at the other end of the cable with the SSR.

    Jonathan,

    Low-power inverters are pretty cheap these days. You might consider powering your PC from its own inverter.

    -Phil
  • MicksterMickster Posts: 2,694
    edited 2013-06-10 09:37
    I guess I don't understand why this isn't really a USB-Ethernet device because such a device appears to exist.

    If it really was an Ethernet link, you could also consider a Wifi bridge. I recently used the low-cost Edimax devices.

    Not absolutely sure but it might have been the: Edimax EW-7228APN

    I had two standalone devices that normally had a CAT cable between them. Simply replaced the cable with this bridge.

    Regards,

    Mickster
  • kwinnkwinn Posts: 8,697
    edited 2013-06-10 10:01
    I checked the power supply for my Dell Lattitude with my meter and found that the ground prong of the 120V plug is connected to the negative ring on the laptop plug. Worth checking on your laptop supply, particularly if it has a 3 prong 120V plug.
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-06-11 10:49
    Jonathan wrote: »
    Hi All,

    I am programming a Prop from 100' away, via a usb-ethernet- ethernet-usb dongle pair. Usually works fine.
    Jonathan

    @Phil
    According to the OP...
    Back to back USB ports with something inbetween... maybe RS232, maybe RS485.

    I am just trying to eliminate as many unnecessary levels of converts as possible. I do understand that everyone is using CAT5 cable for other purposes these days. I love to do so too as it cheaper by the foot than most cable. And I have a lot of it abandoned by students that left the rooming house I live in.

    Frankly, I don't see how anyone is going to solve this without extablishing from verifiable information that it is RS232, RS485, IP ,or something else.

    http://www.wikihow.com/Extend-USB-Cable

    Do these dongles have any documentation or brand name?

    LIKE THIS ====> http://www.blackbox.com/resource/files/productdetails/26675.pdf
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-06-11 11:53
    Do these dongles have any documentation or brand name?
    Typically, no, like this one:

    usb-line-extender.jpg

    This looks like mine, and I've seen the exact same unit under many generic brands from China. Mine uses differential signaling over the CAT5's twisted pairs. (Using RS232 over 100' would make no sense, BTW, since 25' is about the limit.)

    In any event, I do not believe the OP's problems are related to the USB extender, per se, and that it's more of a power system issue.

    -Phil
  • kwinnkwinn Posts: 8,697
    edited 2013-06-11 19:05
    Jonathan wrote: »
    .............................. If I disconnect the power to the laptop it is fine when the pump starts. If I use my netbook it is fine even with the power plugged in. This points to some kind of grounding issue. I tried tying the Prop power supply ground to the earth ground, no help.

    Based on Jonathan's first post I have no doubt this is a power related problem and the best fix is to use optoisolators for communications. This removes all ground, power, and signal connections between the two systems, and the high current (10 – 20mA) signal used to drive the leds pretty much guarantees immunity from EMI.

    The circuitry is also pretty simple as well. An optoisolator and drive transistor at each end for data transmission, a second optoisolator at the remote end, and a second drive transistor at the local end for resetting/programming the remote propeller.

    I am surprised this idea is not used more often. I have used this method on several occasions and it has always solved any noise, intermittent data corruption/loss, and resetting problems.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-06-11 19:43
    I'm thinking more off-the-shelf. Jonathan stated that he has no problems when the laptop is battery-powered. It's only when it's powered from the same inverter that powers the pump that he has issues. So it would seem logical to remove the laptop from that inverter. That's why I suggested obtaining a cheap low-power inverter just for the laptop. I don't know how his house is wired, though, and whether it's convenient to tap into the DC side of his power system to run another inverter. But I suspect that glitching from the main inverter is causing trouble via the laptop's power supply, not via the USB extension.

    He has not stated, however, how the Prop is being powered -- via a wall transformer at the Prop end, or via the USB extension from the laptop? If the latter, he's already opto-isolated, since the only connection to the outside world at the Prop end is the SSR.

    The one issue that's not eliminated is common-mode impulse coupling to the unshielded CAT5 cable. If it lies near the inverter mains to the pump, there could be enough coupling to exceed the common-mode limits of the USB's (or its extension's) transceivers.

    -Phil
  • LoopyBytelooseLoopyByteloose Posts: 12,537
    edited 2013-06-12 07:09
    I take a different point of view and feel that rather than using some mysterious USB Extender extension cord, one can provide a stable solution via known technologies.

    If you are going to use your Propeller in industrial applications, use industrial worthy solutions. The cost is very reasonable.

    RS422-485 is all about common-mode rejection of noise in electrically hostile environs.

    From the computer's USB port - provide a USB to TTL converter and then provide RS-422/485 transceivers for Rx/Tx and the required _RST signal. (I guess that would be two transceivers at each end of the cable for a total of 4). The last 2 transceivers would go directly at TTL 3.3 to the Propeller.

    The core problem is the the USB standard was never really intended for such long distances or to prevent transients from powerful devices starting. It was meant to convey data at high rates two and from short distances.

    The concept of having the +5V 500ma reach the end of 100 feet of wire to power a second USB converter is overly ambitious. If one is going to insist on using such devices, use a brand that will back its claims of reaching over 100 feet, not a company that doesn't put their name on the product.

    Opto Isolation is notoriously slow. RS-422485 is fast and rock solid. I am not even sure it is a ground problem. It just may be a power spike knock over an under-voltage powered CAT5 serial to USB device at the end of the line. But ground conditions can and will vary on a daily basis due to weather.

    >>> I would love to know if Phil is right, if Kwinn is right, or I am.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-06-12 09:37
    The core problem is the the USB standard was never really intended for such long distances or to prevent transients from powerful devices starting. It was meant to convey data at high rates two and from short distances.
    The USB extenders that I've seen address this problem by using RS485-style signaling. The one I have is completely solid and reliable for such service.
    The concept of having the +5V 500ma reach the end of 100 feet of wire to power a second USB converter is overly ambitious.
    That's why the voltage is boosted to a much higher level at the host end and converted back down to +5V at the client end. And it works quite well in my experience.

    -Phil
  • kwinnkwinn Posts: 8,697
    edited 2013-06-12 11:32
    The one issue that's not eliminated is common-mode impulse coupling to the unshielded CAT5 cable. If it lies near the inverter mains to the pump, there could be enough coupling to exceed the common-mode limits of the USB's (or its extension's) transceivers.


    Phil, you seem to have more information about Jonathan's setup than I gleaned from the posts so far so I may be at a disadvantage when making suggestions. I do agree with what you say about coupling being a possibility. It could be enough to make the USB port “get stuffed”. The fact that it does not happen when the laptop is running on batteries, or when the netbook is connected and powered by AC makes it seems more likely to be related to the AC ground connection. Having a potential difference between the grounds of the laptop and the propeller will also affect any signals that are connected by a cable.

    I would be interested in knowing what the resistance is between the 2 output connections of the laptop and netbook power supplies and the 2 or 3 prongs of their respective AC plugs. I suspect the laptop supply has a connection between the AC ground and one of the supply outputs just like my Dell

    @ Loopy

    In the past optoisolators were slow, but with the high speed opto's available today that is not as much of a problem. They can easily run at 115Kbaud and higher, which should be more than enough in most cases. The circuitry is also quite straight forward, inexpensive, and eliminates any electrical connections between the two systems.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-06-12 11:59
    kwinn wrote:
    Having a potential difference between the grounds of the laptop and the propeller will also affect any signals that are connected by a cable.
    True. It's only an issue, though, if the Prop end is not USB-powered. If it is USB-powered, there's no ground connection at the Prop end.

    BTW, I don't have more specific info about Jonathan's setup that anyone else. In the absence of that info, I'm left to extrapolate from the USB extender that I have. In any event, the OP seems to have left the building.

    -Phil
  • JonathanJonathan Posts: 1,023
    edited 2013-06-13 07:39
    Hi All,

    Just back after my 48 hour shift and there is a bunch to catch up on in this thread! Yes, the cat5 is just cat5, no actual ethernet, dumb of me to use that term. I just checked and my laptop power supply does indeed show continuity between earth ground and the negative side of the power supply. The netbook is two pronged, so no ground there. The Prop is powered from the mains (inverter) through an old cell phone charger. I do have a small inverter that I can try, I'll dig it out and see. I'm sure that will work, thing is it's not a good long term solution, running the extra inverter = more power overhead. It does make me wonder if an isolation xfrmr would work.

    Thanks guys, I'm sure there is a way to get this to work.

    JOnathan
  • kwinnkwinn Posts: 8,697
    edited 2013-06-13 10:37
    I'm sure an isolation transformer for the laptop (or an isolated power supply) will work as long as there is no ground connection between the input and output receptacle. Probably less expensive to go the optoisolator route though unless you already have an isolation transformer.
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-06-13 11:13
    kwinn wrote:
    I'm sure an isolation transformer for the laptop (or an isolated power supply) will work ...
    Or just try a cheater temporarily to eliminate the logic ground connection to neutral in the breaker box and see if the problem goes away. If that works, you could continue to use the cheater with a GFI outlet for added safety.

    -Phil
  • JonathanJonathan Posts: 1,023
    edited 2013-06-15 10:16
    Or just try a cheater temporarily to eliminate the logic ground connection to neutral in the breaker box and see if the problem goes away. If that works, you could continue to use the cheater with a GFI outlet for added safety.

    -Phil

    I tried that when I discovered the problem and found no difference either way. I mad a little adapter this morning with a switch that allows me to connect/disconnect the reset line on the Prop plug. This does prevent the reset but of course I have to walk out there to put it in program mode. Still, it allows me to view data with the PST without resetting, so it's better than nothing. I am still going to work on a better solution though.

    Thanks!

    Jonathan
  • Phil Pilgrim (PhiPi)Phil Pilgrim (PhiPi) Posts: 23,514
    edited 2013-06-15 10:24
    The Prop itself is not rebooting, ...
    This does prevent the reset ... Still, it allows me to view data with the PST without resetting, so it's better than nothing. ...
    Okay, I guess I'm confused now as to what the real problem is/was. First you said that rebooting is not an issue. Now you state that preventing the reboot fixes the problem, sort of.

    -Phil
  • JonathanJonathan Posts: 1,023
    edited 2013-06-15 14:47
    Sorry for being unclear...

    When the USB port gets stuffed. I have to remove the USB cable from the laptop and plug it back in, which cause the Prop to reset. The USB port getting stuffed doesn't cause a reboot in and of itself, just unplugging/plugging.

    Jonathan
  • JonathanJonathan Posts: 1,023
    edited 2013-06-16 21:43
    Turns out that the pump still occasionally stuffs the USB port. So while having the reset line disconeccted helps but not solves the problem.

    Jonathan
Sign In or Register to comment.