Getting higher accuracy in measuring AC voltage
True RMS measurement of AC is a complex problem.   So, one generally doesn't
create a new solution, just buy a prebuilt module for the task  typical RMS detector .   If the AC source is at known frequency and/or known waveform,
there are often other (simpler) approaches.

The DC output is somewhat delayed, so stabilizing an AC source using this kind
of sensing can be a problem.