Balancing pendulum to find center of mass