Can anyone guide me on torque equation to rotate a part? hope you all are doing good.
I am  a bit confused on which equation to use to calculate the torque required to rotate a part.
I want to use a hydraulic motor at the 6th axis (end of robot arm) of custom made robot to rotate a part picked by the robot.
The part needs to be rotated at constant velocity (I am aware that at the start there will be some acceleration to reach that constant velocity).
For me to better understand the torque equation I have presented 3 cases where the part to be rotated is in horizontal, vertical and inclined positions.

I know 2 torque equations (T = Force * distance or T = Moment of inertia * acceleration) and I dont know which one is more suitable for above 3 cases.
Could anyone please help me or guide me on understanding how to calculate the torque required to rotate a part for each of the above 3 cases?
Thank you for your time and sharing your knowledge.
 A: The torque applied to the cylinder by gravity will be:
$$\tau=\int\! r \times f\,dV$$
where f is the force density ($\rho g$ in this case)
But as we are given the center of gravity this becomes:
$$\mathbf{\tau}=\mathbf{b} \times M\mathbf{g}=bMg$$
That could be deduced by force times distance, but it is a generalization that you should be aware of.
But this has been calculated supposing that we are in the horizontal case and the center of gravity is in the horizontal plane that contains the axis. However, as the cylinder rotates the position of the center of gravity also rotates. Then, if we call $\phi$ the angle that the part/cylinder has rotated (not to confuse with $\beta$) then the cross product becomes:
$$\tau=bMg\,\cos\phi$$
So, in order to counteract the torque of gravity, the motor will have to produce an opposite and equal-modulus torque. If $\beta$ is not zero and the cylinder is not horizontal, the second equation becomes:
$$\tau=bMg\,\cos\phi\,\sin\beta$$
If you want to maintain a constant angular velocity $\omega$, then we have that $\phi=\omega t$ and:
$$\tau=bMg\,\cos\omega t\,\sin\beta$$
That is the torque that the motor has to produce to counteract gravity. Apart from that, it will probably need to be added by some $\tau_0$ considering friction. So, in the end, the final formula will be:
$$\tau=bMg\,\cos\omega t\,\sin\beta+\tau_0$$
