Controlling the frequency of AC used to energize an electromagnet
If it is difficult to answer your question that is because it is a puzzle to understand it in the first place. A pendulum is a RESONANT device in which the freqqquency of its swing is controlled principally by its effectiove length.  The only effect of your electromagnetic "kick" is to replace thev energy lost in air-resistance to its movement.  Any attempt to affect the dynamics of your pendulum must rerquire an enormous amount of power. Whatever may be your purpose you might be more successful with a conical pendulum.