Automatic initialization methods for photonic components on a silicon-based optical switch