Attitude detection for the permanent-magnet spherical motor using two optical sensors