How to calculate torque required? Here's my problem diagram:

I am working on a hobby project in which a motor is required to rotate a pulley that is connected to a pendulum as shown in the image. The maximum torque, Horsepower and RPM ratings of the motor are to be determined so that it can move the pendulum object of mass $m$ for a distance of $L$ and height $h$. The rivet on the pulley is at a distance $d$ from the equilibrium position of the pendulum.
This is my attempt so far.
Force required by the pulley, $$F = m * a$$
Torque, $$T = F * r $$
Where I am stuck - how to calculate a??
Once I get the Torque, I know how to calculate the Horsepower.
 A: Hint: first find the angular velocity of the disc by conservation of energy,
$\frac{1}{2}I\omega^2 = mgh$ , $\omega$ = angular velocity of the pulley, I = moment of            inertia of the pulley.
It is mentioned that the pendulum cover a horizontal distance L in t seconds. And we also know that
 $$v_{linear-velocity} = R\omega$$
So time t can be found by:
$$\dfrac{L}{R\omega}$$ where R is radius of the pulley.
Now you can find angular acceleration as you know both w and t for the particular instance.
Now torque of the pulley can be found out because:
torque required for the pulley = (moment of inertia of the pulley)* ( angular acceleration)
Now when the motor swings the pendulum to its extreme position, only then the torque is required and remember the above method will give average torque required by the pendulum to move from its mean to the extreme position. Once the pendulum is moved to its extreme position, it will require no torque to move to its mean position. Hence to continue the motion in equilibrium state only that much torque would be  required which would just overcome the negative torque provided by the motor.
