This is a circuit of Closed-Loop Automatic Power Control for RF Applications. The circuit uses a log detector (AD8318) and a VGA (ADL5330). This circuit has a high temperature stability because of the high temperature stability of the AD8318. The AD8318 also ensures the same level of temperature stability at the output of the ADL5330 VGA. The ADL5330 is converted from an open-loop variable gain amplifier into a closed-loop output power control circuit by the log amp detector. The POUT vs. setpoint transfer function of AD8318 follows a linear-in-dB characteristic because the AD8318 has a linear-in-dB transfer function. Here is the circuit:

Closed Loop Automatic Power Control for RF Applications circuit schematic

A sample of the output RF must be fed back to the detector by using additional attenuation and a directional coupler to operate the ADL5330 VGA in an AGC loop. A DAC is used to apply A setpoint voltage to the VSET input of the detector. The VOUT is connected to the GAIN pin of the ADL5330. The GAIN voltage is adjusted by the detector until the level at the RF input corresponds to the applied setpoint voltage. The correct balance between the setpoint voltage and the input signal level at the detector is set by the GAIN. [Source: Analog Devices Application Note]