Design and fabrication of an electromagnetically actuated optical switch with precise tilt angle control