For those of you who have Mathcad, designing a differential amplifier is really easy.
Let’s say you need to design a unipolar to bipolar converter and you decide to use a differential amplifier for this task. You know the input and output voltage range and you need to calculate the resistors based on a voltage reference you have in the system. All you have to do is to create a Mathcad file for a quick response. Then store it some place for future designs.
If you would like to know why the unipolar to bipolar converter can be designed with a differential amplifier, read this article, Design a Unipolar to Bipolar Converter for a Unipolar Voltage Output DAC .
Let’s take an example.
If you have a DAC that outputs 0 to +2.5V, with a reference of 2.5V, and you need a bipolar output of –1V to +1V, write down the differential amplifier transfer function as follows:
where the resistors are those in Figure 1. For the proof of this transfer function read How to Derive the Differential Amplifier Transfer Function.
Let’s rewrite the transfer function as a mathematical relation that depends on the resistor ratios R1/R2 and R4/R3.
This is the equation form we will use in Mathcad. I use it for clarity and to show the resistor ratios.
Open Mathcad and type the voltage reference and a choice for R2 and R3, say 10 kOhm. On the next line type some guess values for R1 and R4, say 10 kOhm also. These two resistors are the unknowns.
Next comes a solving block for two equations with two unknowns. The solving block is delimited by the keywords Given and Find.
Inside the solving block lets write the differential amplifier transfer function in two instances, one when the output voltage is –1V and one for +1V. I also replaced V2 with Vref and V1 with the input signal. The Mathcad code should look like this:
The “Find” function gives the answer in the form of a matrix of one column and two rows. For this example, R1 = 7.5 kOhm and R4 = 4 kOhm. Choose the standard values of 7.5 kOhm 1% and 4.02 kOhm 1% respectively. During the Mathcad calculations I prefer to attach the units as well. If there is a mistake, Mathcad will flag that the units do not match. This is a great way to verify your equations and assumptions on fly.
Figure 2 shows the final schematic.