Re: Concurrency issues? (Jan Kandziora)

classic Classic list List threaded Threaded
4 messages Options
Reply | Threaded
Open this post in threaded view
|

Re: Concurrency issues? (Jan Kandziora)

Loren Amelang
> Date: Tue, 31 May 2016 23:04:52 +0200
> From: Jan Kandziora <[hidden email]>

> That's okay, but keep in mind for later installations twisted pair is
> BAD for onewire. Twisted pair is only good if the drive is symetrical.
> For asymetrical drive as with onewire, it only adds cable length and
> capacity.

Wouldn't parasitic power onewire be symmetrical? Seems to work for me...  
 
I have probably 150 feet of CAT5 chained around my house. Sometimes out on one pair and back on another to continue the chain. At the far end of the chain, a 1N5711 Schottky diode and a 1.5KE20A-T TVS reduced errors a bit. What really cut my errors to zero was adding a 0.02 uF capacitor across the start of the chain. It drastically slows the signal rise times, but doesn't seem to hurt readings. It completely stopped the seemingly random storms of errors that would appear for a few hours and then go away for days. Military radar? Spooks?
 
But that is with an ancient dedicated microprocessor at 5V - not with owfs. It reads and sets up a different single DS18B20 of the ten connected, every ten seconds. Often goes for months without a single missed reading now.

| Loren Amelang | [hidden email] |




------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers
Reply | Threaded
Open this post in threaded view
|

Re: Concurrency issues? (Jan Kandziora)

Jan Kandziora
Am 01.06.2016 um 22:51 schrieb Loren Amelang:

>> Date: Tue, 31 May 2016 23:04:52 +0200 From: Jan Kandziora
>> <[hidden email]>
>
>> That's okay, but keep in mind for later installations twisted pair
>> is BAD for onewire. Twisted pair is only good if the drive is
>> symetrical. For asymetrical drive as with onewire, it only adds
>> cable length and capacity.
>
> Wouldn't parasitic power onewire be symmetrical?
>
Colin Law asked the same in
<CAL=[hidden email]>.

I drew a circuit with noise sources in response.
----------------------------------------------------------------------

                              noise
                             ------>
                               __      +---------+
      1.5k pullup             /  \     |         |
    +-----/\/\--------(----------------+--+      |
    |              |          \__/        |      |
   /|\             |                      /      |
  | | |            |5v       ------>      \ load |
   \|/             |           __         /      |
    |              v          /  \        |      |
    +---------+-------(----------------+--+      |
              |               \__/     |         |
              |                       ===       ===
              |                        |         |
              +------------------------+---------+


The cable capacitance on the ground wire directly shortens the noise
source while the cable capacitance on the DQ wire only shortens the
noise source through the pullup resistor.

So for the same influx, the noise voltage on the ground line is much
smaller than on the DQ line.

[...]

The noise has a certain power which flows into these voltage sources. So
it's either high voltage at low current or high current at low voltage.

If and how much ground capacitance is relevant depends on the frequency
of the noise. R_c = 1/(2*pi*f*C), calculate for yourself. Given f=1MHz,
C=1nF, it's 160 Ohms. That's smaller than the 1.5kOhms of the pullup
resistor. The load resistance of the open circuit of a slave
(master,too) is very high for onewire, megaohms, so it doesn't matter
for the above calculation.
----------------------------------------------------------------------

So, no. Parasite powered Onewire isn't equivalent to symetrical.


> Seems to work for me...
>
Your cables may work, though. That depends on the R', C', L' properties.



> I have probably 150 feet of CAT5 chained around my house. Sometimes
> out on one pair and back on another to continue the chain. At the
> far end of the chain, a 1N5711 Schottky diode and a 1.5KE20A-T TVS
> reduced errors a bit. What really cut my errors to zero was adding a
> 0.02 uF capacitor across the start of the chain.
>
Uh, 20nF is really MUCH.


> It drastically
> slows the signal rise times, but doesn't seem to hurt readings. It
> completely stopped the seemingly random storms of errors that would
> appear for a few hours and then go away for days. Military radar?
> Spooks?
>
Mobile phone is the most likely culprit.


>
> But that is with an ancient dedicated microprocessor at 5V - not
> with owfs. It reads and sets up a different single DS18B20 of the
> ten connected, every ten seconds. Often goes for months without a
> single missed reading now.
>
Ah! That way you can extend the expected rise times easily. The
bit-to-bit timing is not fixed in Onewire slaves, it's only the host
adapter chips which put an upper limit on this.


Kind regards

        Jan

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers
Reply | Threaded
Open this post in threaded view
|

Re: Concurrency issues? (Jan Kandziora)

Loren Amelang
In reply to this post by Loren Amelang
Date: Thu, 2 Jun 2016 00:19:21 +0200
From: Jan Kandziora <[hidden email]>
Subject: Re: [Owfs-developers] Concurrency issues? (Jan Kandziora)

>> Wouldn't parasitic power onewire be symmetrical?
>>
> Colin Law asked the same in
> <CAL=[hidden email]>.
>
> I drew a circuit with noise sources in response.
 
 
Here's how I'd think about the added cable capacitance of twisted pair:

Host      Pullup       Cable...                       1W Device

  ____/\  /\  /\  ____________________________________________...
 |      \/  \/  \/    |      |      |      |      |      |    
 O                    =      =      =      =      =     | |  
 |____________________|______|______|______|______|______|____...

It is evenly distributed along the entire cable. For noise originating at the host adapter, I agree the effect is limited by the pullup. But for noise originating along the cable, which I assume to be the problem in my environment, where DC power to relays and motors runs in the same conduits as the 1-Wire bus, it seems to me the cable capacitance is entirely symmetric. If the noise is reduced along the cable, it won't propagate back through the pullup to the 1-Wire host.

But it seems to me like you've drawn cable capacitance from the two active conductors to some separate ground which connects back to the host independently, maybe other grounded conductors in the same cable. Even in that case, I'd think twisted pair would reduce the coupling between adjacent pairs, reducing the assymmetry. (All my documentation sources say unused conductors should not be grounded.)

Maybe you're assuming the noise originates inside the host adapter, and thus on the other side of the pullup from the majority of the cable capacitance?


> Mobile phone is the most likely culprit.

Only one carrier has service here, and they're ~8 miles away, under -90 dBm. And they're CDMA, typically invisible even to intentional "bug detectors". My phone can be anywhere in the house, makes no difference. But there is a US "Military Operations Area" over the next ridge...  


I just searched my collection of 1-wire documentation. All of these specifically recommend twisted pair:

Maxim 132 1-wire requirements Quick Guide.pdf
Maxim 148 1-wire guidelines.pdf
Maxim 244 Advanced 1-Wire Network Driver.pdf
Maxim tb1 1-wire hdwre interface.pdf

The last one, "Tech Brief 1", has a deep discussion of cable parameters, with great graphs of the relevant effects. "Figure 6 Electrical Equivalent Circuit of the 1-Wire net" is way more complete than my drawing.

This document also recommends twisted pair, and provides many interesting clues:
<http://www.108relays.ca/dl/1_Wire_Design_Guide_v1.0.pdf>

"... examine the twist count for each pair and use the pair that has the most twists per inch."

They show that the "Silver Satin" flat phone cable previously used for 1-wire is actually worse for capacitance than CAT5. "Note that the capacitance figures are lower in the twisted pair cable, both in the wires [pairs] and in between wires. This is very important, as wire lengths get longer."
 
(I guess an untwisted cable with bigger wire and thicker insulation might change those numbers.)

How's this for detail - it matters exactly where on a daisy cable you attach your slaves! "FIGURE 3 - Any discontinuity on the line, including slaves can cause reflections. Locations that are at integer fractions of the line length are particularly problematic as they can resonant."


Probably irrelevant for most installations, but here's my setup. Primarily from "Maxim 132 1-wire requirements Quick Guide.pdf", P.6, Fig.7. Uses active pull-up and pull-down, and of course 5V.
(The 100 ohm resistor is supposed to be 88 ohms, to add to 100 in series with either of the 22 ohm resistors, but I didn't have one and never got around to replacing it.)

                      (To sensors)          (End termination)                
                    Gnd|---||--|1-Wire Net  Gnd|       |1-Wire Net          
                       |  0.02 |               |  ___  |                    
                       |    ___|               |-| >||-| 1N5711 Schottky    
                       |   |   |               |       |                    
                       |  /    |               |  __\  |                    
                       |  \1   |               |-| >||-| 1.5KE20A-T TVS      
                       |  /0   |                    \      
                       |  \0   |                          
                       |  /    |                          
                       |  \    |                          
                       |   |   |                          
                      -----------                          
                     |gnd|1-W|net|                        
                     | o | o | o |                        
                      -----------                          
                       4b  5b  6b    1.33K                
  ______________________|   |      __/\/\/\/\______        
 |                         /      |                |        
 |     PN    _____________|_______|  _______  2N   |        
 |     2222 |       |     |         |       | 2906 |        
 |     (NPN) \|_    |  22  \   22   |    _|/ (PNP) |        
 |           /| |   |\/\/\/\|/\/\/\/|   | |\  _____|        
 |          |   |   |       |       |   |   |/              
 |         -----------------------------------              
 |        |emt|bas|col|spd|1-W|spu|col|bas|emt| PV_T9,      
 |        | o | o | o | o | o | o | o | o | o | left of PV_T6
 |         -----------------------------------              
 |          1   2   3   4   5   6   7   8   9              
 |_________/|   |       |   |   |       |   |              
 |          |    \/\/\/\|   |   |/\/\/\/    |              
 |         Gnd     3.3K |   |   |  120     +5V              
---(TVS) (PV_T7:28)     |   |   |        (PV_T6:1)          
| |                     |   |   |                          
===  (pulldn out)H5:7___|   |   |___H5:6(strong pull-up out)
+|__________________________|_______T1:9(1-W signal input)  
                                                           

(Yes, my whole house control system is documented in ASCII. This started back in the CP/M era, and has outlived ten different computers with different operating systems and incompatible apps.)

OK, enough distraction for today. Thanks for making me look!

Loren
 
| Loren Amelang | [hidden email] |




------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers
Reply | Threaded
Open this post in threaded view
|

Re: Concurrency issues? (Jan Kandziora)

Jan Kandziora
Am 02.06.2016 um 23:10 schrieb Loren Amelang:
>
> it seems to me the cable capacitance is entirely symmetric.
>
That's a capacitance which cancels out both signal and noise (of the
same frequency) the same amount, so it doesn't help anything in
improving signal/noise ratio.

When your signal has lower frequency than the noise (so the capacitors
would have a higher resistance for signal than noise), the receiver
could tell them apart anyways. It has a low pass on input.


>
> But it seems to me like you've drawn cable capacitance from the two
> active conductors to some separate ground
>
That's earth. You have a cable capacitance against earth. Unless you put
them on a pole, with no shielding and such.

Yes, because those capacitances against earth are the ones which matter
for noise cancellation because of using twisted pair cable. If you used
two symetric driven signal wires, the whole circuit would be symetrical,
and you had full noise cancellation.

But Onewire isn't symetrical as soon the ground wire is connected to
earth with low impedance. As usual for PCs.

For a battery-powered single-bus circuit, ground isn't connected to
earth, so it doesn't matter. But it matters again as soon you have two
branches which share the ground line.



> (All my
> documentation sources say unused conductors should not be grounded.)
>
That is because grounded conductors add additional capacitance to earth.


>
>> Mobile phone is the most likely culprit.
>
> Only one carrier has service here, and they're ~8 miles away, under
> -90 dBm. And they're CDMA, typically invisible even to intentional
> "bug detectors". My phone can be anywhere in the house, makes no
> difference. But there is a US "Military Operations Area" over the
> next ridge...
>
Yeah, well... radar then.


>
> I just searched my collection of 1-wire documentation. All of these
> specifically recommend twisted pair:
>
> Maxim 132 1-wire requirements Quick Guide.pdf Maxim 148 1-wire
> guidelines.pdf Maxim 244 Advanced 1-Wire Network Driver.pdf Maxim tb1
> 1-wire hdwre interface.pdf
>
> The last one, "Tech Brief 1", has a deep discussion of cable
> parameters, with great graphs of the relevant effects. "Figure 6
> Electrical Equivalent Circuit of the 1-Wire net" is way more complete
> than my drawing.
>
> This document also recommends twisted pair, and provides many
> interesting clues:
> <http://www.108relays.ca/dl/1_Wire_Design_Guide_v1.0.pdf>
>
> "... examine the twist count for each pair and use the pair that has
> the most twists per inch."
>
Sorry, but twisted pair doesn't help you when one of your conductors is
connected to earth at some place. And even if not, things get extremly
complicated if you have more than one branch which misuse the common
ground as a "symetrical" signal wire.



> They show that the "Silver Satin" flat phone cable previously used
> for 1-wire is actually worse for capacitance than CAT5. "Note that
> the capacitance figures are lower in the twisted pair cable, both in
> the wires [pairs] and in between wires. This is very important, as
> wire lengths get longer."
>
But that's a property of the cable used and not a property of twisted pair.

Ultra-cheap flat telephone cable in addition has a much smaller
cross-section than even cheap Cat5 cable. The added resistance makes the
cable a low-pass and that's bad for Onewire communication.


>
> How's this for detail - it matters exactly where on a daisy cable you
> attach your slaves! "FIGURE 3 - Any discontinuity on the line,
> including slaves can cause reflections. Locations that are at integer
> fractions of the line length are particularly problematic as they can
> resonant."
>
Yes.


Kind regards

        Jan

------------------------------------------------------------------------------
What NetFlow Analyzer can do for you? Monitors network bandwidth and traffic
patterns at an interface-level. Reveals which users, apps, and protocols are
consuming the most bandwidth. Provides multi-vendor support for NetFlow,
J-Flow, sFlow and other flows. Make informed decisions using capacity
planning reports. https://ad.doubleclick.net/ddm/clk/305295220;132659582;e
_______________________________________________
Owfs-developers mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/owfs-developers