Square-wave excitation and sampling techniques for resolver-to-digital converters in AC servo-drives