Singularity analysis of mechanisms and robots via a motion-space model of the instantaneous kinematics