  The torsion pendulum at the heart of the apparatus to measure the
gravitational constant, $G$ at the Bureau International des Poids et Mesures
(BIPM) is used to measure the gravitational torque between source and test-mass
assemblies with two methods. In the Cavendish method, the pendulum moves
freely. In the electrostatic-servo method, the pendulum is maintained at a
constant angle by applying an electrostatic torque equal and opposite to any
gravitational torque on the pendulum. The electrostatic torque is generated by
a servo. This article describes the design and implementation of this servo at
the National Institute of Standards and Technology. We use a digital servo loop
with a Kalman filter to achieve measurement performance comparable to the one
in an open loop. We show that it is possible to achieve small measurement
uncertainty with an experiment that uses three electrodes for feedback control.
