I have built this pendulum using Lego parts. There is a neodymium magnet attached to the pendulum and on the other side a solenoid i had scavenged from a printer. A IR door-sensor (also from a printer) detects when the pendulum reaches the amplitude and then triggers trough a small circuit a relay that activates the solenoid which pushes the pendulum away. This way it always gives a small impulse so the pendulum never stops oscillating. For the circuit i could of course have used also a power transistor to drive the solenoid, but i like the relay as it produces that nice clicking noise so it reminds much of a clock.