Analysis using spreadsheets can sometimes fill a gap in circuit simulation programs by providing a quick and reliable way to determine circuit performance along with the flexibility to display results as desired. In this case the spreadsheet provided a quick way of ensuring that a photodiode amplifier with variable gain would perform properly over its entire adjustment range.

The need for a photodiode amplifier with variable gain that can be set with a potentiometer (R_{F}) in the feedback loop will occasionally arise, for instance in a product design requiring compensation for unit-to-unit variability in its optical power. The potentiometer can be mechanical or digital under the control of a serial bus such as the serial peripheral interface (SPI) or I^{2}C. In either case, however, designers need to consider the noise and stability of the amplifier over the range of R_{F}. The spreadsheet can help determine the optimum compromise compensation by calculating the phase margin over the entire range of R_{F}.

Photodiode amplifiers are second-order systems with a zero at frequency:

set by the gain feedback resistor R_{F} and the sum of all the amplifier’s input capacitances Ci, including the photodiode junction capacitance and associated parasitics. The pole at frequency:

is due to R_{F} and the compensation capacitor C_{F} required for amplifier stability (Fig. 1).

In most applications, R_{F} and C_{F} are fixed with values chosen to provide 45° phase margin, which will ensure stability while preserving desired bandwidth. For a variable gain amplifier, however, the value of C_{F} must be chosen so it maintains the stability of the amplifier throughout the full range of R_{F}. By entering the appropriate equations into a spreadsheet that uses a column of values for R_{F}, designers can quickly determine if a candidate value for C_{F} provides the desired results.

Using the known values for input capacitance Ci, the amplifier’s unity gain crossover frequency fu, and the candidate C_{F}, you can calculate the following:

Pole frequencies f_{1} and f_{2},

Damping factor zeta = \\[Eq. 3\\]

Phase margin in radians = \\[Eq. 4\\]

Phase margin in degrees = \\[Eq. 5\\]

% overshoot = \\[Eq. 6\\]

Phase margin and overshoot are correlated, so this final equation gives designers a means of validating the spreadsheet’s results. Simply generate a step function for the light source driving the photodiode and amplifier and observe the output voltage’s overshoot. Extracting the value for zeta then allows calculation of the phase margin.

The results shown in graphical form come from an example amplifier with fu at 16 MHz and estimated Ci of 560 pF, the sum of all expected capacitances including diode capacitance, contributions from cables connecting the photodiode, and the amplifier’s input capacitance (Fig. 2).

To obtain the gain span desired, the design needed R_{F} to vary from 4500 Ω to 27,000 Ω. Entering these values and running the spreadsheet (Fig. 3) yielded phase margin in degrees and percent overshoot as shown. When R_{F} was at its minimum value of 4500 Ω, the phase margin is 45° and the overshoot is 24%, as expected.