At 03:28 PM 6/9/2005 -0500, you wrote: >On 6/9/05, Todd Bailey wrote: > > Friends, > > > > So I have this sticky analog design problem which I don't think should be > > that complicated, but I just can't find a good reference for it. I suspect > > the circuit I'm looking for is related to a diff amp with some kind of > level > > shifting, and I know this list is about microcontrollers, but I thought > > maybe someone would know the answer to this question just offhand. > > > > It's especially annoying because I can't think of what the appropriate > > name of this circuit would be. > > > > Here goes: > > > > 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. > > > >Mathematically, your desired output voltage is (B-A)*5/(C-A) > >Subtracting A from B is easy. Scaling is harder. You need a >variable gain device. If you are just going into a ADC, you can do A-B >and 5*(C-A) in op-amps, then feed the A-B into the ADC with 5*(C-A) as >the reference. This makes the ADC do the scaling. > >Regards, >Mark >markrages@gmail The AD632 or MPY634 will do this with reasonable accuracy with almost no additional parts. They are NOT cheap. Can you just use a [PIC], digitize the three voltages, spit out the result into the PWM, filter and buffer (and enjoy)? When B approaches A you will have the most difficult case for both the analog and the digital methods of solving this problem. With the digital circuit, the resolution will probably bother you first, with the analog it might be the offsets and linearity. BTW, using a micro with a 24-bit ADC and precision DAC would probably not be much more expensive than the analog multiplier and would be really, really accurate (at very low frequency). Best regards, Spehro Pefhany --"it's the network..." "The Journey is the reward" speff@interlog.com Info for manufacturers: http://www.trexon.com Embedded software/hardware/analog Info for designers: http://www.speff.com ->> Inexpensive test equipment & parts http://search.ebay.com/_W0QQsassZspeff -- http://www.piclist.com PIC/SX FAQ & list archive View/change your membership options at http://mailman.mit.edu/mailman/listinfo/piclist