The setting of a PI or PID used in regulation will not be the same for this controller used in servo-control. It is quite known that in the case of a sinusoidal input we will lose some performance (robustness, phase margin ...). If the objective is to follow variant input it would be more appropriate to use Deat-beat Controller or Proportional-resonant controller.
PI controller can not be used to track an variable reference because the integrator action is proportional to the error. however, there is a robust version of PI called supertwisting that can be used to trcak a variable reference if the reference is lipshitz.
In my last research I generalized the suertwisting for higer order, so the a robust PID is not more than second order supertwisting.
Pleae feel free to check my research in researchgate.
Write your closed loop equations in the frequency domain. Pay attention to stability margins, Bode charts, etc. Some times it is easier to notice weird behaviors in the frequency domain than in time domain.
I think you don't give your answer yet. You should know that most of controllers, including PID, receive error signal or reference signal and output separately. They will then produce control signal based on compiling the error. By Testing the performance of PID with a step signal (DC), we examine it to extract time domain specifications. Absolutely, this controller need some time to reach the steady state and zero error. But, it doesn't mean that we could not use it for tracking purposes. If you plot the frequency response, you will actually find the bandwidth and also phase shifting with increasing the frequency. Therefore, for tracking a sinusoidal reference signal you will see some time shifting and also gain decreasing. With increasing the frequency, this will be more clear. This is logical in real world problems. So, for better tracking, you should increase the PID gain to push the PID to produce larger control signals (high gain control). Be aware that this is dangerous when a disturbance comes. In this situation, discontinuity in reference signal or disturbance lead the control system to instability.
My opinion is that integrators in controllers are a "kludge" added to handle unmodelled dynamics and disturbances. If the disturbance or unmodelled plant effects are DC, the integrator will counteract it over time, reducing the error to zero. Wellbehaved changes in tracking commands should be handled through feed-forward terms, e.g. a sinusoidal input can generate acceleration and velocity feed-forward commands to the controller to improve tracking. Integrators, on the other hand, are always "after the fact". ("the controller isn't tracking well." "Why?" "Who cares - just push harder and see if we can improve it.") This approach doesn't work well with oscillating commands or disturbances. ("Now it's going the other way!" "Oh no - start pushing the other way!" "But it's all wound up from the previous direction!" "Keep pushing! Who designed this thing anyway?!")
Eric's advice seems to be sound, although I do not fully agree with him regarding the usefulness of integrators [feedback control is always "after the fact", not only the integrator ;-) ]:
A feedforward component added to the control variable (the plant's input) can improve the system-response to dynamic reference signals.
You should however not expect miracles. If the frequency of your reference signal is too high (compared to the bandwidth of your plant), then you'll need a lot of energy, to make the closed-loop follow the reference.
One additional comment: There is a general concept called "internal model principle" in linear control theory. It roughly states that to control any reference signal with zero steady state error one needs to have signal model in the feedback loop, i.e. to have a harmonic signal generator there in your case. As already said it is essential namely when the reference signal frequency is high compared to the controller sampling time