Todd Bailey wrote: > The input to this mystery circuit has three slow-moving positive voltages > (essentially DC) which are all linear and floating. Voltage A, although > floating, will always be the highest of the three. Voltage B will always be > the lowest, and Voltage C will move around between the two over time. I > know somewhere out there is a circuit which takes those three inputs and > gives an output voltage which is proportional to the floating input voltage, > but over a fixed range (like a rail-to-rail supply). > For example: Voltage A is 1.5V, Voltage B is 1.0V, and Voltage C is 1.25V. > If the rails on the circuit are 5V and ground, the output would be 2.5V. It > would have exactly the same output (2.5V) if A, B, and C were, say, 1.2V, > 0.8V, and 1.0V, respectively. If by "floating" you mean that A, B and C come in on two terminals each with no common reference, you're going to have to start by putting each one through an instrumentation amplifier to get voltage values that share a common reference. > Another way to think about the inputs would be like the Vref inputs on an > A/D converter -- there are positive and negative reference voltages which > are used to set the scale for the input signal. That isn't a bad way to think about it. The simplest solution might be to do exactly that -- feed the three voltages into an ADC, get a digital value that represents the ratio (C-B)/(A-B), then feed this directly to a DAC that has the 0V and 5V reference "rails" you want. Or just use the digital value directly. If you can't find an ADC that can accept the range of voltages you anticipate for A and B as references (perhaps with some fixed scaling in the IAs), then it might be best to convert all three voltages using a 3-channel ADC, do the necessary arithmetic in a microcontroller and output a result using a DAC. Any solution involving the multiplication and division of analog values directly is going to require linear-log and log-linear converters. It's doable, but finicky to set up, calibrate and stablize, and would probably require more parts than a microcontroller-based solution. H&H does have some good reference material on such converters. -- Dave Tweed -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist