# What is the most accurate method to calculate Torque of 5 DOF Robotic arm

I am working for development of a 5 DOF Robotic arm , and I am confused in the Torque calculation This is a 5 Axis revolute Joints Robotic arm , where Motor for 1st axis will rotate the turning table and all the robotic arm and 2nd and third joints have a rotation axis out and into the page(such that against gravity) , 4th axis will rotate the last joint and 5th axis will make payload up and down, Free body diagram is attached I am calculating Torque of each joints considering the gravity using this formula on all 4 axis,

Torque(2nd axis) = (MLink2*(L2/2) + Mjoint2L2 +MLink3((L3/2) +L2) +Mj3*(L3+L2) +ML4*((L4/2) +L3+L2) + Mj4*(L4+L3+L2) +ML5*(L5/2+L4+L3+L2) + Payloas*(L5+L4+L3+L2)) *9.81
I am using this formula for all axis except 1st

and I am using Torque= (moment of Inertia)*(Angular acceleration) Torque=(1/2(Mass of all joints and link )*R^2)*Angular acceleration

on 1st axis,considering 1st axis will not have effect of gravity, it give very small value and when I calculate Torque of 1st joint using above same formula formula considering gravity and all Links, I get largest torque value, but I think 1st axis motor will only be resposible for rotating the turning table(with all joints) but 2nd axis will be against gravity it should have large value than 1st axis? where I am being wrong in these calculations

and I want to know also about 4th and 5 axis calculation, should I use the same formula which I am using or some thing else should be considered 