PM-fibers have 2 principal axes with large index of refraction differences (\delta n ~ 10^(-4)). Most PM fibers are made such that the core is located between 2 stress rods which generate the high stress required to make the fiber exhibit such high birefringence. In the standard Panda style fiber, the axis that is located along the direction of the stress rods is the slow axis, with the fast axis being perpendicular to the slow axis. The large birefringence means that if well aligned, any perturbation on the fiber will result in a relatively small change in the overall birefringence thereby having little effect on the polarization. However, if misaligned the fiber acts as essentially a super-high order waveplate, with the output polarization being hard to predict and highly susceptible to drifts. So, its worth investing some amount of time into getting the input polarization to be along the correct axis. Below is a method to do this using a laser frequency scan.

Idea: The polarization state is really just determined by the phase difference between Ex and Ey (x and y components of Electric Field in Cartesian coordinates). This phase difference is given by \phi = \frac{2 \pi \delta n l}{c}f. So, by periodically modulating the laser frequency f, we periodically modulate the phase delay between Ex and Ey. When our input polarization is mis-aligned, the changing phase delay will cause the output polarization to change (by turning the polarization fluctuation into a power fluctuation we can detect this). When our input polarization is perfectly aligned along the axis of the PM fiber, the \delta n term (birefringence) is effectively 0. Thus, there is no modulation on the output polarization even though the laser frequency is scanning over ~ GHz. In practice, this GHz scan is easy enough to do since we can just put a voltage ramp on a piezo in our laser cavity. You really want to be able to scan over a range of ~ GHz to see an effect. So, as long as you have an intra-cavity actuator that can achieve this, you can apply this method.

As mentioned above, this periodic phase modulation causes the output polarization to swing smoothly between 2 polarization states (achieved when f=fmin and f=fmax). Accordingly, the analyzer at the output allows the photodiode to see a modulated light signal. In plain terms, the analyzer is converting the polarization fluctuations into power fluctuations that can be monitored on an oscilloscope. By turning the input half-wave plate you can align the input polarization such that the fluctuations on the output polarization are minimized. However, at this point it could also just be that you've turned the output polarization to be minimally sensitive to the polarizer. Thus, you need another half-wave plate on the output end (before the analyzer) so that you can rotate the output polarization back to 45 degrees with respect to the analyzer so that you are maximally sensitive to polarization fluctuations. Iterating this process leads very quickly the correct input polarization. Below I give a quick step-by-step guide to setting this up and performing the algorithm:

Step 1: Put a periodic ramp (triangle, sine, etc) on your laser frequency. Try to sweep over a few GHz.

Step 2: Put the photodiode signal on the scope and AC couple it. Split off the ramp signal and use it to trigger your scope.

Step 3: Make sure the photodiode isn't saturated.

Step 4: Turn the output-end half-wave plate until you see the photodiode signal look like the periodic ramp. Try to maximize the amplitude of the peaks of this signal.

Step 5: Turn the input-end half-wave plate until you make the ramp signal disappear. The signal will flip sign (i.e. positive peaks switch to negative peaks) if you go too far.

Step 6: Repeat steps 4-5 several times.

Step 7: After many iterations, the photodiode signal will be extremely sensitive to any slight adjustment of the input half-wave plate. This shows up in the fact that you can slightly tweak the input half-wave plate and see the ramp quickly switch signs on the scope. You will of course want to zero it out to the best of your ability.