An efficient formulation of robot arm dynamics for control analysis and manipulator design