Pick largest of several voltages with analogue comparators

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP





.everyoneloves__top-leaderboard:empty,.everyoneloves__mid-leaderboard:empty margin-bottom:0;







up vote
4
down vote

favorite












This is not an XY problem. I have already decided that the best way to handle the actual application is to use a multiplexer and ADC/MCU to measure all the voltages.



However, I am always keen to find a neat new way to hook up opamps or comparators. This is an 'does this configuration exist in a neat way' question? I've not managed to find one yet through the normal search routes.



Inputs - 6 or so positive signals in the 1v to 2v range



Outputs - one amplifier or comparator output per signal, where that corresponding to the largest (or equivalently the smallest) voltage has a unique, perhaps high output, and all the others have a low and similar output, such that they are already logic-usable levels, or can be compared against a simple threshhold to give logic levels.



Ignore input voltage offsets as being insignificant with respect to the input voltages. Hysteresis is optional. Scalable to any (reasonable) number of inputs.



It's relatively easy to output true for all the signals that are above the average of the inputs. Just form the average with an equal resistor network, then use this voltage for the reference input to each comparator.



What I feel should be possible is some sort of diode feedback, like in an absolute value circuit, where the gain of an amplifier reduces the diode drop to insignificance, and the 'winning' amplifier/comparator silences all the others. However, I've not managed to find a simple configuration yet.



What's a simple configuration? One amp per input, with at most two additional shared ones. One diode, or at a stretch two, per amp, with at most 4 resistors per amplifier, and a few extra shared, with as few as possible needing matched values.



Any thoughts?



(edit)



I have the outline of a solution which involves an integrator which controls a common reference level. This level ramps down if no inputs exceed it, and ramps up when any input exceeds it. The level will tend to hunt around the largest level, with the comparator output corresponding to the largest flicking on and off. Replacing the comparators with amplifiers and paying attention to stability may result in a steady output that's suitable.







share|improve this question






















  • I am a bit confused, your title states to pick the largest output (that is, one analogue output, N analogue inputs), and your question seems to state you want a digital result (N analogue inputs, N digital outputs).
    – PlasmaHH
    Aug 10 at 11:56










  • @PlasmaHH clarified
    – Neil_UK
    Aug 10 at 12:49










  • You are looking for a "winner take all" circuit. That will prove a useful search term. Easily done with a hardware neural net, but also with comparator trees -- sciencedirect.com/science/article/pii/S0925231204002796
    – Scott Seidman
    Aug 10 at 13:21










  • Interesting circuit... if you're able to and don't mind sharing, what's the application?
    – Shamtam
    Aug 10 at 17:12

















up vote
4
down vote

favorite












This is not an XY problem. I have already decided that the best way to handle the actual application is to use a multiplexer and ADC/MCU to measure all the voltages.



However, I am always keen to find a neat new way to hook up opamps or comparators. This is an 'does this configuration exist in a neat way' question? I've not managed to find one yet through the normal search routes.



Inputs - 6 or so positive signals in the 1v to 2v range



Outputs - one amplifier or comparator output per signal, where that corresponding to the largest (or equivalently the smallest) voltage has a unique, perhaps high output, and all the others have a low and similar output, such that they are already logic-usable levels, or can be compared against a simple threshhold to give logic levels.



Ignore input voltage offsets as being insignificant with respect to the input voltages. Hysteresis is optional. Scalable to any (reasonable) number of inputs.



It's relatively easy to output true for all the signals that are above the average of the inputs. Just form the average with an equal resistor network, then use this voltage for the reference input to each comparator.



What I feel should be possible is some sort of diode feedback, like in an absolute value circuit, where the gain of an amplifier reduces the diode drop to insignificance, and the 'winning' amplifier/comparator silences all the others. However, I've not managed to find a simple configuration yet.



What's a simple configuration? One amp per input, with at most two additional shared ones. One diode, or at a stretch two, per amp, with at most 4 resistors per amplifier, and a few extra shared, with as few as possible needing matched values.



Any thoughts?



(edit)



I have the outline of a solution which involves an integrator which controls a common reference level. This level ramps down if no inputs exceed it, and ramps up when any input exceeds it. The level will tend to hunt around the largest level, with the comparator output corresponding to the largest flicking on and off. Replacing the comparators with amplifiers and paying attention to stability may result in a steady output that's suitable.







share|improve this question






















  • I am a bit confused, your title states to pick the largest output (that is, one analogue output, N analogue inputs), and your question seems to state you want a digital result (N analogue inputs, N digital outputs).
    – PlasmaHH
    Aug 10 at 11:56










  • @PlasmaHH clarified
    – Neil_UK
    Aug 10 at 12:49










  • You are looking for a "winner take all" circuit. That will prove a useful search term. Easily done with a hardware neural net, but also with comparator trees -- sciencedirect.com/science/article/pii/S0925231204002796
    – Scott Seidman
    Aug 10 at 13:21










  • Interesting circuit... if you're able to and don't mind sharing, what's the application?
    – Shamtam
    Aug 10 at 17:12













up vote
4
down vote

favorite









up vote
4
down vote

favorite











This is not an XY problem. I have already decided that the best way to handle the actual application is to use a multiplexer and ADC/MCU to measure all the voltages.



However, I am always keen to find a neat new way to hook up opamps or comparators. This is an 'does this configuration exist in a neat way' question? I've not managed to find one yet through the normal search routes.



Inputs - 6 or so positive signals in the 1v to 2v range



Outputs - one amplifier or comparator output per signal, where that corresponding to the largest (or equivalently the smallest) voltage has a unique, perhaps high output, and all the others have a low and similar output, such that they are already logic-usable levels, or can be compared against a simple threshhold to give logic levels.



Ignore input voltage offsets as being insignificant with respect to the input voltages. Hysteresis is optional. Scalable to any (reasonable) number of inputs.



It's relatively easy to output true for all the signals that are above the average of the inputs. Just form the average with an equal resistor network, then use this voltage for the reference input to each comparator.



What I feel should be possible is some sort of diode feedback, like in an absolute value circuit, where the gain of an amplifier reduces the diode drop to insignificance, and the 'winning' amplifier/comparator silences all the others. However, I've not managed to find a simple configuration yet.



What's a simple configuration? One amp per input, with at most two additional shared ones. One diode, or at a stretch two, per amp, with at most 4 resistors per amplifier, and a few extra shared, with as few as possible needing matched values.



Any thoughts?



(edit)



I have the outline of a solution which involves an integrator which controls a common reference level. This level ramps down if no inputs exceed it, and ramps up when any input exceeds it. The level will tend to hunt around the largest level, with the comparator output corresponding to the largest flicking on and off. Replacing the comparators with amplifiers and paying attention to stability may result in a steady output that's suitable.







share|improve this question














This is not an XY problem. I have already decided that the best way to handle the actual application is to use a multiplexer and ADC/MCU to measure all the voltages.



However, I am always keen to find a neat new way to hook up opamps or comparators. This is an 'does this configuration exist in a neat way' question? I've not managed to find one yet through the normal search routes.



Inputs - 6 or so positive signals in the 1v to 2v range



Outputs - one amplifier or comparator output per signal, where that corresponding to the largest (or equivalently the smallest) voltage has a unique, perhaps high output, and all the others have a low and similar output, such that they are already logic-usable levels, or can be compared against a simple threshhold to give logic levels.



Ignore input voltage offsets as being insignificant with respect to the input voltages. Hysteresis is optional. Scalable to any (reasonable) number of inputs.



It's relatively easy to output true for all the signals that are above the average of the inputs. Just form the average with an equal resistor network, then use this voltage for the reference input to each comparator.



What I feel should be possible is some sort of diode feedback, like in an absolute value circuit, where the gain of an amplifier reduces the diode drop to insignificance, and the 'winning' amplifier/comparator silences all the others. However, I've not managed to find a simple configuration yet.



What's a simple configuration? One amp per input, with at most two additional shared ones. One diode, or at a stretch two, per amp, with at most 4 resistors per amplifier, and a few extra shared, with as few as possible needing matched values.



Any thoughts?



(edit)



I have the outline of a solution which involves an integrator which controls a common reference level. This level ramps down if no inputs exceed it, and ramps up when any input exceeds it. The level will tend to hunt around the largest level, with the comparator output corresponding to the largest flicking on and off. Replacing the comparators with amplifiers and paying attention to stability may result in a steady output that's suitable.









share|improve this question













share|improve this question




share|improve this question








edited Aug 10 at 12:49

























asked Aug 10 at 11:52









Neil_UK

69k272152




69k272152











  • I am a bit confused, your title states to pick the largest output (that is, one analogue output, N analogue inputs), and your question seems to state you want a digital result (N analogue inputs, N digital outputs).
    – PlasmaHH
    Aug 10 at 11:56










  • @PlasmaHH clarified
    – Neil_UK
    Aug 10 at 12:49










  • You are looking for a "winner take all" circuit. That will prove a useful search term. Easily done with a hardware neural net, but also with comparator trees -- sciencedirect.com/science/article/pii/S0925231204002796
    – Scott Seidman
    Aug 10 at 13:21










  • Interesting circuit... if you're able to and don't mind sharing, what's the application?
    – Shamtam
    Aug 10 at 17:12

















  • I am a bit confused, your title states to pick the largest output (that is, one analogue output, N analogue inputs), and your question seems to state you want a digital result (N analogue inputs, N digital outputs).
    – PlasmaHH
    Aug 10 at 11:56










  • @PlasmaHH clarified
    – Neil_UK
    Aug 10 at 12:49










  • You are looking for a "winner take all" circuit. That will prove a useful search term. Easily done with a hardware neural net, but also with comparator trees -- sciencedirect.com/science/article/pii/S0925231204002796
    – Scott Seidman
    Aug 10 at 13:21










  • Interesting circuit... if you're able to and don't mind sharing, what's the application?
    – Shamtam
    Aug 10 at 17:12
















I am a bit confused, your title states to pick the largest output (that is, one analogue output, N analogue inputs), and your question seems to state you want a digital result (N analogue inputs, N digital outputs).
– PlasmaHH
Aug 10 at 11:56




I am a bit confused, your title states to pick the largest output (that is, one analogue output, N analogue inputs), and your question seems to state you want a digital result (N analogue inputs, N digital outputs).
– PlasmaHH
Aug 10 at 11:56












@PlasmaHH clarified
– Neil_UK
Aug 10 at 12:49




@PlasmaHH clarified
– Neil_UK
Aug 10 at 12:49












You are looking for a "winner take all" circuit. That will prove a useful search term. Easily done with a hardware neural net, but also with comparator trees -- sciencedirect.com/science/article/pii/S0925231204002796
– Scott Seidman
Aug 10 at 13:21




You are looking for a "winner take all" circuit. That will prove a useful search term. Easily done with a hardware neural net, but also with comparator trees -- sciencedirect.com/science/article/pii/S0925231204002796
– Scott Seidman
Aug 10 at 13:21












Interesting circuit... if you're able to and don't mind sharing, what's the application?
– Shamtam
Aug 10 at 17:12





Interesting circuit... if you're able to and don't mind sharing, what's the application?
– Shamtam
Aug 10 at 17:12











4 Answers
4






active

oldest

votes

















up vote
3
down vote













It turns out I could smell the solution. It's interesting to see how long it took to get there, needed me to post a question to make it happen, and my thought process went via the intermediate ramping integrator edit to my question.





schematic





simulate this circuit – Schematic created using CircuitLab



It's intended that all channels are identical. However, I've drawn channels 1 and 2 as the simplest possible, and left channel n to receive embellishments.



Consider all inputs except input 1 low. Amplifier 1 works as a follower, with its output a diode D1 drop above its negative input, R1 pulling a modest current through the diode. All other amplifier outputs will be at the negative rail, with their diodes reverse biassed.



As input 2 increases in voltage, it will eventually exceed the common reference voltage on R1, OA2 output will go high, pulling the common reference up to its input voltage, which will send amplifier 1 output low.



If we assume a sufficiently low impedance driving the inputs, I've shown on channel n how a sniff of hysteresis can be applied to the input.



The active output is a diode drop above the input voltage. The inactive outputs are near the negative rail.



To make this easily discriminated by logic, the inputs need to be guaranteed to stay some reasonable voltage above the negative rail. This will happen automatically if the inputs are strictly positive, and the amplifiers receive a negative rail.



With sufficient positive rail available, the diodes could be replaced by elements with a larger voltage drop, for instance several series diodes, or a LED, to increase the voltage excess of the output over the input. Using LEDs would make a nice self-indicating circuit, as long as the LED reverse breakdown was not exceeded, or they were protected by a proper diode in series. If they were inputs to optocouplers, they could be used to drive logic easily.



In an effort to get better logic levels out of the system, I've added Qn. It works as a cascode, transferring the amplifier output current to R1, but only when the output voltage is about 2 diode drops above the logic high reference voltage. Dn could be omitted, as long as the reverse VBE limit, usually around 5v or so for silicon, is not exceeded when the output is low. This now ensures that the outputs are nearly negative rail for low, and logic high reference + 1.4v for high. It does increase the loop gain of the system, so might compromise stability. I'd need to think about that. A resistor in series with Qn emitter would control the gain, and while it would destroy the relatively constant output high voltage, at least the output high voltage is guaranteed to be above a certain voltage, regardless of how low the winning input voltage is.



An essentially identical scheme can be configured to select the smallest input voltage.






share|improve this answer






















  • niceeeee So, I just misread your question; my answer basically just leaves out the part you're solving here.
    – Marcus Müller
    Aug 10 at 13:47

















up vote
2
down vote















schematic





simulate this circuit – Schematic created using CircuitLab



Something similar to this as a single stage may work when repeated multiple times.



The relay can likely be replaced with a transistor based switch.



A comparator may work better in this circuit than a plain op-amp.



The bottom part shows a way to combine the individual stages for multiple signals. For N inputs, you need N-1 stages with this configuration






share|improve this answer


















  • 3




    How would you extend this to N voltages?
    – Autistic
    Aug 10 at 12:56










  • That's really out of the box thinking! Perhaps not an industrial solution, but thought-provoking.
    – winny
    Aug 10 at 13:51










  • nice but not solving the edited OP's problem
    – aaaaaa
    Aug 10 at 18:35

















up vote
1
down vote













So, in the end, you could use $binomN_in2$ comparators to compare all pairs of voltages. That'd give you a $binomN_in2$-bit value, and you could convert that to the info "highest is input $n$" with but a simple LUT.



So, we'd need a set of $binom62=15$ comparators. Ugly? Sure, but you know who's good at comparing voltages (and fast at that)?



Differential line receivers.



In fact, for example, TI has 24 bit LVDS serializers. But you're probably happier with a simpler part like the 16 differential input -> 16 LVTTL output SM65LVDS386. If you're oldschool, you then add logical gates to implement the LUT.



An output like "is $n$ the highest input?" (i.e. one-hot) would even be easier. It would just be an "AND" of all the outputs that involve $n$.






share|improve this answer





























    up vote
    0
    down vote













    Thinking aloud....





    schematic





    simulate this circuit – Schematic created using CircuitLab



    A common "max voltage bus" (with signals B & C) that is compared against one signal (A). Summing of all others is done with diodes. D1 is used to introduce the same voltage drop to signal A as to the other signals.
    Assumption: all diodes are identical and linear enough (diodes... linear...).



    How it scales? Badly... for every signal a max voltage signal of all the other signals is needed.






    share|improve this answer




















      Your Answer




      StackExchange.ifUsing("editor", function ()
      return StackExchange.using("mathjaxEditing", function ()
      StackExchange.MarkdownEditor.creationCallbacks.add(function (editor, postfix)
      StackExchange.mathjaxEditing.prepareWmdForMathJax(editor, postfix, [["\$", "\$"]]);
      );
      );
      , "mathjax-editing");

      StackExchange.ifUsing("editor", function ()
      return StackExchange.using("schematics", function ()
      StackExchange.schematics.init();
      );
      , "cicuitlab");

      StackExchange.ready(function()
      var channelOptions =
      tags: "".split(" "),
      id: "135"
      ;
      initTagRenderer("".split(" "), "".split(" "), channelOptions);

      StackExchange.using("externalEditor", function()
      // Have to fire editor after snippets, if snippets enabled
      if (StackExchange.settings.snippets.snippetsEnabled)
      StackExchange.using("snippets", function()
      createEditor();
      );

      else
      createEditor();

      );

      function createEditor()
      StackExchange.prepareEditor(
      heartbeatType: 'answer',
      convertImagesToLinks: false,
      noModals: false,
      showLowRepImageUploadWarning: true,
      reputationToPostImages: null,
      bindNavPrevention: true,
      postfix: "",
      onDemand: true,
      discardSelector: ".discard-answer"
      ,immediatelyShowMarkdownHelp:true
      );



      );













       

      draft saved


      draft discarded


















      StackExchange.ready(
      function ()
      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2felectronics.stackexchange.com%2fquestions%2f390355%2fpick-largest-of-several-voltages-with-analogue-comparators%23new-answer', 'question_page');

      );

      Post as a guest






























      4 Answers
      4






      active

      oldest

      votes








      4 Answers
      4






      active

      oldest

      votes









      active

      oldest

      votes






      active

      oldest

      votes








      up vote
      3
      down vote













      It turns out I could smell the solution. It's interesting to see how long it took to get there, needed me to post a question to make it happen, and my thought process went via the intermediate ramping integrator edit to my question.





      schematic





      simulate this circuit – Schematic created using CircuitLab



      It's intended that all channels are identical. However, I've drawn channels 1 and 2 as the simplest possible, and left channel n to receive embellishments.



      Consider all inputs except input 1 low. Amplifier 1 works as a follower, with its output a diode D1 drop above its negative input, R1 pulling a modest current through the diode. All other amplifier outputs will be at the negative rail, with their diodes reverse biassed.



      As input 2 increases in voltage, it will eventually exceed the common reference voltage on R1, OA2 output will go high, pulling the common reference up to its input voltage, which will send amplifier 1 output low.



      If we assume a sufficiently low impedance driving the inputs, I've shown on channel n how a sniff of hysteresis can be applied to the input.



      The active output is a diode drop above the input voltage. The inactive outputs are near the negative rail.



      To make this easily discriminated by logic, the inputs need to be guaranteed to stay some reasonable voltage above the negative rail. This will happen automatically if the inputs are strictly positive, and the amplifiers receive a negative rail.



      With sufficient positive rail available, the diodes could be replaced by elements with a larger voltage drop, for instance several series diodes, or a LED, to increase the voltage excess of the output over the input. Using LEDs would make a nice self-indicating circuit, as long as the LED reverse breakdown was not exceeded, or they were protected by a proper diode in series. If they were inputs to optocouplers, they could be used to drive logic easily.



      In an effort to get better logic levels out of the system, I've added Qn. It works as a cascode, transferring the amplifier output current to R1, but only when the output voltage is about 2 diode drops above the logic high reference voltage. Dn could be omitted, as long as the reverse VBE limit, usually around 5v or so for silicon, is not exceeded when the output is low. This now ensures that the outputs are nearly negative rail for low, and logic high reference + 1.4v for high. It does increase the loop gain of the system, so might compromise stability. I'd need to think about that. A resistor in series with Qn emitter would control the gain, and while it would destroy the relatively constant output high voltage, at least the output high voltage is guaranteed to be above a certain voltage, regardless of how low the winning input voltage is.



      An essentially identical scheme can be configured to select the smallest input voltage.






      share|improve this answer






















      • niceeeee So, I just misread your question; my answer basically just leaves out the part you're solving here.
        – Marcus Müller
        Aug 10 at 13:47














      up vote
      3
      down vote













      It turns out I could smell the solution. It's interesting to see how long it took to get there, needed me to post a question to make it happen, and my thought process went via the intermediate ramping integrator edit to my question.





      schematic





      simulate this circuit – Schematic created using CircuitLab



      It's intended that all channels are identical. However, I've drawn channels 1 and 2 as the simplest possible, and left channel n to receive embellishments.



      Consider all inputs except input 1 low. Amplifier 1 works as a follower, with its output a diode D1 drop above its negative input, R1 pulling a modest current through the diode. All other amplifier outputs will be at the negative rail, with their diodes reverse biassed.



      As input 2 increases in voltage, it will eventually exceed the common reference voltage on R1, OA2 output will go high, pulling the common reference up to its input voltage, which will send amplifier 1 output low.



      If we assume a sufficiently low impedance driving the inputs, I've shown on channel n how a sniff of hysteresis can be applied to the input.



      The active output is a diode drop above the input voltage. The inactive outputs are near the negative rail.



      To make this easily discriminated by logic, the inputs need to be guaranteed to stay some reasonable voltage above the negative rail. This will happen automatically if the inputs are strictly positive, and the amplifiers receive a negative rail.



      With sufficient positive rail available, the diodes could be replaced by elements with a larger voltage drop, for instance several series diodes, or a LED, to increase the voltage excess of the output over the input. Using LEDs would make a nice self-indicating circuit, as long as the LED reverse breakdown was not exceeded, or they were protected by a proper diode in series. If they were inputs to optocouplers, they could be used to drive logic easily.



      In an effort to get better logic levels out of the system, I've added Qn. It works as a cascode, transferring the amplifier output current to R1, but only when the output voltage is about 2 diode drops above the logic high reference voltage. Dn could be omitted, as long as the reverse VBE limit, usually around 5v or so for silicon, is not exceeded when the output is low. This now ensures that the outputs are nearly negative rail for low, and logic high reference + 1.4v for high. It does increase the loop gain of the system, so might compromise stability. I'd need to think about that. A resistor in series with Qn emitter would control the gain, and while it would destroy the relatively constant output high voltage, at least the output high voltage is guaranteed to be above a certain voltage, regardless of how low the winning input voltage is.



      An essentially identical scheme can be configured to select the smallest input voltage.






      share|improve this answer






















      • niceeeee So, I just misread your question; my answer basically just leaves out the part you're solving here.
        – Marcus Müller
        Aug 10 at 13:47












      up vote
      3
      down vote










      up vote
      3
      down vote









      It turns out I could smell the solution. It's interesting to see how long it took to get there, needed me to post a question to make it happen, and my thought process went via the intermediate ramping integrator edit to my question.





      schematic





      simulate this circuit – Schematic created using CircuitLab



      It's intended that all channels are identical. However, I've drawn channels 1 and 2 as the simplest possible, and left channel n to receive embellishments.



      Consider all inputs except input 1 low. Amplifier 1 works as a follower, with its output a diode D1 drop above its negative input, R1 pulling a modest current through the diode. All other amplifier outputs will be at the negative rail, with their diodes reverse biassed.



      As input 2 increases in voltage, it will eventually exceed the common reference voltage on R1, OA2 output will go high, pulling the common reference up to its input voltage, which will send amplifier 1 output low.



      If we assume a sufficiently low impedance driving the inputs, I've shown on channel n how a sniff of hysteresis can be applied to the input.



      The active output is a diode drop above the input voltage. The inactive outputs are near the negative rail.



      To make this easily discriminated by logic, the inputs need to be guaranteed to stay some reasonable voltage above the negative rail. This will happen automatically if the inputs are strictly positive, and the amplifiers receive a negative rail.



      With sufficient positive rail available, the diodes could be replaced by elements with a larger voltage drop, for instance several series diodes, or a LED, to increase the voltage excess of the output over the input. Using LEDs would make a nice self-indicating circuit, as long as the LED reverse breakdown was not exceeded, or they were protected by a proper diode in series. If they were inputs to optocouplers, they could be used to drive logic easily.



      In an effort to get better logic levels out of the system, I've added Qn. It works as a cascode, transferring the amplifier output current to R1, but only when the output voltage is about 2 diode drops above the logic high reference voltage. Dn could be omitted, as long as the reverse VBE limit, usually around 5v or so for silicon, is not exceeded when the output is low. This now ensures that the outputs are nearly negative rail for low, and logic high reference + 1.4v for high. It does increase the loop gain of the system, so might compromise stability. I'd need to think about that. A resistor in series with Qn emitter would control the gain, and while it would destroy the relatively constant output high voltage, at least the output high voltage is guaranteed to be above a certain voltage, regardless of how low the winning input voltage is.



      An essentially identical scheme can be configured to select the smallest input voltage.






      share|improve this answer














      It turns out I could smell the solution. It's interesting to see how long it took to get there, needed me to post a question to make it happen, and my thought process went via the intermediate ramping integrator edit to my question.





      schematic





      simulate this circuit – Schematic created using CircuitLab



      It's intended that all channels are identical. However, I've drawn channels 1 and 2 as the simplest possible, and left channel n to receive embellishments.



      Consider all inputs except input 1 low. Amplifier 1 works as a follower, with its output a diode D1 drop above its negative input, R1 pulling a modest current through the diode. All other amplifier outputs will be at the negative rail, with their diodes reverse biassed.



      As input 2 increases in voltage, it will eventually exceed the common reference voltage on R1, OA2 output will go high, pulling the common reference up to its input voltage, which will send amplifier 1 output low.



      If we assume a sufficiently low impedance driving the inputs, I've shown on channel n how a sniff of hysteresis can be applied to the input.



      The active output is a diode drop above the input voltage. The inactive outputs are near the negative rail.



      To make this easily discriminated by logic, the inputs need to be guaranteed to stay some reasonable voltage above the negative rail. This will happen automatically if the inputs are strictly positive, and the amplifiers receive a negative rail.



      With sufficient positive rail available, the diodes could be replaced by elements with a larger voltage drop, for instance several series diodes, or a LED, to increase the voltage excess of the output over the input. Using LEDs would make a nice self-indicating circuit, as long as the LED reverse breakdown was not exceeded, or they were protected by a proper diode in series. If they were inputs to optocouplers, they could be used to drive logic easily.



      In an effort to get better logic levels out of the system, I've added Qn. It works as a cascode, transferring the amplifier output current to R1, but only when the output voltage is about 2 diode drops above the logic high reference voltage. Dn could be omitted, as long as the reverse VBE limit, usually around 5v or so for silicon, is not exceeded when the output is low. This now ensures that the outputs are nearly negative rail for low, and logic high reference + 1.4v for high. It does increase the loop gain of the system, so might compromise stability. I'd need to think about that. A resistor in series with Qn emitter would control the gain, and while it would destroy the relatively constant output high voltage, at least the output high voltage is guaranteed to be above a certain voltage, regardless of how low the winning input voltage is.



      An essentially identical scheme can be configured to select the smallest input voltage.







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Aug 10 at 13:59

























      answered Aug 10 at 13:21









      Neil_UK

      69k272152




      69k272152











      • niceeeee So, I just misread your question; my answer basically just leaves out the part you're solving here.
        – Marcus Müller
        Aug 10 at 13:47
















      • niceeeee So, I just misread your question; my answer basically just leaves out the part you're solving here.
        – Marcus Müller
        Aug 10 at 13:47















      niceeeee So, I just misread your question; my answer basically just leaves out the part you're solving here.
      – Marcus Müller
      Aug 10 at 13:47




      niceeeee So, I just misread your question; my answer basically just leaves out the part you're solving here.
      – Marcus Müller
      Aug 10 at 13:47












      up vote
      2
      down vote















      schematic





      simulate this circuit – Schematic created using CircuitLab



      Something similar to this as a single stage may work when repeated multiple times.



      The relay can likely be replaced with a transistor based switch.



      A comparator may work better in this circuit than a plain op-amp.



      The bottom part shows a way to combine the individual stages for multiple signals. For N inputs, you need N-1 stages with this configuration






      share|improve this answer


















      • 3




        How would you extend this to N voltages?
        – Autistic
        Aug 10 at 12:56










      • That's really out of the box thinking! Perhaps not an industrial solution, but thought-provoking.
        – winny
        Aug 10 at 13:51










      • nice but not solving the edited OP's problem
        – aaaaaa
        Aug 10 at 18:35














      up vote
      2
      down vote















      schematic





      simulate this circuit – Schematic created using CircuitLab



      Something similar to this as a single stage may work when repeated multiple times.



      The relay can likely be replaced with a transistor based switch.



      A comparator may work better in this circuit than a plain op-amp.



      The bottom part shows a way to combine the individual stages for multiple signals. For N inputs, you need N-1 stages with this configuration






      share|improve this answer


















      • 3




        How would you extend this to N voltages?
        – Autistic
        Aug 10 at 12:56










      • That's really out of the box thinking! Perhaps not an industrial solution, but thought-provoking.
        – winny
        Aug 10 at 13:51










      • nice but not solving the edited OP's problem
        – aaaaaa
        Aug 10 at 18:35












      up vote
      2
      down vote










      up vote
      2
      down vote











      schematic





      simulate this circuit – Schematic created using CircuitLab



      Something similar to this as a single stage may work when repeated multiple times.



      The relay can likely be replaced with a transistor based switch.



      A comparator may work better in this circuit than a plain op-amp.



      The bottom part shows a way to combine the individual stages for multiple signals. For N inputs, you need N-1 stages with this configuration






      share|improve this answer
















      schematic





      simulate this circuit – Schematic created using CircuitLab



      Something similar to this as a single stage may work when repeated multiple times.



      The relay can likely be replaced with a transistor based switch.



      A comparator may work better in this circuit than a plain op-amp.



      The bottom part shows a way to combine the individual stages for multiple signals. For N inputs, you need N-1 stages with this configuration







      share|improve this answer














      share|improve this answer



      share|improve this answer








      edited Aug 10 at 13:10

























      answered Aug 10 at 12:33









      uglyoldbob

      1094




      1094







      • 3




        How would you extend this to N voltages?
        – Autistic
        Aug 10 at 12:56










      • That's really out of the box thinking! Perhaps not an industrial solution, but thought-provoking.
        – winny
        Aug 10 at 13:51










      • nice but not solving the edited OP's problem
        – aaaaaa
        Aug 10 at 18:35












      • 3




        How would you extend this to N voltages?
        – Autistic
        Aug 10 at 12:56










      • That's really out of the box thinking! Perhaps not an industrial solution, but thought-provoking.
        – winny
        Aug 10 at 13:51










      • nice but not solving the edited OP's problem
        – aaaaaa
        Aug 10 at 18:35







      3




      3




      How would you extend this to N voltages?
      – Autistic
      Aug 10 at 12:56




      How would you extend this to N voltages?
      – Autistic
      Aug 10 at 12:56












      That's really out of the box thinking! Perhaps not an industrial solution, but thought-provoking.
      – winny
      Aug 10 at 13:51




      That's really out of the box thinking! Perhaps not an industrial solution, but thought-provoking.
      – winny
      Aug 10 at 13:51












      nice but not solving the edited OP's problem
      – aaaaaa
      Aug 10 at 18:35




      nice but not solving the edited OP's problem
      – aaaaaa
      Aug 10 at 18:35










      up vote
      1
      down vote













      So, in the end, you could use $binomN_in2$ comparators to compare all pairs of voltages. That'd give you a $binomN_in2$-bit value, and you could convert that to the info "highest is input $n$" with but a simple LUT.



      So, we'd need a set of $binom62=15$ comparators. Ugly? Sure, but you know who's good at comparing voltages (and fast at that)?



      Differential line receivers.



      In fact, for example, TI has 24 bit LVDS serializers. But you're probably happier with a simpler part like the 16 differential input -> 16 LVTTL output SM65LVDS386. If you're oldschool, you then add logical gates to implement the LUT.



      An output like "is $n$ the highest input?" (i.e. one-hot) would even be easier. It would just be an "AND" of all the outputs that involve $n$.






      share|improve this answer


























        up vote
        1
        down vote













        So, in the end, you could use $binomN_in2$ comparators to compare all pairs of voltages. That'd give you a $binomN_in2$-bit value, and you could convert that to the info "highest is input $n$" with but a simple LUT.



        So, we'd need a set of $binom62=15$ comparators. Ugly? Sure, but you know who's good at comparing voltages (and fast at that)?



        Differential line receivers.



        In fact, for example, TI has 24 bit LVDS serializers. But you're probably happier with a simpler part like the 16 differential input -> 16 LVTTL output SM65LVDS386. If you're oldschool, you then add logical gates to implement the LUT.



        An output like "is $n$ the highest input?" (i.e. one-hot) would even be easier. It would just be an "AND" of all the outputs that involve $n$.






        share|improve this answer
























          up vote
          1
          down vote










          up vote
          1
          down vote









          So, in the end, you could use $binomN_in2$ comparators to compare all pairs of voltages. That'd give you a $binomN_in2$-bit value, and you could convert that to the info "highest is input $n$" with but a simple LUT.



          So, we'd need a set of $binom62=15$ comparators. Ugly? Sure, but you know who's good at comparing voltages (and fast at that)?



          Differential line receivers.



          In fact, for example, TI has 24 bit LVDS serializers. But you're probably happier with a simpler part like the 16 differential input -> 16 LVTTL output SM65LVDS386. If you're oldschool, you then add logical gates to implement the LUT.



          An output like "is $n$ the highest input?" (i.e. one-hot) would even be easier. It would just be an "AND" of all the outputs that involve $n$.






          share|improve this answer














          So, in the end, you could use $binomN_in2$ comparators to compare all pairs of voltages. That'd give you a $binomN_in2$-bit value, and you could convert that to the info "highest is input $n$" with but a simple LUT.



          So, we'd need a set of $binom62=15$ comparators. Ugly? Sure, but you know who's good at comparing voltages (and fast at that)?



          Differential line receivers.



          In fact, for example, TI has 24 bit LVDS serializers. But you're probably happier with a simpler part like the 16 differential input -> 16 LVTTL output SM65LVDS386. If you're oldschool, you then add logical gates to implement the LUT.



          An output like "is $n$ the highest input?" (i.e. one-hot) would even be easier. It would just be an "AND" of all the outputs that involve $n$.







          share|improve this answer














          share|improve this answer



          share|improve this answer








          edited Aug 10 at 13:10

























          answered Aug 10 at 12:54









          Marcus Müller

          28.3k35386




          28.3k35386




















              up vote
              0
              down vote













              Thinking aloud....





              schematic





              simulate this circuit – Schematic created using CircuitLab



              A common "max voltage bus" (with signals B & C) that is compared against one signal (A). Summing of all others is done with diodes. D1 is used to introduce the same voltage drop to signal A as to the other signals.
              Assumption: all diodes are identical and linear enough (diodes... linear...).



              How it scales? Badly... for every signal a max voltage signal of all the other signals is needed.






              share|improve this answer
























                up vote
                0
                down vote













                Thinking aloud....





                schematic





                simulate this circuit – Schematic created using CircuitLab



                A common "max voltage bus" (with signals B & C) that is compared against one signal (A). Summing of all others is done with diodes. D1 is used to introduce the same voltage drop to signal A as to the other signals.
                Assumption: all diodes are identical and linear enough (diodes... linear...).



                How it scales? Badly... for every signal a max voltage signal of all the other signals is needed.






                share|improve this answer






















                  up vote
                  0
                  down vote










                  up vote
                  0
                  down vote









                  Thinking aloud....





                  schematic





                  simulate this circuit – Schematic created using CircuitLab



                  A common "max voltage bus" (with signals B & C) that is compared against one signal (A). Summing of all others is done with diodes. D1 is used to introduce the same voltage drop to signal A as to the other signals.
                  Assumption: all diodes are identical and linear enough (diodes... linear...).



                  How it scales? Badly... for every signal a max voltage signal of all the other signals is needed.






                  share|improve this answer












                  Thinking aloud....





                  schematic





                  simulate this circuit – Schematic created using CircuitLab



                  A common "max voltage bus" (with signals B & C) that is compared against one signal (A). Summing of all others is done with diodes. D1 is used to introduce the same voltage drop to signal A as to the other signals.
                  Assumption: all diodes are identical and linear enough (diodes... linear...).



                  How it scales? Badly... for every signal a max voltage signal of all the other signals is needed.







                  share|improve this answer












                  share|improve this answer



                  share|improve this answer










                  answered Aug 10 at 14:15









                  filo

                  4,8551828




                  4,8551828



























                       

                      draft saved


                      draft discarded















































                       


                      draft saved


                      draft discarded














                      StackExchange.ready(
                      function ()
                      StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2felectronics.stackexchange.com%2fquestions%2f390355%2fpick-largest-of-several-voltages-with-analogue-comparators%23new-answer', 'question_page');

                      );

                      Post as a guest













































































                      Comments

                      Popular posts from this blog

                      Long meetings (6-7 hours a day): Being “babysat” by supervisor

                      Is the Concept of Multiple Fantasy Races Scientifically Flawed? [closed]

                      Confectionery