# Model-Based Design and Simulation of Paraxial Ray Optics Systems
## 4 Results and Discussion
### Automatic Focusing System  
Ultimately, to demonstrate the application of the ray optics model in a multi-domain simulation, an automatic focusing system is designed, as shown in Figure 6a. This setup is analogous to an optical pickup head used in disk readers: the input beam emitted by a laser source is expanded (\(f_{1}\)), collimated (\(f_{2}\)), and then focused with an objective lens (\(f_{3}\)) at the surface of a reflective target, whereas the reflected light is further directed to the photodetector by a beam splitter (BS) [5]. If the target displaces along \(z\)-direction by \(\delta\), the position of the objective lens must be compensated to keep the beam focused, which can be accomplished by a translational stage driven by servo motor that moves the lens along the \(z\)-axis. Besides its traditional application, prospective uses for this system encompass mechanical sensors [30] and tweezers for single-cell trapping [31]. Figure 5: Fabry–[PERSON] interferometer: (**a**) ray optics representation where PD is a photodetector (multiple reflections are omitted for clarity); (**b**) matrix optics model and block diagram; (**c**) ray tracing obtained by simulation for \(y_{0}=5\) mm, \(\theta_{0}=-5^{\circ}\), and \(1.00\leq n\leq 1.40\) (refractive index values in the legend); and (**d**) normalized intensity around \(n=1.30\). The system is modeled by a set of three thin lenses, Figure 6a. Although the optics for light detection is not considered for simplicity, it is presumed that the distance between the objective and the target surface \(d_{3}\) is estimated from the photodetector signal. The objective is mounted on the motorized stage and displaced by \(z_{S}\). The linear actuator is modeled as a permanent-magnet DC motor (armature resistance \(R\) and inductance \(L\), electrical constant \(\kappa\), and mechanical coupling ratio \(\alpha\)) that produces a force \(F_{S}\) required to move the working load (equivalent mass \(m\) and damping \(b\)). The servo system is implemented by proportional-integral (PI) controllers forming an internal velocity loop and an outer position loop (current controller and electric motor drive are omitted). Therefore, if the target is displaced by \(\delta\), the position of the objective must be compensated by \(d_{2}=d_{2,0}+z_{S}\) and \(d_{3}\) = \(d_{3,0}+\delta-z_{S}\) to adjust the focus, where \(d_{2,0}\) and \(d_{3,0}\) are the initial path lengths and \(z_{S}\) is set by the electromechanical servo control. Simulations are carried out according to the block diagram depicted in Figure 6b, using Runge-Kutta solver and time step of \(10^{-5}\) s. Optical system is built with \(d_{0}=d_{1}=d_{3,0}=50\) mm, \(d_{2,0}=200\) mm,\(f_{1}=-50\) mm,\(f_{2}=100\) mm, and\(f_{3}=50\) mm. The motor has \(R=33\)\(\Omega\), \(L=0.6\) mH, rated voltage of 6 V, and rated speed of 2.3 mm/s, yielding \(\kappa=2.6\times 10^{3}\) V.s/mm [32], whereas the linear stage has \(m\) = 0.3 kg, \(b=0.02\) N.s/m, and \(\alpha=10^{3}\). Initially, the electromechanical system is simulated separately for tuning the PI controllers to achieve a rise time \(<\)0.1 s, stationary error \(<\)1%, and guarantee a speed controller (inner loop) faster than the position one (outer loop). Subsequently, the optical model is coupled with the system mechanics for evaluating the focus correction. Figure 6: Optical pickup head with automatic focus control: (**a**) ray optics and mechatronics representation (adapted from [5]); (**b**) matrix optics model and block diagram, \(\mathrm{PI_{z}}\) and \(\mathrm{PI_{v}}\) are position and speed controllers, respectively, and \(s\) is the Laplace variable; effect of focus compensation on (**c**) displacement \(z_{S}\) and (**d**) ray height \(y_{7}\); and (**e**) ray tracing obtained by simulation for \(y_{0}=\pm 10\) mm and \(\theta_{0}=0\), the bottom plots show the output beam position at different times.