leongchuan,
1. Are you certain the sine wave has no DC offset -- are the +peak and -peak of equal magnitude?
2. Does the position drift need to be considered a problem? Isn't your frequency response measurement going to be based on velocity amplitude? Just be sure to use peak-to-peak measurements, since the position drift indicates some DC offset in the velocity response.
3. If the drift lasts a while, I suspect you're exciting the motor at a pretty low frequency. Here's some hand-waving about what you might be seeing:
a. Think of the input sine wave as a sort of "energy pump." A half-cycle of CW input energy followed by a half-cycle of output energy, then repeat.
b. The first half-cycle brings the motor from rest to some level of momentum in the CW direction.
c. The next half-cycle now delivers energy that tries to deliver momentum in the CCW direction. However, most of it is used up just bring the motor from CW rotation to zero speed. Not much is left to make it rotate with CCW momentum.
d. Now you get a half-cycle to give it more CW momentum. It first overcomes the little bit of CCW it had, then most of the energy is left to make the motor rotate with CW momentum again. However, it's a bit less than the first time.
e. The CCW half-cycle now has less CW momentum to overcome and will leave the motor with a bit more CCW momentum than the first time.
f. ... This push-pull continues until a steady-state is reached where the motor (should) oscillate with no further drift. Any freq response measurements should be taken
after reaching steady-state.
Good luck!
-Kevin P.
ALERT! LabVIEW's subscription-only policy came to an end (finally!). Unfortunately, pricing favors the captured and committed over new adopters -- so tread carefully.