Control of robotic systems through singularities