This project implements an automated fiber-coupling system using five servo motors (two per mirror and one z-translation stage) and a PicoScope feedback signal. The system is capable of:
- Recovering from fiber-coupling misalignments caused by drift.
- Performing blind fiber coupling from an unknown starting position.
- Optimizing optical power coupled into a single-mode fiber.
- Operating through Bayesian Optimization combined with local iterative correction.
The optimization process uses Latin Hypercube Sampling (LHS) for initial exploration, a Gaussian Process (GP) model to learn the coupling landscape, and an Upper Confidence Bound (UCB) acquisition function to identify promising regions of the search space.
- SCServo motors with URT-1 controller board (serial communication)
- PicoScope used as the optimization feedback signal
- Two-mirror beam steering system
- Fiber coupling setup
pip install -r requirements.txtcontroller/
│
├── Picoscope.py
├── ServoMotors.py
└── FiberCoupling.py
Contains the hardware interfaces and optimization loop:
- PicoScope communication
- Servo motor control
- Fiber-coupling optimization routines
model/
│
├── Data acquisition
├── Latin Hypercube Sampling (LHS)
└── Gaussian Process implementation
Contains the sampling strategies and machine-learning models used during optimization.
Alternatively, optimization can be performed using M-LOOP:
m_loop/
└── run_experiment_fiber_coupling.py
view/
Graphical user interface providing:
- Read/write servo positions
- Real-time PicoScope voltage monitoring
- Blind fiber coupling
- Drift correction
Initial Sampling
↓
Train Gaussian Process (GP)
↓
Bayesian Optimization (UCB)
↓
Identify High-Coupling Region
↓
Iterative Local Correction
↓
Final Validation
The drift-correction routine performs a complete optimization cycle.
Initially, a set of measurements is collected using Latin Hypercube Sampling and used to train a Gaussian Process model of the coupling landscape.
The Gaussian Process then performs a user-defined number of Bayesian Optimization iterations using an Upper Confidence Bound acquisition function to identify regions likely to contain improved coupling.
Once a promising region has been identified, a local iterative correction routine is executed. The algorithm first performs a sweep of the z-position and moves to the value producing the highest signal. It then performs a plus/minus search on the mirror actuators until no further improvement is observed.
python run_fine_tune.pyImportant parameters:
| Parameter | Description |
|---|---|
global_samples |
Number of samples collected using Latin Hypercube Sampling |
bo_iterations |
Number of Bayesian Optimization iterations |
local_step |
Initial mirror step size during local correction |
local_z_step |
Initial z-axis step size during local correction |
local_rounds |
Number of local correction rounds |
validation_measurements |
Number of measurements used to validate the final result |
These values can be modified directly in:
run_fine_tune.py
Blind fiber coupling is intended for situations where no prior alignment information is available. Unlike drift correction, which starts from a previously aligned state, the algorithm must first locate promising coupling regions within the full actuator search space.
The procedure consists of three stages:
Broad Search
↓
Cluster Selection
↓
Medium Optimization
↓
Fine Optimization
A large Latin Hypercube Sampling (LHS) scan is performed over the entire servo workspace. The objective of this stage is not to find the optimum directly, but rather to identify regions that exhibit measurable coupling.
RANGE_BROAD = np.asarray([2000, 2000, 2000, 2000, 2000])
BROAD_GLOBAL_SAMPLES = 3000The highest-voltage points obtained during the broad search are grouped into distinct clusters. This prevents the optimization from focusing on multiple points belonging to the same coupling region.
BROAD_TOP_N_FOR_CLUSTERING = 30
N_CLUSTERS = 5
CLUSTER_DISTANCE_STEPS = 1000Each cluster is then independently optimized using the same Bayesian Optimization and local correction strategy employed during drift correction, but within a larger local search region.
MEDIUM_RANGE = np.asarray([500, 500, 500, 500, 500])The best-performing medium-search result is selected and refined further within a smaller search region to maximize the final coupling efficiency.
FINE_RANGE = np.asarray([200, 200, 200, 200, 200])The final output of this stage is the estimated optimal actuator configuration together with the corresponding measured coupling signal.
The following parameters can be modified in configuration.py:
| Parameter | Description |
|---|---|
STS_IDS |
IDs of the servo motors used by the system |
PICOSCOPE_RANGE |
Voltage range configured for the PicoScope |
M_LOOP_ITERATIONS |
Number of M-LOOP optimization iterations |
Example:
STS_IDS = [1, 2, 3, 4, 5]
M_LOOP_ITERATIONS = 3000
PICOSCOPE_RANGE = "PS2000_10V"The system has been successfully used for automated fiber coupling and drift correction in a laboratory optical setup. Performance depends on the selected optimization parameters and initial alignment conditions.
Santiago Sangro Cid