Analysis and design of a four-cable-driven parallel manipulator for planar and spatial tasks