pendulum on a string

All you need is a weak pulse, just basically replacing the energy lost in friction of the pendulum swinging
and if you know the weight and length of string you can calculate the period which wont change no matter how fast its swinging, if you had a stepper motor at the top and gave it a pulse every time its called for it'll work fine
id guess it'd be best to pulse it while its directly below to not notice any jerks or just as it starts to reverse