A system for measuring the position of a mechanical pendulum