Analysis and mechanization of three and four gimbal systems