9 ms·
This is why 4-20 mA is a common signaling standard in industrial automation. 4 mA means zero and 20 mA means one. 0 mA means broken transmitter!
by electroly 4y ago
This is why 4-20 mA is a common signaling standard in industrial automation. 4 mA means zero and 20 mA means one. 0 mA means broken transmitter!
- xani_ 4y agoThat's why in our monitoring we used nagios scheme + 1 (0 for invalid, 1 for ok, 2 for warning, 3 for crit, 4 for unknown)
- jallmann 4y agoAlso issue with golang (+ protobufs) where you can't distinguish a populated zero value from the default "not present" value.
- kortex 4y agoThis drives me absolutely bonkers. We had a situation in a machine learning context where we should have been treating the output of a detector as NaN (it was deliberately opting out), but instead it was falling back to zero. Last I checked (this was years ago) the way to deal with this is to wrap it in a sub-message (which are actually nullable), which is just kinda gross.
- krackers 4y agoI thought proto3 has support for optional scalar fields now (https://github.com/protocolbuffers/protobuf/releases/tag/v3.15.0 https://github.com/protocolbuffers/protobuf/releases/tag/v3....), and proto2 always had it
- bazoom42 4y agoThats why JavaScript has both undefined and null!
- deely3 4y agoDo we really need to differentiate between undef and null?
- bazoom42 4y agoNot necessarily, but it does allow a level of robustness to be able to distingish between values which have deliberately been assigned null, and values which have not been initialized correctly.
- mananaysiempre 4y agoLua does fine with only a nil, although it gets a tad annoying when you actually want to store a nil value in an array and end up creating a hole instead. (Arguably, the solution to that problem is to use your own marker object and not a nil when you need some sort of unspecified or default value which is not a literal absence of one.)
- hardware2win 4y agoC# linqs method - first or default has the same problem
- int_19h 4y agoThe method itself just uses the default value of the corresponding type. If you have a sequence of ints, and you cast it to Nullable<int> first before applying FirstOrDefault, then you can distinguish between null and 0.
- invalidator 4y agoThat's one reason, but the big one is that it makes it easy to remote-power the sensors. It gives them a 4mA budget to Do Their Thing even when outputting a zero.
- weaksauce 4y agoI would say the independence of conductor length to voltage drop since current is measurable at any point in the wire is more important. another big advantage to it is that it also is resistant to noise. (though you should be using grounded on on end TSP anyway) nowadays it's pretty common to use cat5 and read a bunch of things from the sensors though via various protocols. 4-20mA sure is a lot simpler to program against though.
- crgwbr 4y agoInteresting. That makes sense, but what’s the reason for using current instead of voltage as the variable?
- mschuster91 4y agoCurrent flow is independent of wire length, the sender only has to turn up the voltage high enough to overcome the wire resistance.
- sjruckle 4y agoAlso, there's greater immunity to interference and poor connections.
- adrian_b 4y agoThis happens because the real insulators are better approximations of ideal insulators, than real conductors are approximations of ideal conductors. In electrical circuits made with normal conductors and insulators, e.g. copper wires and organic polymer insulators, it is possible to ignore the currents that branch from the wires and close through the insulators, because they are extremely small (e.g. in the femtoampere range), but frequently it is not possible to ignore the voltage drops along the copper wires, which are caused by the resistances of the wires, and which may be in the millivolt range.
- lisper 4y agoI have a bachelors degree in electrical engineering and work experience in hardware design and in the back of my mind I've always known this to be true, but this is the first time in my life I've ever heard anyone say this explicitly. EE pedagogy is badly broken in places.
- freedomben 4y agoIndeed, when discussing theory we love pretending that there's no voltage drop from the wires, which can really bite you when you get into design or deep failure analysis. All good technicians and engineers learn this reality fairly soon, and it's one of the things we check especially when dealing with indeterminate failures. As much as I love academia, I really wish there were more instructors with real experience that could say things like, "for math purposes assume a zero-loss conductor" while still emphasizing that real life is not so simple.
- janpot 4y agoor why we build a stop command with normal-closed contacts. a broken wire results in the same signal as a "stop" command.
- mauvehaus 4y agoIf you're doing three-wire control [0], it also means you can add additional "stop" buttons by wiring them all into the circuit in series. A nice-to-have addition to your table saw is a big red stop button you can reach with your foot so you don't have to take your hands off of your work pieces to shut the saw down if things have gotten more interesting than you expected them to. Three wire control makes this super easy to add (once you've found the big red mushroom-head n/c switch, of course). [0] https://twcontrols.com/lessons/control-wiring-3-wire-control-start-stop-circuit https://twcontrols.com/lessons/control-wiring-3-wire-control...
- Akronymus 4y agoI think for a foot pedal, it'd make more sense to have an enable rather than e-stop. Altough, that also depends on if you only work from one location or many. (Presses in industry often use such a design for hands, so that it ensures you hands aren't in the press.)
- phkahler 4y agoSemantics are really important in these situations. We have a system with an E-stop (emergency stop) circuit. Any break in the loop and the system will shut off. It needed to work together with one particular vendors board that insisted on having a "hardware enable" signal that it could control. Rather than adding an additional circuit, someone decided to have "hardware enable" flip a normally open relay in the E-stop circuit. Technically this "works" because enable clears the E-stop condition and allows the thing to function. From a practical point of view this has caused no end of odd problems, particularly when diagnosing issues where things fail because the meaning of this signal has been compromised.
- oasisbob 4y ago
- hedora 4y agoIt is also why white traffic lights no longer mean "go". White means "the red glass lens in front of the incandescent bulb shattered again". Related, from train signals: > The invention of the track circuit in 1872 by William Robinson permitted automatic block signals. Most simply, a low voltage battery current runs up one rail and down the other. As long as current flows from the battery through one rail to the relay and back through the other rail, the relay remains energized and routes current from another battery to the green lamp of a clear signal. But when a train is present, the circuit is short circuited by the steel wheels and axles of the cars; a broken rail or an open switch will also break the circuit. As a result the relay is opened and the signal displays red. The system is arranged so the failure of any component results in a red indication or a dark signal (which must be interpreted as the most restrictive aspect that signal can display). https://www.trains.com/trn/train-basics/abcs-of-railroading/railroad-signals/ https://www.trains.com/trn/train-basics/abcs-of-railroading/...
- martyvis 4y agoSimilarly train brakes are failsafe. They operate by compressed air. Being connected to the locomotive and hence control allows them to be released. If the carriages become disconnected, brakes get applied.
- acdha 4y agoTrain air brakes are similar in failing safely for the same written-in-blood reasons: https://en.wikipedia.org/wiki/Railway_air_brake https://en.wikipedia.org/wiki/Railway_air_brake
- peterleiser 4y agoAlarm systems use the "End of Line" resistor concept. The alarm triggers when a sensor is opened and current flow stops. Closed is ambiguous because it could mean power is flowing through all closed sensors OR there is a short (alarm panels handle shorts). A resistor allows the panel to consider 0 Ohms a short and some specific number of Ohms as closed and working. It apparently also provides a way to detect tampering of the wires. https://www.alarmsystemstore.com/pages/all-about-resistors https://www.alarmsystemstore.com/pages/all-about-resistors
- deleted 4y ago[deleted]
- Unklejoe 4y agoAnother example is how garage door opener trip-beams work (the sensors that detect if something is in the way before lowering the door). The transmitter and receiver are wired in parallel and connected to a power supply through a series resistor. When the receiver receives the signal from the transmitter, it pulls the supply voltage down, which then causes the transmitter to stop transmitting, which then causes the receiver to stop pulling the supply down, and the cycle continues. The end result is that if there's no obstruction, the supply voltage pulses and the system checks for this. If there's any other type of condition, the signal is either 0 or VCC. Basically, the system is designed so that false positives are extremely unlikely since that's the worst case scenario. There's some capacitors in the transmitter/receiver to control the frequency.
- Gordonjcp 4y agoGas central heating boilers use something similar to control the gas solenoid - the solenoid is fed through a biggish capacitor, which has a diode and a capacitor to "smooth" the pulses from the microcontroller. If the microcontroller output latches itself on, the capacitor charges fully, there are no more pulses, and the solenoid drops out.
- blep_ 4y agoThat sounds very complicated. What advantage does it have over wiring the two in series and having an open circuit indicate an obstruction? edit: it gets you protection against one of the two failing closed, duh
- mananaysiempre 4y agoAlso why a standard keyboard has a Break key: used to be that a telegraph station would have a bell that rang if it detected a broken connection (a “break condition”), then people figured that deliberately inducing a break was a handy way to alert the remote operator. I think the first automated telegraph systems actually used current-loop signalling, but I’m not sure about the first practical ones; in any case, the concept carried over into modern (well, 70s-vintage) asynchronous lines—most UARTs nowadays have a break interrupt that you can enable.
- sneak 4y agoI have a standard keyboard and it has no break key.
- cafeinux 4y agoIt's also named "Pause key", but one could argue that if your keyboard doesn't have any of these two keys, it cannot really be called "standard".
- mananaysiempre 4y agoTo clarify, by a “standard” keyboard I mean a (usually US) QWERTY PC keyboard with 101 to 105 keys (depending on the amount of Win/Super and Menu keys and the presence of an additional punctuation key to the left of Z). Those have three rows of three keys each above the arrows (not counting any “media keys” such as Power); the topmost one of those is PrintScreen / SysRq, Scroll Lock, and Pause / Break, though some of those labels may be omitted. I honestly have never seen a full-size PC keyboard without those. (How am I supposed to hit Ctrl-Break or Win-Break otherwise?) Strictly speaking, there is no Break key in the same sense that there is no SysRq key—there are only special Break and SysRq scancodes that AT and PS/2 keyboards send instead of Pause and Print Screen when Ctrl or Alt respectively is depressed (thus the combined labels), while USB keyboards don’t even have those, they just send normal modifier sequences. But I don’t think that’s what you had in mind :)
- sneak 4y ago