| Electronics > Projects, Designs, and Technical Stuff |
| Find highest value of 4 inputs without microcontroller? |
| << < (4/12) > >> |
| spec:
Below is the best I can do at the moment. All channel outputs are at 0V, except for the highest voltage channel output which will be at 5V, so suitable for driving all 5V logic families. |
| T3sl4co1l:
Should be able to do it in slightly fewer, due to this being a sorting problem (of sorts) and sorting problems being guaranteed N log N worst case complexity. Not that this helps much at small N, and indeed, if N = 4, then 4 lg(4) = 4*2 = 8, so the 6-comparator solution given earlier can't be too far from there. I suspect it's possible to save some comparators, in exchange for more logic (e.g., doing pairwise comparisons on ordered sets; using analog muxes to compare pairs in sequence, latch the state and resolve the sampled result; etc.), but this probably won't save many transistors or much space. The analog method is to use a max(a, b, c, d) circuit and monitor the current through each diode; only one will be active at a time (outside of a transition range, which we can make arbitrarily narrow with op-amps). To improve on spec's proposal: instead of a pull-down resistor, first just use a current sink instead of a pull-down resistor. This keeps the offset, transition band, and speed more consistent over the operating range, and lets us work with it more easily, at least for now. Either: - In place of the diodes, use transistors to detect when a channel is active. That is, the pull-down current is communicated through the active transistor's collector, to a load resistor, which probably needs a level shift to get back to a standard logic level (say if the A through D inputs are 0-5V, and the output is 5V CMOS logic level). So we'd need four NPNs and four PNPs, plus resistors (the PNPs can be the "prebiased" or "digital" kind, saving on components). - When a channel is "losing", its op-amp is saturated to -V. In an active rectifier circuit, we often use a diode from -in to out, to reduce integrator windup (i.e., holding the output at (-in) - Vf rather than allowing it to saturate to the full -V, saving slewing time when that signal turns back on). We can capture this with crude comparators (probably just transistors or diodes), and resolve state with logic if necessary. (This is probably not as nice of a method, so I haven't fleshed it out as well.) Similar logic applies to this circuit as well, though being just a two-channel min(a, b) implementation for a particular situation (i.e., wrapping around an error amplifier). https://www.seventransistorlabs.com/Images/Limiter2.png By adding a logic output to the diff pair, a comparison output is available; this could be scaled to any number of limit inputs, if such were needed. This works very nicely for a power supply where you want V/I limiting and indication. The 4-variable version works just the same, but with more process variables. Tim |
| SiliconWizard:
--- Quote from: spec on November 18, 2018, 12:04:02 am ---Below is the best I can do at the moment. --- End quote --- That's clever. :-+ You can probably set your reference voltage a bit higher than 50mV to get more margin, as the highest voltage detection at the opamp's outputs should be a diode drop higher than the input voltage, thus significantly higher than 50mV even if input is very close to 0V, at least for 1N4148 diodes. Using rail-to-rail opamps will also improve the operating range, as well as using schottky diodes. |
| unitedatoms:
@Spec: great! I'd rather rewire input opamps to be followers and leave it for diodes to decide on outcome of voltage drop across individual diodes. In theory only one diode will win and will have highest voltage drop across itself. After that works, the output 4 opamps/comparators should only compare cathode vs anode. So the divider can be removed and negative inputs of comparators should be connected only to single resistor. |
| spec:
--- Quote from: SiliconWizard on November 18, 2018, 12:48:11 am --- --- Quote from: spec on November 18, 2018, 12:04:02 am ---Below is the best I can do at the moment. --- End quote --- That's clever. :-+ You can probably set your reference voltage a bit higher than 50mV to get more margin, as the highest voltage detection at the opamp's outputs should be a diode drop higher than the input voltage, thus significantly higher than 50mV even if input is very close to 0V, at least for 1N4148 diodes. Using rail-to-rail opamps will also improve the operating range, as well as using schottky diodes. --- End quote --- Thank you SW :) I like your suggestions to enhance the design- well though out. Of course, a bit of decoupling would help too. |
| Navigation |
| Message Index |
| Next page |
| Previous page |