A robust eigenvalue assignment algorithm for periodic systems